[Proto-Scripty] Re: selectors failing in IE8FF3

2009-07-24 Thread Daniel Rubin

ColinFine wrote:
 On Jul 21, 1:52 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
 Each to their own, everyone has their own coding practices and concepts.

 Indeed. I'm not about to start using '.' or ':' in ID's myself.
Well...  You have no idea how grateful I am you guys discussed this
problem right now.  Yes, I do have dots in some of my ids because it's
the way the corresponding objects are being referenced at the server
backend, so it just seemed sooo convenient.  Me, a case for a
psychiatrist, out of laziness? Maybe... ;-)

I made the switch from Prototype 1.6.0.2 to 1.6.0.3 and a few down()
calls stopped working for no obvious reasons.  And it turned out to be
just the problem you were discussing here.  Would have taken me ages to
track it down by myself.

I just wanted to let you know, and to say thank you.  Hope you don't mind.

Have fun
Daniel



 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).
 
 I think this is a perverse argument, but I'm not going to get excited
 about it.
 
 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!!!

 I think, as Rick implied above, that the designers of CSS selectors
 were ill-advised to use symbols which were permitted in id's (I'm
 assuming that the HTML spec came before the CSS one, but I haven't
 checked). But formally, there are no contexts in which these are
 ambiguous.
 
 But I think it would be wrong for JS libraries to refuse to work just
 because you had made certain (valid) choices in your HTML.
 (OTOH I wish that browsers and libraries would object to a very common
 instance of invalid HTML: duplicate id's)


--~--~-~--~~~---~--~~
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-24 Thread Mona Remlawi

most welcome, glad to know that someone else out there is using dots in ids ;-)

cheers

--
mona

On Fri, Jul 24, 2009 at 11:20 AM, Daniel Rubindru...@dimedis.de wrote:

 ColinFine wrote:
 On Jul 21, 1:52 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
 Each to their own, everyone has their own coding practices and concepts.

 Indeed. I'm not about to start using '.' or ':' in ID's myself.
 Well...  You have no idea how grateful I am you guys discussed this
 problem right now.  Yes, I do have dots in some of my ids because it's
 the way the corresponding objects are being referenced at the server
 backend, so it just seemed sooo convenient.  Me, a case for a
 psychiatrist, out of laziness? Maybe... ;-)

 I made the switch from Prototype 1.6.0.2 to 1.6.0.3 and a few down()
 calls stopped working for no obvious reasons.  And it turned out to be
 just the problem you were discussing here.  Would have taken me ages to
 track it down by myself.

 I just wanted to let you know, and to say thank you.  Hope you don't mind.

 Have fun
 Daniel



 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).

 I think this is a perverse argument, but I'm not going to get excited
 about it.

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

 I think, as Rick implied above, that the designers of CSS selectors
 were ill-advised to use symbols which were permitted in id's (I'm
 assuming that the HTML spec came before the CSS one, but I haven't
 checked). But formally, there are no contexts in which these are
 ambiguous.

 But I think it would be wrong for JS libraries to refuse to work just
 because you had made certain (valid) choices in your HTML.
 (OTOH I wish that browsers and libraries would object to a very common
 instance of invalid HTML: duplicate id's)


 


--~--~-~--~~~---~--~~
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: Masked Input in Prototype

2009-07-24 Thread Richard Quadling

2009/7/23 Matt Foster mattfoste...@gmail.com:

 You must further define your idea of masked input

 http://www.google.com/search?q=define%3A+masked+inputie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a

 On Jul 23, 3:58 pm, Celso cels...@gmail.com wrote:
 Anyone know a masked input in prototype?

 Thanks,
 Celso.
 


An input mask [1] is where you can say enter text in a form like ...

AA nn nn nn A

You would be able to type 2 letters, 6 numbers and then 1 letter. The
case would be forced to upper case and the spacing would be automatic.

BO 52 91 91 V

for example


OR

Are you talking about hiding the input? Like input type=password ?

Regards,

Richard.

[1] http://www.google.co.uk/search?q=define:+input+mask

-- 
-
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: IE8 invalid argument line 4501

2009-07-24 Thread ColinFine



On Jul 23, 12:28 pm, Jeff jtaylor...@gmail.com wrote:
 We've having this exact error with IE8 and it's always related to
 developers using element IDs that begin with non-Alpha characters.
 Doing something like adding and underscore to the id fixes the
 problem.


Note that an underscore is not a permissible first character of an ID
in the HTML spec etiher. An ID must begin with a letter.


--~--~-~--~~~---~--~~
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: get controls array

2009-07-24 Thread ColinFine



On Jul 24, 1:02 am, diegoturriaga diegoturri...@gmail.com wrote:
 Well... first that all thanks for your reply!

 I'm trying to use a multidemensional javascript array... various
 arrays of input controls of type checkbox

 I have 10 controls with name myarray[1][]
 other 10 controls with name myarray[2][]
 other 10 controls with name myarray[3][]
 ...
 other 10 controls with name myarray[n][]

 And I need get al controls named iqual in an array var... something
 like:

 var aux = document.getElemntsByName('myarray[1][]`);

 but using prototype sintax... :)

I'm not sure if you are under a misapprehension.

The value of a 'NAME' property in HTML is a CDATA - a string of text.
It has no structure.
You are free to call an input opt[0][] but that is a text string,
not any kind of an array in any language.
(PHP kindly treats inputs with [] in their names specially, but that
is the server-side program, not anything to do with the page or
javascript: I don't know whether any other server-side languages do
this).

So if you want to use prototype (or any other javascript) to
manipulate these names, you must treat them as text: match them as
text, perhaps even 'eval' them. But they are not arrays in any way.

As Matt says, the nearest you can get to this in Prototype is by using
the =~ match in a CSS selector, but that will not necessarily do what
you need. Otherwise you will have to do basic Javascript text
matching, or use the suggestions others have made.


(It may be that you already understand the point I am making, in which
case, my apologies).

--~--~-~--~~~---~--~~
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] Which parameters are affected by Effect.Move()

2009-07-24 Thread tej

Hi,

I have a project where I have 3 DIVs one on top of another and I have
3 anchors to show the contents of each DIV.
if I click show 1 then divs 2 and 3 move to show div 1's content

now if i click show 2 divs 2 and 3 move back to original position
and followed by moving div 3 to show div2 content

in order to do this i need to know the current x and y values of div2
to move back to its original value.

or is there any way to do this??

i have used getDimentions and getStyles() but those values remain the
same as i defined in the beginning..
If so.. what values of the element are changed when i use effect.Move
();

any help is appreciated
thanks in advance
ravi



--~--~-~--~~~---~--~~
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] drag between sortables - how to pass sortable id to db

2009-07-24 Thread johnb

I have a small app using sortables where you can re-order within them
but also drag them between different sortables, saving both position
within and which sortable they are in to a db.

My problem: getting the order within each sortable is passing ok but I
can't find the way to get the id of the sortable to pass.

For example, the sortable is created as so:
script type=text/javascript
// ![CDATA[
Sortable.create('group_1',{tag:'div',dropOnEmpty: true, containment:
sections,only:'lineitem',onUpdate:updateList});
Sortable.create('group_'2',{tag:'div',dropOnEmpty: true, containment:
sections,only:'lineitem',onUpdate:updateList});
Sortable.create('page',
{tag:'div',only:'section'||'mainsection',handle:'handle'});
// ]]
 /script

Then when drag/drop the JS is activated:
function updateList(container) {
var url = 'ajax.php';
var params = Sortable.serialize(container.id)
var ajax = new Ajax.Request(url,{
method: 'post',
parameters: params,
});
}

This calls the Ajax which uses:
$demo-updateList($_POST['group_1']);

This passes all the group1[]=1 info ok. I just can't figure out how to
have that Ajax use something like $demo-updateList($_POST
[$x_groupvariable]); since I can't figure out how to assign the id of
the sortable. Any help would be supremely appreciated.

John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: compatibility prototype_scriptaculos et mootools

2009-07-24 Thread Richard Quadling

2009/7/23 lvdesign mail...@lvdesign.com.fr:

 Thanks for the messsage and you know what?  i am very happy to know
 that! (sic)


 but where i can find an clever library with sound.js? i must created
 it?

 bye, bye and merci encore.

 On Jul 23, 8:29 pm, Tobie Langel tobie.lan...@gmail.com wrote:
 Hi.

 Mootools and Prototype are unfortunately totally incompatible.

 You'll have to choose one or the other.

 Best,

 Tobie

 On Jul 23, 6:10 pm, lvdesign mail...@lvdesign.com.fr wrote:



  Hi, i am new french member. So i hope you could understand my
  question.

  I use several .js library for a site's development and i have a
  conflict between prototype and mootools.

  I resolve the problem with Jquery and proto like that:

  //--pour jQuery
  jQuery(function($) {
  //functionDoSomething

  });

  jQuery.noConflict()
  jQuery(document).ready(function ($) {
   $('.functionDoSomething').functionDoSomething();

  });

  //

  I would like only use sound.js of prototype. [ Not another library
  propose this fonctionality(?)]

  How can i do to resolve the $ conflict ?

  thanks a lot for the answer

  Merci d'avance pour une réponse
 


I use the SoundManager [1]

Doesn't require prototype.

[1] http://www.schillmania.com/projects/soundmanager2/

-- 
-
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: drag between sortables - how to pass sortable id to db

2009-07-24 Thread DJ Mangus
you could probably just add the id to the params object directly before you
pass it to the Ajax.Request

On Thu, Jul 23, 2009 at 12:13 PM, johnb jbcen...@gmail.com wrote:


 I have a small app using sortables where you can re-order within them
 but also drag them between different sortables, saving both position
 within and which sortable they are in to a db.

 My problem: getting the order within each sortable is passing ok but I
 can't find the way to get the id of the sortable to pass.

 For example, the sortable is created as so:
 script type=text/javascript
// ![CDATA[
Sortable.create('group_1',{tag:'div',dropOnEmpty: true, containment:
 sections,only:'lineitem',onUpdate:updateList});
Sortable.create('group_'2',{tag:'div',dropOnEmpty: true,
 containment:
 sections,only:'lineitem',onUpdate:updateList});
Sortable.create('page',
 {tag:'div',only:'section'||'mainsection',handle:'handle'});
// ]]
  /script

 Then when drag/drop the JS is activated:
function updateList(container) {
var url = 'ajax.php';
var params = Sortable.serialize(container.id)
var ajax = new Ajax.Request(url,{
method: 'post',
parameters: params,
});
}

 This calls the Ajax which uses:
$demo-updateList($_POST['group_1']);

 This passes all the group1[]=1 info ok. I just can't figure out how to
 have that Ajax use something like $demo-updateList($_POST
 [$x_groupvariable]); since I can't figure out how to assign the id of
 the sortable. Any help would be supremely appreciated.

 John

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Which parameters are affected by Effect.Move()

2009-07-24 Thread DJ Mangus

If you know the original values of x and y you shouldn't have to know
the current value to use effect.Move if you use mode: 'absolute'
unless I am misunderstanding what you are trying to do, can you
explain in a little bit more detail?  (an example would be nice)

On Thu, Jul 23, 2009 at 11:20 AM, tej ravi.kavalip...@gmail.com wrote:

 Hi,

 I have a project where I have 3 DIVs one on top of another and I have
 3 anchors to show the contents of each DIV.
 if I click show 1 then divs 2 and 3 move to show div 1's content

 now if i click show 2 divs 2 and 3 move back to original position
 and followed by moving div 3 to show div2 content

 in order to do this i need to know the current x and y values of div2
 to move back to its original value.

 or is there any way to do this??

 i have used getDimentions and getStyles() but those values remain the
 same as i defined in the beginning..
 If so.. what values of the element are changed when i use effect.Move
 ();

 any help is appreciated
 thanks in advance
 ravi



 

--~--~-~--~~~---~--~~
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-24 Thread klochner


What about css tool tips with onmouseover/anchors?

On Jul 23, 12:21 am, Chris c...@clicksports.de wrote:
 Hi all!

 @Trevan:
 Thank you for this information, I am going to look if I need to tweak
 that function or if I leave it alone.

 @Matt:
 As stated in my mail from 22 Jul., 12:07, this is no option for us. I
 am well aware that the title-Attribute exists, but cannot use it for
 the reasons I stated in my last mail.

 I thank you all for your help, I will post my solution when its ready.

--~--~-~--~~~---~--~~
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: compatibility prototype_scriptaculos et mootools

2009-07-24 Thread lvdesign


Thanks Richard for this proposition but i knew it and it's a very good
solution.

But i search a no_flash solution,  only .js and the prototype function
sound is apparently the only one.

Merci, cordialement.


On Jul 24, 3:30 pm, Richard Quadling rquadl...@googlemail.com wrote:
 2009/7/23 lvdesign mail...@lvdesign.com.fr:







  Thanks for the messsage and you know what?  i am very happy to know
  that! (sic)

  but where i can find an clever library with sound.js? i must created
  it?

  bye, bye and merci encore.

  On Jul 23, 8:29 pm, Tobie Langel tobie.lan...@gmail.com wrote:
  Hi.

  Mootools and Prototype are unfortunately totally incompatible.

  You'll have to choose one or the other.

  Best,

  Tobie

  On Jul 23, 6:10 pm, lvdesign mail...@lvdesign.com.fr wrote:

   Hi, i am new french member. So i hope you could understand my
   question.

   I use several .js library for a site's development and i have a
   conflict between prototype and mootools.

   I resolve the problem with Jquery and proto like that:

   //--pour jQuery
   jQuery(function($) {
   //functionDoSomething

   });

   jQuery.noConflict()
   jQuery(document).ready(function ($) {
    $('.functionDoSomething').functionDoSomething();

   });

   //

   I would like only use sound.js of prototype. [ Not another library
   propose this fonctionality(?)]

   How can i do to resolve the $ conflict ?

   thanks a lot for the answer

   Merci d'avance pour une réponse

 I use the SoundManager [1]

 Doesn't require prototype.

 [1]http://www.schillmania.com/projects/soundmanager2/

 --
 -
 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] Is there a standard Ajax Event ?

2009-07-24 Thread Joachim H. Skeie

Hello,

I would like to be able to execute code whenever an ajax event is
triggered. The reason for this, is that I need to know that the DOM is
finished loading when I first execute the code.

I have my code inside the

document.observe('dom:loaded'...

I would also llike to be able to execute some JavaScript code on a
ajax success, something like

document.observe('ajax:success'...

Does anyone know if this is available in Prototype by default ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] IE autocompleter out of place. Firefox works ok.

2009-07-24 Thread ror-dev244

Hi, I'm using prototype 1.6 and scriptaculous 1.8.2 on top of my Ruby
on Rails app.
I'm using Autocompleter.local and it works great for Firefox 3.0.12
but when I use IE8 to
see it, the suggestion box is out of place. See screenshot links below

IE8 (broken)
http://tinypic.com/r/11t51tz/3
ff3 (works)
http://tinypic.com/r/2epn3wm/3

Have you seen this before? The CSS are as follows:
div.auto_complete {
  margin:0px;
  padding:0px;
  width:350px !important ;
  background:#fff;
  border:1px solid #888;
  position:absolute;
}

div.auto_complete ul {
  margin:0px;
  padding:0px;
  list-style-type:none;
}

div.auto_complete ul li.selected {
  background-color:#ffb;
}

div.auto_complete ul li {
  margin:0;
  padding:2px;
  height:32px;
  display:block;
  list-style-type:none;
  cursor:pointer;
}

--~--~-~--~~~---~--~~
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: Is there a standard Ajax Event ?

2009-07-24 Thread T.J. Crowder

Hi,

For Ajax calls *via Prototype*, there's Ajax.Responders[1].  I'm
pretty sure there's no generic event for all direct XHR uses.

[1] http://prototypejs.org/api/ajax/responders

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


On Jul 24, 6:28 pm, Joachim H. Skeie boem...@gmail.com wrote:
 Hello,

 I would like to be able to execute code whenever an ajax event is
 triggered. The reason for this, is that I need to know that the DOM is
 finished loading when I first execute the code.

 I have my code inside the

 document.observe('dom:loaded'...

 I would also llike to be able to execute some JavaScript code on a
 ajax success, something like

 document.observe('ajax:success'...

 Does anyone know if this is available in Prototype by default ?
--~--~-~--~~~---~--~~
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] scriptaculous PHP help

2009-07-24 Thread dmcglone

Hi all,

 I am trying to create a page that reads a directory of images and
displays them with scriptaculous. So far from what I have, the code
does work as far as displaying the directory links but it is only
making the very 1st one active, all the rest of the directory links on
the page work, BUT they are expanding and folding only the first
directory (gemstone).

I hope this was a good explanation. I've posted my code to help make
it as clear as I can.

Here is my code:

?php
echo div id = noWrap;
echo 'div id = img_cursor';


$directories = array('gemstone', 'bella', 'passage', 'sedona',
'deepstar', 'crystalline');

foreach ($directories as $directory){

$mydir2=opendir(images/laminate/Wilsonart_Laminate_Colors/
$directory);

$cats2=array();

echo h2a href=\#\ onclick=\Effect.toggle('d2','BLIND',
{duration: 2.0}); return false;\$directory/h2br //a;


while(($cat2=readdir($mydir2)) !==false){


if ($cat2 != .  $cat2 != ..  strpos(strtolower($cat2),-
thumb.jpg) !== false){
array_push($cats2, $cat2);

echo div id=\d2\ style=\display:none;\;



echo img src='images/laminate/Wilsonart_Laminate_Colors/$directory/
$cat2' onclick='Another_Big_One(this)'/div;

}



}

closedir($mydir2);

}
echo /div;
echo /div;

?

Blessings
David M.

--~--~-~--~~~---~--~~
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: scriptaculous PHP help

2009-07-24 Thread T.J. Crowder

Hi,

 echo h2a href=\#\ onclick=\Effect.toggle('d2','BLIND',
 {duration: 2.0}); return false;\$directory/h2br //a;

I'm not a PHP guy, but surely that ends up outputting HTML that has an
onclick attribute calling Effect.toggle on the literal element ID
d2?  And of course, IDs are unique in a page, so that's only ever
going to affect one element.

If you want to affect other elements, you'll have to give them unique
IDs and make the call use those IDs appropriately.

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


On Jul 24, 7:27 pm, dmcglone d.mcgl...@att.net wrote:
 Hi all,

  I am trying to create a page that reads a directory of images and
 displays them with scriptaculous. So far from what I have, the code
 does work as far as displaying the directory links but it is only
 making the very 1st one active, all the rest of the directory links on
 the page work, BUT they are expanding and folding only the first
 directory (gemstone).

 I hope this was a good explanation. I've posted my code to help make
 it as clear as I can.

 Here is my code:

 ?php
 echo div id = noWrap;
 echo 'div id = img_cursor';

 $directories = array('gemstone', 'bella', 'passage', 'sedona',
 'deepstar', 'crystalline');

 foreach ($directories as $directory){

 $mydir2=opendir(images/laminate/Wilsonart_Laminate_Colors/
 $directory);

 $cats2=array();

 echo h2a href=\#\ onclick=\Effect.toggle('d2','BLIND',
 {duration: 2.0}); return false;\$directory/h2br //a;

 while(($cat2=readdir($mydir2)) !==false){

 if ($cat2 != .  $cat2 != ..  strpos(strtolower($cat2),-
 thumb.jpg) !== false){
 array_push($cats2, $cat2);

 echo div id=\d2\ style=\display:none;\;

 echo img src='images/laminate/Wilsonart_Laminate_Colors/$directory/
 $cat2' onclick='Another_Big_One(this)'/div;

 }
 }

 closedir($mydir2);

 }

 echo /div;
 echo /div;

 ?

 Blessings
 David M.
--~--~-~--~~~---~--~~
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: Is there a standard Ajax Event ?

2009-07-24 Thread Tobie Langel

Not available but planned.

Best,

Tobie

On Jul 25, 1:46 am, T.J. Crowder t...@crowdersoftware.com wrote:
 Hi,

 For Ajax calls *via Prototype*, there's Ajax.Responders[1].  I'm
 pretty sure there's no generic event for all direct XHR uses.

 [1]http://prototypejs.org/api/ajax/responders

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

 On Jul 24, 6:28 pm, Joachim H. Skeie boem...@gmail.com wrote:



  Hello,

  I would like to be able to execute code whenever an ajax event is
  triggered. The reason for this, is that I need to know that the DOM is
  finished loading when I first execute the code.

  I have my code inside the

  document.observe('dom:loaded'...

  I would also llike to be able to execute some JavaScript code on a
  ajax success, something like

  document.observe('ajax:success'...

  Does anyone know if this is available in Prototype by default ?
--~--~-~--~~~---~--~~
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: scriptaculous PHP help

2009-07-24 Thread Rick Waldron
Or output class=some-class in the element tags and observe the whole set
with some event delegation... will keep your markup and JS sep. and clean.



On Fri, Jul 24, 2009 at 7:59 PM, T.J. Crowder t...@crowdersoftware.comwrote:


 Hi,

  echo h2a href=\#\ onclick=\Effect.toggle('d2','BLIND',
  {duration: 2.0}); return false;\$directory/h2br //a;

 I'm not a PHP guy, but surely that ends up outputting HTML that has an
 onclick attribute calling Effect.toggle on the literal element ID
 d2?  And of course, IDs are unique in a page, so that's only ever
 going to affect one element.

 If you want to affect other elements, you'll have to give them unique
 IDs and make the call use those IDs appropriately.

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


 On Jul 24, 7:27 pm, dmcglone d.mcgl...@att.net wrote:
  Hi all,
 
   I am trying to create a page that reads a directory of images and
  displays them with scriptaculous. So far from what I have, the code
  does work as far as displaying the directory links but it is only
  making the very 1st one active, all the rest of the directory links on
  the page work, BUT they are expanding and folding only the first
  directory (gemstone).
 
  I hope this was a good explanation. I've posted my code to help make
  it as clear as I can.
 
  Here is my code:
 
  ?php
  echo div id = noWrap;
  echo 'div id = img_cursor';
 
  $directories = array('gemstone', 'bella', 'passage', 'sedona',
  'deepstar', 'crystalline');
 
  foreach ($directories as $directory){
 
  $mydir2=opendir(images/laminate/Wilsonart_Laminate_Colors/
  $directory);
 
  $cats2=array();
 
  echo h2a href=\#\ onclick=\Effect.toggle('d2','BLIND',
  {duration: 2.0}); return false;\$directory/h2br //a;
 
  while(($cat2=readdir($mydir2)) !==false){
 
  if ($cat2 != .  $cat2 != ..  strpos(strtolower($cat2),-
  thumb.jpg) !== false){
  array_push($cats2, $cat2);
 
  echo div id=\d2\ style=\display:none;\;
 
  echo img src='images/laminate/Wilsonart_Laminate_Colors/$directory/
  $cat2' onclick='Another_Big_One(this)'/div;
 
  }
  }
 
  closedir($mydir2);
 
  }
 
  echo /div;
  echo /div;
 
  ?
 
  Blessings
  David M.
 


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