[Proto-Scripty] Re: Event.stop with two observers on same object

2009-06-17 Thread steffenb

OK, I read those two points on Event#stop, but still believed
Event#stop would prevent any further event processing, as the method
name indicates.  Maybe a clarifying line in the docs would help here,
e.g.

Note: further observers on the same element will be called despite
Event#stop.

Steffen

On Jun 16, 3:38 pm, T.J. Crowder t...@crowdersoftware.com wrote:
 Hi,

 Interesting question.  It's the expected behavior.  The documentation
 [1] says that Event#stop will:

 * Prevent further bubbling of the event
 * Prevent the default behavior of the event (where the browser allows
 it)

 Not triggering other observers doesn't fall under either of those
 categories.  It would also create a non-deterministic situation (since
 neither browsers nor Prototype guarantee the order in which event
 handlers are called).  It would also be cross-talk (since your handler
 doesn't necessarily have anything to do with other handlers on the
 element), which is usually a bad idea, although I think a successful
 argument could be made that preventing bubbling also creates a cross-
 talk situation. :-)

 [1]http://prototypejs.org/api/event/stop

 HTH,
--~--~-~--~~~---~--~~
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: Sortable onUpdate not working on IE7

2009-06-17 Thread T.J. Crowder

Hi,

 The updateTeamList is a function in a .js file that is used by this
 page.

Is the script tag including that JS file *below* the script tag that
contains the document.observe call?  If so, move it above it.

If that's not it, I'd pick up with #3 on this list:
http://proto-scripty.wikidot.com/faq#xyzprob

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


On Jun 16, 9:26 pm, Adriano Santi antiu...@gmail.com wrote:
 I have a page with a simple sortable UL, with the id attribute
 lister. I'm using the following code:

 document.observe(dom:loaded, function() {
         Sortable.create('lister',{tag:'li', onUpdate:updateTeamList});

 });

 However, when the page is loaded, IE7 gives me the following errors:

 A Runtime Error has occurred. Do you wish to Debug?
 Line: 259
 Error: 'updateTeamList' is undefined

 The updateTeamList is a function in a .js file that is used by this
 page. Other functions from the same file work, and on Firefox,
 everything works with absolutely no glitches. Just FYI, this is the
 function in question:

 function updateTeamList() {
         args = Sortable.serialize('lister');
         Sortable.destroy('lister');
         loadXMLDoc('ajax/team_list_update.php', args);

 }

 I've been googling left and right but haven't found any instances of
 this occurring to anyone else. Does anyone have a clue what might be
 happening here?
--~--~-~--~~~---~--~~
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: Problems with pollDoScroll and IE family (1.6.1 rc)

2009-06-17 Thread T.J. Crowder

Hi,

 When I replace pollDoScroll.defer(); with pollDoScroll.delay(0);
 everything works.

That's weird, since xyz.defer() is functionally equivalent (with a bit
more overhead) to xyz.delay(0.01).

 How is the process to get in tough with the Prototype devels?

http://prototypejs.org/contribute

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

On Jun 16, 3:57 pm, gnaegi florian.gna...@gmail.com wrote:
 Hi David

 Thanks for the link, but this does not help me. I know what
 pollDoScroll() does. My problem is that when I use prototype in my
 webapp, I get Out of stack space error messages in IE because the
 pollDoScroll() method is executed over 600 times in a recursion and
 the expression document.documentElement.doScroll('left'); will always
 fail.

 I traced it down to the fact that together with ExtJS
 pollDoScroll.defer(); does not seem to wait long enough. I don't know
 if this is an ExtJS-Prototype combination problem or if this is
 because my app does some other things while loading.

 When I replace pollDoScroll.defer(); with pollDoScroll.delay(0);
 everything works.

 How is the process to get in tough with the Prototype devels? Is this
 something we can change in the release or is there a reason why it
 uses pollDoScroll.defer(); instead of pollDoScroll.delay(0);?

 Thanks for any hints
 Florian

 On Jun 6, 10:06 pm, david david.brill...@gmail.com wrote:

  Hi Florian,

  i found this comment on the dean edwards blog.
  go and see it:http://dean.edwards.name/weblog/2006/06/again/#comment121098

  I think it explain your problem.

  --
  david

  On 3 juin, 19:08, Florian Gnägi florian.gna...@gmail.com wrote:

   Hi

   I get errors with prototype 1.6.1rc in IE browsers. In IE debugger I
   get the Out of stack space message.

   I could track it down to the lines 635 and 636 in event.js. When I
   remove the lines, everything runs smoothly.

  http://github.com/sstephenson/prototype/blob/483c7886de5c0c6e721dee06...

   Could this be a sideeffect of using prototype with ExtJS?

   Thanks for any hints
   Florian


--~--~-~--~~~---~--~~
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: Creating new lines and bypassing them through escapeHTML

2009-06-17 Thread T.J. Crowder

@kangax  Rob:

I didn't mean to step into someone's holy war here.  By seems to be
recommended I meant what I said earlier, used in the unit tests and
such.

Let's just change them to something reasonable and move on.

-- T.J.

On Jun 17, 7:10 am, RobG robg...@gmail.com wrote:
 On Jun 15, 5:48 pm, T.J. Crowder t...@crowdersoftware.com wrote:

  Heya,

   I thought it wouldn't come as a surprise that using XHTML makes no
   sense...

  Hey, HTML and CSS make no sense, let alone XHTML.  But that's OT. :-)
  I'm just saying, the doctype that seems to be recommended is XHTML
  transitional,

 By who?  Certainly not by those who understand the issues involved -
 search the archives at:

 news:comp.infosystems.www.authoring.html
 URL:http://groups.google.com/group/comp.infosystems.www.authoring.html?lnk=



 XHTML is pretty much dead, it is essentially replaced by HTML 5.  The
 vast majority of documents with an XHTML DOCTYPE are served as text/
 html, so they are treated by browsers as invalid HTML.

 It was something of a fad to pretend to use XHTML, it serves no useful
 purpose.  I always chuckle when I see an IIS server using the default
 XHTML DOCTYPE, then serve it as text/html. If it was served as XML, IE
 would not know what to do with it since IE is one of the few modern
 browsers that don't know what XML is.  A clear case of style over
 substance.

  so that's what I use as I don't have a strong reason for
  doing anything else, and in the XHTML transitional doctype, br/ is
  correct and I'm guessing requires less work from the browser.

  But of course, you're right that if you don't specify any doctype or
  if you specify an HTML doctype, you want br.  I don't know if that's
  going to be 99% of the time, but it's going to be a big number.

 Probably 99.999%

  The take away for the OP is:  Use a doctype (just about any doctype),
  and then use br or br/ depending on what doctype you're using.

 The DOCTYPE is pretty much irrelevant except for switching to or from
 standards mode (or almost standards mode).  Whether the document is
 treated as XML or HTML depends on the response header content type.

 --
 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: Event.stop with two observers on same object

2009-06-17 Thread T.J. Crowder

 Maybe a clarifying line in the docs would help here,
 e.g.

I'm with you; open a ticket on Lighthouse[1] and assign it to me?

[1] https://prototype.lighthouseapp.com/projects/8886-prototype/overview

-- T.J. :-)

On Jun 17, 8:33 am, steffenb sbart...@tzi.de wrote:
 OK, I read those two points on Event#stop, but still believed
 Event#stop would prevent any further event processing, as the method
 name indicates.  Maybe a clarifying line in the docs would help here,
 e.g.

 Note: further observers on the same element will be called despite
 Event#stop.

 Steffen

 On Jun 16, 3:38 pm, T.J. Crowder t...@crowdersoftware.com wrote:

  Hi,

  Interesting question.  It's the expected behavior.  The documentation
  [1] says that Event#stop will:

  * Prevent further bubbling of the event
  * Prevent the default behavior of the event (where the browser allows
  it)

  Not triggering other observers doesn't fall under either of those
  categories.  It would also create a non-deterministic situation (since
  neither browsers nor Prototype guarantee the order in which event
  handlers are called).  It would also be cross-talk (since your handler
  doesn't necessarily have anything to do with other handlers on the
  element), which is usually a bad idea, although I think a successful
  argument could be made that preventing bubbling also creates a cross-
  talk situation. :-)

  [1]http://prototypejs.org/api/event/stop

  HTH,


--~--~-~--~~~---~--~~
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: Creating new lines and bypassing them through escapeHTML

2009-06-17 Thread T.J. Crowder

Sorry, holy war reads a lot stronger than I meant it to.  I'm just
frustrated by the utter bollocks that comes out of the W3C more often
than not.

-- T.J.

On Jun 17, 9:44 am, T.J. Crowder t...@crowdersoftware.com wrote:
 @kangax  Rob:

 I didn't mean to step into someone's holy war here.  By seems to be
 recommended I meant what I said earlier, used in the unit tests and
 such.

 Let's just change them to something reasonable and move on.

 -- T.J.

 On Jun 17, 7:10 am, RobG robg...@gmail.com wrote:

  On Jun 15, 5:48 pm, T.J. Crowder t...@crowdersoftware.com wrote:

   Heya,

I thought it wouldn't come as a surprise that using XHTML makes no
sense...

   Hey, HTML and CSS make no sense, let alone XHTML.  But that's OT. :-)
   I'm just saying, the doctype that seems to be recommended is XHTML
   transitional,

  By who?  Certainly not by those who understand the issues involved -
  search the archives at:

  news:comp.infosystems.www.authoring.html
  URL:http://groups.google.com/group/comp.infosystems.www.authoring.html?lnk=

  XHTML is pretty much dead, it is essentially replaced by HTML 5.  The
  vast majority of documents with an XHTML DOCTYPE are served as text/
  html, so they are treated by browsers as invalid HTML.

  It was something of a fad to pretend to use XHTML, it serves no useful
  purpose.  I always chuckle when I see an IIS server using the default
  XHTML DOCTYPE, then serve it as text/html. If it was served as XML, IE
  would not know what to do with it since IE is one of the few modern
  browsers that don't know what XML is.  A clear case of style over
  substance.

   so that's what I use as I don't have a strong reason for
   doing anything else, and in the XHTML transitional doctype, br/ is
   correct and I'm guessing requires less work from the browser.

   But of course, you're right that if you don't specify any doctype or
   if you specify an HTML doctype, you want br.  I don't know if that's
   going to be 99% of the time, but it's going to be a big number.

  Probably 99.999%

   The take away for the OP is:  Use a doctype (just about any doctype),
   and then use br or br/ depending on what doctype you're using.

  The DOCTYPE is pretty much irrelevant except for switching to or from
  standards mode (or almost standards mode).  Whether the document is
  treated as XML or HTML depends on the response header content type.

  --
  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: Prototype and forms

2009-06-17 Thread anthony

Thanks for the cleanup. I have made those changes. Feel free to post
others. The problem I have is that the form had two dynamic places:

div id=territories/div
and
div id=adjForm/div

There is an onChange that calls the javascript function getTerritories
() allows the
div id=territories/div to display which has a form element
called territory. At the end of the same function, it calls the other
javascript function getAdjForm(). getAdjForm() looks to see if the
form element territory exists. That's the problem, for some reason, it
cannot see it. What can I do to make it where it does not fail the if
statement in that function?

On Jun 16, 11:33 am, Rick Waldron waldron.r...@gmail.com wrote:
 A few things...

  var params = Form.serialize($('createAdjForm'));

 You can clean this up as:

  var params = $('createAdjForm').serialize();

 There are other points that you could optimize, but thats not your
 question...

 And at whatever point you want adjForm to appear, you need to add:

 $('adjForm').show()

 Rick

 On Mon, Jun 15, 2009 at 5:46 PM, anthony mrsmi...@gmail.com wrote:

  I have a form that when a user selects something from a drop-down,
  another element in the form appears. There is another piece of the
  form, that is never showing up, I need to understand what I am doing
  wrong and how to fix it:

  script type=text/javascript language=JavaScript
  function getAdjForm() {

        var params = Form.serialize($('createAdjForm'));
  alert($('territory').value);

         if ($('adjType').value !==   $('territory').value !== ){

                 new Ajax.Updater(
                 adjForm,
                 ?= $this-url(array('controller'='index',
  'action'='get-adj-
  form'))?,
                 {method:'post',
                 parameters: params});
         }
  }

  function getTerritories() {

         var params = Form.serialize($('createAdjForm'));
         new Ajax.Updater(
         territories,
         ?= $this-url(array('controller'='index', 'action'='get-
  territories'))?,
         {method:'post',
         parameters: params});

         if ($('adjType').value !== ){
                 //alert('d');
                 getAdjForm();
         }
  }

  function getCustomer() {

         var params = Form.serialize($('createAdjForm'));
         new Ajax.Updater(
         customer,
         ?= $this-url(array('controller'='index', 'action'='get-
  customer'))?,
         {method:'post',
         parameters: params});
  }

  /script

  form method=POST id=createAdjForm action=
  p

  table border=0 CELLSPACING=10
         tr
                 td
                         bSelect Adjustment Type/b
                 /td
                 td
                         ?php echo $this-formSelect('adjType',
  $this-adjType, array
  (onChange=getAdjForm()), array(=Select an Adjustment Type) +
  $this-adjTypes) ?
                 /td
         /tr
         tr
                 td
                         bSubmitting Territory/b
                 /td
                 td
                         ?php echo $this-formSelect('shortTerritory',
  $this-
  shortTerritory, array(onChange=getTerritories()), array
  (=Select a Territory) + $this-shortTerritories) ?
                         div id=territories/div
                 /td
         /tr
         tr
                 td valign=top
                         bJustification/b
                 /td
                 td
                         ?php echo
  $this-formTextarea('justification',$this-
  justification,array(rows=5,cols=75)) ?
                 /td
         /tr
  /table
  hr
  div id=adjForm
  /div

  ***
  This issue is that the data that should be here:
  div id=adjForm
  /div
  Is never showing. When getAdjForm(); is called from getTerritories(),
  the $('territory').value !==  seems to be the problem. Does the
  browser not know that was an element because it just appeared?
--~--~-~--~~~---~--~~
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] Curvy Corners + draggables (script.aculo.us)

2009-06-17 Thread Rafael M Ximenes

Hi, everybody!

I'm a Brazilian WebDev and I've found  a script to round corners
without images (Script's name is Curvy Corners: 
http://www.curvycorners.net/demos/).
I was trying to round corners of the draggables, but they lose your
functions.

Some help?

Regards.
Rafael

--~--~-~--~~~---~--~~
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] Handle on sortable list doesn't work in IE.

2009-06-17 Thread Maya

I've assigned a handle on my sortable and it works fine in Firefox but
not at all in IE.   In IE you can use any of the elements in the LI to
reorder the list.  I would like to only be able to use the REORDER
element to reorder the list.  Any suggestions?

div id=dragDrop
ul class=sortlist id=list_to_sort
li id=item_1 class=sortlistItem Name - Date - Detail - span
id=thehandleREORDER/span/li
/ul
/div

 script language=JavaScript
Sortable.create(list_to_sort, {
elements:$$('#list_to_sort li.sortlist'),
handles:$$('#list_to_sort #thehandle'),
onUpdate: function() {
new Ajax.Request(updateRowOrder.cfm, {
method: post,
parameters: { data: Sortable.serialize(list_to_sort) }
});
}
});
/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] Need help resolving conflict between Proto and Uize frameworks

2009-06-17 Thread piers

I know it's probably a lousy idea but I have both prototype and uize
referenced in the head of my document:

[code]
script type=text/javascript src=js/Uize.js/script
script  type=text/javascript src=javascript/prototype.js/
script
[/code]

The only time I use a prototype function in the body of the document
is to create a function that plays a movie when a thumbnail is
clicked.

The function is:

[code]
script
function setMovie( url, title )
{
 $('movieHost').innerHTML = '';
 var elEmbed = document.createElement( 'embed' );
 elEmbed.src = url;
 elEmbed.setAttribute(width, 100%);
 elEmbed.setAttribute(height,100%);
 elEmbed.setAttribute(scale,aspect);
 elEmbed.setAttribute(bgcolor,black);

 $('movieHost').appendChild( elEmbed );

 $('nowPlaying').innerHTML = title;
}

new Ajax.Request( '', {
  method: 'get',
  onSuccess: function( transport ) {
var bFirst = true;
for( var b = 0; b  movieTags.length; b++ ) {

  if ( bFirst )
  {
setMovie( url, title );
bFirst = false;
  }
var html = 'a href=javascript:void 
setMovie(\''+url+'\',\''+title
+'\');';
  html += title+'/abr/';
}
  }
} );
/script
[/code]

The only problem I'm having is that I call the function at body
onload:

[code]
BODY onload=setMovie('Quicktimes/mov1.mov', 'Suzuki :
quot;Fencequot;  1 of 12')
[/code]

In order that the first movie starts playing right away...

And everything is fine... EXCEPT that about 10 or 15 seconds into the
first movie it skips back to the beginning and starts playing again.
Once it's done that everything works fine until a page reload - and
then it plays and skips back.

I've tried changing the order of the script references in the head
section... but that breaks the uize framework.

Is there some way to recode the function with absolutes?

Thanks!
--~--~-~--~~~---~--~~
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: Prototype and forms

2009-06-17 Thread anthony

Ok, I have found a better way to explain this.

var params = $('createAdjForm').serialize();
alert(params);

This does not show the form elements that were included via: div
id=territories/div

Why is that the case?


On Jun 17, 9:06 am, anthony mrsmi...@gmail.com wrote:
 Thanks for the cleanup. I have made those changes. Feel free to post
 others. The problem I have is that the form had two dynamic places:

 div id=territories/div
 and
 div id=adjForm/div

 There is an onChange that calls the javascript function getTerritories
 () allows the
 div id=territories/div to display which has a form element
 called territory. At the end of the same function, it calls the other
 javascript function getAdjForm(). getAdjForm() looks to see if the
 form element territory exists. That's the problem, for some reason, it
 cannot see it. What can I do to make it where it does not fail the if
 statement in that function?

 On Jun 16, 11:33 am, Rick Waldron waldron.r...@gmail.com wrote:

  A few things...

   var params = Form.serialize($('createAdjForm'));

  You can clean this up as:

   var params = $('createAdjForm').serialize();

  There are other points that you could optimize, but thats not your
  question...

  And at whatever point you want adjForm to appear, you need to add:

  $('adjForm').show()

  Rick

  On Mon, Jun 15, 2009 at 5:46 PM, anthony mrsmi...@gmail.com wrote:

   I have a form that when a user selects something from a drop-down,
   another element in the form appears. There is another piece of the
   form, that is never showing up, I need to understand what I am doing
   wrong and how to fix it:

   script type=text/javascript language=JavaScript
   function getAdjForm() {

         var params = Form.serialize($('createAdjForm'));
   alert($('territory').value);

          if ($('adjType').value !==   $('territory').value !== ){

                  new Ajax.Updater(
                  adjForm,
                  ?= $this-url(array('controller'='index',
   'action'='get-adj-
   form'))?,
                  {method:'post',
                  parameters: params});
          }
   }

   function getTerritories() {

          var params = Form.serialize($('createAdjForm'));
          new Ajax.Updater(
          territories,
          ?= $this-url(array('controller'='index', 'action'='get-
   territories'))?,
          {method:'post',
          parameters: params});

          if ($('adjType').value !== ){
                  //alert('d');
                  getAdjForm();
          }
   }

   function getCustomer() {

          var params = Form.serialize($('createAdjForm'));
          new Ajax.Updater(
          customer,
          ?= $this-url(array('controller'='index', 'action'='get-
   customer'))?,
          {method:'post',
          parameters: params});
   }

   /script

   form method=POST id=createAdjForm action=
   p

   table border=0 CELLSPACING=10
          tr
                  td
                          bSelect Adjustment Type/b
                  /td
                  td
                          ?php echo $this-formSelect('adjType',
   $this-adjType, array
   (onChange=getAdjForm()), array(=Select an Adjustment Type) +
   $this-adjTypes) ?
                  /td
          /tr
          tr
                  td
                          bSubmitting Territory/b
                  /td
                  td
                          ?php echo $this-formSelect('shortTerritory',
   $this-
   shortTerritory, array(onChange=getTerritories()), array
   (=Select a Territory) + $this-shortTerritories) ?
                          div id=territories/div
                  /td
          /tr
          tr
                  td valign=top
                          bJustification/b
                  /td
                  td
                          ?php echo
   $this-formTextarea('justification',$this-
   justification,array(rows=5,cols=75)) ?
                  /td
          /tr
   /table
   hr
   div id=adjForm
   /div

   ***
   This issue is that the data that should be here:
   div id=adjForm
   /div
   Is never showing. When getAdjForm(); is called from getTerritories(),
   the $('territory').value !==  seems to be the problem. Does the
   browser not know that was an element because it just appeared?
--~--~-~--~~~---~--~~
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: Prototype and forms

2009-06-17 Thread Alex McAuley

Because the contents are from an AJAX request and they dont exist in the 
DOM probably .
OR..

They are outside the /form tag 

Paste full code to a pastie and we can help



- Original Message - 
From: anthony mrsmi...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Wednesday, June 17, 2009 4:52 PM
Subject: [Proto-Scripty] Re: Prototype and forms



Ok, I have found a better way to explain this.

var params = $('createAdjForm').serialize();
alert(params);

This does not show the form elements that were included via: div
id=territories/div

Why is that the case?


On Jun 17, 9:06 am, anthony mrsmi...@gmail.com wrote:
 Thanks for the cleanup. I have made those changes. Feel free to post
 others. The problem I have is that the form had two dynamic places:

 div id=territories/div
 and
 div id=adjForm/div

 There is an onChange that calls the javascript function getTerritories
 () allows the
 div id=territories/div to display which has a form element
 called territory. At the end of the same function, it calls the other
 javascript function getAdjForm(). getAdjForm() looks to see if the
 form element territory exists. That's the problem, for some reason, it
 cannot see it. What can I do to make it where it does not fail the if
 statement in that function?

 On Jun 16, 11:33 am, Rick Waldron waldron.r...@gmail.com wrote:

  A few things...

  var params = Form.serialize($('createAdjForm'));

  You can clean this up as:

  var params = $('createAdjForm').serialize();

  There are other points that you could optimize, but thats not your
  question...

  And at whatever point you want adjForm to appear, you need to add:

  $('adjForm').show()

  Rick

  On Mon, Jun 15, 2009 at 5:46 PM, anthony mrsmi...@gmail.com wrote:

   I have a form that when a user selects something from a drop-down,
   another element in the form appears. There is another piece of the
   form, that is never showing up, I need to understand what I am doing
   wrong and how to fix it:

   script type=text/javascript language=JavaScript
   function getAdjForm() {

   var params = Form.serialize($('createAdjForm'));
   alert($('territory').value);

   if ($('adjType').value !==   $('territory').value !== ){

   new Ajax.Updater(
   adjForm,
   ?= $this-url(array('controller'='index',
   'action'='get-adj-
   form'))?,
   {method:'post',
   parameters: params});
   }
   }

   function getTerritories() {

   var params = Form.serialize($('createAdjForm'));
   new Ajax.Updater(
   territories,
   ?= $this-url(array('controller'='index', 'action'='get-
   territories'))?,
   {method:'post',
   parameters: params});

   if ($('adjType').value !== ){
   //alert('d');
   getAdjForm();
   }
   }

   function getCustomer() {

   var params = Form.serialize($('createAdjForm'));
   new Ajax.Updater(
   customer,
   ?= $this-url(array('controller'='index', 'action'='get-
   customer'))?,
   {method:'post',
   parameters: params});
   }

   /script

   form method=POST id=createAdjForm action=
   p

   table border=0 CELLSPACING=10
   tr
   td
   bSelect Adjustment Type/b
   /td
   td
   ?php echo $this-formSelect('adjType',
   $this-adjType, array
   (onChange=getAdjForm()), array(=Select an Adjustment Type) +
   $this-adjTypes) ?
   /td
   /tr
   tr
   td
   bSubmitting Territory/b
   /td
   td
   ?php echo $this-formSelect('shortTerritory',
   $this-
   shortTerritory, array(onChange=getTerritories()), array
   (=Select a Territory) + $this-shortTerritories) ?
   div id=territories/div
   /td
   /tr
   tr
   td valign=top
   bJustification/b
   /td
   td
   ?php echo
   $this-formTextarea('justification',$this-
   justification,array(rows=5,cols=75)) ?
   /td
   /tr
   /table
   hr
   div id=adjForm
   /div

   ***
   This issue is that the data that should be here:
   div id=adjForm
   /div
   Is never showing. When getAdjForm(); is called from getTerritories(),
   the $('territory').value !==  seems to be the problem. Does the
   browser not know that was an element because it just appeared?



--~--~-~--~~~---~--~~
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: Need help resolving conflict between Proto and Uize frameworks

2009-06-17 Thread Alex McAuley

is it run inside a dom:loaded wrapper ?
- Original Message - 
From: piers piersplow...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Wednesday, June 17, 2009 4:14 PM
Subject: [Proto-Scripty] Need help resolving conflict between Proto and Uize 
frameworks



 I know it's probably a lousy idea but I have both prototype and uize
 referenced in the head of my document:

 [code]
script type=text/javascript src=js/Uize.js/script
script  type=text/javascript src=javascript/prototype.js/
 script
 [/code]

 The only time I use a prototype function in the body of the document
 is to create a function that plays a movie when a thumbnail is
 clicked.

 The function is:

 [code]
 script
 function setMovie( url, title )
 {
 $('movieHost').innerHTML = '';
 var elEmbed = document.createElement( 'embed' );
 elEmbed.src = url;
 elEmbed.setAttribute(width, 100%);
 elEmbed.setAttribute(height,100%);
 elEmbed.setAttribute(scale,aspect);
 elEmbed.setAttribute(bgcolor,black);

 $('movieHost').appendChild( elEmbed );

 $('nowPlaying').innerHTML = title;
 }

 new Ajax.Request( '', {
  method: 'get',
  onSuccess: function( transport ) {
var bFirst = true;
for( var b = 0; b  movieTags.length; b++ ) {

  if ( bFirst )
  {
setMovie( url, title );
bFirst = false;
  }
 var html = 'a href=javascript:void setMovie(\''+url+'\',\''+title
 +'\');';
  html += title+'/abr/';
}
  }
 } );
 /script
 [/code]

 The only problem I'm having is that I call the function at body
 onload:

 [code]
 BODY onload=setMovie('Quicktimes/mov1.mov', 'Suzuki :
 quot;Fencequot;  1 of 12')
 [/code]

 In order that the first movie starts playing right away...

 And everything is fine... EXCEPT that about 10 or 15 seconds into the
 first movie it skips back to the beginning and starts playing again.
 Once it's done that everything works fine until a page reload - and
 then it plays and skips back.

 I've tried changing the order of the script references in the head
 section... but that breaks the uize framework.

 Is there some way to recode the function with absolutes?

 Thanks!
 
 


--~--~-~--~~~---~--~~
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: Handle on sortable list doesn't work in IE.

2009-06-17 Thread Walter Lee Davis

Sure. You have to use a className for the handles, since you  
presumably have more than one of them. You cannot have the same ID  
more than once in any given page. If you do, you get either  
unpredictable results or nothing, depending on how pedantic the  
browser or code is feeling that particular day. Also, the parameter is  
named handle, not handles.

Try this:

div id=dragDrop
ul class=sortlist id=list_to_sort
li id=item_1 class=sortlistItem Name - Date - Detail -
span class=thehandleREORDER/span
/li
/ul
/div

script language=JavaScript
Sortable.create(list_to_sort, {
element:'li', /*this is the default, but I'm adding it to show you  
how this should be written*/
handle:'thehandle',
onUpdate: function() {
new Ajax.Request(updateRowOrder.cfm, {
method: post,
parameters: {
data: Sortable.serialize(list_to_sort)
}
});
}
});
/script

Walter


On Jun 17, 2009, at 11:05 AM, Maya wrote:


 I've assigned a handle on my sortable and it works fine in Firefox but
 not at all in IE.   In IE you can use any of the elements in the LI to
 reorder the list.  I would like to only be able to use the REORDER
 element to reorder the list.  Any suggestions?

 div id=dragDrop
 ul class=sortlist id=list_to_sort
 li id=item_1 class=sortlistItem Name - Date - Detail - span
 id=thehandleREORDER/span/li
 /ul
 /div

 script language=JavaScript
 Sortable.create(list_to_sort, {
 elements:$$('#list_to_sort li.sortlist'),
 handles:$$('#list_to_sort #thehandle'),
 onUpdate: function() {
 new Ajax.Request(updateRowOrder.cfm, {
 method: post,
 parameters: { data: Sortable.serialize(list_to_sort) }
 });
 }
 });
 /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: Prototype and forms

2009-06-17 Thread anthony

Here was the problem.

I should have been calling the function (getAdjForm) using onComplete:

function getTerritories() {

var params = $('createAdjForm').serialize();
new Ajax.Updater(
territories,
?= $this-url(array('controller'='index', 'action'='get-
territories'))?,
{method:'post',
parameters: params,
onComplete: getAdjForm});
}

I have a lot to learn.

On Jun 17, 10:54 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 Because the contents are from an AJAX request and they dont exist in the
 DOM probably .
 OR..

 They are outside the /form tag 

 Paste full code to a pastie and we can help

 - Original Message -
 From: anthony mrsmi...@gmail.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 17, 2009 4:52 PM
 Subject: [Proto-Scripty] Re: Prototype and forms

 Ok, I have found a better way to explain this.

 var params = $('createAdjForm').serialize();
 alert(params);

 This does not show the form elements that were included via: div
 id=territories/div

 Why is that the case?

 On Jun 17, 9:06 am, anthony mrsmi...@gmail.com wrote:
  Thanks for the cleanup. I have made those changes. Feel free to post
  others. The problem I have is that the form had two dynamic places:

  div id=territories/div
  and
  div id=adjForm/div

  There is an onChange that calls the javascript function getTerritories
  () allows the
  div id=territories/div to display which has a form element
  called territory. At the end of the same function, it calls the other
  javascript function getAdjForm(). getAdjForm() looks to see if the
  form element territory exists. That's the problem, for some reason, it
  cannot see it. What can I do to make it where it does not fail the if
  statement in that function?

  On Jun 16, 11:33 am, Rick Waldron waldron.r...@gmail.com wrote:

   A few things...

   var params = Form.serialize($('createAdjForm'));

   You can clean this up as:

   var params = $('createAdjForm').serialize();

   There are other points that you could optimize, but thats not your
   question...

   And at whatever point you want adjForm to appear, you need to add:

   $('adjForm').show()

   Rick

   On Mon, Jun 15, 2009 at 5:46 PM, anthony mrsmi...@gmail.com wrote:

I have a form that when a user selects something from a drop-down,
another element in the form appears. There is another piece of the
form, that is never showing up, I need to understand what I am doing
wrong and how to fix it:

script type=text/javascript language=JavaScript
function getAdjForm() {

var params = Form.serialize($('createAdjForm'));
alert($('territory').value);

if ($('adjType').value !==   $('territory').value !== ){

new Ajax.Updater(
adjForm,
?= $this-url(array('controller'='index',
'action'='get-adj-
form'))?,
{method:'post',
parameters: params});
}
}

function getTerritories() {

var params = Form.serialize($('createAdjForm'));
new Ajax.Updater(
territories,
?= $this-url(array('controller'='index', 'action'='get-
territories'))?,
{method:'post',
parameters: params});

if ($('adjType').value !== ){
//alert('d');
getAdjForm();
}
}

function getCustomer() {

var params = Form.serialize($('createAdjForm'));
new Ajax.Updater(
customer,
?= $this-url(array('controller'='index', 'action'='get-
customer'))?,
{method:'post',
parameters: params});
}

/script

form method=POST id=createAdjForm action=
p

table border=0 CELLSPACING=10
tr
td
bSelect Adjustment Type/b
/td
td
?php echo $this-formSelect('adjType',
$this-adjType, array
(onChange=getAdjForm()), array(=Select an Adjustment Type) +
$this-adjTypes) ?
/td
/tr
tr
td
bSubmitting Territory/b
/td
td
?php echo $this-formSelect('shortTerritory',
$this-
shortTerritory, array(onChange=getTerritories()), array
(=Select a Territory) + $this-shortTerritories) ?
div id=territories/div
/td
/tr
tr
td valign=top
bJustification/b
/td
td
?php echo
$this-formTextarea('justification',$this-
justification,array(rows=5,cols=75)) ?
/td
/tr
/table
hr
div id=adjForm
/div

***
This issue is that the data that should be here:
div id=adjForm
/div
Is never showing. When getAdjForm(); is called from getTerritories(),
the $('territory').value !==  seems to be the problem. Does the
browser not know that was an element because it just appeared?
--~--~-~--~~~---~--~~
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 

[Proto-Scripty] Re: AJAX exception handling

2009-06-17 Thread rasmus

 No harm in 
 asking!https://prototype.lighthouseapp.com/projects/8886-prototype/overview

Thank you for the reference.

I found this interesting ticket on the subject:
https://prototype.lighthouseapp.com/projects/8886/tickets/634-no-exception-on-error-in-oncreate-method-of-ajaxrequest

Tobie Langel, one of the core members, agrees that exceptions should
be rethrown in ajax callbacks instead of dieing silently.
--~--~-~--~~~---~--~~
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: MySQL - order ID

2009-06-17 Thread WLQ

I'm quite positive that it's something wrong with your script, because
on drop (clone) this gets inserted in html:
li class=clone id=span class=remove(x)/spanDescription/
li

Instead of being:
li class=clone id=Item_someNumberDescriptionspan class=remove
(x)/span/li

For some reason it creates 2 instances instead of one (both of the
above). If you drag out items in ascending order by the id (1,2,3).


 Right! There wasn't any _ just the id, now everything is fine.

 The problem I'm seeing now is that when I clone an item, it's becoming
 undraggable until you drop on more item.
 Basically last dropped item won't move, previous items will start
 moving. It will also create a space [0] = 

 You'll understand what I'm talking about when you'll look at the
 examplehttp://scriptaculous.host22.com/

  What does your HTML look like? Are your list element IDs in the form  
  that Sortable requires?

  ul id=my_sortable_list
  li id=someString_1The visible draggable part/li
  li id=someString_3The visible draggable part/li
  li id=someString_4The visible draggable part/li
  /ul



  Unless your LIs have an ID and that IDegigins with one or more
letters  

 a-z, has exactly one underscore in it followed by a unique number  
  (which should be the ID column value from your database, just to tie a  
  bow on things here) then you won't get anything out of  
  Sortable.serialize() -- not even an error.

  Walter

  On Jun 13, 2009, at 12:29 PM, WLQ wrote:

   As you've noted the post should give you some feedback like this:

   whatever_your_list_ID_is = Array(
          0 = 12,
          1 = 13,
          2 = 24,
          3 = 2,
          4 = 42
   )

   But it does not return any number on the other side:

   Array
   (
      [whatever_your_list_ID_is] = Array
          (
              [0] =
              [1] =
              [2] =
              [3] =
          )

   )

   Yes, mysql_query doesn't return a list, it returns a resource
  iedenttifier. You have to create the list yourself using a loop nd
   my
y
sql_fetch_object or mysql_fetch_array or one of theotther  
   fetchers.





  efoefefore we go much furthe I need t to remind you that this is not
a  P
  
 
   PHP
he
uag
uages on earth.

   The example I posted was working code ripped out obusy usy site.
   However it relies on the MyActiveRecord ORM to do anything.

 
  define('MYACTIVERECORD_CONCTN_STR''mysyql://use/user::pa 'm'mysysql://
   databasename')R', 'm'mysysql
re_once('MyActiveRecord.0.5.php');
   claswiets eendnd MyActyActivvetendns Mds My

 $lisecord{}
iveRecordextetendnds getulu,'osipn nSCC),nul,,,po
ion nSC');
 
;
  
  s'  ts',',
poon nts',nulu,

ulu,

nSC'n 'n
 
 



   
 w
w
   w       h//prin-w  / /tioc ctiti



ipn
tn
tionitt
itt th
  Th alis all there is to that. Anything else, I really rethihthis
is
that bn:0-312-3178617-31S -3 n-ISn6IS -32-d17't17't knoway be -he curr784-2 (
  is). PHP s). and Mnd s). pm. pmens).ntmeny  by Luke Welling and
Laura
homson Thomso
 )
 )

 Waltealter

AMS)
  *Where  I best  meanmean eanst.
t.

   On Jun 13, 2009 9:04 :04 AM, WLQ wrote:

   I've followed your link and tried to buihe listlist as you suggested
   there. But it gives me.

   ERRNO: 2 TEXT: Invalid argument supplied for foreach()  
   LOCATION: ...,
   line 7
  http://jsbin.com/elocu/edit

  re' a list list ofs. (I ums. (I uatabasebaseoblems.ve the st of p
   sortable too).
 clones any item but not
   the
   first, it wil nde nd ertverted.vd. But you wout ont be able to  
   move
   it (inside of cloned sortable), when you drag and drop one more  
   it 
 apparently
   receives the ability of being dragged. What is extremely weir.  
   Here's
   one more weirdness, if you drag items from originals in order they
   appear, then they will be cloned but won't be reverted. I've also
   added your print_r($_POST) to the update_order.php but it's giving
   some unfair results.
   I've uploaded the whole pack to a some website. 
   Checkoutttpthttp://scris.hculous.host22.com/

cul On Jun 8, 1:00 pm, Walter Lee Davis wam/
@wdstudio.com/scote:

   Gaa! I always get this backward. As Mr. Wonka w,  d say,  
   Strike
   that; reverse it!

 er_yoatv your_your_lv = Arrtv = Array(
  _ID_is 2   12 = 0  
 r_lv          13 =
        our_lis2,
      2  13 ,= = 0     42 =  
 = 0     42 =   = 0     42 = 4



   
 = 0     42

O   8, 2009, a,= 3,
ote:         42 wrote:

  wrote data generated by Sortablewrotialize looks like this after  
   PHP
   grabs it from the POST:

   whatever_your_list_ID_is = Array(
      0 = 1tev
      1 = 13,
      2 = 24,
      3 = 2,
      4 = 42
   )

   The keys of the array give the position, the values give the
   numerical
   part of the list item ID. So in this case, the list looked like
   this
   in the DOM when serialize() wrapped it up:
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this 

[Proto-Scripty] Re: Curvy Corners + draggables (script.aculo.us)

2009-06-17 Thread Rick Waldron
Before I take a look at your issue... I have a rewrite of CurvyCorners that
i did that makes it run way faster. I was using it in a project and was
annoyed by how long it took to render the corners. I can't say its any
cleaner, but I corrected an unecessary loop. I've attched the rewrite to
this email along with an  example usage (same file, its at the bottom).




Can you post your code? http://jsbin.com


Rick







On Wed, Jun 17, 2009 at 9:58 AM, Rafael M Ximenes rmalv...@gmail.comwrote:


 Hi, everybody!

 I'm a Brazilian WebDev and I've found  a script to round corners
 without images (Script's name is Curvy Corners:
 http://www.curvycorners.net/demos/).
 I was trying to round corners of the draggables, but they lose your
 functions.

 Some help?

 Regards.
 Rafael

 


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



curvy-doesnt-suck.js
Description: JavaScript source


[Proto-Scripty] Re: Need help resolving conflict between Proto and Uize frameworks

2009-06-17 Thread Rick Waldron
Maybe I'm nuts but you're calling

setMovie() in the body tag


meanwhile... you have an Ajax.Request getting some data that will call...

setMovie() when successful



So... i suspect, that onload starts playing, then the ajax request finishes
and resets your player.

I dont recommend onload='' ever btw.

should change to:

script
document.observe('dom:loaded', function () {
 call function in here

});
/script


I think even Alex would agree with me on this particular inline event ;)


Rick

On Wed, Jun 17, 2009 at 11:55 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:


 is it run inside a dom:loaded wrapper ?
 - Original Message -
 From: piers piersplow...@gmail.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 17, 2009 4:14 PM
 Subject: [Proto-Scripty] Need help resolving conflict between Proto and
 Uize
 frameworks


 
  I know it's probably a lousy idea but I have both prototype and uize
  referenced in the head of my document:
 
  [code]
 script type=text/javascript src=js/Uize.js/script
 script  type=text/javascript src=javascript/prototype.js/
  script
  [/code]
 
  The only time I use a prototype function in the body of the document
  is to create a function that plays a movie when a thumbnail is
  clicked.
 
  The function is:
 
  [code]
  script
  function setMovie( url, title )
  {
  $('movieHost').innerHTML = '';
  var elEmbed = document.createElement( 'embed' );
  elEmbed.src = url;
  elEmbed.setAttribute(width, 100%);
  elEmbed.setAttribute(height,100%);
  elEmbed.setAttribute(scale,aspect);
  elEmbed.setAttribute(bgcolor,black);
 
  $('movieHost').appendChild( elEmbed );
 
  $('nowPlaying').innerHTML = title;
  }
 
  new Ajax.Request( '', {
   method: 'get',
   onSuccess: function( transport ) {
 var bFirst = true;
 for( var b = 0; b  movieTags.length; b++ ) {
 
   if ( bFirst )
   {
 setMovie( url, title );
 bFirst = false;
   }
  var html = 'a href=javascript:void setMovie(\''+url+'\',\''+title
  +'\');';
   html += title+'/abr/';
 }
   }
  } );
  /script
  [/code]
 
  The only problem I'm having is that I call the function at body
  onload:
 
  [code]
  BODY onload=setMovie('Quicktimes/mov1.mov', 'Suzuki :
  quot;Fencequot;  1 of 12')
  [/code]
 
  In order that the first movie starts playing right away...
 
  And everything is fine... EXCEPT that about 10 or 15 seconds into the
  first movie it skips back to the beginning and starts playing again.
  Once it's done that everything works fine until a page reload - and
  then it plays and skips back.
 
  I've tried changing the order of the script references in the head
  section... but that breaks the uize framework.
 
  Is there some way to recode the function with absolutes?
 
  Thanks!
  
 


 


--~--~-~--~~~---~--~~
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: Prototype and forms

2009-06-17 Thread Rick Waldron
Always nice to find your own mistakes and learn from them - well done!


On Wed, Jun 17, 2009 at 12:30 PM, anthony mrsmi...@gmail.com wrote:


 Here was the problem.

 I should have been calling the function (getAdjForm) using onComplete:

 function getTerritories() {

var params = $('createAdjForm').serialize();
 new Ajax.Updater(
territories,
?= $this-url(array('controller'='index', 'action'='get-
 territories'))?,
{method:'post',
 parameters: params,
onComplete: getAdjForm});
 }

 I have a lot to learn.

 On Jun 17, 10:54 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Because the contents are from an AJAX request and they dont exist in the
  DOM probably .
  OR..
 
  They are outside the /form tag 
 
  Paste full code to a pastie and we can help
 
  - Original Message -
  From: anthony mrsmi...@gmail.com
  To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
  Sent: Wednesday, June 17, 2009 4:52 PM
  Subject: [Proto-Scripty] Re: Prototype and forms
 
  Ok, I have found a better way to explain this.
 
  var params = $('createAdjForm').serialize();
  alert(params);
 
  This does not show the form elements that were included via: div
  id=territories/div
 
  Why is that the case?
 
  On Jun 17, 9:06 am, anthony mrsmi...@gmail.com wrote:
   Thanks for the cleanup. I have made those changes. Feel free to post
   others. The problem I have is that the form had two dynamic places:
 
   div id=territories/div
   and
   div id=adjForm/div
 
   There is an onChange that calls the javascript function getTerritories
   () allows the
   div id=territories/div to display which has a form element
   called territory. At the end of the same function, it calls the other
   javascript function getAdjForm(). getAdjForm() looks to see if the
   form element territory exists. That's the problem, for some reason, it
   cannot see it. What can I do to make it where it does not fail the if
   statement in that function?
 
   On Jun 16, 11:33 am, Rick Waldron waldron.r...@gmail.com wrote:
 
A few things...
 
var params = Form.serialize($('createAdjForm'));
 
You can clean this up as:
 
var params = $('createAdjForm').serialize();
 
There are other points that you could optimize, but thats not your
question...
 
And at whatever point you want adjForm to appear, you need to add:
 
$('adjForm').show()
 
Rick
 
On Mon, Jun 15, 2009 at 5:46 PM, anthony mrsmi...@gmail.com wrote:
 
 I have a form that when a user selects something from a drop-down,
 another element in the form appears. There is another piece of the
 form, that is never showing up, I need to understand what I am
 doing
 wrong and how to fix it:
 
 script type=text/javascript language=JavaScript
 function getAdjForm() {
 
 var params = Form.serialize($('createAdjForm'));
 alert($('territory').value);
 
 if ($('adjType').value !==   $('territory').value !== ){
 
 new Ajax.Updater(
 adjForm,
 ?= $this-url(array('controller'='index',
 'action'='get-adj-
 form'))?,
 {method:'post',
 parameters: params});
 }
 }
 
 function getTerritories() {
 
 var params = Form.serialize($('createAdjForm'));
 new Ajax.Updater(
 territories,
 ?= $this-url(array('controller'='index', 'action'='get-
 territories'))?,
 {method:'post',
 parameters: params});
 
 if ($('adjType').value !== ){
 //alert('d');
 getAdjForm();
 }
 }
 
 function getCustomer() {
 
 var params = Form.serialize($('createAdjForm'));
 new Ajax.Updater(
 customer,
 ?= $this-url(array('controller'='index', 'action'='get-
 customer'))?,
 {method:'post',
 parameters: params});
 }
 
 /script
 
 form method=POST id=createAdjForm action=
 p
 
 table border=0 CELLSPACING=10
 tr
 td
 bSelect Adjustment Type/b
 /td
 td
 ?php echo $this-formSelect('adjType',
 $this-adjType, array
 (onChange=getAdjForm()), array(=Select an Adjustment
 Type) +
 $this-adjTypes) ?
 /td
 /tr
 tr
 td
 bSubmitting Territory/b
 /td
 td
 ?php echo $this-formSelect('shortTerritory',
 $this-
 shortTerritory, array(onChange=getTerritories()), array
 (=Select a Territory) + $this-shortTerritories) ?
 div id=territories/div
 /td
 /tr
 tr
 td valign=top
 bJustification/b
 /td
 td
 ?php echo
 $this-formTextarea('justification',$this-
 justification,array(rows=5,cols=75)) ?
 /td
 /tr
 /table
 hr
 div id=adjForm
 /div
 
 ***
 This issue is that the data that should be here:
 div id=adjForm
 /div
 Is never showing. When getAdjForm(); is called from
 getTerritories(),
 the $('territory').value !==  seems to be the problem. Does the
 browser not 

[Proto-Scripty] Re: Prototype and forms

2009-06-17 Thread Alex McAuley

Maybe add it on onSuccess too ! just to be safe!
- Original Message - 
From: anthony mrsmi...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Wednesday, June 17, 2009 5:30 PM
Subject: [Proto-Scripty] Re: Prototype and forms



Here was the problem.

I should have been calling the function (getAdjForm) using onComplete:

function getTerritories() {

var params = $('createAdjForm').serialize();
new Ajax.Updater(
territories,
?= $this-url(array('controller'='index', 'action'='get-
territories'))?,
{method:'post',
parameters: params,
onComplete: getAdjForm});
}

I have a lot to learn.

On Jun 17, 10:54 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 Because the contents are from an AJAX request and they dont exist in the
 DOM probably .
 OR..

 They are outside the /form tag 

 Paste full code to a pastie and we can help

 - Original Message -
 From: anthony mrsmi...@gmail.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 17, 2009 4:52 PM
 Subject: [Proto-Scripty] Re: Prototype and forms

 Ok, I have found a better way to explain this.

 var params = $('createAdjForm').serialize();
 alert(params);

 This does not show the form elements that were included via: div
 id=territories/div

 Why is that the case?

 On Jun 17, 9:06 am, anthony mrsmi...@gmail.com wrote:
  Thanks for the cleanup. I have made those changes. Feel free to post
  others. The problem I have is that the form had two dynamic places:

  div id=territories/div
  and
  div id=adjForm/div

  There is an onChange that calls the javascript function getTerritories
  () allows the
  div id=territories/div to display which has a form element
  called territory. At the end of the same function, it calls the other
  javascript function getAdjForm(). getAdjForm() looks to see if the
  form element territory exists. That's the problem, for some reason, it
  cannot see it. What can I do to make it where it does not fail the if
  statement in that function?

  On Jun 16, 11:33 am, Rick Waldron waldron.r...@gmail.com wrote:

   A few things...

   var params = Form.serialize($('createAdjForm'));

   You can clean this up as:

   var params = $('createAdjForm').serialize();

   There are other points that you could optimize, but thats not your
   question...

   And at whatever point you want adjForm to appear, you need to add:

   $('adjForm').show()

   Rick

   On Mon, Jun 15, 2009 at 5:46 PM, anthony mrsmi...@gmail.com wrote:

I have a form that when a user selects something from a drop-down,
another element in the form appears. There is another piece of the
form, that is never showing up, I need to understand what I am doing
wrong and how to fix it:

script type=text/javascript language=JavaScript
function getAdjForm() {

var params = Form.serialize($('createAdjForm'));
alert($('territory').value);

if ($('adjType').value !==   $('territory').value !== ){

new Ajax.Updater(
adjForm,
?= $this-url(array('controller'='index',
'action'='get-adj-
form'))?,
{method:'post',
parameters: params});
}
}

function getTerritories() {

var params = Form.serialize($('createAdjForm'));
new Ajax.Updater(
territories,
?= $this-url(array('controller'='index', 'action'='get-
territories'))?,
{method:'post',
parameters: params});

if ($('adjType').value !== ){
//alert('d');
getAdjForm();
}
}

function getCustomer() {

var params = Form.serialize($('createAdjForm'));
new Ajax.Updater(
customer,
?= $this-url(array('controller'='index', 'action'='get-
customer'))?,
{method:'post',
parameters: params});
}

/script

form method=POST id=createAdjForm action=
p

table border=0 CELLSPACING=10
tr
td
bSelect Adjustment Type/b
/td
td
?php echo $this-formSelect('adjType',
$this-adjType, array
(onChange=getAdjForm()), array(=Select an Adjustment Type) 
+
$this-adjTypes) ?
/td
/tr
tr
td
bSubmitting Territory/b
/td
td
?php echo $this-formSelect('shortTerritory',
$this-
shortTerritory, array(onChange=getTerritories()), array
(=Select a Territory) + $this-shortTerritories) ?
div id=territories/div
/td
/tr
tr
td valign=top
bJustification/b
/td
td
?php echo
$this-formTextarea('justification',$this-
justification,array(rows=5,cols=75)) ?
/td
/tr
/table
hr
div id=adjForm
/div

***
This issue is that the data that should be here:
div id=adjForm
/div
Is never showing. When getAdjForm(); is called from 
getTerritories(),
the $('territory').value !==  seems to be the problem. Does the
browser not know that was an element because it just appeared?




[Proto-Scripty] Re: Handle on sortable list doesn't work in IE.

2009-06-17 Thread Maya

Perfect!  Thank you.  It works now.

--~--~-~--~~~---~--~~
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: MySQL - order ID

2009-06-17 Thread Walter Lee Davis

We're not getting this done by pasting little bits of code back and  
forth. You're missing something  in here, the server process that does  
the clone in the database has to return the new ID -- that's the only  
place it can come from. If you go back to my example, I had the last  
line of the onSuccess method update the clone's ID with the  
responseText from the server. So in your PHP clone code, make sure  
that the last thing it does is print 'item_someNumber' (where  
someNumber is in fact the most recently added element ID. In MAR, this  
would look like this:

//create_clone.php
$original = $_POST['original'];
if($master = MyActiveRecord::FindById('originals',$original){
$data = get_object_vars($original);
array_shift($data); //get rid of the ID
$new = MyActiveRecord::Create('clones',$data);
$new-save();
if(false === $new-get_errors()){
header('Content-type: text/html; charset=utf-8');
//this is the part you need:
print 'item_' .  $new-id;
}else{
header('HTTP/1.0 500 Server Error',true,500);
exit;
}
}else{
header('HTTP/1.0 404 Missing',true,404);
}

Walter

On Jun 17, 2009, at 12:57 PM, WLQ wrote:


 I'm quite positive that it's something wrong with your script, because
 on drop (clone) this gets inserted in html:
 li class=clone id=span class=remove(x)/spanDescription/
 li

 Instead of being:
 li class=clone id=Item_someNumberDescriptionspan  
 class=remove
 (x)/span/li

 For some reason it creates 2 instances instead of one (both of the
 above). If you drag out items in ascending order by the id (1,2,3).


 Right! There wasn't any _ just the id, now everything is fine.

 The problem I'm seeing now is that when I clone an item, it's  
 becoming
 undraggable until you drop on more item.
 Basically last dropped item won't move, previous items will start
 moving. It will also create a space [0] = 

 You'll understand what I'm talking about when you'll look at the
 examplehttp://scriptaculous.host22.com/

 What does your HTML look like? Are your list element IDs in the form
 that Sortable requires?

 ul id=my_sortable_list
 li id=someString_1The visible draggable part/li
 li id=someString_3The visible draggable part/li
 li id=someString_4The visible draggable part/li
 /ul



 Unless your LIs have an ID and that IDegigins with one or more
 letters

 a-z, has exactly one underscore in it followed by a unique number
 (which should be the ID column value from your database, just to  
 tie a
 bow on things here) then you won't get anything out of
 Sortable.serialize() -- not even an error.

 Walter

 On Jun 13, 2009, at 12:29 PM, WLQ wrote:

 As you've noted the post should give you some feedback like this:

 whatever_your_list_ID_is = Array(
0 = 12,
1 = 13,
2 = 24,
3 = 2,
4 = 42
 )

 But it does not return any number on the other side:

 Array
 (
[whatever_your_list_ID_is] = Array
(
[0] =
[1] =
[2] =
[3] =
)

 )

 Yes, mysql_query doesn't return a list, it returns a resource
 iedenttifier. You have to create the list yourself using a loop nd
 my
 y
 sql_fetch_object or mysql_fetch_array or one of theotther
 fetchers.





  efoefefore we go much furthe I need t to remind you that this is not
 a  P


 PHP
 he
 uag
 uages on earth.

 The example I posted was working code ripped out obusy usy site.
 However it relies on the MyActiveRecord ORM to do anything.


 define('MYACTIVERECORD_CONCTN_STR''mysyql://use/user::pa  
 'm'mysysql://
 databasename')R', 'm'mysysql
 re_once('MyActiveRecord.0.5.php');
 claswiets eendnd MyActyActivvetendns Mds My

 $lisecord{}
 iveRecordextetendnds getulu,'osipn nSCC),nul,,,po
 ion nSC');

 ;

 s'  ts',',
 poon nts',nulu,

 ulu,

 nSC'n 'n





   
 w
 w
w   h//prin-w  / /tioc ctiti



 ipn
 tn
 tionitt
 itt th
 Th alis all there is to that. Anything else, I really rethihthis
 is
 that bn:0-312-3178617-31S -3 n-ISn6IS -32-d17't17't knoway be -he  
 curr784-2 (
 is). PHP s). and Mnd s). pm. pmens).ntmeny  by Luke Welling and
 Laura
 homson Thomso
 )
 )

 Waltealter

 AMS)
 *Where  I best  meanmean eanst.
 t.

 On Jun 13, 2009 9:04 :04 AM, WLQ wrote:

 I've followed your link and tried to buihe listlist as you  
 suggested
 there. But it gives me.

 ERRNO: 2 TEXT: Invalid argument supplied for foreach()
 LOCATION: ...,
 line 7
 http://jsbin.com/elocu/edit

 re' a list list ofs. (I ums. (I uatabasebaseoblems.ve the st of p
 sortable too).
 clones any item but not
 the
 first, it wil nde nd ertverted.vd. But you wout ont be able to
 move
 it (inside of cloned sortable), when you drag and drop one  
 more  
 it 
 apparently
 receives the ability of being dragged. What is extremely weir.
 Here's
 one more weirdness, if you drag items from originals in order  
 they
 appear, then they will be cloned but won't be reverted. I've 

[Proto-Scripty] Clarification on PUT method in Ajax.Request

2009-06-17 Thread P. Douglas Reeder

The documentation on Ajax.Request, for the method option, says:

method  'post'  The HTTP method to use for the request. The 
other
widespread possibility is 'get'. As a Ruby On Rails special, Prototype
also reacts to other verbs (such as 'put' and 'delete' by actually
using 'post' and putting an extra '_method' parameter with the
originally requested method in there.

Do I understand this to mean that Prototype is incapable of issuing a
true HTTP PUT request, that to issue one, I must deal with the raw XHR
object?
--~--~-~--~~~---~--~~
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: Sortable onUpdate not working on IE7

2009-06-17 Thread Adriano Santi

On Jun 17, 1:31 am, T.J. Crowder t...@crowdersoftware.com wrote:
 Is the script tag including that JS file *below* the script tag that
 contains the document.observe call?  If so, move it above it.

It's way above. All my external .js files are called on the head of
the html. First one called is prototype, then scriptaculous, then the
one with the custom functions. The document.observe call is way at the
bottom of the document, after the list it affects.

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