[Proto-Scripty] Re: passthrough of script-Tags

2009-03-05 Thread majestixx

Hi,
I got it now running with element.innerHTML instead of element.update.
Seems that when set by innerHTML the scripts are fortunately not
executed and then stripped out.

$(element).innerHTML = transport.responseText;

Hope thats also the solution to your problem.

On 4 Mrz., 22:05, erling erl...@spekk.no wrote:
 Hi

 Here is the script code that is inside my HTML code, it stops all the
 way up when I load this. I do not understand why.

 script src=http://maps.google.com/maps?
 file=apiamp;v=2amp;key=ABQIC8qQ5K5OzgUXSp3HAHYLCBToCz2T6q0h8s9gNtyOGdr19HE7IRShryCxKI7T0XpWQzOZ1s6y4B66sQ
 type=text/javascript charset=utf-8/script
 script type=text/javascript
 // FCK googlemaps v1.97
 document.write('div id=gmap200917133224 style=width:400px; height:
 240px;./div');
 function CreateGMap200917133224() {
         if(!GBrowserIsCompatible()) return;
         var allMapTypes = [G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP,
 G_PHYSICAL_MAP] ;
         var map = new GMap2(document.getElementById(gmap200917133224),
 {mapTypes:allMapTypes});
         map.setCenter(new GLatLng(58.2069,7.99255), 10);
         map.setMapType( allMapTypes[ 3 ] );
         map.addControl(new GSmallMapControl());
         map.addControl(new GMapTypeControl());
         AddMarkers( map, [] ) ;}

 /script/ppnbsp;/ppxcv/ppxcv/ppnbsp;/ppnbsp;/
 ppnbsp;/ppxc/ppvx/ppcv/ppnbsp;/pdivqwqw/div
 script type=text/javascript
 // FCK googlemapsEnd v1.97
 function AddMarkers( map, aPoints )
 {
         for (var i=0; iaPoints.length ; i++)
         {
                 var point = aPoints[i] ;
                 map.addOverlay( createMarker(new GLatLng(point.lat, 
 point.lon),
 point.text) );
         }}

 function createMarker( point, html )
 {
         var marker = new GMarker(point);
         GEvent.addListener(marker, click, function() {
                 marker.openInfoWindowHtml(html, {maxWidth:200});
         });
         return marker;}

 if (window.addEventListener) {
     window.addEventListener(load, CreateGMap200917133224, false);} else {

     window.attachEvent(onload, CreateGMap200917133224);}

 onunload = GUnload ;
 /script

 Here are the latest codes I have tried, but it does not work, then, if
 there is a way to resolve this, I do not see what you need to.

 function test(url)
 {

 var element='trimm';
 var req=new Ajax.Request(url, {
          evalScripts: false, // -- notice false is not wrapped in
 quotes !!
          evalJS: false,
          evalJSON: false,
          sanitizeJSON: true,
          method: 'post',
          onSuccess : function(transport) {
                  transport.headerJSON
                 $(element).update(transport.responseText);
          }

     });

   req=null; // null the object to free up memory

 }

 I hope there is someone who has an explanation, perhaps this can not
 work?

 Regards Erling

 On 4 Mar, 10:10, Alex Mcauley webmas...@thecarmarketplace.com
 wrote:

  you might want to try

  something like this ...

  var element='someElementId';
  var req=new Ajax.Request('/'+url, {
           evalScripts: false, // -- notice false is not wrapped in quotes
  !!
           method: 'post',
           onSuccess : function(transport) {
                  $(element).update(transport.responseText);
           }

      });

    req=null; // null the object to free up memory

  }

  HTH

  Alex

  - Original Message -
  From: erling erl...@spekk.no
  To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com
  Sent: Tuesday, March 03, 2009 11:02 PM
  Subject: [Proto-Scripty] Re: passthrough of script-Tags

  Hi

  I have tried most things :-)

  But I have great problems to get prototype to ignore javascript

  new Ajax.Request(url, {
  method:'post',
  evalJS:'false',
  evalJSON:'false',
  sanitizeJSON:'false',
          onSuccess: function(transport) {
              // At this point, the *text* of the response is
              // available as transport.responseText.
              // You can do anything with it you like.
              // Here's one thing you can do with it, written
              // in separate lines for clarity:
                transport.evalJS = 'false';
                transport.evalJSON = 'false';
              var text;
              text = transport.responseText;
              //text = text.replace(/\/g, amp;);
              //text = text.replace(/\/g, lt;);
              //text = text.replace(/\/g, gt;);
              $('trimm').update(text);
          }
      });

  I am unable to retrieve the html and javascript without this method
  begins to work with my javascript, which means that nothing is being
  presented in my div container.

  I dont understand this :-)

  Regards Erling

  On 26 Feb, 23:37, T.J. Crowder t...@crowdersoftware.com wrote:
   Hi,

What am I doing wrong, or how to set up Ajax.Updater to not change
thescript.

   If you want to treat the HTML andscriptas thought it were just text,
   you can't use Ajax.Updater. You'll have to use 

[Proto-Scripty] Re: writeAttribute problem

2009-03-05 Thread Tobie Langel

Rob,

Please have a look at the DOM specs.

The only area where you should not be using writeAttribute is:

- When you want to store anything but a string (use the new storage
API or expandos directly).
- For setting or getting the value attribute of Form elements (use
FormElement#(get|set)Value instead).

Best,

Tobie

On Mar 5, 3:53 am, RobG rg...@iinet.net.au wrote:
 On Mar 5, 7:32 am, Lee Jenkins l...@datatrakpos.com wrote:

  Are there any known problems with writeAttribtue and FF3?  I have a small 
  function:

  function(obj){
       Element.writeAttribute(obj.elname, obj.attr, obj.newValue);

  }

  It doesn't update the attribute.

 How did you determine that? Do you have a test case?

   I also tried with literal values instead of
  using the object's properties as params.  Setting the value using dot 
  notation
  works however and both the dot notation and writeAttribute works on IE7.

 Don't use writeAttribute for attributes defined in HTML 4 for DOM
 elements where setting the dot property does the job.  writeAttribute
 uses setAttribute which has known differences between browsers (e.g.
 when working with form controls, using setAttribute to set the value
 attribute will only change the value in IE, Firefox changes both the
 value and the defaultValue).

 setAttribute is intended to be a general way to set the value of
 attributes, not properties.  While it works more or less
 interchangeably with the dot property 99% of the time, the few foibles
 mean that it's safter to only use it for setting attributes that
 aren't standard HTML 4 attributes (and use the dot property for
 everything else).

 --
 Rob
--~--~-~--~~~---~--~~
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] Internet Explorer 7 8

2009-03-05 Thread Jeztah

Hi guys, kind of proto/scriptac related ..

I have some strange behaviour in my internet explorer ...

Everytime i try to select from a select box, the select box wont open,
instead it gives me a Popup was blocked Error ..

THe select box is not dynamic, it has no events bound to it or
anything... i've tried to debug every piece of script on the page ..

The only way i can not get it to open a select box is to remove all
javascript includes and script on the page ..
My first thought was that it was an unclosed anchor - but i checked
and its not that .. anyone else had this problem and knows a fix ?

Thanks
Alex
--~--~-~--~~~---~--~~
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 resize window without screen flickering

2009-03-05 Thread david

Hi Mel,

Could we have an online exemple ??
because just reading the code, What you does seems good !!

--
david

On 25 fév, 16:16, Mel melindasa...@texashealth.org wrote:
 I have a JSP page whereby I am displaying a table that contains rows
 of each data record.  Each record has an icon at the beginning of each
 row that when the user clicks that icon a function that I created
 using the Ajax.Updater gets the data and populates another JSP page
 that displays the details of that row item that I am inserting via a
 DIV ... tag in the initial JSP and that is working great.

 However, the user can click another row's icon in the initial JSP page
 and the window keeps growing even though it is only displaying the
 details of the next item.  I need a way to resize the window back to
 where it was prior to displaying the details of that next row.  I
 attempted to resize the window before running the Ajax.Updater for the
 next record but when I did that the window flickers.  I would like to
 be able to click another icon on that same page and just display the
 next record's details without having the entire window flicker.

 Any help or direction would be greatly appreciated.  Here is my
 function:

         function getVendorInfo(vNum) {
                 window.resizeBy(0, -$('vendorInfoResults').offsetHeight);
                 var url = '/common/Lookup.action';

                 new Ajax.Updater('vendorInfoResults', url,
                         {method: 'get',
                                 parameters: {vendorInfo: '', vendorNum: vNum},
                                 onComplete: function() {
                                         window.resizeBy(0, 
 $('vendorInfoResults').offsetHeight);
                                 }
                         });
         }
--~--~-~--~~~---~--~~
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: positionedOffset with floated elements

2009-03-05 Thread david

Hi Knad,

I would probably use the afterUpdateElement callback of the
autocompleter to modify the autocompleter DIV poisition.
In fact, it just need to reset the left value.

--
david

On 25 fév, 16:59, Knad kna...@gmail.com wrote:
 Hello All!

 I am struggling to get this autocomplete div positioned correctly. The
 code I have works correctly on most pages, but when the containing DIV
 is floated the position is incorrect.

 I am sure you have all seen autocompleters and know where the
 suggestions DIV should be positioned (below).

 http://beta.rugbybowmen.org.uk/position.html

 Any ideas?

 Knad
--~--~-~--~~~---~--~~
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: Drag and Drop with conditional revert

2009-03-05 Thread david

Hi ColinFine,

I think that the method that will hide the element during request is
as you say BAD :((
I will do another way:
- if dropsite is good, just lauch AJAX request, but before set a
spinner inside, near, where you want to indicate that actually the
apply is processing something.
- If response is not good, just do a manual revert (I did not think
you could have bundle callback, ... to do this.

But, The idea of making all info available in the CLIENT is THE GOOD
idea, because each time you go and check if element could be dropped,
you make one more call to the server and it should create all
necessary process to respond to the request == which consume a lot of
resources.

--
david

On 25 fév, 20:41, ColinFine colin.f...@pace.com wrote:
 I've been struggling to achieve something with drag and drop. I've
 found a solution, but I don't think it's very elegant, and I was
 wondering if anybody has a better solution.

 I'm dragging an object from one box to another. If it is a suitable
 dropsite, it fires off an Ajax request to update the database and
 several parts of the display (including the dropsite).  But it is
 possible that the operation will not be permitted, in which case the
 Ajax returns a failure code and a message, and the object hasn't been
 moved in the database.

 So far so good. But I want the drag to revert not only if the user
 doesn't find a suitable dropsite, but also if the Ajax operation
 returns failure. On the other hand, if the Ajax operation succeeds, I
 don't want it to revert. (It will only be for a moment before the box
 is redrawn, but it doesn't look good).

 The workround I've implemented is to hide the element before issuing
 the Ajax call, and show it again in the failure callback, but not in
 the success one; so the user won't see it reverting in the latter
 case. But it means the object you've moved disappears for a moment,
 which is not very good.

 Is there a better solution? I wondered if there was a way to use a
 function in the 'revert' option of the Draggable, or to use the onEnd
 of the Draggable or onDrop of the Droppable. But none of these have
 access to the Draggable, only to the dragged element, so I would have
 to write my own revert. In any case, there doesn't seem to be a
 callable default 'revert' function in Draggable: I would expect there
 to be one, so that you can provide a callback which does some other
 processing and then calls the default.

 I see that there was a discussion on similar lines last September, but
 the recommendation there seemed to be to do the checking client-side.
 That is possible, but would mean that much more data would need to be
 downloaded, so I prefer to do it on the server.

 Any suggestions?
--~--~-~--~~~---~--~~
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: Internet Explorer 7 8

2009-03-05 Thread zero

Ye i also got that problem, dunno how to fix it.
I got it because i got IE6 and IE7 on the same computer (http://
tredosoft.com/IE7_standalone)

On 5 Mar, 12:36, Jeztah webmas...@thecarmarketplace.com wrote:
 Hi guys, kind of proto/scriptac related ..

 I have some strange behaviour in my internet explorer ...

 Everytime i try to select from a select box, the select box wont open,
 instead it gives me a Popup was blocked Error ..

 THe select box is not dynamic, it has no events bound to it or
 anything... i've tried to debug every piece of script on the page ..

 The only way i can not get it to open a select box is to remove all
 javascript includes and script on the page ..
 My first thought was that it was an unclosed anchor - but i checked
 and its not that .. anyone else had this problem and knows a fix ?

 Thanks
 Alex
--~--~-~--~~~---~--~~
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: clonePosition - problem in IE and Opera

2009-03-05 Thread zero

is it a prototype bug? Does it have some bug ticket?

On 2 Mar, 12:50, zero zero.zero1...@gmail.com wrote:
 This code works in firefox 2, firefox3 and chrome but in  in opera,
 ie6, ie7 olive div appear in wrong place when u scroll list. In ie it
 goes up and in opera down. Why, any solution?.

 style
         ul{margin: 200px 0px;padding: 0px;list-style: none;background-color:
 blue;overflow: auto;width:120px;height: 150px;}
         li{width:100px;height: 100px;background-color: green;}
         #klon{position:absolute;width:100px;height: 100px;z-index:
 10;background-color: olive; }
 /style

 ul
         lia/li
         lib/li
         lin/li
         lim/li
         lit/li
         liu/li
         lio/li
 /ul

 div id=klon style=display:none 
 /div

 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/prototype/1.6.0.3/prototype.js /script
 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/scriptaculous/1.8.1/scriptaculous.js /script

 script type=text/javascript
         Event.observe(window, 'load', function() {
                 var klon;
                 $$('li').each(function(el){
                         Event.observe(el, 'mouseover', function(event) {
                                 klon = $('klon');
                                 klon.clonePosition(el);
                                 klon.show();
                                 klon.clonePosition(el);
                         });
                 });

                 Event.observe('klon', 'mouseout', function(event) {
                         klon.hide();
                 });

         });
 /script
--~--~-~--~~~---~--~~
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: Having an issue with bubbling of a SELECT's onChange event in IE.

2009-03-05 Thread david

Hi Richard,

not tested, just thought: does it works with DOM0 event ??

--
david

On 26 fév, 16:22, Richard Quadling rquadl...@googlemail.com wrote:
 Hi.

 Below is a simple example of the problem I'm having.

 In FF and Chrome, the change event is bubbled to the dynamicContainer.
 In IE it isn't.

 Am I doing something wrong? Is there a workaround?

 I don't want to watch click as it happens as you go into and out of
 the select.

 Something else I noticed about Chrome is that the OPTION never
 triggers the event, or at least in the way I'm testing it, only
 Firefox ever has the event fired on an OPTION.

 Ideas/suggestions warmly welcomed.

 Regards,

 Richard.

 html
 head
 script type=text/javascript
 src=http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js;/script
 script type=text/javascript
 function watchEvents(ev){
   var el = ev.element();
   if ('option' == el.tagName.toLowerCase()){
     el = el.up('select');
   }

   $('watchedEvents').update(
     ev.element().tagName + ' / ' +
     ev.element().id + ' / ' +
     el.tagName + ' / ' +
     el.id + ' / ' +
     ev.type + 'br /' +
     $('watchedEvents').innerHTML
   );

 }

 document.observe('dom:loaded', function(){
   $('dynamicContainer')
     .observe('click', watchEvents) // So I can see when clicks occur -
 not in my real code.
     .observe('change', watchEvents)
     .observe('keyup', watchEvents);});

 /script
 body
 div id=dynamicContainer
   form method=post action=
     select id=aSelector name=bob
       option value=1One/option
       option value=2Two/option
       option value=3Three/option
       option value=4Four/option
     /select
   /form
 div
 div id=watchedEvents/div
 /body
 /html

 --
 -
 Richard Quadling
 Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!
--~--~-~--~~~---~--~~
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: On Licensing for a Calculator Generator

2009-03-05 Thread david

Hi,
I did not think there is any conflict with the MIT license, until you
respect the term of MIT license :))

--
david

On 26 fév, 17:49, Eman Calso egca...@gmail.com wrote:
 I'm developing a calculator generator[1] using prototype and i'm
 wondering if i can release this under the GNU GPL (version 2) License
 [2]. I'm pretty sure it won't conflict with the MIT License, but i
 thought i'd ask just to be sure.

 Thanks
 Eman

 [1] Javascript Calculator Generator is currently hosted at:
      *https://edge.launchpad.net/calculator-generator;and
      *http://code.google.com/p/calculator-generator

 [2] GNU GPL v2 is available athttp://www.gnu.org/licenses/gpl-2.0.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] Re: writeAttribute problem

2009-03-05 Thread Lee Jenkins

Tobie Langel wrote:
 Rob,
 
 Please have a look at the DOM specs.
 
 The only area where you should not be using writeAttribute is:
 
 - When you want to store anything but a string (use the new storage
 API or expandos directly).
 - For setting or getting the value attribute of Form elements (use
 FormElement#(get|set)Value instead).
 

Tobie,

That may have well been the case.  I was trying to use writeAttribute with a 
Text Input.  I assumed that it would work and apparent does in IE7.

I will post another query to the group to get some suggestions for my current 
project and the best way to approach it.

--
Warm Regards,

Lee

--~--~-~--~~~---~--~~
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: writeAttribute problem

2009-03-05 Thread Quleczka

Hi,

 That may have well been the case.  I was trying to use writeAttribute with a
 Text Input.  I assumed that it would work and apparent does in IE7.

I'm curious, which attribute were you trying to set -  just a value
of  this input field?

 - For setting or getting the value attribute of Form elements (use
 FormElement#(get|set)Value instead).

Lee, is there a setValue()?

Only getValue is mentioned in API Docs -  
http://prototypejs.org/api/form/element
.

I use just something.value='test'; and it's working :)

Quleczka
--~--~-~--~~~---~--~~
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: Having an issue with bubbling of a SELECT's onChange event in IE.

2009-03-05 Thread Richard Quadling

2009/3/5 david david.brill...@gmail.com:

 Hi Richard,

 not tested, just thought: does it works with DOM0 event ??

 --
 david

 On 26 fév, 16:22, Richard Quadling rquadl...@googlemail.com wrote:
 Hi.

 Below is a simple example of the problem I'm having.

 In FF and Chrome, the change event is bubbled to the dynamicContainer.
 In IE it isn't.

 Am I doing something wrong? Is there a workaround?

 I don't want to watch click as it happens as you go into and out of
 the select.

 Something else I noticed about Chrome is that the OPTION never
 triggers the event, or at least in the way I'm testing it, only
 Firefox ever has the event fired on an OPTION.

 Ideas/suggestions warmly welcomed.

 Regards,

 Richard.

 html
 head
 script type=text/javascript
 src=http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js;/script
 script type=text/javascript
 function watchEvents(ev){
   var el = ev.element();
   if ('option' == el.tagName.toLowerCase()){
     el = el.up('select');
   }

   $('watchedEvents').update(
     ev.element().tagName + ' / ' +
     ev.element().id + ' / ' +
     el.tagName + ' / ' +
     el.id + ' / ' +
     ev.type + 'br /' +
     $('watchedEvents').innerHTML
   );

 }

 document.observe('dom:loaded', function(){
   $('dynamicContainer')
     .observe('click', watchEvents) // So I can see when clicks occur -
 not in my real code.
     .observe('change', watchEvents)
     .observe('keyup', watchEvents);});

 /script
 body
 div id=dynamicContainer
   form method=post action=
     select id=aSelector name=bob
       option value=1One/option
       option value=2Two/option
       option value=3Three/option
       option value=4Four/option
     /select
   /form
 div
 div id=watchedEvents/div
 /body
 /html

 --
 -
 Richard Quadling
 Zend Certified Engineer :http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!
 


Sorry for being such a newbie, but can you explain that?

-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

--~--~-~--~~~---~--~~
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] DOM and drag and drop

2009-03-05 Thread janrmr

hi to all expert

How can i drag an item when using DOM , so far I am receiving an error
in prototype.js line 1903 element is null


here is my simple code



script type=text/javascript
src=javascript/prototype.js/script
script type=text/javascript
src=javascript/scriptaculous.js/script

script
function imagedrag(name)
{
new Draggable(name);
}
/script
  script
function gen()
{
document.getElementById(wa).innerHTML=div id='image1'img
src='html.gif'/div;
}
  /script

body onload=gen()

   p id=wa/p

script type=text/javascript
imagedrag('image1');

 /script



--~--~-~--~~~---~--~~
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] Slide Down/Slide Up w/Overlay

2009-03-05 Thread Avram

My group is an interaction design team, not a team of developers, so
we don’t know much javascript.

We’ve been looking at  Blind Down/Blind Up and Slide Down/Slide Up,
but these don’t do exactly what we are looking for.  Is there a slide
down script that will overlay, not push down, the content that’s
below it?

--~--~-~--~~~---~--~~
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] [Ajax.Autocomplete] Position of div with suggests

2009-03-05 Thread Mr. Snoot

Hi,

I've tried Ajax.Autocomplete and it works fine in Firefox 3 and Opera
9. Unfortunately it doesn't in IE6, 7, 8.

In IE8 the div with the suggested words from the database is placed
not correct. In FF/Opera the div is directly shown below the input
field but in IE8 it's about 100 px above and overlaps the input field.

In IE6 and 7 the div doesn't appear anywhere on the screen. Maybe it's
covered anywhere behind another div.

Is it possible, to manually set the div's position? I had another
autocomplete script before, where I could playce the div via
stylesheets and it worked perfect in every browser. Now in
scriptaculous' autocomplete script no settings related to the div's
width or position are working.

Thanks for your help.

Best regards
Philipp

--~--~-~--~~~---~--~~
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: General Questions

2009-03-05 Thread zero

bottom of page just before /body tag

script type=text/javascript src=http://ajax.googleapis.com/ajax/
libs/prototype/1.6.0.3/prototype.js/script
script type=text/javascript
Event.observe(window, 'load', function() {

});
/script
/body

On 5 Mar, 16:01, Lee Jenkins l...@datatrakpos.com wrote:
 Hi all,

 Stupid question: where is best practices to place startup code that needs to
 register observers, setup page level objects, etc?

 Small page level script that kick starts everything?

 Thanks,

 --
 Warm Regards,

 Lee
--~--~-~--~~~---~--~~
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] Problem with Effect.SlideDown on MSIE6

2009-03-05 Thread Julien

Dear all,

I've been trying a lot of things but I can't get it work. I use
Effect.SlideDown on a page but it won't work, even with another div
inside my main div: http://tinyurl.com/d5n2l2

Click on the + button on the bottom right thumbnail or call the
addLine() function.

It works perfectly in MSIE7 and Firefox.

Thanks in advance for your help!

Julien

--~--~-~--~~~---~--~~
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] Decimal places

2009-03-05 Thread Bob

I'm relativley new to PrototypeJS. I
 am doing some calculation in a back end program and returning a JSON
string to my web page. One of the values is a price. If I return
14.20, it gets converted in evalJSON to 14.2. I want to keep both
digits. I can find how to pad the left of a nmber to a certain number
of places, but can't seem to find anythig about keeping decimals out
to a set number of places.


--~--~-~--~~~---~--~~
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] Passing value sub pseudo function

2009-03-05 Thread DasJan

Hi!

I have the following code:

var LightIt = {
timeout : null,
highLight : function(elementId){
clearTimeout(this.timeout);
var allpics = 50;
for (var i=0; i  allpics; i++) {
var currentElement = 'pic' + i;
var dummyElement = 'dummy' + i;

if($(elementId).style.opacity == 1){
if(document.getElementById(currentElement) != null) {
if(currentElement != elementId) {
  this.timeout = setTimeout(function(){new 
Effect.Opacity
(currentElement, {duration:0.2, from:1, to:0.2} )},400);
}
}
if(document.getElementById(dummyElement) != null) {
  this.timeout = setTimeout(function(){new 
Effect.Opacity
(dummyElement, {duration:0.2, from:1, to:0.2})},400);
}
}
}
},
unhighLight : function(elementId){
if($(elementId).style.opacity == 1){
clearTimeout(this.timeout);
}else{
var allpics = 50;
for (var i=0; i  allpics; i++) {
var currentElement = 'pic' + i;
var dummyElement = 'dummy' + i;



if(document.getElementById(currentElement) != null) {
if(currentElement != elementId) 
{
this.timeout = 
setTimeout(function(){new Effect.Opacity
( currentElement, {duration:0.2, from:0.2, to:1} )},400);
}
}

if(document.getElementById(dummyElement) != null) {
this.timeout = 
setTimeout(function(){new
Effect.Opacity( dummyElement, {duration:0.2, from:0.2, to:1} )},400);
}
}
}
}
}

That code is called by onmouseover=LightIt.highLight('pic1'); and
onmouseout=LightIt.unhighLight('pic1');.

However my Firebug console displays the following error:

uncaught exception: [object Object]

I have have figured out that the problem is this part:

 this.timeout = setTimeout(function(){new Effect.Opacity
(currentElement, {duration:0.2, from:1, to:0.2} )},400);

The currentElement in there seems to be empty, because the value is
not passed to the pseudo function. To see if the script work I did
this:

 this.timeout = setTimeout(function(){new Effect.Opacity('pic1',
{duration:0.2, from:1, to:0.2} )},400);

When I directly write the element name into the script it works
perfectly.

The question is, how can I pass the currentElement value to that
pseudo function?

Thanks,
Jan

--~--~-~--~~~---~--~~
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] Fade In and Fade Off

2009-03-05 Thread Akshit Soota

I need the exact code with script includes where a div fades in and
off !!

--~--~-~--~~~---~--~~
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: Decimal places

2009-03-05 Thread Matt Zagrabelny
On Wed, 2009-03-04 at 13:50 -0800, Bob wrote:
 I'm relativley new to PrototypeJS. I
  am doing some calculation in a back end program and returning a JSON
 string to my web page. One of the values is a price. If I return
 14.20, it gets converted in evalJSON to 14.2. I want to keep both
 digits. I can find how to pad the left of a nmber to a certain number
 of places, but can't seem to find anythig about keeping decimals out
 to a set number of places.

Just a guess:

Convert to a string and then back to a number as needed?

-- 
Matt Zagrabelny - mzagr...@d.umn.edu - (218) 726 8844
University of Minnesota Duluth
Information Technology Systems  Services
PGP key 1024D/84E22DA2 2005-11-07
Fingerprint: 78F9 18B3 EF58 56F5 FC85  C5CA 53E7 887F 84E2 2DA2

He is not a fool who gives up what he cannot keep to gain what he cannot
lose.
-Jim Elliot


signature.asc
Description: This is a digitally signed message part


[Proto-Scripty] Re: Having an issue with bubbling of a SELECT's onChange event in IE.

2009-03-05 Thread Walter Lee Davis


On Mar 5, 2009, at 9:44 AM, Richard Quadling wrote:


 2009/3/5 david david.brill...@gmail.com:

 Hi Richard,

 not tested, just thought: does it works with DOM0 event ??

 --
 [snip]

 Sorry for being such a newbie, but can you explain that?

 -- 
 -

I think he means if you use an inline 'onchange' event handler.

Walter



--~--~-~--~~~---~--~~
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: Passing value sub pseudo function

2009-03-05 Thread T.J. Crowder

Hi,

 The question is, how can I pass the currentElement value to that
 pseudo function?

It's not a psuedo-function, it's a function.  It's anonymous, but
other than that it's exactly the same as any other function.

I'm not saying that to be pedantic.  Getting a deep understanding
JavaScript functions is one of the keys to really using the language
well.

In your code, you're calling setTimeout in a loop, and within that
loop (on each iteration) you're creating a function to pass into
setTimeout.  You're expecting that that function will receive a frozen
copy of the value of the currentElement variable, and so will refer to
the element for that iteration of the loop.  That's where things are
going wrong, because that's not what the function receives.  (Don't
worry, *lots* of people make that mistake, it's all part of the
learning curve.)

When a function is created within a scope (such as within another
function), it receives a *live* reference (not a frozen copy) of all
of the variables in that scope.  So all of the copies of your
function, when they run, will try to use the value pic50 -- which
doesn't exist, as you have pic0 through pic49.  Why?  Because by the
time they use the currentElement variable, it has the value 50.

Try this little experiment to see this effect in action:

function foo() {
var a;

a = 5;

setTimeout(function() { alert(a =  + a); }, 500);

a = 6;
}

If you run foo(), you'll see a = 6, not a = 5.  Freaky, huh, since
foo() has long since returned.  'a' still exists because the anonymous
function has a reference to it (indirectly, because it has a reference
to the variable object that contains all of foo's variables -- even
ones that nothing will ever use again).

This is one of the most powerful features of JavaScript.  Search for
JavaScript closure to find more about it; I've also written up a bit
about closures here:
http://blog.niftysnippets.org/2008/02/closures-are-not-complicated.html
http://blog.niftysnippets.org/2008/03/closures-by-example.html

What I'd suggest in your situation is write a named function that does
what you want, and accepts a parameter giving the ID to perform the
work on.  Something like this:

function applyOpacityEffect(id) {
new Effect.Opacity(id, {duration:0.2, from:0.2, to:1} );
}

...although you can probably make it more general than that, and then
use Function#delay[1] to call it after half a second's delay:

this.timeout = applyOpacityEffect.delay(0.5, currentElement);

[1] http://prototypejs.org/api/function/delay

It doesn't have to be a named function, but it will tend to make the
code clearer.

Have fun!

HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Mar 5, 10:43 am, DasJan jro...@gmail.com wrote:
 Hi!

 I have the following code:

 var LightIt = {
     timeout : null,
     highLight : function(elementId){
         clearTimeout(this.timeout);
         var allpics = 50;
         for (var i=0; i  allpics; i++) {
                 var currentElement = 'pic' + i;
                                 var dummyElement = 'dummy' + i;

                                 if($(elementId).style.opacity == 1){
                         if(document.getElementById(currentElement) != null) {
                                 if(currentElement != elementId) {
                           this.timeout = setTimeout(function(){new 
 Effect.Opacity
 (currentElement, {duration:0.2, from:1, to:0.2} )},400);
                                 }
                         }
                         if(document.getElementById(dummyElement) != null) {
                                   this.timeout = setTimeout(function(){new 
 Effect.Opacity
 (dummyElement, {duration:0.2, from:1, to:0.2})},400);
                         }
                 }
         }
     },
     unhighLight : function(elementId){
         if($(elementId).style.opacity == 1){
             clearTimeout(this.timeout);
         }else{
                 var allpics = 50;
                                 for (var i=0; i  allpics; i++) {
                                 var currentElement = 'pic' + i;
                                                 var dummyElement = 'dummy' + 
 i;

                                         
 if(document.getElementById(currentElement) != null) {
                                                 if(currentElement != 
 elementId) {
                                         this.timeout = 
 setTimeout(function(){new Effect.Opacity
 ( currentElement, {duration:0.2, from:0.2, to:1} )},400);
                                                 }
                                         }
                                         
 if(document.getElementById(dummyElement) != null) {
                                                 this.timeout = 
 setTimeout(function(){new
 Effect.Opacity( dummyElement, {duration:0.2, from:0.2, to:1} )},400);
                                         }
                          

[Proto-Scripty] Re: Fade In and Fade Off

2009-03-05 Thread zero

just look at example http://wiki.github.com/madrobby/scriptaculous/effect-fade

On 5 Mar, 13:52, Akshit Soota a.so...@gmail.com wrote:
 I need the exact code with script includes where a div fades in and
 off !!
--~--~-~--~~~---~--~~
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: Slide Down/Slide Up w/Overlay

2009-03-05 Thread zero

do u know css?

just add position:absolute or position:relative to overlay div. left
and top attributes to set where u want overlay.

On 4 Mar, 05:41, Avram abas...@mitre.org wrote:
 My group is an interaction design team, not a team of developers, so
 we don’t know much javascript.

 We’ve been looking at  Blind Down/Blind Up and Slide Down/Slide Up,
 but these don’t do exactly what we are looking for.  Is there a slide
 down script that will overlay, not push down, the content that’s
 below it?
--~--~-~--~~~---~--~~
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: General Questions

2009-03-05 Thread Quleczka

 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/prototype/1.6.0.3/prototype.js/script
 script type=text/javascript
 Event.observe(window, 'load', function() {

 });

 /script
 /body

Why?

Why not include prototype and other things in the head section of the
page?  If you use observe it on window load it doesn't haveto byat the
end of the page.


Bythe way, you can also use dom:loaded instead of window load :)
--
From API Docs (http://prototypejs.org/api/event/observe) :

Of course, you'd want this line of code to run once the form exists
in the DOM; but putting inline scripts in the document is pretty
obtrusive, so instead we'll go for a simple approach that waits till
the page is fully loaded:

Event.observe(window, 'load', function() {
  Event.observe('signinForm', 'submit', checkForm);
});

Just a little wrapping…

Note that if your page is heavy, you might want to run this code
before the page is fully loaded: just wait until the DOM is loaded,
that will be enough. (Prototype's dom:loaded event can help you with
that.)
--
--~--~-~--~~~---~--~~
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: Decimal places

2009-03-05 Thread T.J. Crowder

Hi,

If you're passing it as a numeric literal, e.g.:

 {  price:  14.20  }

...what you're dealing with is a number, which you'll later *render*
as a string for display.  All JavaScript numbers have the same
precision, which I'm not quite geeky enough to quote you. ;-)  You'll
need to handle formatting at the presentation stage.  Since these are
prices, formatting is pretty straightforward, as the precision doesn't
vary from one price to the next.

If you needed to handle this for numbers where the precision varied,
you'd have to either pass them as strings or pass the precision as a
separate value for use in your formatting code.

HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Mar 4, 9:50 pm, Bob bro...@packagingcorp.com wrote:
 I'm relativley new to PrototypeJS. I
  am doing some calculation in a back end program and returning a JSON
 string to my web page. One of the values is a price. If I return
 14.20, it gets converted in evalJSON to 14.2. I want to keep both
 digits. I can find how to pad the left of a nmber to a certain number
 of places, but can't seem to find anythig about keeping decimals out
 to a set number of places.
--~--~-~--~~~---~--~~
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] Processing Ajax.updater response before updating container

2009-03-05 Thread Steakfest

I just started using prototype and scriptalicous yesterday. I was able
to get an Ajax update call working with very little effort.  Thanks to
the community for such great documentation.

In my framework, sometimes there is debugging information dumped at
the bottom of the page. I would like to know what the easiest way to
scrub that debug output would be with prototype.  My framework
outputs a very unique string before the debug output. So, a simple
substring-before would do the trick.

Thanks in advance for any advice

--~--~-~--~~~---~--~~
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] $$ failing in FF3.1b3

2009-03-05 Thread Jim Higson

Hi,

Is anybody else finding this? Does Prototype from git work with FF3.1?

Thanks,
Jim

-- 
Jim
my wiki ajaxification thing: http://wikizzle.org
my blog: http://jimhigson.blogspot.com/

--~--~-~--~~~---~--~~
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: Position of div with suggests

2009-03-05 Thread Quleczka

 Is it possible, to manually set the div's position? I had another
 autocomplete script before, where I could playce the div via
 stylesheets and it worked perfect in every browser. Now in
 scriptaculous' autocomplete script no settings related to the div's
 width or position are working.

What do you mean? You can use stylesheet :)

CSS The styling of the div and the returned UL are important.
Applying a visual cue that an item is selected allows the user to take
advantage of the keyboard navigation of the dropdown and adding
background colors, borders, positioning, etc to the div (as the demo
does) allows the UI element to stand out.

From http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter

There is even style for div.autocomplete and other classes from
example included.
Like this ones:

div.autocomplete {
  position:absolute;
  width:250px;
  background-color:white;
  border:1px solid #888;
  margin:0;
  padding:0;
}

Quleczka
--~--~-~--~~~---~--~~
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: Processing Ajax.updater response before updating container

2009-03-05 Thread Quleczka

 In my framework, sometimes there is debugging information dumped at
 the bottom of the page. I would like to know what the easiest way to
 scrub that debug output would be with prototype.  My framework
 outputs a very unique string before the debug output. So, a simple
 substring-before would do the trick.

I'm new to prototype as well:)

I don't see option to do something else before updating container...
but it is really easy to make your own ajax.updater  - I mean just
new ajax.request which will do what you want and then update the
container.

It is really easy :) Look at the basic example at 
http://prototypejs.org/api/ajax/request
--~--~-~--~~~---~--~~
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: observe select changes from javascript

2009-03-05 Thread ColinFine



On Mar 4, 4:14 pm, Matt Zagrabelny mzagr...@d.umn.edu wrote:
 Greetings,

 I am trying to observe a select element's value changing when its
 value changes programmatically. The observation works when a human
 changes the select's value, but not when the javascript changes it.

 I know that I could add some more logic to the button push, but would
 like to avoid that if possible and simply register the observing
 conditions for the select.


The definition of 'onChange' is The onchange event occurs when a
control loses the input focus and its value has been modified since
gaining focus. [1]

Simply changing the value should not fire the event (though I'm not
sure all browsers respect this). I don't think that there is an event
which will reliably fire in this case - you need to do it another
way.

Colin

[1] http://www.w3.org/TR/html401/interact/scripts.html#adef-onchange
--~--~-~--~~~---~--~~
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: Drag and Drop with conditional revert

2009-03-05 Thread ColinFine



On Mar 5, 12:30 pm, david david.brill...@gmail.com wrote:
 Hi ColinFine,

Thanks for replying.

 I think that the method that will hide the element during request is
 as you say BAD :((
Yes
 I will do another way:
 - if dropsite is good, just lauch AJAX request, but before set a
 spinner inside, near, where you want to indicate that actually the
 apply is processing something.
Not relevant - I will do that if I think it needs it
 - If response is not good, just do a manual revert (I did not think
 you could have bundle callback, ... to do this.

That is really what I was asking for. I am surprised both that I can't
do it through a callback, and that Draggable does not provide me a
callable method to do it.

 But, The idea of making all info available in the CLIENT is THE GOOD
 idea, because each time you go and check if element could be dropped,
 you make one more call to the server and it should create all
 necessary process to respond to the request == which consume a lot of
 resources.

I see that point, and I have sometimes done it that way, but there are
two reasons against it:
1. All the data that may be required to perform any of the validations
needs to be downloaded with the original page load.
2. The validation has to be coded in Javascript, but is likely to
duplicate some code which is also needed in the server program (PHP in
my case).

For a given site, there will be a trade-off between these different
points, and you make a decision depending on the amount of data
required, the likely number of drag-drop operations, the speed of
connection, the load on the server etc.

Colin

--~--~-~--~~~---~--~~
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] Array.without() problem

2009-03-05 Thread webbear1000

Hey peeps!

I'm sure I'm missing something obvious here but I can't for the life
of me figure out what's going wrong.

I'm trying to use Array.without() to get rid of a number from an array
in the fourth line of my code.
The trouble is, it returns an array with all instances of the index
set to zero.

---
this.removeTab = function(index){
list.select(li)[index].remove();
history = history.without(index);
if(selected == index){ this.setSelected(history.last()); }
}
---

Any idea what's going on people?

Help much appreciated.
BEAR
--~--~-~--~~~---~--~~
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: $$ failing in FF3.1b3

2009-03-05 Thread Jim Higson

On Thursday 05 March 2009 16:16:05 Jim Higson wrote:
 Hi,

 Is anybody else finding this? Does Prototype from git work with FF3.1?

On closer inspection, it is quite easy to get Prototype to throw similar 
errors even in FF3. It just happens that my present code only provokes it in 
3.1.

For example here:
http://users.ox.ac.uk/~admn2094/test.html

Basically, writeAttribute tries to add an attribute called 'foo' somewhere 
with the value 
function foo(){ return @@ } and this fails because of the illegal @ char.

Are you not allowed to extend Object when using prototype? Prototype doesn't 
seem to do any hasOwnProperty checks:

http://yuiblog.com/blog/2006/09/26/for-in-intrigue/

File as a bug?

-- 
Jim
my wiki ajaxification thing: http://wikizzle.org
my blog: http://jimhigson.blogspot.com/


--~--~-~--~~~---~--~~
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] Effect Problems

2009-03-05 Thread John McGowan
As I said in my last post, I'm brand new to Proto and Scripty.  I apologize
a head of time for this newbie question.

I was just testing out a simple little page that uses Ajax.Updater to get
new content and drop it into a div.  It works just fine, over and over
again, without trouble.

However, when I add some Effects to the mix, eventually, the container div
ends up getting hidden, when it shouldn't be... I'm a programmer, so I
understand that there's probably some sort of race condition occuring.

Here's an example of what I'm doing, these calls are in the onChange for a
drop down on the main page.

new Effect.Appear('pkgSearchFormLoading', {{ queue: 'end' }});
new Effect.Fade('pkgSearchForm', {{ queue: 'end' }});
new Ajax.Updater('pkgSearchForm', 'main.taf', {{ evalScripts: true, method:
'get', parameters: {{live:'live',p:'9,4,1',PackageID:$F('pspkgid')}} }});

on the page that gets loaded and dropped into the pkgSearchForm container,
this following script is returned...

new Effect.Fade('pkgSearchFormLoading', {{ queue: 'end' }});
new Effect.Appear('pkgSearchForm', {{ queue: 'end' }});

I started out without the queue stuff, but adding it didn't really change
anything.

I'm sure that what's happening is that the Appear that's supposed to execute
when the Updater loads the html fragment is either not executing, or it's
executing in parallel with the Fade from the original OnChange event on
the main page.

Could someone just point me in the right direction as to the best practice
in doing this sort of thing.

Thanks,
John

--~--~-~--~~~---~--~~
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: writeAttribute problem

2009-03-05 Thread Lee Jenkins

Quleczka wrote:
 Hi,
 
 That may have well been the case.  I was trying to use writeAttribute with a
 Text Input.  I assumed that it would work and apparent does in IE7.
 
 I'm curious, which attribute were you trying to set -  just a value
 of  this input field?
 
 - For setting or getting the value attribute of Form elements (use
 FormElement#(get|set)Value instead).
 
 Lee, is there a setValue()?
 
 Only getValue is mentioned in API Docs -  
 http://prototypejs.org/api/form/element
 .
 
 I use just something.value='test'; and it's working :)
  

Hi Quleczka,

Yes, the dot notation method works for me as well.  I was trying to create a 
generic handler on the page that could set attributes for elements in a generic 
way according to ajax responses.  It's ok, I can use the method you mentioned 
above for Form Elements and the generic version for others.

--
Warm Regards,

Lee

--~--~-~--~~~---~--~~
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: General Questions

2009-03-05 Thread Lee Jenkins

Quleczka wrote:
 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/prototype/1.6.0.3/prototype.js/script
 script type=text/javascript
 Event.observe(window, 'load', function() {

 });

 /script
 /body
 
 Why?
 
 Why not include prototype and other things in the head section of the
 page?  If you use observe it on window load it doesn't haveto byat the
 end of the page.
 

But either way, a quick call to register an observer which will kick start all 
of my initialization code.

Thanks to both.

--
Warm Regards,

Lee

--~--~-~--~~~---~--~~
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: writeAttribute problem

2009-03-05 Thread Quleczka

 It's ok, I can use the method you mentioned
 above for Form Elements and the generic version for others.

I think $(a).attribute=value; works for both types... but I'm not the
expert ;)

Good luck :)

Quleczka
--~--~-~--~~~---~--~~
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: $$ failing in FF3.1b3

2009-03-05 Thread Tobie Langel

Hi,

Extending Object.prototype is regarded as a Bad Thing[1].

The main reason being that cross-browser support for hasOwnProperty is
fairly recent (Safari 2 doesn't have it for example).

Best,

Tobie

[1] http://erik.eae.net/archives/2005/06/06/22.13.54/

On Mar 5, 6:34 pm, Jim Higson j...@wikizzle.org wrote:
 On Thursday 05 March 2009 16:16:05 Jim Higson wrote:

  Hi,

  Is anybody else finding this? Does Prototype from git work with FF3.1?

 On closer inspection, it is quite easy to get Prototype to throw similar
 errors even in FF3. It just happens that my present code only provokes it in
 3.1.

 For example here:http://users.ox.ac.uk/~admn2094/test.html

 Basically, writeAttribute tries to add an attribute called 'foo' somewhere
 with the value
 function foo(){ return @@ } and this fails because of the illegal @ char.

 Are you not allowed to extend Object when using prototype? Prototype doesn't
 seem to do any hasOwnProperty checks:

 http://yuiblog.com/blog/2006/09/26/for-in-intrigue/

 File as a bug?

 --
 Jim
 my wiki ajaxification thing:http://wikizzle.org
 my blog:http://jimhigson.blogspot.com/
--~--~-~--~~~---~--~~
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: writeAttribute problem

2009-03-05 Thread RobG

On Mar 5, 6:53 pm, Tobie Langel tobie.lan...@gmail.com wrote:
 Rob,

 Please have a look at the DOM specs.

I have, the issue is how it's implemented.  When the specs are written
without ambiguity and all browsers follow them, it might be reasonable
to use them as the sole criterion for doing something.  But life’s not
like that.  :-(

 The only area where you should not be using writeAttribute is:

 - When you want to store anything but a string (use the new storage
 API or expandos directly).
 - For setting or getting the value attribute of Form elements (use
 FormElement#(get|set)Value instead).

writeAttribute does not fix cross browser differences in the
implementation of setAttribute.

My reason for recommending using the dot property is that it works
reliably, is precise, does not have the idiosyncrasies of setAttribute
and, most of all, directly sets the property versus making at least 3
function calls to do (more or less) the same thing.

Feel free to recommend otherwise but I'd like to see some reasons why.


--
Rob
--~--~-~--~~~---~--~~
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: Decimal places

2009-03-05 Thread RobG



On Mar 5, 7:50 am, Bob bro...@packagingcorp.com wrote:
 I'm relativley new to PrototypeJS. I
  am doing some calculation in a back end program and returning a JSON
 string to my web page. One of the values is a price. If I return
 14.20, it gets converted in evalJSON to 14.2. I want to keep both
 digits. I can find how to pad the left of a nmber to a certain number
 of places, but can't seem to find anythig about keeping decimals out
 to a set number of places.

Others have answered your question (pass the value as a string),
here's a bit more information on the topic if you are doing in-page
calculations and wondering why they don't quite add up:

How do I format a Number as a String with exactly 2 decimal places?
URL: http://www.jibbering.com/faq/#formatNumber 


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