[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
I don't really want to change the whole script, and the problem is that I
can't get the ID out, not the script.

Is there any way to extract an ID instead of doing:

var id = elm.id.split('_').last();

Because everything up to that point is working, I'm confused.

 

 

 Ya, I'm getting an empty box, so something is wrong.

 

  Dude, firstly please stop topping the message and removing the code and

 replies from your replies.

 

  secondly: try the below script and see what gets alerted (it should be

 your numeric ID, if not then you have something wrong somewhere

 

  $('clones').observe('click',function(evt){

 

var elm = evt.element();

 

if (elm.hasClassName('remove')){

 

  evt.stop();

 

  var id = elm.id.split('_').last();

 

  alert(id);

 

  return;

 

  new Ajax.Request('remove_clone.php',{

 

parameters:{clone:id},

 

onSuccess:function(transport){

 

  elm.up('li').remove();

 

  pollSortable.defer();

 

}

 

  });

 

- Original Message -

From: Yan Kovyakh

To: prototype-scriptaculous@googlegroups.com

Sent: Monday, July 20, 2009 7:35 PM

Subject: [Proto-Scripty] Delete php

 

They actualy have Item_numericalID

 

Is this the problem?


--~--~-~--~~~---~--~~
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: selectors failing in IE8FF3

2009-07-21 Thread Mona Remlawi



ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens (-),
underscores (_), colons (:), and periods (.).
...
 [1]

So if HTML permits a '.' in the ID value of elements, so should prototype core.

Another point is that even if I rewrote my selectors, there would
still be a problem in doing the following

$('my\.long\.id').down('.myclass');

as prototype would translate this into :
element.querySelectorAll('#my.long.id .myclass')

I still insist that escaping 'special' chars in Element#identify
method is the way to go ...

[1] http://www.w3.org/TR/html4/types.html#type-name


cheers

--
mona

On Tue, Jul 21, 2009 at 4:16 AM, Rick Waldronwaldron.r...@gmail.com wrote:
 I feel like i should provide more insight. That was rather vague. An ID
 could be labelled a.b:c and referenced in your style sheet as #a.b:c but
 as well as being the id of an element, it could mean:

 id a, class b, pseudo-selector c.

 Best to avoid the confusion and stay away from using . and : altogether.




 On Mon, Jul 20, 2009 at 10:10 PM, Rick Waldron waldron.r...@gmail.com
 wrote:

 Instead of changing the way the core works... and potentially causing
 breakage to existing code - perhaps you might try rewriting your selector
 statement with escaped periods.

 This question caused me to read a bunch regarding valid id's from one html
 spec to another, and then double back to css selector specs. Apparently,
 they didn't compare notes...

 Rick




 On Mon, Jul 20, 2009 at 11:28 AM, Mona Remlawi mona.reml...@gmail.com
 wrote:

 You've guessed it, it's unfeasible, the amount of effort that takes
 makes my head hurt :)
 Anyway, i found the little bug in prototype (hooray!).

 IE8 and FF3 have their selectors go into 'selectorsAPI' mode, now into
 some debugging (version: 1.6.0.3)
 
 2723:      this.mode = 'selectorsAPI';
 ...
 2823:      findElements: function(root) {
 ...
 2837:      case 'selectorsAPI':
 ...
 2842:          var oldId = root.id, id = $(root).identify();
 2843:          e = # + id +   + e;
                  alert(e) // you'll see how the dots are confusing
 the selector for classnames ...
 

 Now for a fix, i changed the following line in Element#identify
 
 1782:  if (id)  return id.replace(/\./g, '\\.');
 
 to escape the dots.

 with that, the unit test will succeed.

 I'm not sure if this is the best way to go around it, or if there is
 another chars for escaping, so it's in your hands now.

 Waiting for the feedback and hopefully a patch :)

 cheers

 --
 mona

 On Mon, Jul 20, 2009 at 5:06 PM, Richard
 Quadlingrquadl...@googlemail.com wrote:
 
  2009/7/20 Mona Remlawi mona.reml...@gmail.com:
 
  Hello prototypers,
 
  I'm getting a basic error (in selectors) in *IE8/FF3* and don't think
  anyone has reported it yet -- or maybe did, i searched but not
  extensively.
  The problem is that the Element#selector fails when invoked on an
  Element that has a '.' in its id.
  I've put a small unit test on pastie, you just need to get a copy of
  unittest.js from scriptaculous (and test.css if you like colors :) )
  http://pastie.org/552134
 
  Tested with both version#1.6.0.3 and version#1.6.1RC#3 with the same
  results.
 
  Any help is greatly appreciated, I'm trying to debug on my own but
  doubt i'll reach somewhere.
 
  cheers
 
  --
  mona
 
  
 
 
  I don't know how feasible it it, but maybe globally changing your IDs
  to use _ rather than . would be a quick and easy fix.
 
 
 
  --
  -
  Richard Quadling
  Zend Certified Engineer :
  http://zend.com/zce.php?c=ZEND002498r=213474731
  Standing on the shoulders of some very clever giants!
  ZOPA : http://uk.zopa.com/member/RQuadling
 
  
 





 


--~--~-~--~~~---~--~~
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 call is not working in MAC(Firefox)

2009-07-21 Thread Atanu Dey

I have a script which executes periodically after each 10 seconds. You
can see that there is an ajax call which actually updates database for
me and return 1 or 0 depending of the script execution.

The problem is, it is working cool in windows platform with firefox
3.0.11. But not working with the same version of firefox in MAC OS.

The Script:

new PeriodicalExecuter(function(){
var date = new Date();
//console.log('setOnlineStatus.php?sid='+date.getTime());
new Ajax.Request('setOnlineStatus.php?sid='+date.getTime(),
{method:'get', onComplete:function(transport){
if(!parseInt(transport.responseText))
window.location=../index.php;
}});
},10);

Can anybody has any idea about this? Thanks in advance for your help.

--~--~-~--~~~---~--~~
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: Ajax call is not working in MAC(Firefox)

2009-07-21 Thread Mona Remlawi

Not sure if this is related (haven't worked on MAC OS), but I would
double check the use of '../' for relative uri.
Different operating systems might interpret this differently.
You might wanna consider absolute uri's instead : /appcontext/index.php

cheers

--
mona

On Tue, Jul 21, 2009 at 9:13 AM, Atanu Deymratanu...@gmail.com wrote:

 I have a script which executes periodically after each 10 seconds. You
 can see that there is an ajax call which actually updates database for
 me and return 1 or 0 depending of the script execution.

 The problem is, it is working cool in windows platform with firefox
 3.0.11. But not working with the same version of firefox in MAC OS.

 The Script:

 new PeriodicalExecuter(function(){
                var date = new Date();
                //console.log('setOnlineStatus.php?sid='+date.getTime());
                new Ajax.Request('setOnlineStatus.php?sid='+date.getTime(),
 {method:'get', onComplete:function(transport){
                        if(!parseInt(transport.responseText))
                                window.location=../index.php;
                }});
        },10);

 Can anybody has any idea about this? Thanks in advance for your help.

 


--~--~-~--~~~---~--~~
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: selectors failing in IE8FF3

2009-07-21 Thread T.J. Crowder

Hi Mona,

I agree, dots and colons are valid in HTML, and so should work with
the selector engine.

I took a quick look at Lighthouse[1], and it looks like there may be a
ticket[2] or two[3] there that is relevant, although #559 is marked as
fixed in 1.6.1 and you say what you're seeing is still an issue in
RC3.  It was a very quick search, though, so please have a good look
and open a ticket if you don't find one already open for this.  (I'm
surprised that both 1.6.0.3 and 1.6.1 should have this bug, as they
use completely different selector engines.)

FWIW, can I suggest a one-page test case with no dependancies other
than Prototype?  Just something very simple; the one you posted
earlier is a bit much to grok in the time most people have available.
(Maybe this is less true for people who have used scripty's unit test
suite more than I.)

[1] http://prototype.lighthouseapp.com/projects/8886-prototype
[2] https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/559
[3] https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/501

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

On Jul 21, 10:28 am, Mona Remlawi mona.reml...@gmail.com wrote:
 
 
 ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
 followed by any number of letters, digits ([0-9]), hyphens (-),
 underscores (_), colons (:), and periods (.).
 ...
  [1]

 So if HTML permits a '.' in the ID value of elements, so should prototype 
 core.

 Another point is that even if I rewrote my selectors, there would
 still be a problem in doing the following

 $('my\.long\.id').down('.myclass');

 as prototype would translate this into :
 element.querySelectorAll('#my.long.id .myclass')

 I still insist that escaping 'special' chars in Element#identify
 method is the way to go ...

 [1]http://www.w3.org/TR/html4/types.html#type-name

 cheers

 --
 mona



 On Tue, Jul 21, 2009 at 4:16 AM, Rick Waldronwaldron.r...@gmail.com wrote:
  I feel like i should provide more insight. That was rather vague. An ID
  could be labelled a.b:c and referenced in your style sheet as #a.b:c but
  as well as being the id of an element, it could mean:

  id a, class b, pseudo-selector c.

  Best to avoid the confusion and stay away from using . and : altogether.

  On Mon, Jul 20, 2009 at 10:10 PM, Rick Waldron waldron.r...@gmail.com
  wrote:

  Instead of changing the way the core works... and potentially causing
  breakage to existing code - perhaps you might try rewriting your selector
  statement with escaped periods.

  This question caused me to read a bunch regarding valid id's from one html
  spec to another, and then double back to css selector specs. Apparently,
  they didn't compare notes...

  Rick

  On Mon, Jul 20, 2009 at 11:28 AM, Mona Remlawi mona.reml...@gmail.com
  wrote:

  You've guessed it, it's unfeasible, the amount of effort that takes
  makes my head hurt :)
  Anyway, i found the little bug in prototype (hooray!).

  IE8 and FF3 have their selectors go into 'selectorsAPI' mode, now into
  some debugging (version: 1.6.0.3)
  
  2723:      this.mode = 'selectorsAPI';
  ...
  2823:      findElements: function(root) {
  ...
  2837:      case 'selectorsAPI':
  ...
  2842:          var oldId = root.id, id = $(root).identify();
  2843:          e = # + id +   + e;
                   alert(e) // you'll see how the dots are confusing
  the selector for classnames ...

  Now for a fix, i changed the following line in Element#identify
  
  1782:  if (id)  return id.replace(/\./g, '\\.');

  to escape the dots.

  with that, the unit test will succeed.

  I'm not sure if this is the best way to go around it, or if there is
  another chars for escaping, so it's in your hands now.

  Waiting for the feedback and hopefully a patch :)

  cheers

  --
  mona

  On Mon, Jul 20, 2009 at 5:06 PM, Richard
  Quadlingrquadl...@googlemail.com wrote:

   2009/7/20 Mona Remlawi mona.reml...@gmail.com:

   Hello prototypers,

   I'm getting a basic error (in selectors) in *IE8/FF3* and don't think
   anyone has reported it yet -- or maybe did, i searched but not
   extensively.
   The problem is that the Element#selector fails when invoked on an
   Element that has a '.' in its id.
   I've put a small unit test on pastie, you just need to get a copy of
   unittest.js from scriptaculous (and test.css if you like colors :) )
  http://pastie.org/552134

   Tested with both version#1.6.0.3 and version#1.6.1RC#3 with the same
   results.

   Any help is greatly appreciated, I'm trying to debug on my own but
   doubt i'll reach somewhere.

   cheers

   --
   mona

   I don't know how feasible it it, but maybe globally changing your IDs
   to use _ rather than . would be a quick and easy fix.

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

[Proto-Scripty] Re: selectors failing in IE8FF3

2009-07-21 Thread Alex McAuley

Why would you want to use . in an id In most web programming a . or 
a :: means its a node or part of a class or something.

This makes no sense to me why anyone would want to confuse js libraries and 
possible server side backends.




- Original Message - 
From: Mona Remlawi mona.reml...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 10:28 AM
Subject: [Proto-Scripty] Re: selectors failing in IE8FF3





ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens (-),
underscores (_), colons (:), and periods (.).
...
 [1]

So if HTML permits a '.' in the ID value of elements, so should prototype 
core.

Another point is that even if I rewrote my selectors, there would
still be a problem in doing the following

$('my\.long\.id').down('.myclass');

as prototype would translate this into :
element.querySelectorAll('#my.long.id .myclass')

I still insist that escaping 'special' chars in Element#identify
method is the way to go ...

[1] http://www.w3.org/TR/html4/types.html#type-name


cheers

--
mona

On Tue, Jul 21, 2009 at 4:16 AM, Rick Waldronwaldron.r...@gmail.com wrote:
 I feel like i should provide more insight. That was rather vague. An ID
 could be labelled a.b:c and referenced in your style sheet as #a.b:c but
 as well as being the id of an element, it could mean:

 id a, class b, pseudo-selector c.

 Best to avoid the confusion and stay away from using . and : altogether.




 On Mon, Jul 20, 2009 at 10:10 PM, Rick Waldron waldron.r...@gmail.com
 wrote:

 Instead of changing the way the core works... and potentially causing
 breakage to existing code - perhaps you might try rewriting your selector
 statement with escaped periods.

 This question caused me to read a bunch regarding valid id's from one 
 html
 spec to another, and then double back to css selector specs. Apparently,
 they didn't compare notes...

 Rick




 On Mon, Jul 20, 2009 at 11:28 AM, Mona Remlawi mona.reml...@gmail.com
 wrote:

 You've guessed it, it's unfeasible, the amount of effort that takes
 makes my head hurt :)
 Anyway, i found the little bug in prototype (hooray!).

 IE8 and FF3 have their selectors go into 'selectorsAPI' mode, now into
 some debugging (version: 1.6.0.3)
 
 2723: this.mode = 'selectorsAPI';
 ...
 2823: findElements: function(root) {
 ...
 2837: case 'selectorsAPI':
 ...
 2842: var oldId = root.id, id = $(root).identify();
 2843: e = # + id +   + e;
 alert(e) // you'll see how the dots are confusing
 the selector for classnames ...
 

 Now for a fix, i changed the following line in Element#identify
 
 1782: if (id) return id.replace(/\./g, '\\.');
 
 to escape the dots.

 with that, the unit test will succeed.

 I'm not sure if this is the best way to go around it, or if there is
 another chars for escaping, so it's in your hands now.

 Waiting for the feedback and hopefully a patch :)

 cheers

 --
 mona

 On Mon, Jul 20, 2009 at 5:06 PM, Richard
 Quadlingrquadl...@googlemail.com wrote:
 
  2009/7/20 Mona Remlawi mona.reml...@gmail.com:
 
  Hello prototypers,
 
  I'm getting a basic error (in selectors) in *IE8/FF3* and don't think
  anyone has reported it yet -- or maybe did, i searched but not
  extensively.
  The problem is that the Element#selector fails when invoked on an
  Element that has a '.' in its id.
  I've put a small unit test on pastie, you just need to get a copy of
  unittest.js from scriptaculous (and test.css if you like colors :) )
  http://pastie.org/552134
 
  Tested with both version#1.6.0.3 and version#1.6.1RC#3 with the same
  results.
 
  Any help is greatly appreciated, I'm trying to debug on my own but
  doubt i'll reach somewhere.
 
  cheers
 
  --
  mona
 
  
 
 
  I don't know how feasible it it, but maybe globally changing your IDs
  to use _ rather than . would be a quick and easy fix.
 
 
 
  --
  -
  Richard Quadling
  Zend Certified Engineer :
  http://zend.com/zce.php?c=ZEND002498r=213474731
  Standing on the shoulders of some very clever giants!
  ZOPA : http://uk.zopa.com/member/RQuadling
 
  
 





 





--~--~-~--~~~---~--~~
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: Ajax call is not working in MAC(Firefox)

2009-07-21 Thread Alex McAuley

What does firebug say ?



- Original Message - 
From: Mona Remlawi mona.reml...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 10:37 AM
Subject: [Proto-Scripty] Re: Ajax call is not working in MAC(Firefox)



Not sure if this is related (haven't worked on MAC OS), but I would
double check the use of '../' for relative uri.
Different operating systems might interpret this differently.
You might wanna consider absolute uri's instead : /appcontext/index.php

cheers

--
mona

On Tue, Jul 21, 2009 at 9:13 AM, Atanu Deymratanu...@gmail.com wrote:

 I have a script which executes periodically after each 10 seconds. You
 can see that there is an ajax call which actually updates database for
 me and return 1 or 0 depending of the script execution.

 The problem is, it is working cool in windows platform with firefox
 3.0.11. But not working with the same version of firefox in MAC OS.

 The Script:

 new PeriodicalExecuter(function(){
 var date = new Date();
 //console.log('setOnlineStatus.php?sid='+date.getTime());
 new Ajax.Request('setOnlineStatus.php?sid='+date.getTime(),
 {method:'get', onComplete:function(transport){
 if(!parseInt(transport.responseText))
 window.location=../index.php;
 }});
 },10);

 Can anybody has any idea about this? Thanks in advance for your help.

 





--~--~-~--~~~---~--~~
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: .setStyle - overwrites existing style?

2009-07-21 Thread T.J. Crowder

Hi,

 I'm using .addClassName and .setStyle to change body background. But
 my code doesn't work very well right now so I need to swich just
 to .setStyle . My question is: will .setStyle overwrite my existing
 style?

There's nothing like trying it to find out.

 Button 1 uses:
  $$('body')[0].setStyle({background: 'url(someimage1.png) center
 center no-repeat;'});

 Button 2 uses:
  $$('body')[0].setStyle({background: 'url(someimage2.png) center
 center no-repeat;'});

 So will this second command overwrite the existing style?

If you set the same style property on the same element (in this case
the document body), then yes, the second one overwrites (replaces) the
first.  It's just like setting the property of an object (in fact, it
*is* setting the property of an object).

BTW, it's OT, but take out that semicolon.  Semicolons are used in CSS
blocks to mark the end of a style definition, they are not part of the
style value.  Here you're giving the style value.

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

On Jul 21, 1:23 am, wosd webosdevelo...@gmail.com wrote:
 Hi eveyone,

 I'm using .addClassName and .setStyle to change body background. But
 my code doesn't work very well right now so I need to swich just
 to .setStyle . My question is: will .setStyle overwrite my existing
 style?

 Example:

 Button 1 uses:
  $$('body')[0].setStyle({background: 'url(someimage1.png) center
 center no-repeat;'});

 Button 2 uses:
  $$('body')[0].setStyle({background: 'url(someimage2.png) center
 center no-repeat;'});

 So will this second command overwrite the existing style? If not - is
 there any way how to remove style? I know you can do it
 with .addClasName and .removeClassName, but I can't use them because
 my bg image path changes every time.

 Thanks for help.
--~--~-~--~~~---~--~~
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: Ajax call is not working in MAC(Firefox)

2009-07-21 Thread T.J. Crowder

Hi,

Not working in what way?  Does it...

...do nothing?
...raise an error?
...stop all scripts on the page?
...turn the entire page mauve?
...depress the economies of the western democracies?

You get the idea, there are dozens of things not working could
mean. ;-)
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Jul 21, 8:13 am, Atanu Dey mratanu...@gmail.com wrote:
 I have a script which executes periodically after each 10 seconds. You
 can see that there is an ajax call which actually updates database for
 me and return 1 or 0 depending of the script execution.

 The problem is, it is working cool in windows platform with firefox
 3.0.11. But not working with the same version of firefox in MAC OS.

 The Script:

 new PeriodicalExecuter(function(){
                 var date = new Date();
                 //console.log('setOnlineStatus.php?sid='+date.getTime());
                 new Ajax.Request('setOnlineStatus.php?sid='+date.getTime(),
 {method:'get', onComplete:function(transport){
                         if(!parseInt(transport.responseText))
                                 window.location=../index.php;
                 }});
         },10);

 Can anybody has any idea about this? Thanks in advance for your help.
--~--~-~--~~~---~--~~
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: Ajax call is not working in MAC(Firefox)

2009-07-21 Thread Alex McAuley

LOL @ western democracies !

Wish my scripts could do that
;)

Alex Mcauley
Developer
The Vacancy Market LTD
http://www.thevacancymarket.com

- Original Message - 
From: T.J. Crowder t...@crowdersoftware.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 10:51 AM
Subject: [Proto-Scripty] Re: Ajax call is not working in MAC(Firefox)



Hi,

Not working in what way?  Does it...

...do nothing?
...raise an error?
...stop all scripts on the page?
...turn the entire page mauve?
...depress the economies of the western democracies?

You get the idea, there are dozens of things not working could
mean. ;-)
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Jul 21, 8:13 am, Atanu Dey mratanu...@gmail.com wrote:
 I have a script which executes periodically after each 10 seconds. You
 can see that there is an ajax call which actually updates database for
 me and return 1 or 0 depending of the script execution.

 The problem is, it is working cool in windows platform with firefox
 3.0.11. But not working with the same version of firefox in MAC OS.

 The Script:

 new PeriodicalExecuter(function(){
 var date = new Date();
 //console.log('setOnlineStatus.php?sid='+date.getTime());
 new Ajax.Request('setOnlineStatus.php?sid='+date.getTime(),
 {method:'get', onComplete:function(transport){
 if(!parseInt(transport.responseText))
 window.location=../index.php;
 }});
 },10);

 Can anybody has any idea about this? Thanks in advance for your help.



--~--~-~--~~~---~--~~
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: Ajax call is not working in MAC(Firefox)

2009-07-21 Thread Atanu Dey

Thanks a lot for your replies. I was not on my machine so got late to
reply here

You can see that there is a commented code:

//console.log('setOnlineStatus.php?sid='+date.getTime());

I cannot see that log and also there is no ajax call taking place.
there is no javascript error found in the firebug.

what I can see that it is not getting inside the function for
periodical executer...

not sure why but, this is working properly in windows with the same
version of firefox...

On Jul 21, 2:57 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 LOL @ western democracies !

 Wish my scripts could do that
 ;)

 Alex Mcauley
 Developer
 The Vacancy Market LTDhttp://www.thevacancymarket.com

 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 10:51 AM
 Subject: [Proto-Scripty] Re: Ajax call is not working in MAC(Firefox)

 Hi,

 Not working in what way?  Does it...

 ...do nothing?
 ...raise an error?
 ...stop all scripts on the page?
 ...turn the entire page mauve?
 ...depress the economies of the western democracies?

 You get the idea, there are dozens of things not working could
 mean. ;-)
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available

 On Jul 21, 8:13 am, Atanu Dey mratanu...@gmail.com wrote:
  I have a script which executes periodically after each 10 seconds. You
  can see that there is an ajax call which actually updates database for
  me and return 1 or 0 depending of the script execution.

  The problem is, it is working cool in windows platform with firefox
  3.0.11. But not working with the same version of firefox in MAC OS.

  The Script:

  new PeriodicalExecuter(function(){
  var date = new Date();
  //console.log('setOnlineStatus.php?sid='+date.getTime());
  new Ajax.Request('setOnlineStatus.php?sid='+date.getTime(),
  {method:'get', onComplete:function(transport){
  if(!parseInt(transport.responseText))
  window.location=../index.php;
  }});
  },10);

  Can anybody has any idea about this? Thanks in advance for your help.
--~--~-~--~~~---~--~~
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: selectors failing in IE8FF3

2009-07-21 Thread Mona Remlawi

Hi T.J.,

ticket#559 is very relevant indeed, and the final patch contained
 ... id = id.replace(/[\.:]/g, \\$1); ...  [1]
does solve the issue with dots and colons in IDs.

However, looks like this patch didn't make it to the 'bleeding-edge
version'. [3]
Instead, there is the old (still buggy) patch
 ... id = id.replace(/[\.:]/g, \\$0); ...  [2]

So, I don't know how to go from here, is RC4 due any time soon (i
really dislike manual changes in prototype core :) )


[1] 
http://github.com/sstephenson/prototype/commit/059ce21040ce1c469d13c3633ead78d03fc610c3
[2] 
http://github.com/sstephenson/prototype/commit/97fc24a0b2f32717c40a0d71bbdea4ca58e0847b
[3] http://prototypejs.org/assets/2009/6/16/prototype.js

Thanks a lot, always helpful

cheers

--
mona

On Tue, Jul 21, 2009 at 11:41 AM, T.J. Crowdert...@crowdersoftware.com wrote:

 Hi Mona,

 I agree, dots and colons are valid in HTML, and so should work with
 the selector engine.

 I took a quick look at Lighthouse[1], and it looks like there may be a
 ticket[2] or two[3] there that is relevant, although #559 is marked as
 fixed in 1.6.1 and you say what you're seeing is still an issue in
 RC3.  It was a very quick search, though, so please have a good look
 and open a ticket if you don't find one already open for this.  (I'm
 surprised that both 1.6.0.3 and 1.6.1 should have this bug, as they
 use completely different selector engines.)

 FWIW, can I suggest a one-page test case with no dependancies other
 than Prototype?  Just something very simple; the one you posted
 earlier is a bit much to grok in the time most people have available.
 (Maybe this is less true for people who have used scripty's unit test
 suite more than I.)

 [1] http://prototype.lighthouseapp.com/projects/8886-prototype
 [2] https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/559
 [3] https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/501

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

 On Jul 21, 10:28 am, Mona Remlawi mona.reml...@gmail.com wrote:
 
 
 ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
 followed by any number of letters, digits ([0-9]), hyphens (-),
 underscores (_), colons (:), and periods (.).
 ...
  [1]

 So if HTML permits a '.' in the ID value of elements, so should prototype 
 core.

 Another point is that even if I rewrote my selectors, there would
 still be a problem in doing the following

 $('my\.long\.id').down('.myclass');

 as prototype would translate this into :
 element.querySelectorAll('#my.long.id .myclass')

 I still insist that escaping 'special' chars in Element#identify
 method is the way to go ...

 [1]http://www.w3.org/TR/html4/types.html#type-name

 cheers

 --
 mona



 On Tue, Jul 21, 2009 at 4:16 AM, Rick Waldronwaldron.r...@gmail.com wrote:
  I feel like i should provide more insight. That was rather vague. An ID
  could be labelled a.b:c and referenced in your style sheet as #a.b:c but
  as well as being the id of an element, it could mean:

  id a, class b, pseudo-selector c.

  Best to avoid the confusion and stay away from using . and : altogether.

  On Mon, Jul 20, 2009 at 10:10 PM, Rick Waldron waldron.r...@gmail.com
  wrote:

  Instead of changing the way the core works... and potentially causing
  breakage to existing code - perhaps you might try rewriting your selector
  statement with escaped periods.

  This question caused me to read a bunch regarding valid id's from one html
  spec to another, and then double back to css selector specs. Apparently,
  they didn't compare notes...

  Rick

  On Mon, Jul 20, 2009 at 11:28 AM, Mona Remlawi mona.reml...@gmail.com
  wrote:

  You've guessed it, it's unfeasible, the amount of effort that takes
  makes my head hurt :)
  Anyway, i found the little bug in prototype (hooray!).

  IE8 and FF3 have their selectors go into 'selectorsAPI' mode, now into
  some debugging (version: 1.6.0.3)
  
  2723:      this.mode = 'selectorsAPI';
  ...
  2823:      findElements: function(root) {
  ...
  2837:      case 'selectorsAPI':
  ...
  2842:          var oldId = root.id, id = $(root).identify();
  2843:          e = # + id +   + e;
                   alert(e) // you'll see how the dots are confusing
  the selector for classnames ...

  Now for a fix, i changed the following line in Element#identify
  
  1782:  if (id)  return id.replace(/\./g, '\\.');

  to escape the dots.

  with that, the unit test will succeed.

  I'm not sure if this is the best way to go around it, or if there is
  another chars for escaping, so it's in your hands now.

  Waiting for the feedback and hopefully a patch :)

  cheers

  --
  mona

  On Mon, Jul 20, 2009 at 5:06 PM, Richard
  Quadlingrquadl...@googlemail.com wrote:

   2009/7/20 Mona Remlawi mona.reml...@gmail.com:

   Hello prototypers,

   I'm getting a basic error (in selectors) in *IE8/FF3* and don't think
   anyone has reported it 

[Proto-Scripty] Re: Ajax call is not working in MAC(Firefox)

2009-07-21 Thread Alex McAuley

try changing date to d or something in var date=.. incase FF on MAC 
might reserve the word or mistake the case of it for Date and 
re-variablise the class

Alex Mcauley
Developer
The Vacancy Market LTD
http://www.thevacancymarket.com


- Original Message - 
From: Atanu Dey mratanu...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 11:05 AM
Subject: [Proto-Scripty] Re: Ajax call is not working in MAC(Firefox)



Thanks a lot for your replies. I was not on my machine so got late to
reply here

You can see that there is a commented code:

//console.log('setOnlineStatus.php?sid='+date.getTime());

I cannot see that log and also there is no ajax call taking place.
there is no javascript error found in the firebug.

what I can see that it is not getting inside the function for
periodical executer...

not sure why but, this is working properly in windows with the same
version of firefox...

On Jul 21, 2:57 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 LOL @ western democracies !

 Wish my scripts could do that
 ;)

 Alex Mcauley
 Developer
 The Vacancy Market LTDhttp://www.thevacancymarket.com

 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 10:51 AM
 Subject: [Proto-Scripty] Re: Ajax call is not working in MAC(Firefox)

 Hi,

 Not working in what way? Does it...

 ...do nothing?
 ...raise an error?
 ...stop all scripts on the page?
 ...turn the entire page mauve?
 ...depress the economies of the western democracies?

 You get the idea, there are dozens of things not working could
 mean. ;-)
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available

 On Jul 21, 8:13 am, Atanu Dey mratanu...@gmail.com wrote:
  I have a script which executes periodically after each 10 seconds. You
  can see that there is an ajax call which actually updates database for
  me and return 1 or 0 depending of the script execution.

  The problem is, it is working cool in windows platform with firefox
  3.0.11. But not working with the same version of firefox in MAC OS.

  The Script:

  new PeriodicalExecuter(function(){
  var date = new Date();
  //console.log('setOnlineStatus.php?sid='+date.getTime());
  new Ajax.Request('setOnlineStatus.php?sid='+date.getTime(),
  {method:'get', onComplete:function(transport){
  if(!parseInt(transport.responseText))
  window.location=../index.php;
  }});
  },10);

  Can anybody has any idea about this? Thanks in advance for your help.



--~--~-~--~~~---~--~~
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] Delete PHP

2009-07-21 Thread Yan Kovyakh
Well yes, this does gives me a true, and in post of the remove_clone.php  I
see clone 1234. But that's because you specified  

var e='blah_1234';

But how am I going to connect my clone:id parameter?

 

 Here is one way to do it (though probably not the best) - but it works

  var e='blah_1234';

 

  var i=e.split('_');

  var l=i.length-1;

 var id=(l=1) ? i[l] : 'NULL' ;

 var test=(id.length=1) ? true : false ;

 alert(test); // true means its set and has a string length greater than 1,
false means there is nothing after _

 

 then you can test it with

 

 if(test!==true) {

 

 alert('No ID Found');

 return

 

 }

 

 parameters : { clone: id }

 

 HTH

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 10:00 AM

   Subject: [Proto-Scripty] Delete php

 

   I don't really want to change the whole script, and the problem is that
I can't get the ID out, not the script.

 

   Is there any way to extract an ID instead of doing:

 

   var id = elm.id.split('_').last();

 

   Because everything up to that point is working, I'm confused.

 

Ya, I'm getting an empty box, so something is wrong.

 

 Dude, firstly please stop topping the message and removing the code
and

 

replies from your replies.

 

 secondly: try the below script and see what gets alerted (it should
be

 

your numeric ID, if not then you have something wrong somewhere

 

 $('clones').observe('click',function(evt){

 

   var elm = evt.element();

 

   if (elm.hasClassName('remove')){

 

 evt.stop();

 

 var id = elm.id.split('_').last();

 

 alert(id);

 

 return;

 

 new Ajax.Request('remove_clone.php',{

 

   parameters:{clone:id},

 

   onSuccess:function(transport){

 

 elm.up('li').remove();

 

 pollSortable.defer();

 

   }

 

 });

 

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Monday, July 20, 2009 7:35 PM

 

   Subject: [Proto-Scripty] Delete php

 

   They actualy have Item_numericalID

 

   Is this the problem?


--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh
Well yes, this does gives me a true, and in post of the remove_clone.php  I
see clone 1234. But that's because you specified  

var e='blah_1234';

But how am I going to connect my clone:id parameter?

 

 Here is one way to do it (though probably not the best) - but it works

  var e='blah_1234';

 

  var i=e.split('_');

  var l=i.length-1;

 var id=(l=1) ? i[l] : 'NULL' ;

 var test=(id.length=1) ? true : false ;

 alert(test); // true means its set and has a string length greater than 1,

 false means there is nothing after _

 

 then you can test it with

 

 if(test!==true) {

 

 alert('No ID Found');

 return

 

 }

 

 parameters : { clone: id }

 

 HTH

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 10:00 AM

   Subject: [Proto-Scripty] Delete php

 

   I don't really want to change the whole script, and the problem is that 

I can't get the ID out, not the script.

 

   Is there any way to extract an ID instead of doing:

 

   var id = elm.id.split('_').last();

 

   Because everything up to that point is working, I'm confused.

 

Ya, I'm getting an empty box, so something is wrong.

 

 Dude, firstly please stop topping the message and removing the code 

 and

 

replies from your replies.

 

 secondly: try the below script and see what gets alerted (it should 

be

 

your numeric ID, if not then you have something wrong somewhere

 

 $('clones').observe('click',function(evt){

 

   var elm = evt.element();

 

   if (elm.hasClassName('remove')){

 

 evt.stop();

 

 var id = elm.id.split('_').last();

 

 alert(id);

 

 return;

 

 new Ajax.Request('remove_clone.php',{

 

   parameters:{clone:id},

 

   onSuccess:function(transport){

 

 elm.up('li').remove();

 

 pollSortable.defer();

 

   }

 

 });

 

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Monday, July 20, 2009 7:35 PM

 

   Subject: [Proto-Scripty] Delete php

 

   They actualy have Item_numericalID

 

   Is this the problem?


--~--~-~--~~~---~--~~
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: Delete php

2009-07-21 Thread Alex McAuley
var elm=evt.element().id; //is the id of the element no ?



  - Original Message - 
  From: Yan Kovyakh 
  To: prototype-scriptaculous@googlegroups.com 
  Sent: Tuesday, July 21, 2009 11:27 AM
  Subject: [Proto-Scripty] Delete php


  Well yes, this does gives me a true, and in post of the remove_clone.php  I 
see clone 1234. But that's because you specified  

  var e='blah_1234';

  But how am I going to connect my clone:id parameter?

   

   Here is one way to do it (though probably not the best) - but it works

var e='blah_1234';

   

var i=e.split('_');

var l=i.length-1;

   var id=(l=1) ? i[l] : 'NULL' ;

   var test=(id.length=1) ? true : false ;

   alert(test); // true means its set and has a string length greater than 1,

   false means there is nothing after _

   

   then you can test it with

   

   if(test!==true) {

   

   alert('No ID Found');

   return

   

   }

   

   parameters : { clone: id }

   

   HTH

   

 - Original Message -

 From: Yan Kovyakh

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 10:00 AM

 Subject: [Proto-Scripty] Delete php

   

 I don't really want to change the whole script, and the problem is that 

  I can't get the ID out, not the script.

   

 Is there any way to extract an ID instead of doing:

   

 var id = elm.id.split('_').last();

   

 Because everything up to that point is working, I'm confused.

   

  Ya, I'm getting an empty box, so something is wrong.

   

   Dude, firstly please stop topping the message and removing the code 

   and

   

  replies from your replies.

   

   secondly: try the below script and see what gets alerted (it should 

  be

   

  your numeric ID, if not then you have something wrong somewhere

   

   $('clones').observe('click',function(evt){

   

 var elm = evt.element();

   

 if (elm.hasClassName('remove')){

   

   evt.stop();

   

   var id = elm.id.split('_').last();

   

   alert(id);

   

   return;

   

   new Ajax.Request('remove_clone.php',{

   

 parameters:{clone:id},

   

 onSuccess:function(transport){

   

   elm.up('li').remove();

   

   pollSortable.defer();

   

 }

   

   });

   

 - Original Message -

   

 From: Yan Kovyakh

   

 To: prototype-scriptaculous@googlegroups.com

   

 Sent: Monday, July 20, 2009 7:35 PM

   

 Subject: [Proto-Scripty] Delete php

   

 They actualy have Item_numericalID

   

 Is this the problem?


  

--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh
Don't really understand what should I do with that line?

 

 var elm=evt.element().id; //is the id of the element no ?

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 11:27 AM

   Subject: [Proto-Scripty] Delete php

 

   Well yes, this does gives me a true, and in post of the remove_clone.php
I see clone 1234. 

  But that's because you specified  

   var e='blah_1234';

 

   But how am I going to connect my clone:id parameter?

 

Here is one way to do it (though probably not the best) - but it works

 

 var e='blah_1234';

 

 var i=e.split('_');

 

 var l=i.length-1;

 

var id=(l=1) ? i[l] : 'NULL' ;

 

var test=(id.length=1) ? true : false ;

 

alert(test); // true means its set and has a string length greater
than 1,

 

false means there is nothing after _

 

then you can test it with

 

if(test!==true) {

 

alert('No ID Found');

 

return

 

}

 

parameters : { clone: id }

 

HTH

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 10:00 AM

 

  Subject: [Proto-Scripty] Delete php

 

  I don't really want to change the whole script, and the problem is
that

 

   I can't get the ID out, not the script.

 

  Is there any way to extract an ID instead of doing:

 

  var id = elm.id.split('_').last();

 

  Because everything up to that point is working, I'm confused.

 

   Ya, I'm getting an empty box, so something is wrong.

 

Dude, firstly please stop topping the message and removing the
code

 

and

 

   replies from your replies.

 

secondly: try the below script and see what gets alerted (it
should

 

   be

 

   your numeric ID, if not then you have something wrong somewhere

 

$('clones').observe('click',function(evt){

 

  var elm = evt.element();

 

  if (elm.hasClassName('remove')){

 

evt.stop();

 

var id = elm.id.split('_').last();

 

alert(id);

 

return;

 

new Ajax.Request('remove_clone.php',{

 

  parameters:{clone:id},

 

  onSuccess:function(transport){

 

elm.up('li').remove();

 

pollSortable.defer();

 

  }

 

});

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Monday, July 20, 2009 7:35 PM

 

  Subject: [Proto-Scripty] Delete php

 

  They actualy have Item_numericalID

 

  Is this the problem?


--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh
Don't really understand what should I do with that line?

 

 var elm=evt.element().id; //is the id of the element no ?

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 11:27 AM

   Subject: [Proto-Scripty] Delete php

 

   Well yes, this does gives me a true, and in post of the remove_clone.php


 I see clone 1234. 

  But that's because you specified  

   var e='blah_1234';

 

   But how am I going to connect my clone:id parameter?

 

Here is one way to do it (though probably not the best) - but it works

 

 var e='blah_1234';

 

 var i=e.split('_');

 

 var l=i.length-1;

 

var id=(l=1) ? i[l] : 'NULL' ;

 

var test=(id.length=1) ? true : false ;

 

alert(test); // true means its set and has a string length greater 

  than 1,

false means there is nothing after _

 

then you can test it with

 

if(test!==true) {

 

alert('No ID Found');

 

return

 

}

 

parameters : { clone: id }

 

HTH

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 10:00 AM

 

  Subject: [Proto-Scripty] Delete php

 

  I don't really want to change the whole script, and the problem is

  that

   I can't get the ID out, not the script.

 

  Is there any way to extract an ID instead of doing:

 

  var id = elm.id.split('_').last();

 

  Because everything up to that point is working, I'm confused.

 

   Ya, I'm getting an empty box, so something is wrong.

 

Dude, firstly please stop topping the message and removing the

  code

and

 

   replies from your replies.

 

secondly: try the below script and see what gets alerted (it 

  should

   be

 

   your numeric ID, if not then you have something wrong somewhere

 

$('clones').observe('click',function(evt){

 

  var elm = evt.element();

 

  if (elm.hasClassName('remove')){

 

evt.stop();

 

var id = elm.id.split('_').last();

 

alert(id);

 

return;

 

new Ajax.Request('remove_clone.php',{

 

  parameters:{clone:id},

 

  onSuccess:function(transport){

 

elm.up('li').remove();

 

pollSortable.defer();

 

  }

 

});

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Monday, July 20, 2009 7:35 PM

 

  Subject: [Proto-Scripty] Delete php

 

  They actualy have Item_numericalID

 

  Is this the problem?


--~--~-~--~~~---~--~~
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: Delete php

2009-07-21 Thread Alex McAuley
I suggest you give up lol because it really doesnt get any simpler than what i 
offered.

If however you do not wish to give up i will give you the answer.

var e=evt.element().id;


Then use the script given to you by me to get the actual ID from e
  - Original Message - 
  From: Yan Kovyakh 
  To: prototype-scriptaculous@googlegroups.com 
  Sent: Tuesday, July 21, 2009 11:47 AM
  Subject: [Proto-Scripty] Delete php


  Don't really understand what should I do with that line?

   

   var elm=evt.element().id; //is the id of the element no ?

   

 - Original Message -

 From: Yan Kovyakh

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 11:27 AM

 Subject: [Proto-Scripty] Delete php

   

 Well yes, this does gives me a true, and in post of the remove_clone.php 

   I see clone 1234. 

But that's because you specified  

 var e='blah_1234';

   

 But how am I going to connect my clone:id parameter?

   

  Here is one way to do it (though probably not the best) - but it works

   

   var e='blah_1234';

   

   var i=e.split('_');

   

   var l=i.length-1;

   

  var id=(l=1) ? i[l] : 'NULL' ;

   

  var test=(id.length=1) ? true : false ;

   

  alert(test); // true means its set and has a string length greater 

than 1,

  false means there is nothing after _

   

  then you can test it with

   

  if(test!==true) {

   

  alert('No ID Found');

   

  return

   

  }

   

  parameters : { clone: id }

   

  HTH

   

- Original Message -

   

From: Yan Kovyakh

   

To: prototype-scriptaculous@googlegroups.com

   

Sent: Tuesday, July 21, 2009 10:00 AM

   

Subject: [Proto-Scripty] Delete php

   

I don't really want to change the whole script, and the problem is

that

 I can't get the ID out, not the script.

   

Is there any way to extract an ID instead of doing:

   

var id = elm.id.split('_').last();

   

Because everything up to that point is working, I'm confused.

   

 Ya, I'm getting an empty box, so something is wrong.

   

  Dude, firstly please stop topping the message and removing the

code

  and

   

 replies from your replies.

   

  secondly: try the below script and see what gets alerted (it 

should

 be

   

 your numeric ID, if not then you have something wrong somewhere

   

  $('clones').observe('click',function(evt){

   

var elm = evt.element();

   

if (elm.hasClassName('remove')){

   

  evt.stop();

   

  var id = elm.id.split('_').last();

   

  alert(id);

   

  return;

   

  new Ajax.Request('remove_clone.php',{

   

parameters:{clone:id},

   

onSuccess:function(transport){

   

  elm.up('li').remove();

   

  pollSortable.defer();

   

}

   

  });

   

- Original Message -

   

From: Yan Kovyakh

   

To: prototype-scriptaculous@googlegroups.com

   

Sent: Monday, July 20, 2009 7:35 PM

   

Subject: [Proto-Scripty] Delete php

   

They actualy have Item_numericalID

   

Is this the problem?


  

--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh
I'm getting true in a test but NULL as an post ID. Every element has an Id: 

li id=Item_55span class=remove(x)/span/li

I'm getting frustrated as much as you do Alex, the last pledge for help
would be to send in the whole script.

http://pastie.org/553229

 

 

 I suggest you give up lol because it really doesnt get any simpler than 

  what i offered.

 If however you do not wish to give up i will give you the answer.

 

 var e=evt.element().id;

 

 

 Then use the script given to you by me to get the actual ID from e

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 11:47 AM

   Subject: [Proto-Scripty] Delete php

 

   Don't really understand what should I do with that line?

 

var elm=evt.element().id; //is the id of the element no ?

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 11:27 AM

 

  Subject: [Proto-Scripty] Delete php

 

  Well yes, this does gives me a true, and in post of the 

  remove_clone.php

I see clone 1234.

 

 But that's because you specified  

 

  var e='blah_1234';

 

  But how am I going to connect my clone:id parameter?

 

   Here is one way to do it (though probably not the best) 

 - but it works

var e='blah_1234';

 

var i=e.split('_');

 

var l=i.length-1;

 

   var id=(l=1) ? i[l] : 'NULL' ;

 

   var test=(id.length=1) ? true : false ;

 

   alert(test); // true means its set and has a string 

  length greater

 than 1,

 

   false means there is nothing after _

 

   then you can test it with

 

   if(test!==true) {

 

   alert('No ID Found');

 

   return

 

   }

 

   parameters : { clone: id }

 

   HTH

 

 - Original Message -

 

 From: Yan Kovyakh

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Tuesday, July 21, 2009 10:00 AM

 

 Subject: [Proto-Scripty] Delete php

 

 I don't really want to change the whole scripts

 , and the problem i

 that

 

  I can't get the ID out, not the script.

 

 Is there any way to extract an ID instead of doing:

 

 var id = elm.id.split('_').last();

 

 Because everything up to that point is working

 , I'm confused.

  Ya, I'm getting an empty box, so something 

  is wrong.

   Dude, firstly please stop topping the message 

  and removing the

 code

 

   and

 

  replies from your replies.

 

   secondly: try the below script and see 

  what gets alerted (it

 should

 

  be

 

  your numeric ID, if not then you have 

  something wrong somewhere

   $('clones').observe('click',function(evt){

 

 var elm = evt.element();

 

 if (elm.hasClassName('remove')){

 

   evt.stop();

 

   var id = elm.id.split('_').last();

 

   alert(id);

 

   return;

 

   new Ajax.Request('remove_clone.php',{

 

 parameters:{clone:id},

 

 onSuccess:function(transport){

 

   elm.up('li').remove();

 

   pollSortable.defer();

 

 }

 

   });

 

 - Original Message -

 

 From: Yan Kovyakh

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Monday, July 20, 2009 7:35 PM

 

 Subject: [Proto-Scripty] Delete php

 

 They actualy have Item_numericalID

 

 Is this the problem?


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

attachment: winmail.dat

[Proto-Scripty] Re: selectors failing in IE8FF3

2009-07-21 Thread Richard Quadling

2009/7/21 Mona Remlawi mona.reml...@gmail.com:

 Hi T.J.,

 ticket#559 is very relevant indeed, and the final patch contained
  ... id = id.replace(/[\.:]/g, \\$1); ...  [1]
 does solve the issue with dots and colons in IDs.

 However, looks like this patch didn't make it to the 'bleeding-edge
 version'. [3]
 Instead, there is the old (still buggy) patch
  ... id = id.replace(/[\.:]/g, \\$0); ...  [2]

 So, I don't know how to go from here, is RC4 due any time soon (i
 really dislike manual changes in prototype core :) )


 [1] 
 http://github.com/sstephenson/prototype/commit/059ce21040ce1c469d13c3633ead78d03fc610c3
 [2] 
 http://github.com/sstephenson/prototype/commit/97fc24a0b2f32717c40a0d71bbdea4ca58e0847b
 [3] http://prototypejs.org/assets/2009/6/16/prototype.js

 Thanks a lot, always helpful

 cheers

 --
 mona

 On Tue, Jul 21, 2009 at 11:41 AM, T.J. Crowdert...@crowdersoftware.com 
 wrote:

 Hi Mona,

 I agree, dots and colons are valid in HTML, and so should work with
 the selector engine.

 I took a quick look at Lighthouse[1], and it looks like there may be a
 ticket[2] or two[3] there that is relevant, although #559 is marked as
 fixed in 1.6.1 and you say what you're seeing is still an issue in
 RC3.  It was a very quick search, though, so please have a good look
 and open a ticket if you don't find one already open for this.  (I'm
 surprised that both 1.6.0.3 and 1.6.1 should have this bug, as they
 use completely different selector engines.)

 FWIW, can I suggest a one-page test case with no dependancies other
 than Prototype?  Just something very simple; the one you posted
 earlier is a bit much to grok in the time most people have available.
 (Maybe this is less true for people who have used scripty's unit test
 suite more than I.)

 [1] http://prototype.lighthouseapp.com/projects/8886-prototype
 [2] https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/559
 [3] https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/501

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

 On Jul 21, 10:28 am, Mona Remlawi mona.reml...@gmail.com wrote:
 
 
 ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
 followed by any number of letters, digits ([0-9]), hyphens (-),
 underscores (_), colons (:), and periods (.).
 ...
  [1]

 So if HTML permits a '.' in the ID value of elements, so should prototype 
 core.

 Another point is that even if I rewrote my selectors, there would
 still be a problem in doing the following

 $('my\.long\.id').down('.myclass');

 as prototype would translate this into :
 element.querySelectorAll('#my.long.id .myclass')

 I still insist that escaping 'special' chars in Element#identify
 method is the way to go ...

 [1]http://www.w3.org/TR/html4/types.html#type-name

 cheers

 --
 mona



 On Tue, Jul 21, 2009 at 4:16 AM, Rick Waldronwaldron.r...@gmail.com wrote:
  I feel like i should provide more insight. That was rather vague. An ID
  could be labelled a.b:c and referenced in your style sheet as #a.b:c but
  as well as being the id of an element, it could mean:

  id a, class b, pseudo-selector c.

  Best to avoid the confusion and stay away from using . and : altogether.

  On Mon, Jul 20, 2009 at 10:10 PM, Rick Waldron waldron.r...@gmail.com
  wrote:

  Instead of changing the way the core works... and potentially causing
  breakage to existing code - perhaps you might try rewriting your selector
  statement with escaped periods.

  This question caused me to read a bunch regarding valid id's from one 
  html
  spec to another, and then double back to css selector specs. Apparently,
  they didn't compare notes...

  Rick

  On Mon, Jul 20, 2009 at 11:28 AM, Mona Remlawi mona.reml...@gmail.com
  wrote:

  You've guessed it, it's unfeasible, the amount of effort that takes
  makes my head hurt :)
  Anyway, i found the little bug in prototype (hooray!).

  IE8 and FF3 have their selectors go into 'selectorsAPI' mode, now into
  some debugging (version: 1.6.0.3)
  
  2723:      this.mode = 'selectorsAPI';
  ...
  2823:      findElements: function(root) {
  ...
  2837:      case 'selectorsAPI':
  ...
  2842:          var oldId = root.id, id = $(root).identify();
  2843:          e = # + id +   + e;
                   alert(e) // you'll see how the dots are confusing
  the selector for classnames ...

  Now for a fix, i changed the following line in Element#identify
  
  1782:  if (id)  return id.replace(/\./g, '\\.');

  to escape the dots.

  with that, the unit test will succeed.

  I'm not sure if this is the best way to go around it, or if there is
  another chars for escaping, so it's in your hands now.

  Waiting for the feedback and hopefully a patch :)

  cheers

  --
  mona

  On Mon, Jul 20, 2009 at 5:06 PM, Richard
  Quadlingrquadl...@googlemail.com wrote:

   2009/7/20 Mona Remlawi mona.reml...@gmail.com:

   Hello prototypers,

   I'm getting a basic 

[Proto-Scripty] Re: Checking if prototype is loaded

2009-07-21 Thread Richard Quadling

2009/7/20 Alex McAuley webmas...@thecarmarketplace.com:

 No problems at all. i just dont want to upset the client who paid for
 the development of it.
 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Monday, July 20, 2009 4:38 PM
 Subject: [Proto-Scripty] Re: Checking if prototype is loaded



 2009/7/20 Alex McAuley webmas...@thecarmarketplace.com:

 I can share most of it though the minifier i wrote is not available as
 its
 part of a package someone paid me to develop

 I can certainly give you the concepts of what needs doing and i am sure
 you
 can work out the code.

 I'll make a pastie of everything that should be done and put the link up
 when its finished

 Alex

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Monday, July 20, 2009 4:09 PM
 Subject: [Proto-Scripty] Re: Checking if prototype is loaded



 2009/7/20 Alex McAuley webmas...@thecarmarketplace.com:

 The technique i developed is about 5 times faster than the one in the
 link
 you provided and alot less server load!...

 However back in 2006 it was good insight from razaak to achieve it that
 way..

 Thanks for the info.

 Alex
 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Monday, July 20, 2009 3:22 PM
 Subject: [Proto-Scripty] Re: Checking if prototype is loaded



 2009/7/20 Alex McAuley webmas...@thecarmarketplace.com:

 With a script that gathers everything first, minifies, checks for
 gzip
 handling and outputs the appropriate response! ... same with CSS.

 When i started looking into speeding pages up using the google page
 speed
 add on for firefox i had 7 red x's  now i have 100% green ticks!
 which
 is thanks to a few hacks i worked out but mainly due to downloading
 everything the page needs in one hit rather than paralell or lazy
 loading!... couple that with caching and you have a lightning web
 app.



 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Monday, July 20, 2009 2:29 PM
 Subject: [Proto-Scripty] Re: Checking if prototype is loaded



 2009/7/20 Alex McAuley webmas...@thecarmarketplace.com:

 Yer i dont load it via src= as it slows the page down
 dramatically!!!
 

 Contrary to popular belief i have tried and tested external scripts
 and
 external css files and due to browsers paralell downloads with
 YSlow
 i
 can
 save around 7 seconds on loading a very heavy page full of
 prototype,jQuery
 some UI stuff and a bunch of CSS!...

 It does seem that it gets evaluated though you are correct, i went
 back
 and
 checked after finding those bits out and watched page load speed
 before
 and
 after!.

 Ta

 Alex


 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Monday, July 20, 2009 12:23 PM
 Subject: [Proto-Scripty] Re: Checking if prototype is loaded



 2009/7/20 Alex McAuley webmas...@thecarmarketplace.com:

 Just an FYI incase anyone wondered 

 It seems (at least in firefox 3x, IE7+, CHrome, Safari (windows))
 that
 the
 browser or prototype itself wont load 2 copies of it

 To Test i included prototype.js in the head and included it
 again
 in
 the
 body and there was only one output of javascript!

 Kudos to the browser vendors or the script devs!!

 - Original Message -
 From: Alex McAuley webmas...@thecarmarketplace.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Monday, July 20, 2009 11:12 AM
 Subject: [Proto-Scripty] Re: Checking if prototype is loaded



 Sorry my bad was if(window.Prototype) ...


 Sorry for silly post !!

 Alex
 - Original Message -
 From: Jeztah webmas...@thecarmarketplace.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Monday, July 20, 2009 11:07 AM
 Subject: [Proto-Scripty] Checking if prototype is loaded



 Morning guys.

 Does anyone know a way to check if prototype is loaded or not
 

 I have tried if(Prototype) { ... but just throws an undefined
 error.

 I know i know i should know if it is loaded or not but my
 servers
 use
 very heavy aggressive caching due to massive user loads and i
 noticed
 in my cache there was some javascript thats not even on the
 page
 left
 in a session cache.

 To cut it short i use server side methods to gzip/minify js
 files
 on
 page load (same with the css) as they are loaded they go
 into
 an
 array if whats loaded. Then on the page i am able to check the
 Cache
 of javascript loaded by checking a session array variable. The
 trouble
 is  the session variable is rightly telling me prototype is
 (included) - but not in the head tag so it is not showing up
 as
 a
 loaded script once the page is refreshed!!!

 would it be 

[Proto-Scripty] Re: Delete php

2009-07-21 Thread Alex McAuley

either its not getting the element or var id=...split(). is resetiing 
something...

Try

var theid = elm.id.split('_').last();parameters :{clone:id}...Or if you cant 
do it in javascript send the whole id of the element and split it in 
php?php // remove_clone.php$id=end(explode(_,$_POST['clone'])); ?
- Original Message - 
From: Yan Kovyakh maybe...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 12:38 PM
Subject: [Proto-Scripty] Delete php


 I'm getting true in a test but NULL as an post ID. Every element has an 
 Id:

 li id=Item_55span class=remove(x)/span/li

 I'm getting frustrated as much as you do Alex, the last pledge for help
 would be to send in the whole script.

 http://pastie.org/553229





 I suggest you give up lol because it really doesnt get any simpler than

  what i offered.

 If however you do not wish to give up i will give you the answer.



 var e=evt.element().id;

 



 Then use the script given to you by me to get the actual ID from e



   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 11:47 AM

   Subject: [Proto-Scripty] Delete php



   Don't really understand what should I do with that line?



var elm=evt.element().id; //is the id of the element no ?



  - Original Message -



  From: Yan Kovyakh



  To: prototype-scriptaculous@googlegroups.com



  Sent: Tuesday, July 21, 2009 11:27 AM



  Subject: [Proto-Scripty] Delete php



  Well yes, this does gives me a true, and in post of the

  remove_clone.php

I see clone 1234.



 But that's because you specified



  var e='blah_1234';



  But how am I going to connect my clone:id parameter?



   Here is one way to do it (though probably not the best)

 - but it works

var e='blah_1234';



var i=e.split('_');



var l=i.length-1;



   var id=(l=1) ? i[l] : 'NULL' ;



   var test=(id.length=1) ? true : false ;



   alert(test); // true means its set and has a string

  length greater

 than 1,



   false means there is nothing after _



   then you can test it with



   if(test!==true) {



   alert('No ID Found');



   return



   }



   parameters : { clone: id }



   HTH



 - Original Message -



 From: Yan Kovyakh



 To: prototype-scriptaculous@googlegroups.com



 Sent: Tuesday, July 21, 2009 10:00 AM



 Subject: [Proto-Scripty] Delete php



 I don't really want to change the whole scripts

 , and the problem i

 that



  I can't get the ID out, not the script.



 Is there any way to extract an ID instead of doing:



 var id = elm.id.split('_').last();



 Because everything up to that point is working

 , I'm confused.

  Ya, I'm getting an empty box, so something

  is wrong.

   Dude, firstly please stop topping the message

  and removing the

 code



   and



  replies from your replies.



   secondly: try the below script and see

  what gets alerted (it

 should



  be



  your numeric ID, if not then you have

  something wrong somewhere

   $('clones').observe('click',function(evt){



 var elm = evt.element();



 if (elm.hasClassName('remove')){



   evt.stop();



   var id = elm.id.split('_').last();



   alert(id);



   return;



   new Ajax.Request('remove_clone.php',{



 parameters:{clone:id},



 onSuccess:function(transport){



   elm.up('li').remove();



   pollSortable.defer();



 }



   });



 - Original Message -



 From: Yan Kovyakh



 To: prototype-scriptaculous@googlegroups.com



 Sent: Monday, July 20, 2009 7:35 PM



 Subject: [Proto-Scripty] Delete php



 They actualy have Item_numericalID



 Is this the problem?


 
 


--~--~-~--~~~---~--~~
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: selectors failing in IE8FF3

2009-07-21 Thread ColinFine



On Jul 21, 10:42 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 Why would you want to use . in an id In most web programming a . or
 a :: means its a node or part of a class or something.

 This makes no sense to me why anyone would want to confuse js libraries and
 possible server side backends.

I started out agreeing with you, then thought about it, and realised
that I disagree quite strongly. Why shouldn't you use dots if you
want? Different languagfe use symbols in different ways. In both Perl
and PHP (two widely used languages for web programming) '.' is a
concatenation operator, not a hierarchical one. It is now quite common
to use dots between the parts of an email name, though the purists
used to complain that the dot was supposed to denote hierarchy.

If the HTML spec didn't allow '.', that would be different. But since
it does you are free to use them. There's no question of 'confusing'
js libraries or server programs unless those libraries and programs
are wrong, in which case they ought to be fixed.

--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh
Look like it can't find the element or the id of the element, because all
that gets send is clone and nothing more.

 

 

 either its not getting the element or var id=...split(). is resetiing

 something...

 

 Try

 

 var theid = elm.id.split('_').last();parameters :{clone:id}...Or if you
cant

 do it in javascript send the whole id of the element and split it in

 php?php // remove_clone.php$id=end(explode(_,$_POST['clone'])); ?

 

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 12:38 PM

 Subject: [Proto-Scripty] Delete php

 

  I'm getting true in a test but NULL as an post ID. Every element has an

  Id:

 

  li id=Item_55span class=remove(x)/span/li

 

  I'm getting frustrated as much as you do Alex, the last pledge for help

  would be to send in the whole script.

 

 http://pastie.org/553229

 

  I suggest you give up lol because it really doesnt get any simpler than

 

   what i offered.

 

  If however you do not wish to give up i will give you the answer.

 

  var e=evt.element().id;

 

  

 

  Then use the script given to you by me to get the actual ID from e

 

- Original Message -

 

From: Yan Kovyakh

 

To: prototype-scriptaculous@googlegroups.com

 

Sent: Tuesday, July 21, 2009 11:47 AM

 

Subject: [Proto-Scripty] Delete php

 

Don't really understand what should I do with that line?

 

 var elm=evt.element().id; //is the id of the element no ?

 

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Tuesday, July 21, 2009 11:27 AM

 

   Subject: [Proto-Scripty] Delete php

 

   Well yes, this does gives me a true, and in post of the

 

   remove_clone.php

 

 I see clone 1234.

 

  But that's because you specified

 

   var e='blah_1234';

 

   But how am I going to connect my clone:id parameter?

 

Here is one way to do it (though probably not the best)

 

  - but it works

 

 var e='blah_1234';

 

 var i=e.split('_');

 

 var l=i.length-1;

 

var id=(l=1) ? i[l] : 'NULL' ;

 

var test=(id.length=1) ? true : false ;

 

alert(test); // true means its set and has a string

 

   length greater

 

  than 1,

 

false means there is nothing after _

 

then you can test it with

 

if(test!==true) {

 

alert('No ID Found');

 

return

 

}

 

parameters : { clone: id }

 

HTH

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 10:00 AM

 

  Subject: [Proto-Scripty] Delete php

 

  I don't really want to change the whole scripts

 

  , and the problem i

 

  that

 

   I can't get the ID out, not the script.

 

  Is there any way to extract an ID instead of doing:

 

  var id = elm.id.split('_').last();

 

  Because everything up to that point is working

 

  , I'm confused.

 

   Ya, I'm getting an empty box, so something

 

   is wrong.

 

Dude, firstly please stop topping the message

 

   and removing the

 

  code

 

and

 

   replies from your replies.

 

secondly: try the below script and see

 

   what gets alerted (it

 

  should

 

   be

 

   your numeric ID, if not then you have

 

   something wrong somewhere

 

$('clones').observe('click',function(evt){

 

  var elm = evt.element();

 

  if (elm.hasClassName('remove')){

 

evt.stop();

 

var id = elm.id.split('_').last();

 

alert(id);

 

return;

 

new Ajax.Request('remove_clone.php',{

 

  parameters:{clone:id},

 

  onSuccess:function(transport){

 

elm.up('li').remove();

 

pollSortable.defer();

 

  }

 

});

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Monday, July 20, 2009 7:35 PM

 

  Subject: [Proto-Scripty] Delete php

 

  They actualy have Item_numericalID

 

  Is this the problem?


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

[Proto-Scripty] Need help for performantly creating tooltips

2009-07-21 Thread Chris

Hi all,

one of our clients has a very javascript heavy application for local
intranets. On many pages of this application, there are tooltips that
get loaded (usually up to 60 or 70), which make the application behave
very slowly at some time or another (at least in good ole IE6, which
we need to support). Currently we are using Prototip2 from nick
stackenburg, but it seems that this seems overkill and isnt so
performant at all.

So, I want to start to build my own tooltip-functionality, which
should be lightweight and does not need thousands of listeners, which
also seems to make pages very slow.

My question is: What is the best approach for this task? I am
currently experimenting with event-bubbeling to only use one listener
on this page, so I can create as many tooltips as i want without
raising memory too much.

This is what I have come up with in the last 20 minutes or so:

/**
 * Creat tooltips for an array of objects
 * @param {Object} classes Classname of elements where the tooltips
should be shown on
 * @param {Object} content_attribute The dom attribute of the element
we should get the content from
 */
var tt = Class.create({

initialize: function(classes, content_attribute) {

this.classes = classes;
this.content_attribute = content_attribute;

this.initListeners();
},

/**
 * Initialize the global listener
 */
initListeners: function() {

document.observe('mouseover', 
this.moverListener.bindAsEventListener
(this));
document.observe('mouseout', 
this.moutListener.bindAsEventListener
(this));
},

moverListener: function(e) {

elm = Event.findElement(e, '.' + this.classes);

if(elm !== undefined) {

this.showToolTip(elm)
} else return;
},

moutListener: function(e) {

elm = Event.findElement(e, '.' + this.classes);
if(elm !== undefined) {

this.hideTooltip(elm);
}
},

showToolTip: function(elm) {

console.log(elm + ' is shown')
},

hideTooltip: function(elm) {

console.log(elm + ' is hidden')
}
};

As I am quite experienced in prototype.js (well, at least I think I
am...), but not in such things like performance tuning javascript and
such stuff, I really would love to hear some feedback from you. Are
there any other performance problems that this type of listener would
force me in (dont know how fast findElement() is compared to a direct
binding to the source element of a listener). do you think that this
is maybe the wrong approach at all?

The tooltips should go without great graphical stuff, the only thing I
want to add are pointers in pure css, like those seen on
http://www.filamentgroup.com/lab/image_free_css_tooltip_pointers_a_use_for_polygonal_css/,
to save some more bandswidth.

Thanks in advance,
Chris
--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh
The whole element is not working if you place var elm = this;

 

$('clones').observe('click',function(evt){

  var elm = this;

  if (elm.hasClassName('remove')){

evt.stop();

 


 you may be able to get the clicked element with this

 

 Example.

 

 $('clones').observe('click',function(evt){

   var elm = this;

 .. var e=this.id;

 

 - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 2:32 PM

   Subject: [Proto-Scripty] Delete php

 

   Look like it can't find the element or the id of the element, because
all that gets send is clone and nothing more.

 

either its not getting the element or var id=...split(). is
resetiing

 

something...

 

Try

 

var theid = elm.id.split('_').last();parameters :{clone:id}...Or if
you

 

   cant

 

do it in javascript send the whole id of the element and split it in

 

php?php // remove_clone.php$id=end(explode(_,$_POST['clone'])); ?

 

- Original Message -

 

From: Yan Kovyakh maybe...@gmail.com

 

To: prototype-scriptaculous@googlegroups.com

 

Sent: Tuesday, July 21, 2009 12:38 PM

 

Subject: [Proto-Scripty] Delete php

 

 I'm getting true in a test but NULL as an post ID. Every element has
an

 

 Id:

 

 li id=Item_55span class=remove(x)/span/li

 

 I'm getting frustrated as much as you do Alex, the last pledge for
help

 

 would be to send in the whole script.

 

http://pastie.org/553229

 

 I suggest you give up lol because it really doesnt get any simpler
than

 

  what i offered.

 

 If however you do not wish to give up i will give you the answer.

 

 var e=evt.element().id;

 

 

 

 Then use the script given to you by me to get the actual ID from
e

 

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Tuesday, July 21, 2009 11:47 AM

 

   Subject: [Proto-Scripty] Delete php

 

   Don't really understand what should I do with that line?

 

var elm=evt.element().id; //is the id of the element no ?

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 11:27 AM

 

  Subject: [Proto-Scripty] Delete php

 

  Well yes, this does gives me a true, and in post of the

 

  remove_clone.php

 

I see clone 1234.

 

 But that's because you specified

 

  var e='blah_1234';

 

  But how am I going to connect my clone:id parameter?

 

   Here is one way to do it (though probably not the best)

 

 - but it works

 

var e='blah_1234';

 

var i=e.split('_');

 

var l=i.length-1;

 

   var id=(l=1) ? i[l] : 'NULL' ;

 

   var test=(id.length=1) ? true : false ;

 

   alert(test); // true means its set and has a string

 

  length greater

 

 than 1,

 

   false means there is nothing after _

 

   then you can test it with

 

   if(test!==true) {

 

   alert('No ID Found');

 

   return

 

   }

 

   parameters : { clone: id }

 

   HTH

 

 - Original Message -

 

 From: Yan Kovyakh

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Tuesday, July 21, 2009 10:00 AM

 

 Subject: [Proto-Scripty] Delete php

 

 I don't really want to change the whole scripts

 

 , and the problem i

 

 that

 

  I can't get the ID out, not the script.

 

 Is there any way to extract an ID instead of doing:

 

 var id = elm.id.split('_').last();

 

 Because everything up to that point is working

 

 , I'm confused.

 

  Ya, I'm getting an empty box, so something

 

  is wrong.

 

   Dude, firstly please stop topping the message

 

  and removing the

 

 code

 

   and

 

  replies from your replies.

 

   secondly: try the below script and see

 

  what gets alerted (it

 

 should

 

  be

 

  your numeric ID, if not then you have

 

  something wrong somewhere

 

   $('clones').observe('click',function(evt){

 

 var elm = evt.element();

 

 if (elm.hasClassName('remove')){

 

   evt.stop();

 

   var id = elm.id.split('_').last();

 

   alert(id);

 

   return;

 

   new Ajax.Request('remove_clone.php',{

 

 parameters:{clone:id},

 

[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
The whole element is not working if you place var elm = this;

 

$('clones').observe('click',function(evt){

  var elm = this;

  if (elm.hasClassName('remove')){

evt.stop();

 


 you may be able to get the clicked element with this

 

 Example.

 

 $('clones').observe('click',function(evt){

   var elm = this;

 .. var e=this.id;

 

 - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 2:32 PM

   Subject: [Proto-Scripty] Delete php

 

   Look like it can't find the element or the id of the element, because 

  all that gets send is clone and nothing more.

either its not getting the element or var id=...split(). is 

  resetiing

something...

 

Try

 

var theid = elm.id.split('_').last();parameters :{clone:id}...Or 

  if you

   cant

 

do it in javascript send the whole id of the element and split it in

 

php?php // remove_clone.php$id=end(explode(_,$_POST['clone'])); ?

 

- Original Message -

 

From: Yan Kovyakh maybe...@gmail.com

 

To: prototype-scriptaculous@googlegroups.com

 

Sent: Tuesday, July 21, 2009 12:38 PM

 

Subject: [Proto-Scripty] Delete php

 

 I'm getting true in a test but NULL as an post ID. Every element 

  has an

 Id:

 

 li id=Item_55span class=remove(x)/span/li

 

 I'm getting frustrated as much as you do Alex, the last pledge 

  for help

 would be to send in the whole script.

 

http://pastie.org/553229

 

 I suggest you give up lol because it really doesnt get any 

  simpler than

  what i offered.

 

 If however you do not wish to give up i will give you the answer.

 

 var e=evt.element().id;

 

 

 

 Then use the script given to you by me to get the actual ID 

  from e

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Tuesday, July 21, 2009 11:47 AM

 

   Subject: [Proto-Scripty] Delete php

 

   Don't really understand what should I do with that line?

 

var elm=evt.element().id; //is the id of the element no ?

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 11:27 AM

 

  Subject: [Proto-Scripty] Delete php

 

  Well yes, this does gives me a true, and in post of the

 

  remove_clone.php

 

I see clone 1234.

 

 But that's because you specified

 

  var e='blah_1234';

 

  But how am I going to connect my clone:id parameter?

 

   Here is one way to do it (though probably not the best)

 

 - but it works

 

var e='blah_1234';

 

var i=e.split('_');

 

var l=i.length-1;

 

   var id=(l=1) ? i[l] : 'NULL' ;

 

   var test=(id.length=1) ? true : false ;

 

   alert(test); // true means its set and has a string

 

  length greater

 

 than 1,

 

   false means there is nothing after _

 

   then you can test it with

 

   if(test!==true) {

 

   alert('No ID Found');

 

   return

 

   }

 

   parameters : { clone: id }

 

   HTH

 

 - Original Message -

 

 From: Yan Kovyakh

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Tuesday, July 21, 2009 10:00 AM

 

 Subject: [Proto-Scripty] Delete php

 

 I don't really want to change the whole scripts

 

 , and the problem i

 

 that

 

  I can't get the ID out, not the script.

 

 Is there any way to extract an ID instead of doing:

 

 var id = elm.id.split('_').last();

 

 Because everything up to that point is working

 

 , I'm confused.

 

  Ya, I'm getting an empty box, so something

 

  is wrong.

 

   Dude, firstly please stop topping the message

 

  and removing the

 

 code

 

   and

 

  replies from your replies.

 

   secondly: try the below script and see

 

  what gets alerted (it

 

 should

 

  be

 

  your numeric ID, if not then you have

 

  something wrong somewhere

 

   $('clones').observe('click',function(evt){

 

 var elm = evt.element();

 

 if (elm.hasClassName('remove')){

 

   evt.stop();

 

   var id = elm.id.split('_').last();

 

   alert(id);

 

   return;

 

   new Ajax.Request('remove_clone.php',{

 

 

[Proto-Scripty] Re: Delete php

2009-07-21 Thread Chris

Sorry if I dont understand it right, but you have an id of
Item_SOMENUMBER as id and just want the SOMENUMBER as post id,
right? I have something similiar in one of my applications, the
following is tested and works (at least if your prefix does not
change):

function getId(realId, prefix) { return realId.replace(prefix, ''); }

Hope I understood right and could help you.

Greetings from Germany,
Chris
--~--~-~--~~~---~--~~
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: Delete php

2009-07-21 Thread Chris

Ah, forgot:

Call it in your function with the_id_i_want_to_use = getId(elm.id,
'Item_');

Greetings from Germany,
Chris
--~--~-~--~~~---~--~~
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] Parsing XML

2009-07-21 Thread ferion

Hello Everybody,

i got a problem with the parsing of an XML Response.

I know i have to handle IE and FF differently
So my AjaxResponse delivers Something like

RESPONSE
  RHEAD
REQUESTNUMBER38/REQUESTNUMBER
  /RHEAD
  RBODY
ACTION
  CREATELAYER
 NAMEDESKTOP/NAME
  TOOLBOX
   RHTML
  IMG src=img/toolbar/widget-icon.gif /
  /RHTML
 DISPLAYNAMEDesktop anzeigen/DISPLAYNAME
 INFO-1/INFO
  /TOOLBOX
 /CREATELAYER
   /ACTION
  /RBODY
/RESPONSE

I want do accesss the nodes by getElementsByTagNames.

Until now im Using the following script

function XML2DOM(obj)
{

if (window.ActiveXObject)
{
var xmlDoc = new ActiveXObject(Microsoft.XMLDOM);
xmlDoc.async=false;
xmlDoc.loadXML(obj);
if(xmlDoc.parseError.errorCode!=0)
{
txt=Error Code:  +
xmlDoc.parseError.errorCode + \n;
txt=txt+Error Reason:  +
xmlDoc.parseError.reason;
txt=txt+Error Line:  +
xmlDoc.parseError.line;
alert(txt);
}
else
{
}
}
else if (document.implementation 
document.implementation.createDocument)
{
var parser=new DOMParser();
var text=obj;
var xmlDoc=parser.parseFromString(text,text/xml);
if (xmlDoc.documentElement.nodeName==parsererror)
{
alert(xmlDoc.documentElement.childNodes
[0].nodeValue);
}
else
{
var toAppend = document.createElement('xml');
toAppend.innerHTML = obj;
toAppend.setAttribute('id','transferToXML');
document.body.appendChild(toAppend);
xmlDoc = document.getElementById
('transferToXML');
alert(xmlDoc.childNodes[0].tagName); //--
This says RESPONSE
alert(xmlDoc.getElementsByTagName
(RESPONSE).length); //-- but this is 0 !?
//document.body.removeChild
(document.getElementById('transferToXML'));
}
}
return(xmlDoc);
}

IE Part is working perfectly, the FF Part won't.
Funny thing is, that i was using
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
in the Nesting page (NOT in the AjaxRequest) and it worked in FF
Changing it to
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
causes the Problem.

I was working on this for hours know, and decided to look for help by
the gurus in this forum.

Thanks in advandce
Ferion

P.S.
Please exuse my improper english. I'm not a native speaker.

--~--~-~--~~~---~--~~
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: Delete php

2009-07-21 Thread Alex McAuley
try the follwing then.



$('clones').observe('click',function(evt,element){

  var elm = element;

  if (elm.hasClassName('remove')){

evt.stop();

  - Original Message - 
  From: Yan Kovyakh 
  To: prototype-scriptaculous@googlegroups.com 
  Sent: Tuesday, July 21, 2009 3:42 PM
  Subject: [Proto-Scripty] Delete php


  The whole element is not working if you place var elm = this;

   

  $('clones').observe('click',function(evt){

var elm = this;

if (elm.hasClassName('remove')){

  evt.stop();

   

 you may be able to get the clicked element with this

 

 Example.

 

 $('clones').observe('click',function(evt){

   var elm = this;

 .. var e=this.id;

 

 - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 2:32 PM

   Subject: [Proto-Scripty] Delete php

 

   Look like it can't find the element or the id of the element, 
because 

  all that gets send is clone and nothing more.

either its not getting the element or var id=...split(). is 

  resetiing

something...

 

Try

 

var theid = elm.id.split('_').last();parameters :{clone:id}...Or 

  if you

   cant

 

do it in javascript send the whole id of the element and split it 
in

 

php?php // 
remove_clone.php$id=end(explode(_,$_POST['clone'])); ?

 

- Original Message -

 

From: Yan Kovyakh maybe...@gmail.com

 

To: prototype-scriptaculous@googlegroups.com

 

Sent: Tuesday, July 21, 2009 12:38 PM

 

Subject: [Proto-Scripty] Delete php

 

 I'm getting true in a test but NULL as an post ID. Every 
element 

  has an

 Id:

 

 li id=Item_55span class=remove(x)/span/li

 

 I'm getting frustrated as much as you do Alex, the last pledge 

  for help

 would be to send in the whole script.

 

http://pastie.org/553229

 

 I suggest you give up lol because it really doesnt get any 

  simpler than

  what i offered.

 

 If however you do not wish to give up i will give you the 
answer.

 

 var e=evt.element().id;

 

 

 

 Then use the script given to you by me to get the actual ID 

  from e

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Tuesday, July 21, 2009 11:47 AM

 

   Subject: [Proto-Scripty] Delete php

 

   Don't really understand what should I do with that line?

 

var elm=evt.element().id; //is the id of the element no ?

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 11:27 AM

 

  Subject: [Proto-Scripty] Delete php

 

  Well yes, this does gives me a true, and in post of the

 

  remove_clone.php

 

I see clone 1234.

 

 But that's because you specified

 

  var e='blah_1234';

 

  But how am I going to connect my clone:id parameter?

 

   Here is one way to do it (though probably not the best)

 

 - but it works

 

var e='blah_1234';

 

var i=e.split('_');

 

var l=i.length-1;

 

   var id=(l=1) ? i[l] : 'NULL' ;

 

   var test=(id.length=1) ? true : false ;

 

   alert(test); // true means its set and has a string

 

  length greater

 

 than 1,

 

   false means there is nothing after _

 

   then you can test it with

 

   if(test!==true) {

 

   alert('No ID Found');

 

   return

 

   }

 

   parameters : { clone: id }

 

   HTH

 

 - Original Message -

 

 

[Proto-Scripty] Re: Delete php

2009-07-21 Thread Walter Lee Davis

Try this:

$('clones').observe('click',function(evt){
var elm = evt.element();
if(elm.id){
//your code goes here
}
});

Walter

On Jul 21, 2009, at 11:10 AM, Alex McAuley wrote:

 try the follwing then.

 $('clones').observe('click',function(evt,element){
   var elm = element;
   if (elm.hasClassName('remove')){
 evt.stop();
 - Original Message -
 From: Yan Kovyakh
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 3:42 PM
 Subject: [Proto-Scripty] Delete php

 The whole element is not working if you place var elm = this;

 $('clones').observe('click',function(evt){
   var elm = this;
   if (elm.hasClassName('remove')){
 evt.stop();

  you may be able to get the clicked element with this
 
  Example.
 
  $('clones').observe('click',function(evt){
var elm = this;
  .. var e=this.id;
 
  - Original Message -
From: Yan Kovyakh
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 2:32 PM
Subject: [Proto-Scripty] Delete php
 
Look like it can't find the element or the id of the element,  
 because
   all that gets send is clone and nothing more.
 either its not getting the element or var id=...split(). is
   resetiing
 something...
 
 Try
 
 var theid = elm.id.split('_').last();parameters :{clone:id}...Or
   if you
cant
 
 do it in javascript send the whole id of the element and split  
 it in
 
 php?php // remove_clone.php$id=end(explode(_, 
 $_POST['clone'])); ?
 
 - Original Message -
 
 From: Yan Kovyakh maybe...@gmail.com
 
 To: prototype-scriptaculous@googlegroups.com
 
 Sent: Tuesday, July 21, 2009 12:38 PM
 
 Subject: [Proto-Scripty] Delete php
 
  I'm getting true in a test but NULL as an post ID. Every  
 element
   has an
  Id:
 
  li id=Item_55span class=remove(x)/span/li
 
  I'm getting frustrated as much as you do Alex, the last pledge
   for help
  would be to send in the whole script.
 
 http://pastie.org/553229
 
  I suggest you give up lol because it really doesnt get any
   simpler than
   what i offered.
 
  If however you do not wish to give up i will give you the  
 answer.
 
  var e=evt.element().id;
 
  
 
  Then use the script given to you by me to get the actual ID
   from e
- Original Message -
 
From: Yan Kovyakh
 
To: prototype-scriptaculous@googlegroups.com
 
Sent: Tuesday, July 21, 2009 11:47 AM
 
Subject: [Proto-Scripty] Delete php
 
Don't really understand what should I do with that line?
 
 var elm=evt.element().id; //is the id of the element no ?
 
   - Original Message -
 
   From: Yan Kovyakh
 
   To: prototype-scriptaculous@googlegroups.com
 
   Sent: Tuesday, July 21, 2009 11:27 AM
 
   Subject: [Proto-Scripty] Delete php
 
   Well yes, this does gives me a true, and in post of the
 
   remove_clone.php
 
 I see clone 1234.
 
  But that's because you specified
 
   var e='blah_1234';
 
   But how am I going to connect my clone:id parameter?
 
Here is one way to do it (though probably not the  
 best)
 
  - but it works
 
 var e='blah_1234';
 
 var i=e.split('_');
 
 var l=i.length-1;
 
var id=(l=1) ? i[l] : 'NULL' ;
 
var test=(id.length=1) ? true : false ;
 
alert(test); // true means its set and has a string
 
   length greater
 
  than 1,
 
false means there is nothing after _
 
then you can test it with
 
if(test!==true) {
 
alert('No ID Found');
 
return
 
}
 
parameters : { clone: id }
 
HTH
 
  - Original Message -
 
  From: Yan Kovyakh
 
  To: prototype-scriptaculous@googlegroups.com
 
  Sent: Tuesday, July 21, 2009 10:00 AM
 
  Subject: [Proto-Scripty] Delete php
 
  I don't really want to change the whole scripts
 
  , and the problem i
 
  that
 
   I can't get the ID out, not the script.
 
  Is there any way to extract an ID instead of doing:
 
  var id = elm.id.split('_').last();
 
  Because everything up to that point is working
 
  , I'm confused.
 
   Ya, I'm getting an empty box, so something
 
   is wrong.
 
Dude, firstly please stop topping the message
 
   and removing the
 
  code
 
and
 
   replies from your replies.
 
secondly: try the below script and see
 
   what gets alerted (it
 
  should
 
   be
 
   your numeric ID, if not 

[Proto-Scripty] Re: Delete php

2009-07-21 Thread Alex McAuley

Already been tried !!!


- Original Message - 
From: Walter Lee Davis wa...@wdstudio.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 4:14 PM
Subject: [Proto-Scripty] Re: Delete php



 Try this:

 $('clones').observe('click',function(evt){
 var elm = evt.element();
 if(elm.id){
 //your code goes here
 }
 });

 Walter

 On Jul 21, 2009, at 11:10 AM, Alex McAuley wrote:

 try the follwing then.

 $('clones').observe('click',function(evt,element){
   var elm = element;
   if (elm.hasClassName('remove')){
 evt.stop();
 - Original Message -
 From: Yan Kovyakh
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 3:42 PM
 Subject: [Proto-Scripty] Delete php

 The whole element is not working if you place var elm = this;

 $('clones').observe('click',function(evt){
   var elm = this;
   if (elm.hasClassName('remove')){
 evt.stop();

  you may be able to get the clicked element with this
 
  Example.
 
  $('clones').observe('click',function(evt){
var elm = this;
  .. var e=this.id;
 
  - Original Message -
From: Yan Kovyakh
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 2:32 PM
Subject: [Proto-Scripty] Delete php
 
Look like it can't find the element or the id of the element,
 because
   all that gets send is clone and nothing more.
 either its not getting the element or var id=...split(). is
   resetiing
 something...
 
 Try
 
 var theid = elm.id.split('_').last();parameters :{clone:id}...Or
   if you
cant
 
 do it in javascript send the whole id of the element and split
 it in
 
 php?php // remove_clone.php$id=end(explode(_,
 $_POST['clone'])); ?
 
 - Original Message -
 
 From: Yan Kovyakh maybe...@gmail.com
 
 To: prototype-scriptaculous@googlegroups.com
 
 Sent: Tuesday, July 21, 2009 12:38 PM
 
 Subject: [Proto-Scripty] Delete php
 
  I'm getting true in a test but NULL as an post ID. Every
 element
   has an
  Id:
 
  li id=Item_55span class=remove(x)/span/li
 
  I'm getting frustrated as much as you do Alex, the last pledge
   for help
  would be to send in the whole script.
 
 http://pastie.org/553229
 
  I suggest you give up lol because it really doesnt get any
   simpler than
   what i offered.
 
  If however you do not wish to give up i will give you the
 answer.
 
  var e=evt.element().id;
 
  
 
  Then use the script given to you by me to get the actual ID
   from e
- Original Message -
 
From: Yan Kovyakh
 
To: prototype-scriptaculous@googlegroups.com
 
Sent: Tuesday, July 21, 2009 11:47 AM
 
Subject: [Proto-Scripty] Delete php
 
Don't really understand what should I do with that line?
 
 var elm=evt.element().id; //is the id of the element no ?
 
   - Original Message -
 
   From: Yan Kovyakh
 
   To: prototype-scriptaculous@googlegroups.com
 
   Sent: Tuesday, July 21, 2009 11:27 AM
 
   Subject: [Proto-Scripty] Delete php
 
   Well yes, this does gives me a true, and in post of the
 
   remove_clone.php
 
 I see clone 1234.
 
  But that's because you specified
 
   var e='blah_1234';
 
   But how am I going to connect my clone:id parameter?
 
Here is one way to do it (though probably not the
 best)
 
  - but it works
 
 var e='blah_1234';
 
 var i=e.split('_');
 
 var l=i.length-1;
 
var id=(l=1) ? i[l] : 'NULL' ;
 
var test=(id.length=1) ? true : false ;
 
alert(test); // true means its set and has a string
 
   length greater
 
  than 1,
 
false means there is nothing after _
 
then you can test it with
 
if(test!==true) {
 
alert('No ID Found');
 
return
 
}
 
parameters : { clone: id }
 
HTH
 
  - Original Message -
 
  From: Yan Kovyakh
 
  To: prototype-scriptaculous@googlegroups.com
 
  Sent: Tuesday, July 21, 2009 10:00 AM
 
  Subject: [Proto-Scripty] Delete php
 
  I don't really want to change the whole scripts
 
  , and the problem i
 
  that
 
   I can't get the ID out, not the script.
 
  Is there any way to extract an ID instead of doing:
 
  var id = elm.id.split('_').last();
 
  Because everything up to that point is working
 
  , I'm confused.
 
   Ya, I'm getting an empty box, so something
 
   is wrong.
 
Dude, firstly please stop topping the message
 
   and removing the
 
  code
 
and
 
   replies from 

[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh

Maybe there's something completely other that causes this problem, if
someone look at it  http://pastie.org/553229

 Already been tried !!!
 
 - Original Message -
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 4:14 PM
 Subject: [Proto-Scripty] Re: Delete php
 
  Try this:
 
  $('clones').observe('click',function(evt){
  var elm = evt.element();
  if(elm.id){
  //your code goes here
  }
  });
 
  Walter
 
  On Jul 21, 2009, at 11:10 AM, Alex McAuley wrote:
 
  try the follwing then.
 
  $('clones').observe('click',function(evt,element){
var elm = element;
if (elm.hasClassName('remove')){
  evt.stop();
  - Original Message -
  From: Yan Kovyakh
  To: prototype-scriptaculous@googlegroups.com
  Sent: Tuesday, July 21, 2009 3:42 PM
  Subject: [Proto-Scripty] Delete php
 
  The whole element is not working if you place var elm = this;
 
  $('clones').observe('click',function(evt){
var elm = this;
if (elm.hasClassName('remove')){
  evt.stop();
 
   you may be able to get the clicked element with this
 
   Example.
 
   $('clones').observe('click',function(evt){
 var elm = this;
   .. var e=this.id;
 
   - Original Message -
 From: Yan Kovyakh
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 2:32 PM
 Subject: [Proto-Scripty] Delete php
 
 Look like it can't find the element or the id of the element,
  because
all that gets send is clone and nothing more.
  either its not getting the element or var id=...split(). is
resetiing
  something...


--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh

Both of the solutions causes script not to work at all, just to make sure
I'm connecting all right.
http://jsbin.com/igixe/edit

 Okay.
 
 Your script is listening to the ul list with ID of clones so you will
 never get an element id that is not clones because it is listening on
the
 ul
 
 event.element() should track it but its not working...
 
 solution 1. use this insetad
 $('clones').observe('click',function(event){
 var elm=Event.element(event);Rest of your code
 
 Solution 2.
 
 Listen to each li inside the ul for the click like the following
 
 $$('#clones li').invoke('observe','click',function(event) {
 
 var elm=this; // this will now be the element (this.id will be its ID)
 
 rest of your code.
 
 });
 
 HTH
 Alex Mcauleyhttp://www.thevacancymarket.com
 
 - Original Message -
 From: Yan Kovyakh maybe...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 4:26 PM
 Subject: [Proto-Scripty] Delete php
 
  Maybe there's something completely other that causes this problem, if
  someone look at it  http://pastie.org/553229
 
  Already been tried !!!
 
  - Original Message -
  From: Walter Lee Davis wa...@wdstudio.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Tuesday, July 21, 2009 4:14 PM
  Subject: [Proto-Scripty] Re: Delete php
 
   Try this:
 
   $('clones').observe('click',function(evt){
   var elm = evt.element();
   if(elm.id){
   //your code goes here
   }
   });
 
   Walter
 
   On Jul 21, 2009, at 11:10 AM, Alex McAuley wrote:
 
   try the follwing then.



--~--~-~--~~~---~--~~
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: Delete php

2009-07-21 Thread Alex McAuley

and firebug says ?

you have an undefined error in there for a start with evt.stop();



Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Yan Kovyakh maybe...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 5:04 PM
Subject: [Proto-Scripty] Delete php



 Both of the solutions causes script not to work at all, just to make sure
 I'm connecting all right.
 http://jsbin.com/igixe/edit

 Okay.

 Your script is listening to the ul list with ID of clones so you will
 never get an element id that is not clones because it is listening on
 the
 ul

 event.element() should track it but its not working...

 solution 1. use this insetad
 $('clones').observe('click',function(event){
 var elm=Event.element(event);Rest of your code

 Solution 2.

 Listen to each li inside the ul for the click like the following

 $$('#clones li').invoke('observe','click',function(event) {

 var elm=this; // this will now be the element (this.id will be its ID)

 rest of your code.

 });

 HTH
 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Yan Kovyakh maybe...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 4:26 PM
 Subject: [Proto-Scripty] Delete php

  Maybe there's something completely other that causes this problem, if
  someone look at it  http://pastie.org/553229

  Already been tried !!!

  - Original Message -
  From: Walter Lee Davis wa...@wdstudio.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Tuesday, July 21, 2009 4:14 PM
  Subject: [Proto-Scripty] Re: Delete php

   Try this:

   $('clones').observe('click',function(evt){
   var elm = evt.element();
   if(elm.id){
   //your code goes here
   }
   });

   Walter

   On Jul 21, 2009, at 11:10 AM, Alex McAuley wrote:

   try the follwing then.



 
 


--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh

Says nothing, it's unclick-able now.



and firebug says ?

you have an undefined error in there for a start with evt.stop();



Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Yan Kovyakh maybe...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 5:04 PM
Subject: [Proto-Scripty] Delete php



 Both of the solutions causes script not to work at all, just to make sure
 I'm connecting all right.
 http://jsbin.com/igixe/edit

 Okay.

 Your script is listening to the ul list with ID of clones so you will
 never get an element id that is not clones because it is listening on
 the
 ul

 event.element() should track it but its not working...

 solution 1. use this insetad
 $('clones').observe('click',function(event){
 var elm=Event.element(event);Rest of your code

 Solution 2.

 Listen to each li inside the ul for the click like the following

 $$('#clones li').invoke('observe','click',function(event) {

 var elm=this; // this will now be the element (this.id will be its ID)

 rest of your code.

 });

 HTH
 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Yan Kovyakh maybe...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 4:26 PM
 Subject: [Proto-Scripty] Delete php

  Maybe there's something completely other that causes this problem, if
  someone look at it  http://pastie.org/553229

  Already been tried !!!

  - Original Message -
  From: Walter Lee Davis wa...@wdstudio.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Tuesday, July 21, 2009 4:14 PM
  Subject: [Proto-Scripty] Re: Delete php

   Try this:

   $('clones').observe('click',function(evt){
   var elm = evt.element();
   if(elm.id){
   //your code goes here
   }
   });

   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: Delete php

2009-07-21 Thread Alex McAuley

$$('#clones li').invoke('observe','click',function(event) {
  var elm=this;
  if (elm.hasClassName('remove')){ // this was unclosed

Event.stop(event);
} // now closed properly
  var the_id = elm.id.split('_').last();
   alert(the_id);  // remove this to make it work
 return; // remove this to make it work
new Ajax.Request('remove_clone.php',{
  parameters:{clone:the_id},
  onSuccess:function(transport){
elm.up('li').remove();
pollSortable.defer();
  }
});
 });

That works because i just tested it, it alerts 1234 for the follwing html 
and 4567 for the second list element.

See the comments in the code to make it work for you.



ul id=clones
li id=foo_1234ID = foo_1234/li
 li id=foo_4567ID = foo_4567 /li
  /ul



Alex Mcauley
http://www.thevacancymarket.com


- Original Message - 
From: Yan Kovyakh maybe...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 5:17 PM
Subject: [Proto-Scripty] Delete php



 Says nothing, it's unclick-able now.



and firebug says ?

you have an undefined error in there for a start with evt.stop();



Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Yan Kovyakh maybe...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 5:04 PM
Subject: [Proto-Scripty] Delete php



 Both of the solutions causes script not to work at all, just to make sure
 I'm connecting all right.
 http://jsbin.com/igixe/edit

 Okay.

 Your script is listening to the ul list with ID of clones so you 
 will
 never get an element id that is not clones because it is listening on
 the
 ul

 event.element() should track it but its not working...

 solution 1. use this insetad
 $('clones').observe('click',function(event){
 var elm=Event.element(event);Rest of your code

 Solution 2.

 Listen to each li inside the ul for the click like the following

 $$('#clones li').invoke('observe','click',function(event) {

 var elm=this; // this will now be the element (this.id will be its ID)

 rest of your code.

 });

 HTH
 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Yan Kovyakh maybe...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 4:26 PM
 Subject: [Proto-Scripty] Delete php

  Maybe there's something completely other that causes this problem, if
  someone look at it  http://pastie.org/553229

  Already been tried !!!

  - Original Message -
  From: Walter Lee Davis wa...@wdstudio.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Tuesday, July 21, 2009 4:14 PM
  Subject: [Proto-Scripty] Re: Delete php

   Try this:

   $('clones').observe('click',function(evt){
   var elm = evt.element();
   if(elm.id){
   //your code goes here
   }
   });

   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: selectors failing in IE8FF3

2009-07-21 Thread Rick Waldron
This is a really interesting thread...

I don't want to retract my statement, but I dont entirely agree with what i
wrote previously (it's all part of learning right ?).

I've discussed this with a respected colleague, and we both agree that just
because a spec says so doesn't make it right or best practice, to quote
him:

if i start seeing div id=iswear.iamnotaclass:honest I am going to take
my life - Al MacDonald (hyper-metrix.com  @f1lt3r)

I couldn't agree more.

























On Tue, Jul 21, 2009 at 8:52 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:


 Each to their own, everyone has their own coding practices and concepts.

 In PHP and Perl you -could- call . a heirachial operator as it joins 2
 nodes (strings for example) together - thus jumping from one to the next or
 making the bridge (to assimilate them) - which is what it does in
 Javascript
 for example (kind of).

 As i said - each to their own but if CSS explicits .className as a
 classname then perhaps they should think about not having dots in ID's
 ([0-9Aa-Zz]\-_) would be a better fit for DOM element id's in my opinion.
 Classnames do not allow dots as far as i know. I would've thought the devs
 of JS libraries wluld have realised that perhaps 0.01% of javascript
 developers in the world would use dots and possibly didnt want the
 performance lack to accomodate these users  Just my 2 pence worth!!!


 Alex Mcauley
 Developer
 The Vacancy Market LTD
 http://www.thevacancymarket.com



 - Original Message -
 From: ColinFine colin.f...@pace.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 1:09 PM
 Subject: [Proto-Scripty] Re: selectors failing in IE8FF3





 On Jul 21, 10:42 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Why would you want to use . in an id In most web programming a .
  or
  a :: means its a node or part of a class or something.
 
  This makes no sense to me why anyone would want to confuse js libraries
  and
  possible server side backends.
 
 I started out agreeing with you, then thought about it, and realised
 that I disagree quite strongly. Why shouldn't you use dots if you
 want? Different languagfe use symbols in different ways. In both Perl
 and PHP (two widely used languages for web programming) '.' is a
 concatenation operator, not a hierarchical one. It is now quite common
 to use dots between the parts of an email name, though the purists
 used to complain that the dot was supposed to denote hierarchy.

 If the HTML spec didn't allow '.', that would be different. But since
 it does you are free to use them. There's no question of 'confusing'
 js libraries or server programs unless those libraries and programs
 are wrong, in which case they ought to be fixed.




 


--~--~-~--~~~---~--~~
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: Ajax call is not working in MAC(Firefox)

2009-07-21 Thread T.J. Crowder

@Alex:

 try changing date to d or something in var date=.. incase FF on MAC
 might reserve the word or mistake the case of it for Date and
 re-variablise the class

That would be a truly massive bug in FF, I doubt it would get out of
beta.

@Atanu:

Firebug[1] works on the Mac, I'd suggest walking through the code in
the debugger (the script panel).

[1] http://getfirebug.com/

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


On Jul 21, 11:14 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 try changing date to d or something in var date=.. incase FF on MAC
 might reserve the word or mistake the case of it for Date and
 re-variablise the class

 Alex Mcauley
 Developer
 The Vacancy Market LTDhttp://www.thevacancymarket.com



 - Original Message -
 From: Atanu Dey mratanu...@gmail.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 11:05 AM
 Subject: [Proto-Scripty] Re: Ajax call is not working in MAC(Firefox)

 Thanks a lot for your replies. I was not on my machine so got late to
 reply here

 You can see that there is a commented code:

 //console.log('setOnlineStatus.php?sid='+date.getTime());

 I cannot see that log and also there is no ajax call taking place.
 there is no javascript error found in the firebug.

 what I can see that it is not getting inside the function for
 periodical executer...

 not sure why but, this is working properly in windows with the same
 version of firefox...

 On Jul 21, 2:57 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  LOL @ western democracies !

  Wish my scripts could do that
  ;)

  Alex Mcauley
  Developer
  The Vacancy Market LTDhttp://www.thevacancymarket.com

  - Original Message -
  From: T.J. Crowder t...@crowdersoftware.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Tuesday, July 21, 2009 10:51 AM
  Subject: [Proto-Scripty] Re: Ajax call is not working in MAC(Firefox)

  Hi,

  Not working in what way? Does it...

  ...do nothing?
  ...raise an error?
  ...stop all scripts on the page?
  ...turn the entire page mauve?
  ...depress the economies of the western democracies?

  You get the idea, there are dozens of things not working could
  mean. ;-)
  --
  T.J. Crowder
  tj / crowder software / com
  Independent Software Engineer, consulting services available

  On Jul 21, 8:13 am, Atanu Dey mratanu...@gmail.com wrote:
   I have a script which executes periodically after each 10 seconds. You
   can see that there is an ajax call which actually updates database for
   me and return 1 or 0 depending of the script execution.

   The problem is, it is working cool in windows platform with firefox
   3.0.11. But not working with the same version of firefox in MAC OS.

   The Script:

   new PeriodicalExecuter(function(){
   var date = new Date();
   //console.log('setOnlineStatus.php?sid='+date.getTime());
   new Ajax.Request('setOnlineStatus.php?sid='+date.getTime(),
   {method:'get', onComplete:function(transport){
   if(!parseInt(transport.responseText))
   window.location=../index.php;
   }});
   },10);

   Can anybody has any idea about this? Thanks in advance for your help.
--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh
Great, now it finds the correct ID, and sends a post of clone ID but the
rest of the code seems not working:

 

new Ajax.Request('remove_clone.php',{

  parameters:{clone:the_id},

  onSuccess:function(transport){

elm.up('li').remove();

pollSortable.defer();

 }

 });

   });  

});

 

The last 2 lines of the code doesn't work, it's not removing the li anymore.


 

 

 $$('#clones li').invoke('observe','click',function(event) {

   var elm=this;

   if (elm.hasClassName('remove')){ // this was unclosed

 

 Event.stop(event);

 } // now closed properly

   var the_id = elm.id.split('_').last();

alert(the_id);  // remove this to make it work

  return; // remove this to make it work

 new Ajax.Request('remove_clone.php',{

   parameters:{clone:the_id},

   onSuccess:function(transport){

 elm.up('li').remove();

 pollSortable.defer();

   }

 });

  });

 

 That works because i just tested it, it alerts 1234 for the follwing html

 and 4567 for the second list element.

 

 See the comments in the code to make it work for you.

 

 ul id=clones

 li id=foo_1234ID = foo_1234/li

  li id=foo_4567ID = foo_4567 /li

   /ul

 

 Alex Mcauleyhttp://www.thevacancymarket.com

 

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 5:17 PM

 Subject: [Proto-Scripty] Delete php

 

  Says nothing, it's unclick-able now.

 

 and firebug says ?

 

 you have an undefined error in there for a start with evt.stop();

 

 Alex Mcauley

 http://www.thevacancymarket.com

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 5:04 PM

 Subject: [Proto-Scripty] Delete php

 

  Both of the solutions causes script not to work at all, just to make
sure

  I'm connecting all right.

 http://jsbin.com/igixe/edit

 

  Okay.

 

  Your script is listening to the ul list with ID of clones so you

  will

  never get an element id that is not clones because it is listening
on

  the

  ul

 

  event.element() should track it but its not working...

 

  solution 1. use this insetad

  $('clones').observe('click',function(event){

  var elm=Event.element(event);Rest of your code

 

  Solution 2.

 

  Listen to each li inside the ul for the click like the following

 

  $$('#clones li').invoke('observe','click',function(event) {

 

  var elm=this; // this will now be the element (this.id will be its ID)

 

  rest of your code.

 

  });

 

  HTH

  Alex Mcauleyhttp://www.thevacancymarket.com

 

  - Original Message -

  From: Yan Kovyakh maybe...@gmail.com

  To: prototype-scriptaculous@googlegroups.com

  Sent: Tuesday, July 21, 2009 4:26 PM

  Subject: [Proto-Scripty] Delete php

 

   Maybe there's something completely other that causes this problem,
if

   someone look at it  http://pastie.org/553229

 

   Already been tried !!!

 

   - Original Message -

   From: Walter Lee Davis wa...@wdstudio.com

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 4:14 PM

   Subject: [Proto-Scripty] Re: Delete php

 

Try this:

 

$('clones').observe('click',function(evt){

var elm = evt.element();

if(elm.id){

//your code goes here

}

});

 

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] Delete php

2009-07-21 Thread Yan Kovyakh
Great, now it finds the correct ID, and sends a post of clone ID but the
rest of the code seems not working:

 

new Ajax.Request('remove_clone.php',{

  parameters:{clone:the_id},

  onSuccess:function(transport){

elm.up('li').remove();

pollSortable.defer();

 }

 });

   });  

});

 

The last 2 lines of the code doesn't work, it's not removing the li anymore.


 

 

 $$('#clones li').invoke('observe','click',function(event) {

   var elm=this;

   if (elm.hasClassName('remove')){ // this was unclosed

 

 Event.stop(event);

 } // now closed properly

   var the_id = elm.id.split('_').last();

alert(the_id);  // remove this to make it work

  return; // remove this to make it work

 new Ajax.Request('remove_clone.php',{

   parameters:{clone:the_id},

   onSuccess:function(transport){

 elm.up('li').remove();

 pollSortable.defer();

   }

 });

  });

 

 That works because i just tested it, it alerts 1234 for the follwing html

 and 4567 for the second list element.

 

 See the comments in the code to make it work for you.

 

 ul id=clones

 li id=foo_1234ID = foo_1234/li

  li id=foo_4567ID = foo_4567 /li

   /ul

 

 Alex Mcauleyhttp://www.thevacancymarket.com

 

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 5:17 PM

 Subject: [Proto-Scripty] Delete php

 

  Says nothing, it's unclick-able now.

 

 and firebug says ?

 

 you have an undefined error in there for a start with evt.stop();

 

 Alex Mcauley

 http://www.thevacancymarket.com

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 5:04 PM

 Subject: [Proto-Scripty] Delete php

 

  Both of the solutions causes script not to work at all, just to make 

  sure  I'm connecting all right.

 http://jsbin.com/igixe/edit

 

  Okay.

 

  Your script is listening to the ul list with ID of clones so you

  will

  never get an element id that is not clones because it is 

 listening on  the

  ul

 

  event.element() should track it but its not working...

 

  solution 1. use this insetad

  $('clones').observe('click',function(event){

  var elm=Event.element(event);Rest of your code

 

  Solution 2.

 

  Listen to each li inside the ul for the click like the following

 

  $$('#clones li').invoke('observe','click',function(event) {

 

  var elm=this; // this will now be the element (this.id will be its ID)

 

  rest of your code.

 

  });

 

  HTH

  Alex Mcauleyhttp://www.thevacancymarket.com

 

  - Original Message -

  From: Yan Kovyakh maybe...@gmail.com

  To: prototype-scriptaculous@googlegroups.com

  Sent: Tuesday, July 21, 2009 4:26 PM

  Subject: [Proto-Scripty] Delete php

 

   Maybe there's something completely other that causes this problem

  , if   someone look at it  http://pastie.org/553229

 

   Already been tried !!!

 

   - Original Message -

   From: Walter Lee Davis wa...@wdstudio.com

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 4:14 PM

   Subject: [Proto-Scripty] Re: Delete php

 

Try this:

 

$('clones').observe('click',function(evt){

var elm = evt.element();

if(elm.id){

//your code goes here

}

});

 

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: Delete php

2009-07-21 Thread Walter Lee Davis

Put an alert in there, or a console.log, and see if your Ajax.Request  
is even returning success. If it doesn't, you will never see anything  
happen to that list item.

Walter

On Jul 21, 2009, at 1:47 PM, Yan Kovyakh wrote:

 Great, now it finds the correct ID, and sends a post of “clone ID”  
 but the rest of the code seems not working:

 new Ajax.Request('remove_clone.php',{
   parameters:{clone:the_id},
   onSuccess:function(transport){
 elm.up('li').remove();
 pollSortable.defer();
  }
  });
});
 });

 The last 2 lines of the code doesn’t work, it’s not removing the li  
 anymore.


  $$('#clones li').invoke('observe','click',function(event) {
var elm=this;
if (elm.hasClassName('remove')){ // this was unclosed
 
  Event.stop(event);
  } // now closed properly
var the_id = elm.id.split('_').last();
 alert(the_id);  // remove this to make it work
   return; // remove this to make it work
  new Ajax.Request('remove_clone.php',{
parameters:{clone:the_id},
onSuccess:function(transport){
  elm.up('li').remove();
  pollSortable.defer();
}
  });
   });
 
  That works because i just tested it, it alerts 1234 for the  
 follwing html
  and 4567 for the second list element.
 
  See the comments in the code to make it work for you.
 
  ul id=clones
  li id=foo_1234ID = foo_1234/li
   li id=foo_4567ID = foo_4567 /li
/ul
 
  Alex Mcauleyhttp://www.thevacancymarket.com
 
  - Original Message -
  From: Yan Kovyakh maybe...@gmail.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Tuesday, July 21, 2009 5:17 PM
  Subject: [Proto-Scripty] Delete php
 
   Says nothing, it's unclick-able now.
 
  and firebug says ?
 
  you have an undefined error in there for a start with evt.stop();
 
  Alex Mcauley
  http://www.thevacancymarket.com
  - Original Message -
  From: Yan Kovyakh maybe...@gmail.com
  To: prototype-scriptaculous@googlegroups.com
  Sent: Tuesday, July 21, 2009 5:04 PM
  Subject: [Proto-Scripty] Delete php
 
   Both of the solutions causes script not to work at all, just to  
 make
   sure  I'm connecting all right.
  http://jsbin.com/igixe/edit
 
   Okay.
 
   Your script is listening to the ul list with ID of clones  
 so you
   will
   never get an element id that is not clones because it is
  listening on  the
   ul
 
   event.element() should track it but its not working...
 
   solution 1. use this insetad
   $('clones').observe('click',function(event){
   var elm=Event.element(event);Rest of your code
 
   Solution 2.
 
   Listen to each li inside the ul for the click like the  
 following
 
   $$('#clones li').invoke('observe','click',function(event) {
 
   var elm=this; // this will now be the element (this.id will be  
 its ID)
 
   rest of your code.
 
   });
 
   HTH
   Alex Mcauleyhttp://www.thevacancymarket.com
 
   - Original Message -
   From: Yan Kovyakh maybe...@gmail.com
   To: prototype-scriptaculous@googlegroups.com
   Sent: Tuesday, July 21, 2009 4:26 PM
   Subject: [Proto-Scripty] Delete php
 
Maybe there's something completely other that causes this  
 problem
   , if   someone look at it  http://pastie.org/553229
 
Already been tried !!!
 
- Original Message -
From: Walter Lee Davis wa...@wdstudio.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 4:14 PM
Subject: [Proto-Scripty] Re: Delete php
 
 Try this:
 
 $('clones').observe('click',function(evt){
 var elm = evt.element();
 if(elm.id){
 //your code goes here
 }
 });
 
 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] Delete php

2009-07-21 Thread Yan Kovyakh
Alert works up to the last 2 lines, up to the elm.up('li').remove();

 

 Put an alert in there, or a console.log, and see if your Ajax.Request  

 is even returning success. If it doesn't, you will never see anything  

 happen to that list item.

 

 Walter

 

 On Jul 21, 2009, at 1:47 PM, Yan Kovyakh wrote:

 

  Great, now it finds the correct ID, and sends a post of clone ID  

  but the rest of the code seems not working:

 

  new Ajax.Request('remove_clone.php',{

parameters:{clone:the_id},

onSuccess:function(transport){

  elm.up('li').remove();

  pollSortable.defer();

   }

   });

 });

  });

 

  The last 2 lines of the code doesn't work, it's not removing the li  

  anymore.

 

   $$('#clones li').invoke('observe','click',function(event) {

 var elm=this;

 if (elm.hasClassName('remove')){ // this was unclosed

 

   Event.stop(event);

   } // now closed properly

 var the_id = elm.id.split('_').last();

  alert(the_id);  // remove this to make it work

return; // remove this to make it work

   new Ajax.Request('remove_clone.php',{

 parameters:{clone:the_id},

 onSuccess:function(transport){

   elm.up('li').remove();

   pollSortable.defer();

 }

   });

});

 

   That works because i just tested it, it alerts 1234 for the  

  follwing html

   and 4567 for the second list element.

 

   See the comments in the code to make it work for you.

 

   ul id=clones

   li id=foo_1234ID = foo_1234/li

li id=foo_4567ID = foo_4567 /li

 /ul

 

   Alex Mcauleyhttp://www.thevacancymarket.com

 

   - Original Message -

   From: Yan Kovyakh maybe...@gmail.com

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 5:17 PM

   Subject: [Proto-Scripty] Delete php

 

Says nothing, it's unclick-able now.

 

   and firebug says ?

 

   you have an undefined error in there for a start with evt.stop();

 

   Alex Mcauley

   http://www.thevacancymarket.com

   - Original Message -

   From: Yan Kovyakh maybe...@gmail.com

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 5:04 PM

   Subject: [Proto-Scripty] Delete php

 

Both of the solutions causes script not to work at all, just to  

  make

sure  I'm connecting all right.

   http://jsbin.com/igixe/edit

 

Okay.

 

Your script is listening to the ul list with ID of clones  

  so you

will

never get an element id that is not clones because it is

   listening on  the

ul

 

event.element() should track it but its not working...

 

solution 1. use this insetad

$('clones').observe('click',function(event){

var elm=Event.element(event);Rest of your code

 

Solution 2.

 

Listen to each li inside the ul for the click like the  

  following

 

$$('#clones li').invoke('observe','click',function(event) {

 

var elm=this; // this will now be the element (this.id will be  

  its ID)

 

rest of your code.

 

});

 

HTH

Alex Mcauleyhttp://www.thevacancymarket.com

 

- Original Message -

From: Yan Kovyakh maybe...@gmail.com

To: prototype-scriptaculous@googlegroups.com

Sent: Tuesday, July 21, 2009 4:26 PM

Subject: [Proto-Scripty] Delete php

 

 Maybe there's something completely other that causes this  

  problem

, if   someone look at it  http://pastie.org/553229

 

 Already been tried !!!

 

 - Original Message -

 From: Walter Lee Davis wa...@wdstudio.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 4:14 PM

 Subject: [Proto-Scripty] Re: Delete php

 

  Try this:

 

  $('clones').observe('click',function(evt){

  var elm = evt.element();

  if(elm.id){

  //your code goes here

  }

  });

 

  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: Delete php

2009-07-21 Thread Alex McAuley

change

elm.up('li').remove();

to
$(this).remove();

and it will remove the element that was clicked

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Walter Lee Davis wa...@wdstudio.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 7:53 PM
Subject: [Proto-Scripty] Re: Delete php



 What does Firebug say your return from Ajax.Request looks like? You
 should be able to see it in the Console tab, you'll see a POST and
 then the response from that.

 Walter

 On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

 Alert works up to the last 2 lines, up to the elm.up('li').remove();

 Try console.log(elm.up('li')) and see what you get in Firebug, that
 should return the HTML for your list item if there is an enclosing LI
 element around elm. If elm is the link (not the li) then you should be
 golden.



 
 


--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh

In the post of remove_clone.php I see clone theIDnumber in response tab
see nothing...

change

elm.up('li').remove();

to
$(this).remove();

and it will remove the element that was clicked

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Walter Lee Davis wa...@wdstudio.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 7:53 PM
Subject: [Proto-Scripty] Re: Delete php



 What does Firebug say your return from Ajax.Request looks like? You
 should be able to see it in the Console tab, you'll see a POST and
 then the response from that.

 Walter

 On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

 Alert works up to the last 2 lines, up to the elm.up('li').remove();

 Try console.log(elm.up('li')) and see what you get in Firebug, that
 should return the HTML for your list item if there is an enclosing LI
 element around elm. If elm is the link (not the li) then you should be
 golden.



 
 





--~--~-~--~~~---~--~~
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: Delete php

2009-07-21 Thread Walter Lee Davis

Do you actually see the real ID number, or do you see 'theIDnumber'?

Can you turn on error reporting in your remove_clone.php?

ini_set('display_errors',1);
error_reporting(E_ALL);

As close to the top of the PHP script as you can get it.

Walter

On Jul 21, 2009, at 2:58 PM, Yan Kovyakh wrote:


 In the post of remove_clone.php I see clone theIDnumber in  
 response tab
 see nothing...

 change

 elm.up('li').remove();

 to
 $(this).remove();

 and it will remove the element that was clicked

 Alex Mcauley
 http://www.thevacancymarket.com
 - Original Message -
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 7:53 PM
 Subject: [Proto-Scripty] Re: Delete php



 What does Firebug say your return from Ajax.Request looks like? You
 should be able to see it in the Console tab, you'll see a POST and
 then the response from that.

 Walter

 On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

 Alert works up to the last 2 lines, up to the elm.up('li').remove();

 Try console.log(elm.up('li')) and see what you get in Firebug, that
 should return the HTML for your list item if there is an enclosing LI
 element around elm. If elm is the link (not the li) then you should  
 be
 golden.










 


--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh

I do see the real ID of an item, no errors, nothing changed since adding the
code you've gave. And again in the firebug XHR tab for the POST
remove_clone.php in the tab Post I see clone theRealID without  of
course. Nothing in HTML or Response tabs.


Do you actually see the real ID number, or do you see 'theIDnumber'?

Can you turn on error reporting in your remove_clone.php?

ini_set('display_errors',1);
error_reporting(E_ALL);

As close to the top of the PHP script as you can get it.

Walter

On Jul 21, 2009, at 2:58 PM, Yan Kovyakh wrote:


 In the post of remove_clone.php I see clone theIDnumber in response 
 tab see nothing...

 change

 elm.up('li').remove();

 to
 $(this).remove();

 and it will remove the element that was clicked

 Alex Mcauley
 http://www.thevacancymarket.com
 - Original Message -
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 7:53 PM
 Subject: [Proto-Scripty] Re: Delete php



 What does Firebug say your return from Ajax.Request looks like? You 
 should be able to see it in the Console tab, you'll see a POST and 
 then the response from that.

 Walter

 On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

 Alert works up to the last 2 lines, up to the elm.up('li').remove();

 Try console.log(elm.up('li')) and see what you get in Firebug, that 
 should return the HTML for your list item if there is an enclosing LI 
 element around elm. If elm is the link (not the li) then you should 
 be golden.










 





--~--~-~--~~~---~--~~
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: Delete php

2009-07-21 Thread Walter Lee Davis

Can you make a regular POST to the delete script (using a test form)  
and see if it responds in any way? I remain convinced that your  
problem is in that script, nowhere else.

Walter

On Jul 21, 2009, at 4:01 PM, Yan Kovyakh wrote:


 I do see the real ID of an item, no errors, nothing changed since  
 adding the
 code you've gave. And again in the firebug XHR tab for the POST
 remove_clone.php in the tab Post I see clone theRealID without  of
 course. Nothing in HTML or Response tabs.


 Do you actually see the real ID number, or do you see 'theIDnumber'?

 Can you turn on error reporting in your remove_clone.php?

 ini_set('display_errors',1);
 error_reporting(E_ALL);

 As close to the top of the PHP script as you can get it.

 Walter

 On Jul 21, 2009, at 2:58 PM, Yan Kovyakh wrote:


 In the post of remove_clone.php I see clone theIDnumber in response
 tab see nothing...

 change

 elm.up('li').remove();

 to
 $(this).remove();

 and it will remove the element that was clicked

 Alex Mcauley
 http://www.thevacancymarket.com
 - Original Message -
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 7:53 PM
 Subject: [Proto-Scripty] Re: Delete php



 What does Firebug say your return from Ajax.Request looks like? You
 should be able to see it in the Console tab, you'll see a POST and
 then the response from that.

 Walter

 On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

 Alert works up to the last 2 lines, up to the  
 elm.up('li').remove();

 Try console.log(elm.up('li')) and see what you get in Firebug, that
 should return the HTML for your list item if there is an enclosing  
 LI
 element around elm. If elm is the link (not the li) then you should
 be golden.
















 


--~--~-~--~~~---~--~~
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 for performantly creating tooltips

2009-07-21 Thread Diodeus

Performantly isn't a word.

On Jul 21, 10:31 am, Chris c...@clicksports.de wrote:
 Hi all,

 one of our clients has a very javascript heavy application for local
 intranets. On many pages of this application, there are tooltips that
 get loaded (usually up to 60 or 70), which make the application behave
 very slowly at some time or another (at least in good ole IE6, which
 we need to support). Currently we are using Prototip2 from nick
 stackenburg, but it seems that this seems overkill and isnt so
 performant at all.

 So, I want to start to build my own tooltip-functionality, which
 should be lightweight and does not need thousands of listeners, which
 also seems to make pages very slow.

 My question is: What is the best approach for this task? I am
 currently experimenting with event-bubbeling to only use one listener
 on this page, so I can create as many tooltips as i want without
 raising memory too much.

 This is what I have come up with in the last 20 minutes or so:

 /**
  * Creat tooltips for an array of objects
  * @param {Object} classes Classname of elements where the tooltips
 should be shown on
  * @param {Object} content_attribute The dom attribute of the element
 we should get the content from
  */
 var tt = Class.create({

         initialize: function(classes, content_attribute) {

                 this.classes = classes;
                 this.content_attribute = content_attribute;

                 this.initListeners();
         },

         /**
          * Initialize the global listener
          */
         initListeners: function() {

                 document.observe('mouseover', 
 this.moverListener.bindAsEventListener
 (this));
                 document.observe('mouseout', 
 this.moutListener.bindAsEventListener
 (this));
         },

         moverListener: function(e) {

                 elm = Event.findElement(e, '.' + this.classes);

                 if(elm !== undefined) {

                         this.showToolTip(elm)
                 } else return;
         },

         moutListener: function(e) {

                 elm = Event.findElement(e, '.' + this.classes);
                 if(elm !== undefined) {

                         this.hideTooltip(elm);
                 }
         },

         showToolTip: function(elm) {

                 console.log(elm + ' is shown')
         },

         hideTooltip: function(elm) {

                 console.log(elm + ' is hidden')
         }

 };

 As I am quite experienced in prototype.js (well, at least I think I
 am...), but not in such things like performance tuning javascript and
 such stuff, I really would love to hear some feedback from you. Are
 there any other performance problems that this type of listener would
 force me in (dont know how fast findElement() is compared to a direct
 binding to the source element of a listener). do you think that this
 is maybe the wrong approach at all?

 The tooltips should go without great graphical stuff, the only thing I
 want to add are pointers in pure css, like those seen 
 onhttp://www.filamentgroup.com/lab/image_free_css_tooltip_pointers_a_us...,
 to save some more bandswidth.

 Thanks in advance,
 Chris
--~--~-~--~~~---~--~~
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 for performantly creating tooltips

2009-07-21 Thread Alex McAuley

Good thing he said performant then init !! :P


Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Diodeus diod...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 10:00 PM
Subject: [Proto-Scripty] Re: Need help for performantly creating tooltips



Performantly isn't a word.

On Jul 21, 10:31 am, Chris c...@clicksports.de wrote:
 Hi all,

 one of our clients has a very javascript heavy application for local
 intranets. On many pages of this application, there are tooltips that
 get loaded (usually up to 60 or 70), which make the application behave
 very slowly at some time or another (at least in good ole IE6, which
 we need to support). Currently we are using Prototip2 from nick
 stackenburg, but it seems that this seems overkill and isnt so
 performant at all.

 So, I want to start to build my own tooltip-functionality, which
 should be lightweight and does not need thousands of listeners, which
 also seems to make pages very slow.

 My question is: What is the best approach for this task? I am
 currently experimenting with event-bubbeling to only use one listener
 on this page, so I can create as many tooltips as i want without
 raising memory too much.

 This is what I have come up with in the last 20 minutes or so:

 /**
 * Creat tooltips for an array of objects
 * @param {Object} classes Classname of elements where the tooltips
 should be shown on
 * @param {Object} content_attribute The dom attribute of the element
 we should get the content from
 */
 var tt = Class.create({

 initialize: function(classes, content_attribute) {

 this.classes = classes;
 this.content_attribute = content_attribute;

 this.initListeners();
 },

 /**
 * Initialize the global listener
 */
 initListeners: function() {

 document.observe('mouseover', this.moverListener.bindAsEventListener
 (this));
 document.observe('mouseout', this.moutListener.bindAsEventListener
 (this));
 },

 moverListener: function(e) {

 elm = Event.findElement(e, '.' + this.classes);

 if(elm !== undefined) {

 this.showToolTip(elm)
 } else return;
 },

 moutListener: function(e) {

 elm = Event.findElement(e, '.' + this.classes);
 if(elm !== undefined) {

 this.hideTooltip(elm);
 }
 },

 showToolTip: function(elm) {

 console.log(elm + ' is shown')
 },

 hideTooltip: function(elm) {

 console.log(elm + ' is hidden')
 }

 };

 As I am quite experienced in prototype.js (well, at least I think I
 am...), but not in such things like performance tuning javascript and
 such stuff, I really would love to hear some feedback from you. Are
 there any other performance problems that this type of listener would
 force me in (dont know how fast findElement() is compared to a direct
 binding to the source element of a listener). do you think that this
 is maybe the wrong approach at all?

 The tooltips should go without great graphical stuff, the only thing I
 want to add are pointers in pure css, like those seen 
 onhttp://www.filamentgroup.com/lab/image_free_css_tooltip_pointers_a_us...,
 to save some more bandswidth.

 Thanks in advance,
 Chris



--~--~-~--~~~---~--~~
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 for performantly creating tooltips

2009-07-21 Thread Richard Quadling

2009/7/21 Alex McAuley webmas...@thecarmarketplace.com:

 Good thing he said performant then init !! :P



And even then it is a neologism and proscribed [1].

[1] http://en.wiktionary.org/wiki/performant

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

--~--~-~--~~~---~--~~
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: Delete php

2009-07-21 Thread Alex McAuley
its $_POST['clone']

not $_POST['the_id']

thats why !!
Alex Mcauley
http://www.thevacancymarket.com
  - Original Message - 
  From: Yan Kovyakh 
  To: prototype-scriptaculous@googlegroups.com 
  Sent: Tuesday, July 21, 2009 10:22 PM
  Subject: [Proto-Scripty] Delete php


  I don't know whether I'll be able to find a problem as I'm not that good in 
Javascript, but just to be on the safe side. 

  Here's again the script: http://pastie.org/554101

  And the remove_clone: http://pastie.org/554099

  Thanks,

   

   Can you make a regular POST to the delete script (using a test form)  

   and see if it responds in any way? I remain convinced that your  

   problem is in that script, nowhere else.

   

   Walter

   

   On Jul 21, 2009, at 4:01 PM, Yan Kovyakh wrote:

   

   

   

I do see the real ID of an item, no errors, nothing changed since  

adding the

code you've gave. And again in the firebug XHR tab for the POST

remove_clone.php in the tab Post I see clone theRealID without  of

course. Nothing in HTML or Response tabs.

   

Do you actually see the real ID number, or do you see 'theIDnumber'?

   

Can you turn on error reporting in your remove_clone.php?

   

ini_set('display_errors',1);

error_reporting(E_ALL);

   

As close to the top of the PHP script as you can get it.

   

Walter

   

On Jul 21, 2009, at 2:58 PM, Yan Kovyakh wrote:

   

In the post of remove_clone.php I see clone theIDnumber in response

tab see nothing...

   

change

   

elm.up('li').remove();

   

to

$(this).remove();

   

and it will remove the element that was clicked

   

Alex Mcauley

   http://www.thevacancymarket.com

- Original Message -

From: Walter Lee Davis wa...@wdstudio.com

To: prototype-scriptaculous@googlegroups.com

Sent: Tuesday, July 21, 2009 7:53 PM

Subject: [Proto-Scripty] Re: Delete php

   

What does Firebug say your return from Ajax.Request looks like? You

should be able to see it in the Console tab, you'll see a POST and

then the response from that.

   

Walter

   

On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

   

Alert works up to the last 2 lines, up to the  

elm.up('li').remove();

   

Try console.log(elm.up('li')) and see what you get in Firebug, that

should return the HTML for your list item if there is an enclosing  

LI

element around elm. If elm is the link (not the li) then you should

be golden.


  

--~--~-~--~~~---~--~~
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 for performantly creating tooltips

2009-07-21 Thread Chris

Well, at all I thought I would get some help and not taunts for my
english (I am not a native speaker, but I think it should be clear
what I mean).

Greetings from Germany,
Chris
--~--~-~--~~~---~--~~
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] Delete php

2009-07-21 Thread Yan Kovyakh
WOW Great! Though it's still aren't removing the link dynamically:
elm.up('li').remove(); neither by: $(this).remove();

Thanks for the amazing support so far!

 

 its $_POST['clone']

 

 not $_POST['the_id']

 

 thats why !!

 Alex Mcauleyhttp://www.thevacancymarket.com

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 10:22 PM

   Subject: [Proto-Scripty] Delete php

 

   I don't know whether I'll be able to find a problem as I'm not that good
in Javascript, but just to be on the safe side.

 

   Here's again the script:http://pastie.org/554101

 

   And the remove_clone:http://pastie.org/554099

 

   Thanks,

 

Can you make a regular POST to the delete script (using a test form)  

 

and see if it responds in any way? I remain convinced that your  

 

problem is in that script, nowhere else.

 

Walter

 

On Jul 21, 2009, at 4:01 PM, Yan Kovyakh wrote:

 

 I do see the real ID of an item, no errors, nothing changed since  

 

 adding the

 

 code you've gave. And again in the firebug XHR tab for the POST

 

 remove_clone.php in the tab Post I see clone theRealID without 
of

 

 course. Nothing in HTML or Response tabs.

 

 Do you actually see the real ID number, or do you see
'theIDnumber'?

 

 Can you turn on error reporting in your remove_clone.php?

 

 ini_set('display_errors',1);

 

 error_reporting(E_ALL);

 

 As close to the top of the PHP script as you can get it.

 

 Walter

 

 On Jul 21, 2009, at 2:58 PM, Yan Kovyakh wrote:

 

 In the post of remove_clone.php I see clone theIDnumber in
response

 

 tab see nothing...

 

 change

 

 elm.up('li').remove();

 

 to

 

 $(this).remove();

 

 and it will remove the element that was clicked

 

 Alex Mcauley

 

http://www.thevacancymarket.com

 

 - Original Message -

 

 From: Walter Lee Davis wa...@wdstudio.com

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Tuesday, July 21, 2009 7:53 PM

 

 Subject: [Proto-Scripty] Re: Delete php

 

 What does Firebug say your return from Ajax.Request looks like?
You

 

 should be able to see it in the Console tab, you'll see a POST and

 

 then the response from that.

 

 Walter

 

 On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

 

 Alert works up to the last 2 lines, up to the  

 

 elm.up('li').remove();

 

 Try console.log(elm.up('li')) and see what you get in Firebug,
that

 

 should return the HTML for your list item if there is an enclosing


 

 LI

 

 element around elm. If elm is the link (not the li) then you
should

 

 be golden.


--~--~-~--~~~---~--~~
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: Parsing XML

2009-07-21 Thread ferion

Olla,

is there nobody out there who is able to help me out?
If i'm posting in the wrong forum or if my question is stupid like
shooting in your own foot, please tell this to me.

I'm realy clueless.

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