[Proto-Scripty] Re: sortables with scroll and overflow

2009-10-01 Thread DIV

For illustration purposes...what I'm talking about is working in YUI:
http://developer.yahoo.com/yui/3/examples/dd/scroll-list.html

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Scriptacculous Slider

2009-10-01 Thread jfraser

Hey,

I'm using the scriptaculous sliders in a project that requires them to
dynamically change their range depending on other factors. Is there an
easy way to perfom this?

I try change the range but that just causes the sliders to be able to
go past the slider div. I think I need a way to recalculate the
boundaries and redraw the slider after range change.

Any help would be greatly appreciated

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] How to fire a custom/synthetic Control key + mouse scroll wheel movement event?

2009-10-01 Thread tcupolo

Hi,

First, some disclaimers. I'm a novice JS/Prototype programmer.
Embedded firmware is a different story

There's a very cool feature supported by all the major browsers that
has no name as far as I know.
Turning the scroll wheel on the mouse while holding down the control
key on the keyboard will enlarge/shrink the entire document image
displayed in the window with focus.

This is a highly useful feature, I would love to add some widgets
type icons (magnifier glasses with a + and -) on my site that allows
people to rescale the document image using it. It would very intuitive
(just click the +magnifier icon to make it bigger and visa versa).

The reason this is a better approach is 2-fold: (1) most people don't
know that browsers support this feature and (2) a lot of people still
don't have a mouse with a scroll wheel even when they do.

I know that custom events can be created in JS that simulate mouse and
key events. Prototype also has some support but I'm not sure if it
includes creating mouse and key events.

In any case, I can't find any reference that defines what the syntax
would be for these 2 events (a. control key down; b. scroll wheel
movement).

Any help would be much appreciated!

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?

2009-10-01 Thread Chris Sansom

At 19:47 -0700 30/9/09, tcupolo wrote:
Turning the scroll wheel on the mouse while holding down the control
key on the keyboard will enlarge/shrink the entire document image
displayed in the window with focus.

Surely this is more of a system-wide thing, at least on the Mac. If I 
do this, the entire /screen/ zooms in and out, regardless of what 
software is currently active.

-- 
Cheers... Chris
Highway 57 Web Development -- http://highway57.co.uk/

Old professors never die; they just lose their faculties.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Extending InPlaceColectionEditor

2009-10-01 Thread Mr. Williams

I would like to be able to add support for MULTIPLE selections and
default selected options to the InPlaceColectionEditor.  I was
planning on doing this with something like :

code
Object.extend(Ajax.InPlaceCollectionEditor.prototype,
{
  createEditField: function()
{
var list = document.createElement('select');
list.name = this.options.paramName;
list.size = 1;

//none of the following attempts work
(firefox)
//list.setAttribute(MULTIPLE);
//list.multiple = 'true';
//list.multiple = true;
//list.multiple;

this._controls.editor = list;
this._collection = this.options.collection ||
[];
if
(this.options.loadCollectionURL)
  this.loadCollection
();
 
else
  this.checkForExternalText
();
this._form.appendChild(this._controls.editor);
  }
});
/code

Any ideas?

I haven't even started on the selected attribute for the options as
this will involve overriding one of the other methods.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: problem with class and this

2009-10-01 Thread T.J. Crowder

Ciao Nick!

  Many thanks in advance...and sorry for my english ;)

Nessun problema, mi dà la possibilità di practicare il mio
italiano. ;-)

(For non-Italian speakers: it's the usual answer about preserving
`this`.)

Il problema è con il callback da Droppable:

 Droppables.add(elem, {accept: class,
 onDrop:
 function(dragged, dropped) {

 this.aggiungiGiocatore();

Dentro del callback, `this` non ha il guisto valore. Ci necessario
usare Function#bind[1] o un closure per questo:

Con Function#bind:
* * * *
makeDroppable: function(elem, class) {
Droppables.add(elem, {
accept: class,
onDrop: (function(dragged, dropped) {
this.aggiungiGiocatore();
}).bind(this)
});
},
* * * *

Con un closure:
* * * *
makeDroppable: function(elem, class) {
var self = this;
Droppables.add(elem, {
accept: class,
onDrop: function(dragged, dropped) {
self.aggiungiGiocatore();
}
});
},
* * * *

C'è di più qui (in inglese, mi dispiace):
http://blog.niftysnippets.org/2008/04/you-must-remember-this.html

(Devo practicare il mio italiano di piu, ho avuto usare Google per
trovare alcuni dei frasi e parole. :-( )

Spero che questo aiuta,
--
T.J. Crowder
tj / crowder software / com
www.crowdersoftware.com


On Sep 30, 5:51 pm, Nick nicola1...@tiscalinet.it wrote:
 Hi all,

 I created the following class with prototype

 --- 
 

 var gestioneFormazione = Class.create ({

         initialize: function(modulo, formazioneDrop){

                 ...

                 for (var i = 0; i  formazioneDrop.length; i++){
                   

                   this.makeDroppable(idDiv, class);
                 }

         },

         makeDroppable: function(elem, class){

                 Droppables.add(elem, {accept: class,
                                                             onDrop:
 function(dragged, dropped) {

 this.aggiungiGiocatore();

                                                             }
                                                          }
                 );

         },

         aggiungiGiocatore: function(eDrag, eDrop){

             .
         },

 });

 --- 
 

 Can you tell me why I can not to call the method
 this.aggiungiGiocatore
 ( this.aggiungiGiocatore is not a function) only inside onDrop?

 Many thanks in advance...and sorry for my english ;)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Last child selector seems to have stopped working

2009-10-01 Thread T.J. Crowder

Hi,

Thanks for writing in.  Can you create a minimal, self-contained test
case[1] that works with 1.6.0 but doesn't work with 1.6.1?  (I was
just going to do it, but I frankly don't know the nth-last-of-type
selector well enough.)  If you can replicate it with a simple self-
contained test case that does work with 1.6.0 but not 1.6.1, would you
open a ticket for this on Lighthouse[2]?

[1] http://proto-scripty.wikidot.com/self-contained-test-page
[2] https://prototype.lighthouseapp.com/projects/8886-prototype/overview

Thanks,
--
T.J. Crowder
tj / crowder software / com
www.crowdersoftware.com


On Sep 30, 6:56 pm, wid matt.ml...@gmail.com wrote:
 Here is my problem, I was using Prototype 1.6.0 and Scriptaculous
 1.8.1 and decided it was time to upgrade to Prototype 1.6.1 and
 Scriptaculous 1.8.2. I have a snipet of code that used to work before
 upgrading I couldn't figure out why. Below is a my code, the first
 child function works but the last child seems to not work at all.  I
 didn't see any changes in the API for different ways of doing Each
 Loops or CSS Selectors.  Anyone got an idea?

         var firstMenuItem = $$('#preview-accordion-menu.accordion
 div.accordion-toggle:first-child');
         var lastMenuItem = $$('#preview-accordion-menu.accordion
 div.accordion-toggle:nth-last-of-type(1)');
         firstMenuItem.each(function (element, index) {
                 Event.observe(element, 'mouseover', function () {
                         $('pg-nav-hover').removeClassName('panel-accordion');
                         $('pg-nav-hover').addClassName('accordion-top-hover');
                 });
                 Event.observe(element, 'mouseout', function () {
                         
 $('pg-nav-hover').removeClassName('accordion-top-hover');
                         $('pg-nav-hover').addClassName('panel-accordion');
                 });
         });
         lastMenuItem.each(function (element, index) {
                 element.addClassName('last');
                 Event.observe(element, 'mouseover', function () {
                         $('pg-nav-hover').removeClassName('panel-accordion');
                         
 $('pg-nav-hover').addClassName('accordion-bottom-hover');
                 });
                 Event.observe(element, 'mouseout', function () {
                         
 $('pg-nav-hover').removeClassName('accordion-bottom-hover');
                         $('pg-nav-hover').addClassName('panel-accordion');
                 });
         });
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?

2009-10-01 Thread T.J. Crowder

@Chris,

It's a browser thing (too).  On Windows, Chrome, IE, and Firefox (at
least, didn't try Safari and Opera) all support it for zooming.

@tcupolo,

(I believe the feature is called full-page zoom.)  Firing native
browser events is a bit tricky cross-platform.  Prototype doesn't
currently offer that feature.  If you do a search on it, you'll find a
number of pages about doing it natively; for instance, this[1] is one
of the first few hits.

[1] http://jehiah.cz/archive/firing-javascript-events-properly

HTH,
--
T.J. Crowder
tj / crowder software / com
www.crowdersoftware.com

On Oct 1, 10:03 am, Chris Sansom ch...@highway57.co.uk wrote:
 At 19:47 -0700 30/9/09, tcupolo wrote:

 Turning the scroll wheel on the mouse while holding down the control
 key on the keyboard will enlarge/shrink the entire document image
 displayed in the window with focus.

 Surely this is more of a system-wide thing, at least on the Mac. If I
 do this, the entire /screen/ zooms in and out, regardless of what
 software is currently active.

 --
 Cheers... Chris
 Highway 57 Web Development --http://highway57.co.uk/

 Old professors never die; they just lose their faculties.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?

2009-10-01 Thread Radoslav Stankov

A time ago I have created ticket and a patch for making Event.fire to
fire event (
https://prototype.lighthouseapp.com/projects/8886/tickets/697-eventfire-to-support-all-events-not-only-custom-ones#ticket-697-12
)

Here is a git for http://gist.github.com/121011
I hope it's useful
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] IE 8 Properties Undefined Crashes Browser

2009-10-01 Thread laurin1

We just discovered what appears to be a very strange bug that appeared
with 1.6.1_rc2 (I don't have anything between 1.6.0 and 1.6.1_rc2 to
test.) When viewing the properties of the page, the several of the
properties are undefined and it crashes the browser.

Size: bytes (no number, just says bytes)
Created: undefined
Modified: undefined

Here is our test page:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://
www.w3.org/TR/html4/loose.dtd
html
head
titleTest/title
script language=javascript type=text/javascript src=/javascript/
prototype.js/script/head
body

/body
/html


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] object.each problem

2009-10-01 Thread Dave

I have just upgraded to the latest scriptaculous (1.8.2) which
includes prototype 1.6.0.3 and the following code no longer works:-

Ajax.JSONResponse = function(xhr) {
var data=eval('('+xhr.responseText+')');
Object.extend(data,Enumerable);
Object.extend(data,Hash);
return data;
};

...

var opts = Ajax.JSONResponse(xhr);
if (opts.size()0) {
opts.each(function(opt) {
.

There is no error, it just seems that execution stops when trying to
access any method of the opts object. I checked the response returned
by Ajax in the previous and the latest versions, by doing console.log
(data) after the eval, and they are identical. However, if I replace
the eval line in the above code with this line

var data=$H(eval('('+xhr.responseText+')'));

it now works.

I didn't write the original code and I am relatively new to prototype.
Can anyone tell me whether the $H() is the correct solution or is
there an alternative (better) solution.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: IE 8 Properties Undefined Crashes Browser

2009-10-01 Thread T.J. Crowder

It probably doesn't address your issue (you never know, though), but
would you try the released version of 1.6.1?  There was an RC3, and
now the final[1] is out.

[1] http://prototypejs.org/download
--
T.J. Crowder
tj / crowder software / com
www.crowdersoftware.com


On Oct 1, 2:51 pm, laurin1 keithda...@solidtechservice.com wrote:
 We just discovered what appears to be a very strange bug that appeared
 with 1.6.1_rc2 (I don't have anything between 1.6.0 and 1.6.1_rc2 to
 test.) When viewing the properties of the page, the several of the
 properties are undefined and it crashes the browser.

 Size: bytes (no number, just says bytes)
 Created: undefined
 Modified: undefined

 Here is our test page:

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
 http://www.w3.org/TR/html4/loose.dtd;
 html
 head
         titleTest/title
         script language=javascript type=text/javascript src=/javascript/
 prototype.js/script/head
 body

 /body
 /html
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Where the 'click' go in Safari?

2009-10-01 Thread ronman

Hi,
After a certain sequence of events I lose my 'click' events in
Safari.  It works normally in Firefox.

Here's how:
I have some href tags with Event.observe('click' ...   attached.

I open a child window with javascript window.open.

Do some things, then just before closing the child window I
automatically refresh the content in the parent window with
opener.myajaxfunction('someparameter').  The parent window sets up
the Event.observes again (which I've verified it actually does).

Now in the parent window the first click is eaten somewhere.  It has
no effect.  The second click operates normally, whatever you click on.

I'm using Safari 4 on Vista, and Prototype 1.6.

Anyone seen this behavior before?  I'm stumped.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: IE 8 Properties Undefined Crashes Browser

2009-10-01 Thread laurin1

Maybe I was unclear. Every version AFTER 1.6.1_rc2 does this. Meaning,
1.6.1_rc3 and 1.6.1 final as well.

On Oct 1, 10:26 am, T.J. Crowder t...@crowdersoftware.com wrote:
 It probably doesn't address your issue (you never know, though), but
 would you try the released version of 1.6.1?  There was an RC3, and
 now the final[1] is out.

 [1]http://prototypejs.org/download
 --
 T.J. Crowder
 tj / crowder software / comwww.crowdersoftware.com

 On Oct 1, 2:51 pm, laurin1 keithda...@solidtechservice.com wrote:



  We just discovered what appears to be a very strange bug that appeared
  with 1.6.1_rc2 (I don't have anything between 1.6.0 and 1.6.1_rc2 to
  test.) When viewing the properties of the page, the several of the
  properties are undefined and it crashes the browser.

  Size: bytes (no number, just says bytes)
  Created: undefined
  Modified: undefined

  Here is our test page:

  !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
  http://www.w3.org/TR/html4/loose.dtd;
  html
  head
          titleTest/title
          script language=javascript type=text/javascript 
  src=/javascript/
  prototype.js/script/head
  body

  /body
  /html- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Range utility increment

2009-10-01 Thread Matt Foster

I hadn't thought of that and a good point.

 So if you create a NumberRange of even numbers from 2 to 6 and ask it
 if 3 is included, unless you override that behavior in your
 NumberRange class, `include` will return true.

The range object itself will certainly return true in this scenario.
as it does fall within the beginning and end.  Although in most cases,
and certainly in my example I've wrapped the instance within an
Enumerable ($A) which also has an include method (actually ObjectRange
inherits and overrides this method).. but the Enumerable.include
method is..quoting the API docs based on the == comparison operator
(equality with implicit type conversion) such that, 3 is simply not a
number created by the range, hence not a value in the enumerable.

http://api.prototypejs.org/language/enumerable.html#include-instance_method

--

http://positionabsolute.net


On Sep 28, 7:27 pm, T.J. Crowder t...@crowdersoftware.com wrote:
 Matt,

 The ObjectRange `include` method looks like this:

   function include(value) {
     if (value  this.start)
       return false;
     if (this.exclusive)
       return value  this.end;
     return value = this.end;
   }

 So if you create a NumberRange of even numbers from 2 to 6 and ask it
 if 3 is included, unless you override that behavior in your
 NumberRange class, `include` will return true.

 -- T.J.

 On Sep 28, 9:20 pm, Matt Foster mattfoste...@gmail.com wrote:

  Hey TJ,

  I don't understand, if a NumberRange was given an instance of
  EvenNumber as its start and end parameters, how would it come up with
  the number 3?

  On Sep 26, 7:10 am, T.J. Crowder t...@crowdersoftware.com wrote:

   All right, lads, let's move along...  Each approach has its benefits
   and costs, it all depends on what problem you're solving.

   Matt, FWIW, I think you'd want to override the `include` method as
   well, as others a NumberRange with even numbers would include 3.  At
   that point you're overriding most of ObjectRange, so I'd probably just
   start from Enumerable.  This is not intended as a dig.

   -- T.J.

   On Sep 25, 9:51 pm, Alex McAuley webmas...@thecarmarketplace.com
   wrote:

Omg get over yourself you have taken what i said completely the wrong 
way..

What arrogant plug was that?...

Lets take your code and look at it shall we...

30+ lines for no reason other than Hey look at me, i can write a
function/class in 30 lines that only needs to be 5.

Chill out dude, i wasn't knocking your code, it was just OTT.

You can continue to think you are right which is arrogance in itself...
there is more than one way to skin a cat.

TJ's/My loop that took all of 30 seconds to create is faster no doubt, 
has
less weight and does the job. I personaly have better things to do than
write some amazing class to achieve what can be done in 30 seconds -
evidently you do not so good luck with that.

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Matt Foster mattfoste...@gmail.com
To: Prototype  script.aculo.us 
prototype-scriptaculous@googlegroups.com
Sent: Friday, September 25, 2009 9:16 PM
Subject: [Proto-Scripty] Re: Range utility increment

 That only gives you even or odd increments to the top number...

Incorrect, notice the constructor method? It ensures that the number
given is even such that you'll never get a range of odd numbers.
Granted the last line of the Jojo's question was

 Let's say count up by 2's: [2,4,6,8,10].  How do you do this?

Hence why I went with this specific implementation, to demonstrate how
you can create classes that the ObjectRange class can use to create
proper ranges.  I didn't feel it was necessary to abstract out the
class such that it covers all bases but demonstrate how to do it one
way and then Jojo could modify for their own purposes.

 Better to go with my/TJ's loop

What an arrogant plug of your own spaghetti code and hasty discredit
to my contribution.  Exposing your shortfalls isn't difficult, you
aren't creating a range object, completely bypassing the ObjectRange's
functionality and just simply creating a hacked out array.

So to put the nail in the coffin, here is the classes abstracted out

var IncrementNumber = Class.create({
initialize : function(num, increment){
this.num = num;
this.increment = increment;},

succ : function(){
return this.clone(this.num + this.increment, this.increment);},

clone : function(num, increment){
return new IncrementNumber(num, increment);},

toString : function(){
return this.num;}
});

var EvenNumber = Class.create(IncrementNumber,
{
initialize : function($super, num){
$super(num, 2);
this.num = (num % 2 == 1) ? num - 1 : num;},

clone : function(num, increment){
return new EvenNumber(num);}
});

var NumberRange = 

[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?

2009-10-01 Thread tcupolo

@T.J. Crowder,

Thanks. It works a little different on Safari, probably b/c it's the
Mac default browser. It does enlarge/shrink the image but not
everything - looks like it's just effecting the text font size. It's a
complete zoom function on Opera.

@Radoslav Stankov,

Thank you! I think your patch will probably get it done. But it
doesn't appear to be in the version of Prototype my platform is
currently using (1.6.1_rc2), and not even the latest stable verison
(1..6.1).

How would one go about using your patch in this case?

Also, do you know which mouse event I would use in the call that
corresponds to a movement of the mouse's scroll wheel?
Is this as easy as setting ctrlKey=true in the call, for the right
mouse type event?




--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?

2009-10-01 Thread tcupolo

@all,

Another approach would be to find out what the browswer is doing when
it receives the zoom event.
I'm thinking maybe there's an attribute setting for each window that's
changed. That would make sense.
It only effects the window with focus, nothing else - so it must track
to the window.

Maybe a simple DOM noe modification would do the same thing, if I only
knew what the DOM element (or something like it) is.
That might be simpler to do and fully supported by Prototype.

Thoughts??
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] inPlaceEditor changes from single line to multiline

2009-10-01 Thread JoJo

Upon entering the page and clicking on an inPlaceEditor, I get the
expected result: single line editing of a text field.  I then click
ok without even touching the text. My PHP script trims it and spits
back the value. I then click to edit again, but now the box has become
a 3 multi-line box.  It has put \n\n\s in front of my text.  On this
second try, it has also failed to apply the CSS stylings that I
specified.

new Ajax.InPlaceEditor(
'imageTitle',
'script.php', {
formClassName: 'formEditingTitle',
cols: Prototype.Browser.WebKit ? 29 : 38
}
);
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to fire a custom/synthetic Control key + mouse scroll wheel movement event?

2009-10-01 Thread tcupolo

Minor update:

TJ is correct. This feature is the same thing in all browswers - the
zoomin/out function of every browser.
So, it turns out it can be done 2 ways:

a. cntrl key and + or -
b. cntrl key and mouse scroll wheel up or down

Originally I asked about making a synthetic event for (b) but I think
it might be easier to generate a synthetic event for (a), it's just
key strokes.
Still, if there's a accessible property of the window object that's
getting changed by this - that's probably even easier to work with.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Conflict between dojo and prototype js

2009-10-01 Thread Siddhartha Banik

Hi,
using prototype.js [version 1.6.0.3] for AJAX requests. Now to develop
a chat application [bayeux protocol based], I need to use dojo version
1.2.0.

Is there any way I can resolve the namespace issue, due to which dojo
is not working correctly?
If I remove prototype.js , the chat functionality works well.

Thanks
Siddhartha
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: inPlaceEditor changes from single line to multiline

2009-10-01 Thread Mr. Williams

I figured this out and wanted to post a followup sollution.  I call
the new Object Ajax.InPlaceCollectionEditorMulti (mostly because I
didn't test if I could just overwrite the name
Ajax.InPlaceCollectionEditor).  To get the multi select functionality
we override two methods from the Ajax.InPlaceCollectionEditor;
createEditField and buildOptionList.

This takes all the same options as Ajax.InPlaceCollectionEditor and
allow two additional options: multiple and selected.  The object is
used as follows:

code
new Ajax.InPlaceCollectionEditorMulti(
  element_id,
  submit_url,
  {collection:[[0, zero],[1,one],[2,two]],
  multiple:true,
  selected:[[0,''],[2,'']], // zero and two in the select list
will be selected.
  ajaxOptions:{asynchronous:true, evalScripts:true}}
);
/code

It should be noted that when using a multi select the form does not
like being a size of one, hence size=2 below.

code
Ajax.InPlaceCollectionEditorMulti = Class.create
(Ajax.InPlaceCollectionEditor, {
  createEditField: function() {
var list = document.createElement('select');
list.name = this.options.paramName;
list.size = 1;
if (this.options.multiple) {
  list.writeAttribute
('multiple');
  list.size =
2;
}
this._controls.editor = list;
this._collection = this.options.collection ||
[];
if
(this.options.loadCollectionURL)
  this.loadCollection
();
else
  this.checkForExternalText();
this._form.appendChild
(this._controls.editor);
  },

  buildOptionList: function() {
this._form.removeClassName
(this.options.loadingClassName);
this._collection = this._collection.map(function(entry) {
  return 2 === entry.length ? entry : [entry, entry].flatten
();
});
var marker = ('value' in this.options) ? this.options.value :
this._text;
var textFound = this._collection.any(function(entry)
{
  return entry[0] ==
marker;
}.bind(this));
this._controls.editor.update
('');
var option;
this._collection.each(function(entry, index)
{
  option = document.createElement
('option');
  option.value = entry[0];
  if (this.options.selected)
{
option.selected =
  (entry[0] in this.options.selected) ? 1 :
0;
  }
  else {
option.selected = textFound ? entry[0] == marker : 0 == index;
  }
  option.appendChild(document.createTextNode(entry[1]));
  this._controls.editor.appendChild(option);
}.bind(this));
this._controls.editor.disabled = false;
Field.scrollFreeActivate(this._controls.editor);
  }
});
/code

high 5 to all the developers, thanks for the lib!  I would wake up
every morning dreading life if I had to program js without
script.aculo.us, prototype, and jquery.

On Oct 1, 3:56 pm, JoJo tokyot...@gmail.com wrote:
 Upon entering the page and clicking on an inPlaceEditor, I get the
 expected result: single line editing of a text field.  I then click
 ok without even touching the text. My PHP script trims it and spits
 back the value. I then click to edit again, but now the box has become
 a 3 multi-line box.  It has put \n\n\s in front of my text.  On this
 second try, it has also failed to apply the CSS stylings that I
 specified.

 new Ajax.InPlaceEditor(
     'imageTitle',
     'script.php', {
         formClassName: 'formEditingTitle',
         cols: Prototype.Browser.WebKit ? 29 : 38
     }
 );
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---