[Proto-Scripty] Re: When?

2009-02-26 Thread RobG



On Feb 26, 7:28 am, Lox gecka.comp...@gmail.com wrote:
  [...] then prototype is becoming the mature
  and stable platform for standardised/cross platform javascript
  development.

 I understand that, and quite second that, but Peppy or Sizzle are much
 more faster at selecting elements by css selector witch, these days
 where javascript apps a getting bigger, is a must have.

Don't get to wrapped-up in javascript CSS selectors.  Most browsers
have a host getElementsByClassName that has the benefit of being a
live collection (get it once, update the DOM all you like, the
collection is automatically updated for you).  When combined with
getElementById, getElementsByTagName and standard DOM collections, you
can do an awful lot easily and quickly.

Further, complex CSS selectors tie your code to the page layout -
isn't the idea to separate the two?

Lastly, they encourage rubbish like: tagName#someID, which is used in
style rules because it helps the developer, but using it in a script
selector is just plain dumb.

I can understand the use of selectors for prototyping or small things
where speed is irrelevant, but using them as a fundamental strategy to
get large sets of elements doesn't make sense.  Write a function to do
it using standard host methods, it will perform much faster and be
easier to work with.


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



[Proto-Scripty] Slideshow Fader w/Pagination

2009-02-26 Thread Sarah

I'm bashing my head against a brick wall and need some help.
Basically, I'm trying to recreate the Featured Content Slider found at
http://dynamicdrive.com/dynamicindex17/featuredcontentslider.htm
complete with the pagination, but using Prototype/Scriptaculous.

Glider.js (http://www.missingmethod.com/projects/glider.html) but not
the fade effect I need.

This site (http://www.icommunicate.co.uk/articles/all/
simple_slide_show_for_prototype_scriptaculous_38/) has the fade effect
and a counter div that displays 1 of 5 and changes to 2 of 5 as
the slides change, but it has no pagination.

Has anyone adapted either of these (or a new one) to encompass all my
wants/needs?  Or can someone point me in the right direction?

TIA,
Sarah

--~--~-~--~~~---~--~~
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] $() work around for prototype

2009-02-26 Thread Boysenberry Payne

Hello Everyone,

I have a situation where there is a conflict being generated on our  
site between jQuery and Prototype using the $() syntax.
I have already looked over the jQuery workarounds for inter-library  
conflicts.
I was wondering if prototype has any such feature, i.e. a way to  
replace $() with something else that would allow it to play with  
others nicely.

My situation is cause because there is an ad being loaded that uses  
DIGG and jQuery.
I didn't build the ad and would rather just fix my code than to have  
to dig through someone else's.
This mean I also don't have prototype loading before jQuery (as a  
couple of the jQuery solutions suggest.)

(on the right side midway down the page, look for the link add  
newsletter)
Here is an example of the working code:
http://www.chicagotribune.com/travel/
Broken code:
http://www.chicagotribune.com/business/


PS we're in the process of reworking the graphics, so just ignore the  
pixelation...

Thank you,
Boysenberry Payne

--~--~-~--~~~---~--~~
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: Observing events on dynamic content.

2009-02-26 Thread Sidney

I think you have just described the solution to a problem I am
experiencing, but I'm a bit too noob to understand quite to how to
implement it.

A basic eample (I have similar problems elsewhere): I have a div that
gets updated by ajax. The ajax request returns a list of data rows
with a delete button for each row. The oberserve code is also returned
in the response because it knows the id's of the delete buttons.  I
*think* that when the refresh occurs the old observer handlers are
hanging around (memory is rising) and sometimes (perhaps on other
pages) the new content is not active i.e. the returned observers
sometimes don't take effect (that's on another page with buttons and
droppables).

Do you suggest something like: // Hope my rough psuedo code is
understandable
   $$('#divid.del_button').each(removeObserver('click'));
update the div via ajax; (on success {
  $$('#divid.del_button').observe(  function to figure
out which delete button was clicked, work out correct row id, send to
delete action..)

Is this what you mean or have I got it totally wrong? If this is
correct, it looks like an elegent design pattern that would be
resuable:
1.  clear * observers in the div
2. update div. On success {
2.1   add common obervers based on class to the div e.g. $$
('#divname.del_btn), $$('#divname.edit_btn), $$('#divname.view_btn)  }

The 2nd problem that I infered to above, is when my ajax response
returns a droppables div, with code to attach the droppables observer,
sometimes that does not register.  (I say sometimes' because I have
droppables all over the place and haven't figured where this is a
consistent problem; sometimes they alreay exist on a page and other
times they get added and replaced dynamically).

Cheers.


On Feb 25, 8:13 pm, Richard Quadling rquadl...@googlemail.com wrote:
 2009/2/24 david david.brill...@gmail.com:





  Hi,

  Why not relying on event delegation to a parent contener that will not
  be delete or modify ??

  btw, I thing the only problem is an excessive memory consuption. I did
  not say/mean memory leak !!
  There should not have more impact even.

  --
  david

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

  I know that I need to stop observing on elements before I destroy them
  (say they are coming in via an AJAX connection).

  I know one way of handling this is to not actually attach events to
  dynamic content, but to the container and then use the bubbling
  effect.

  With that, the event handler for such a container may have several
  different paths through the code, depending upon the event and the
  element that triggered it.

  I suppose if the generic event handler was nothing more than a switch
  board, then the functions which is attached directly could remain as
  they are.

  Anyone know of anything else I should be aware of with this issue?

  Regards,

  Richard Quadling.

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

 I've put a container around the dynamic elements. This will have all
 the event handlers attached. Most obvious really.

 Thank you.

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

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



[Proto-Scripty] Re: $() work around for prototype

2009-02-26 Thread T.J. Crowder

Hi,

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.

An *ad* is loading jQuery?!  Sorry, isn't that a bit...intrusive of
them?

No, Prototype doesn't have a no conflict mode like jQuery's.  But I'd
say the real conflict is with the ad.  I'd (politely!) tell the
advertiser to rein themselves in.

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


On Feb 25, 10:40 pm, Boysenberry Payne habitatl...@gmail.com wrote:
 Hello Everyone,

 I have a situation where there is a conflict being generated on our  
 site between jQuery and Prototype using the $() syntax.
 I have already looked over the jQuery workarounds for inter-library  
 conflicts.
 I was wondering if prototype has any such feature, i.e. a way to  
 replace $() with something else that would allow it to play with  
 others nicely.

 My situation is cause because there is an ad being loaded that uses  
 DIGG and jQuery.
 I didn't build the ad and would rather just fix my code than to have  
 to dig through someone else's.
 This mean I also don't have prototype loading before jQuery (as a  
 couple of the jQuery solutions suggest.)

 (on the right side midway down the page, look for the link add  
 newsletter)
 Here is an example of the working code:http://www.chicagotribune.com/travel/
 Broken code:http://www.chicagotribune.com/business/

 PS we're in the process of reworking the graphics, so just ignore the  
 pixelation...

 Thank you,
 Boysenberry Payne
--~--~-~--~~~---~--~~
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: $() work around for prototype

2009-02-26 Thread Alex Mcauley

when jQuery is loaded do $jq=jQuery.noConflict();

then $jq becomes jquery


or just use jQuery() instead of $()
- Original Message - 
From: T.J. Crowder t...@crowdersoftware.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Thursday, February 26, 2009 9:50 AM
Subject: [Proto-Scripty] Re: $() work around for prototype



Hi,

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.

An *ad* is loading jQuery?!  Sorry, isn't that a bit...intrusive of
them?

No, Prototype doesn't have a no conflict mode like jQuery's.  But I'd
say the real conflict is with the ad.  I'd (politely!) tell the
advertiser to rein themselves in.

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


On Feb 25, 10:40 pm, Boysenberry Payne habitatl...@gmail.com wrote:
 Hello Everyone,

 I have a situation where there is a conflict being generated on our
 site between jQuery and Prototype using the $() syntax.
 I have already looked over the jQuery workarounds for inter-library
 conflicts.
 I was wondering if prototype has any such feature, i.e. a way to
 replace $() with something else that would allow it to play with
 others nicely.

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.
 I didn't build the ad and would rather just fix my code than to have
 to dig through someone else's.
 This mean I also don't have prototype loading before jQuery (as a
 couple of the jQuery solutions suggest.)

 (on the right side midway down the page, look for the link add
 newsletter)
 Here is an example of the working 
 code:http://www.chicagotribune.com/travel/
 Broken code:http://www.chicagotribune.com/business/

 PS we're in the process of reworking the graphics, so just ignore the
 pixelation...

 Thank you,
 Boysenberry Payne



--~--~-~--~~~---~--~~
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: Observing events on dynamic content.

2009-02-26 Thread Richard Quadling

As I am generating the content, I know my class and IDs that are going
to be present.

See http://pastie.org/400808 and http://pastie.org/400809 for cut down
versions of my code. Don't try to understand the specifics, but look
at the general flow.

Thi


2009/2/26 Sidney aussiealthomp...@gmail.com:

 I think you have just described the solution to a problem I am
 experiencing, but I'm a bit too noob to understand quite to how to
 implement it.

 A basic eample (I have similar problems elsewhere): I have a div that
 gets updated by ajax. The ajax request returns a list of data rows
 with a delete button for each row. The oberserve code is also returned
 in the response because it knows the id's of the delete buttons.  I
 *think* that when the refresh occurs the old observer handlers are
 hanging around (memory is rising) and sometimes (perhaps on other
 pages) the new content is not active i.e. the returned observers
 sometimes don't take effect (that's on another page with buttons and
 droppables).

 Do you suggest something like: // Hope my rough psuedo code is
 understandable
   $$('#divid.del_button').each(removeObserver('click'));
        update the div via ajax; (on success {
              $$('#divid.del_button').observe(  function to figure
 out which delete button was clicked, work out correct row id, send to
 delete action..)

 Is this what you mean or have I got it totally wrong? If this is
 correct, it looks like an elegent design pattern that would be
 resuable:
 1.  clear * observers in the div
 2. update div. On success {
    2.1   add common obervers based on class to the div e.g. $$
 ('#divname.del_btn), $$('#divname.edit_btn), $$('#divname.view_btn)  }

 The 2nd problem that I infered to above, is when my ajax response
 returns a droppables div, with code to attach the droppables observer,
 sometimes that does not register.  (I say sometimes' because I have
 droppables all over the place and haven't figured where this is a
 consistent problem; sometimes they alreay exist on a page and other
 times they get added and replaced dynamically).

 Cheers.


 On Feb 25, 8:13 pm, Richard Quadling rquadl...@googlemail.com wrote:
 2009/2/24 david david.brill...@gmail.com:





  Hi,

  Why not relying on event delegation to a parent contener that will not
  be delete or modify ??

  btw, I thing the only problem is an excessive memory consuption. I did
  not say/mean memory leak !!
  There should not have more impact even.

  --
  david

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

  I know that I need to stop observing on elements before I destroy them
  (say they are coming in via an AJAX connection).

  I know one way of handling this is to not actually attach events to
  dynamic content, but to the container and then use the bubbling
  effect.

  With that, the event handler for such a container may have several
  different paths through the code, depending upon the event and the
  element that triggered it.

  I suppose if the generic event handler was nothing more than a switch
  board, then the functions which is attached directly could remain as
  they are.

  Anyone know of anything else I should be aware of with this issue?

  Regards,

  Richard Quadling.

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

 I've put a container around the dynamic elements. This will have all
 the event handlers attached. Most obvious really.

 Thank you.

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

 




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

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



[Proto-Scripty] Re: Adding Scroll bars to list

2009-02-26 Thread vanq69

Have had a look into this and havent been able to find a suitable
method.

I am aiming for having a space for 12 rows with scrollbars to get to
the rest,
with the top div - addPage and the bottom div - trash being always
visible.

Here is the code im currently trying:

!-- start sidebar2 --
div id=sidebar2 class=sidebar
ul
li id=chunkListModule
h2Chunk List/h2
div id = addPage
h4 align=centerDRAG HERE TO ADD TO PAGE/h4
/div
br /
ul setsize=12 id=chunksList 
class=sortableList
onmouseup=processChunk('chunksList', 'recreateList')
?php
$myChunksList = new 
ChunksList();
echo 
$myChunksList-BuildChunksList();
?
/ul
br /
div id = trash
h4 align=centerDRAG HERE TO 
DELETE/h4
/div
/ul
/div
!-- end sidebar2 --

And here is the relevant parts of the CSS:

/* Sidebar2 CSS */

#sidebar2 {
float: centre;
padding: 20px 20px;
}

#addPage
{
border: 4px solid #ffd90f;
width: 190px;
padding: 10px;
}

ul.sortableList
{
list-style-type: none;
padding: 0px;
margin: 0px;
width: 220px;
}

ul.sortableList li
{
cursor: move;
padding: 2px 2px;
margin: 2px 0px;
border: 1px solid #ffd90f;
background-color: #eee;
}

#trash
{
border: 4px solid #ffd90f;
width: 190px;
padding: 10px;
}


Any thoughts or help would be great :)

Regards


--~--~-~--~~~---~--~~
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: Adding Scroll bars to list

2009-02-26 Thread Alex Mcauley

Firstly in your CSS you have float:centre

There is no float:center as far as i know .. if there were it would be 
center --- american spelling

i also cannot see any Javascript in there to help you with




- Original Message - 
From: vanq69 jaed...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Thursday, February 26, 2009 11:37 AM
Subject: [Proto-Scripty] Re: Adding Scroll bars to list



 Have had a look into this and havent been able to find a suitable
 method.

 I am aiming for having a space for 12 rows with scrollbars to get to
 the rest,
 with the top div - addPage and the bottom div - trash being always
 visible.

 Here is the code im currently trying:

 !-- start sidebar2 --
 div id=sidebar2 class=sidebar
 ul
 li id=chunkListModule
 h2Chunk List/h2
 div id = addPage
 h4 align=centerDRAG HERE TO ADD TO PAGE/h4
 /div
 br /
 ul setsize=12 id=chunksList class=sortableList
 onmouseup=processChunk('chunksList', 'recreateList')
 ?php
 $myChunksList = new ChunksList();
 echo $myChunksList-BuildChunksList();
 ?
 /ul
 br /
 div id = trash
 h4 align=centerDRAG HERE TO DELETE/h4
 /div
 /ul
 /div
 !-- end sidebar2 --

 And here is the relevant parts of the CSS:

 /* Sidebar2 CSS */

 #sidebar2 {
 float: centre;
 padding: 20px 20px;
 }

 #addPage
 {
 border: 4px solid #ffd90f;
 width: 190px;
 padding: 10px;
 }

 ul.sortableList
 {
 list-style-type: none;
 padding: 0px;
 margin: 0px;
 width: 220px;
 }

 ul.sortableList li
 {
 cursor: move;
 padding: 2px 2px;
 margin: 2px 0px;
 border: 1px solid #ffd90f;
 background-color: #eee;
 }

 #trash
 {
 border: 4px solid #ffd90f;
 width: 190px;
 padding: 10px;
 }


 Any thoughts or help would be great :)

 Regards


 
 


--~--~-~--~~~---~--~~
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: $() work around for prototype

2009-02-26 Thread Boysenberry Payne

It's the Digg API that has it built in.

We're contacting them today to see if they have a work around in their  
API.

One would think if the people over at Digg are relying so heavily on  
Jquery they'd think to make it global safe.

Oh well, I guess we're still in the Wild West era of JS coding...

If I get feedback from them that is useful, I'll post it back to this  
list for posterity.

Thanks,
Boysenberry Payne


On Feb 26, 2009, at 3:56 AM, Alex Mcauley wrote:


 when jQuery is loaded do $jq=jQuery.noConflict();

 then $jq becomes jquery


 or just use jQuery() instead of $()
 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com 
 
 Sent: Thursday, February 26, 2009 9:50 AM
 Subject: [Proto-Scripty] Re: $() work around for prototype



 Hi,

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.

 An *ad* is loading jQuery?!  Sorry, isn't that a bit...intrusive of
 them?

 No, Prototype doesn't have a no conflict mode like jQuery's.  But I'd
 say the real conflict is with the ad.  I'd (politely!) tell the
 advertiser to rein themselves in.

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


 On Feb 25, 10:40 pm, Boysenberry Payne habitatl...@gmail.com wrote:
 Hello Everyone,

 I have a situation where there is a conflict being generated on our
 site between jQuery and Prototype using the $() syntax.
 I have already looked over the jQuery workarounds for inter-library
 conflicts.
 I was wondering if prototype has any such feature, i.e. a way to
 replace $() with something else that would allow it to play with
 others nicely.

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.
 I didn't build the ad and would rather just fix my code than to have
 to dig through someone else's.
 This mean I also don't have prototype loading before jQuery (as a
 couple of the jQuery solutions suggest.)

 (on the right side midway down the page, look for the link add
 newsletter)
 Here is an example of the working
 code:http://www.chicagotribune.com/travel/
 Broken code:http://www.chicagotribune.com/business/

 PS we're in the process of reworking the graphics, so just ignore the
 pixelation...

 Thank you,
 Boysenberry Payne



 


--~--~-~--~~~---~--~~
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: $() work around for prototype

2009-02-26 Thread Alex Mcauley

jQuery is globally safe as its parenthised (check out the source code) ...
It could be plugins that run on Digg bringing it into the global scope

- Original Message - 
From: Boysenberry Payne habitatl...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Thursday, February 26, 2009 2:54 PM
Subject: [Proto-Scripty] Re: $() work around for prototype



 It's the Digg API that has it built in.

 We're contacting them today to see if they have a work around in their
 API.

 One would think if the people over at Digg are relying so heavily on
 Jquery they'd think to make it global safe.

 Oh well, I guess we're still in the Wild West era of JS coding...

 If I get feedback from them that is useful, I'll post it back to this
 list for posterity.

 Thanks,
 Boysenberry Payne


 On Feb 26, 2009, at 3:56 AM, Alex Mcauley wrote:


 when jQuery is loaded do $jq=jQuery.noConflict();

 then $jq becomes jquery


 or just use jQuery() instead of $()
 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 
 Sent: Thursday, February 26, 2009 9:50 AM
 Subject: [Proto-Scripty] Re: $() work around for prototype



 Hi,

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.

 An *ad* is loading jQuery?!  Sorry, isn't that a bit...intrusive of
 them?

 No, Prototype doesn't have a no conflict mode like jQuery's.  But I'd
 say the real conflict is with the ad.  I'd (politely!) tell the
 advertiser to rein themselves in.

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


 On Feb 25, 10:40 pm, Boysenberry Payne habitatl...@gmail.com wrote:
 Hello Everyone,

 I have a situation where there is a conflict being generated on our
 site between jQuery and Prototype using the $() syntax.
 I have already looked over the jQuery workarounds for inter-library
 conflicts.
 I was wondering if prototype has any such feature, i.e. a way to
 replace $() with something else that would allow it to play with
 others nicely.

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.
 I didn't build the ad and would rather just fix my code than to have
 to dig through someone else's.
 This mean I also don't have prototype loading before jQuery (as a
 couple of the jQuery solutions suggest.)

 (on the right side midway down the page, look for the link add
 newsletter)
 Here is an example of the working
 code:http://www.chicagotribune.com/travel/
 Broken code:http://www.chicagotribune.com/business/

 PS we're in the process of reworking the graphics, so just ignore the
 pixelation...

 Thank you,
 Boysenberry Payne



 


 
 


--~--~-~--~~~---~--~~
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: $() work around for prototype

2009-02-26 Thread Boysenberry Payne

Actually it has 2 global variables:
http://mankz.com/code/GlobalCheck.htm

$ and jQuery

It's the $ that conflicts with prototype (obviously).
jQuery has a couple of work arounds on their site, but in order for it  
to work I have to be able to change how the jQuery commands are used,  
something I can't do with a 3rd party app like Digg's API.

If I could load prototype first it would probably be okay, so that  
might be my eventual solution.
Right now, I have emailed some folks at Digg to see if they have a  
solution that doesn't require me to load prototype out of the natural  
order it comes in using our current build.

--Boysenberry



On Feb 26, 2009, at 9:05 AM, Alex Mcauley wrote:


 jQuery is globally safe as its parenthised (check out the source  
 code) ...
 It could be plugins that run on Digg bringing it into the global scope

 - Original Message -
 From: Boysenberry Payne habitatl...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Thursday, February 26, 2009 2:54 PM
 Subject: [Proto-Scripty] Re: $() work around for prototype



 It's the Digg API that has it built in.

 We're contacting them today to see if they have a work around in  
 their
 API.

 One would think if the people over at Digg are relying so heavily on
 Jquery they'd think to make it global safe.

 Oh well, I guess we're still in the Wild West era of JS coding...

 If I get feedback from them that is useful, I'll post it back to this
 list for posterity.

 Thanks,
 Boysenberry Payne


 On Feb 26, 2009, at 3:56 AM, Alex Mcauley wrote:


 when jQuery is loaded do $jq=jQuery.noConflict();

 then $jq becomes jquery


 or just use jQuery() instead of $()
 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com

 Sent: Thursday, February 26, 2009 9:50 AM
 Subject: [Proto-Scripty] Re: $() work around for prototype



 Hi,

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.

 An *ad* is loading jQuery?!  Sorry, isn't that a bit...intrusive of
 them?

 No, Prototype doesn't have a no conflict mode like jQuery's.  But  
 I'd
 say the real conflict is with the ad.  I'd (politely!) tell the
 advertiser to rein themselves in.

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


 On Feb 25, 10:40 pm, Boysenberry Payne habitatl...@gmail.com  
 wrote:
 Hello Everyone,

 I have a situation where there is a conflict being generated on our
 site between jQuery and Prototype using the $() syntax.
 I have already looked over the jQuery workarounds for inter-library
 conflicts.
 I was wondering if prototype has any such feature, i.e. a way to
 replace $() with something else that would allow it to play with
 others nicely.

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.
 I didn't build the ad and would rather just fix my code than to  
 have
 to dig through someone else's.
 This mean I also don't have prototype loading before jQuery (as a
 couple of the jQuery solutions suggest.)

 (on the right side midway down the page, look for the link add
 newsletter)
 Here is an example of the working
 code:http://www.chicagotribune.com/travel/
 Broken code:http://www.chicagotribune.com/business/

 PS we're in the process of reworking the graphics, so just ignore  
 the
 pixelation...

 Thank you,
 Boysenberry Payne










 


--~--~-~--~~~---~--~~
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: $() work around for prototype

2009-02-26 Thread Alex Mcauley

in the latest jQuery you can call noConflict after its loaded to work 
alongside older versions if needs be, so there must be a way to remove the 
loaded jQuery and use the new one, John Resig explained it in a webcast last 
week on ajaxian



- Original Message - 
From: Boysenberry Payne habitatl...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Thursday, February 26, 2009 3:15 PM
Subject: [Proto-Scripty] Re: $() work around for prototype



 Actually it has 2 global variables:
 http://mankz.com/code/GlobalCheck.htm

 $ and jQuery

 It's the $ that conflicts with prototype (obviously).
 jQuery has a couple of work arounds on their site, but in order for it
 to work I have to be able to change how the jQuery commands are used,
 something I can't do with a 3rd party app like Digg's API.

 If I could load prototype first it would probably be okay, so that
 might be my eventual solution.
 Right now, I have emailed some folks at Digg to see if they have a
 solution that doesn't require me to load prototype out of the natural
 order it comes in using our current build.

 --Boysenberry



 On Feb 26, 2009, at 9:05 AM, Alex Mcauley wrote:


 jQuery is globally safe as its parenthised (check out the source
 code) ...
 It could be plugins that run on Digg bringing it into the global scope

 - Original Message -
 From: Boysenberry Payne habitatl...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Thursday, February 26, 2009 2:54 PM
 Subject: [Proto-Scripty] Re: $() work around for prototype



 It's the Digg API that has it built in.

 We're contacting them today to see if they have a work around in
 their
 API.

 One would think if the people over at Digg are relying so heavily on
 Jquery they'd think to make it global safe.

 Oh well, I guess we're still in the Wild West era of JS coding...

 If I get feedback from them that is useful, I'll post it back to this
 list for posterity.

 Thanks,
 Boysenberry Payne


 On Feb 26, 2009, at 3:56 AM, Alex Mcauley wrote:


 when jQuery is loaded do $jq=jQuery.noConflict();

 then $jq becomes jquery


 or just use jQuery() instead of $()
 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com

 Sent: Thursday, February 26, 2009 9:50 AM
 Subject: [Proto-Scripty] Re: $() work around for prototype



 Hi,

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.

 An *ad* is loading jQuery?!  Sorry, isn't that a bit...intrusive of
 them?

 No, Prototype doesn't have a no conflict mode like jQuery's.  But
 I'd
 say the real conflict is with the ad.  I'd (politely!) tell the
 advertiser to rein themselves in.

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


 On Feb 25, 10:40 pm, Boysenberry Payne habitatl...@gmail.com
 wrote:
 Hello Everyone,

 I have a situation where there is a conflict being generated on our
 site between jQuery and Prototype using the $() syntax.
 I have already looked over the jQuery workarounds for inter-library
 conflicts.
 I was wondering if prototype has any such feature, i.e. a way to
 replace $() with something else that would allow it to play with
 others nicely.

 My situation is cause because there is an ad being loaded that uses
 DIGG and jQuery.
 I didn't build the ad and would rather just fix my code than to
 have
 to dig through someone else's.
 This mean I also don't have prototype loading before jQuery (as a
 couple of the jQuery solutions suggest.)

 (on the right side midway down the page, look for the link add
 newsletter)
 Here is an example of the working
 code:http://www.chicagotribune.com/travel/
 Broken code:http://www.chicagotribune.com/business/

 PS we're in the process of reworking the graphics, so just ignore
 the
 pixelation...

 Thank you,
 Boysenberry Payne










 


 
 


--~--~-~--~~~---~--~~
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: $() work around for prototype

2009-02-26 Thread Boysenberry Payne

The only thing I've been able to come up with after reading the  
examples here:
http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Is either forcing prototype to load first then use noConflict after  
jQuery gets loaded which would solve my problem (I think)
Or getting a Digg version that uses the jQuery form of syntax instead  
of the $() shortcut approach.

Unfortunately, the situation I'm in is because we use a CMS that  
allows producers to change what appears on a site dynamically.
Because of this, forcing a prototype load at the top of a page would  
require it happen across the board on all of our pages and sites.
It seems like overkill to me to load libraries regardless if they're  
used or not.

If you want to see examples of the situation here are 2 pages: (look  
for the add newsletter link on the right midway down the page.)
Working:
http://www.chicagotribune.com/travel/
Not Working:
http://www.chicagotribune.com/business/

There are definitely, better ways to handle one offs, but it gets a  
lot more complicated when you're talking about 50+ sites with 1000s of  
pages on each site.
In our situation there are so many convoluted reasons for doing things  
the way they're done that situations like my current one are almost  
unavoidable.

Thanks for you help and feedback though...

-Boysenberry

On Feb 26, 2009, at 9:23 AM, Alex Mcauley wrote:


 in the latest jQuery you can call noConflict after its loaded to work
 alongside older versions if needs be, so there must be a way to  
 remove the
 loaded jQuery and use the new one, John Resig explained it in a  
 webcast last
 week on ajaxian



 - Original Message -
 From: Boysenberry Payne habitatl...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Thursday, February 26, 2009 3:15 PM
 Subject: [Proto-Scripty] Re: $() work around for prototype



 Actually it has 2 global variables:
 http://mankz.com/code/GlobalCheck.htm

 $ and jQuery

 It's the $ that conflicts with prototype (obviously).
 jQuery has a couple of work arounds on their site, but in order for  
 it
 to work I have to be able to change how the jQuery commands are used,
 something I can't do with a 3rd party app like Digg's API.

 If I could load prototype first it would probably be okay, so that
 might be my eventual solution.
 Right now, I have emailed some folks at Digg to see if they have a
 solution that doesn't require me to load prototype out of the natural
 order it comes in using our current build.

 --Boysenberry



 On Feb 26, 2009, at 9:05 AM, Alex Mcauley wrote:


 jQuery is globally safe as its parenthised (check out the source
 code) ...
 It could be plugins that run on Digg bringing it into the global  
 scope

 - Original Message -
 From: Boysenberry Payne habitatl...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Thursday, February 26, 2009 2:54 PM
 Subject: [Proto-Scripty] Re: $() work around for prototype



 It's the Digg API that has it built in.

 We're contacting them today to see if they have a work around in
 their
 API.

 One would think if the people over at Digg are relying so heavily  
 on
 Jquery they'd think to make it global safe.

 Oh well, I guess we're still in the Wild West era of JS coding...

 If I get feedback from them that is useful, I'll post it back to  
 this
 list for posterity.

 Thanks,
 Boysenberry Payne


 On Feb 26, 2009, at 3:56 AM, Alex Mcauley wrote:


 when jQuery is loaded do $jq=jQuery.noConflict();

 then $jq becomes jquery


 or just use jQuery() instead of $()
 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com

 Sent: Thursday, February 26, 2009 9:50 AM
 Subject: [Proto-Scripty] Re: $() work around for prototype



 Hi,

 My situation is cause because there is an ad being loaded that  
 uses
 DIGG and jQuery.

 An *ad* is loading jQuery?!  Sorry, isn't that a bit...intrusive  
 of
 them?

 No, Prototype doesn't have a no conflict mode like jQuery's.  But
 I'd
 say the real conflict is with the ad.  I'd (politely!) tell the
 advertiser to rein themselves in.

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


 On Feb 25, 10:40 pm, Boysenberry Payne habitatl...@gmail.com
 wrote:
 Hello Everyone,

 I have a situation where there is a conflict being generated on  
 our
 site between jQuery and Prototype using the $() syntax.
 I have already looked over the jQuery workarounds for inter- 
 library
 conflicts.
 I was wondering if prototype has any such feature, i.e. a way to
 replace $() with something else that would allow it to play with
 others nicely.

 My situation is cause because there is an ad being loaded that  
 uses
 DIGG and jQuery.
 I didn't build the ad and would rather just fix my code than to
 have
 to dig through someone else's.
 This mean I also don't have prototype loading before jQuery (as a
 

[Proto-Scripty] Re: Adding Scroll bars to list

2009-02-26 Thread vanq69

Thanks for the CSS tip, im certainly not an expert with it at this
stage so what I have is
simply a rough mock up to give me some structure whilst I am doing the
coding.

RE Javascript I have all the javascript working for the sortable list
and related ajax and
php elements, its simply the creating of scroll bars for the list im
unsure of how to do -
would this need to be in javascript??

///
/// ///
///Droppable 1///
///  Fixed   ///
/// ///
///

///
/// ///
///Sortable ///
///  List  ///
/// ///
///Scrollable   ///
/// ///
/// ///
/// ///
/// ///
/// ///
///

///
/// ///
///Droppable 2///
///  Fixed   ///
/// ///
///

This is the design format I have at the moment but without the middle
bit being scrollable - this is what
I am unsure of how to do.

Hope this clears things up, thanks for the help so far :)





On Feb 26, 1:18 pm, Alex Mcauley webmas...@thecarmarketplace.com
wrote:
 Firstly in your CSS you have float:centre

 There is no float:center as far as i know .. if there were it would be
 center --- american spelling

 i also cannot see any Javascript in there to help you with

 - Original Message -
 From: vanq69 jaed...@gmail.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Thursday, February 26, 2009 11:37 AM
 Subject: [Proto-Scripty] Re: Adding Scroll bars to list

  Have had a look into this and havent been able to find a suitable
  method.

  I am aiming for having a space for 12 rows with scrollbars to get to
  the rest,
  with the top div - addPage and the bottom div - trash being always
  visible.

  Here is the code im currently trying:

  !-- start sidebar2 --
  div id=sidebar2 class=sidebar
  ul
  li id=chunkListModule
  h2Chunk List/h2
  div id = addPage
  h4 align=centerDRAG HERE TO ADD TO PAGE/h4
  /div
  br /
  ul setsize=12 id=chunksList class=sortableList
  onmouseup=processChunk('chunksList', 'recreateList')
  ?php
  $myChunksList = new ChunksList();
  echo $myChunksList-BuildChunksList();
  ?
  /ul
  br /
  div id = trash
  h4 align=centerDRAG HERE TO DELETE/h4
  /div
  /ul
  /div
  !-- end sidebar2 --

  And here is the relevant parts of the CSS:

  /* Sidebar2 CSS */

  #sidebar2 {
  float: centre;
  padding: 20px 20px;
  }

  #addPage
  {
  border: 4px solid #ffd90f;
  width: 190px;
  padding: 10px;
  }

  ul.sortableList
  {
  list-style-type: none;
  padding: 0px;
  margin: 0px;
  width: 220px;
  }

  ul.sortableList li
  {
  cursor: move;
  padding: 2px 2px;
  margin: 2px 0px;
  border: 1px solid #ffd90f;
  background-color: #eee;
  }

  #trash
  {
  border: 4px solid #ffd90f;
  width: 190px;
  padding: 10px;
  }

  Any thoughts or help would be great :)

  Regards
--~--~-~--~~~---~--~~
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: Adding Scroll bars to list

2009-02-26 Thread vanq69

Thanks for the CSS tip, im certainly not an expert with it at this
stage so what I have is
simply a rough mock up to give me some structure whilst I am doing
the
coding.
RE Javascript I have all the javascript working for the sortable list
and related ajax and
php elements, its simply the creating of scroll bars for the list im
unsure of how to do -
would this need to be in javascript??
///
/// ///
///Droppable 1///
///  Fixed   ///
/// ///
///
///
/// ///
///Sortable ///
///  List  ///
/// ///
///Scrollable   ///
/// ///
/// ///
/// ///
/// ///
/// ///
///
///
/// ///
///Droppable 2///
///  Fixed   ///
/// ///
///
This is the design format I have at the moment but without the middle
bit being scrollable - this is what
I am unsure of how to do.
Hope this clears things up, thanks for the help so far :)

On Feb 26, 1:18 pm, Alex Mcauley webmas...@thecarmarketplace.com
wrote:
 Firstly in your CSS you have float:centre

 There is no float:center as far as i know .. if there were it would be
 center --- american spelling

 i also cannot see any Javascript in there to help you with

 - Original Message -
 From: vanq69 jaed...@gmail.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Thursday, February 26, 2009 11:37 AM
 Subject: [Proto-Scripty] Re: Adding Scroll bars to list

  Have had a look into this and havent been able to find a suitable
  method.

  I am aiming for having a space for 12 rows with scrollbars to get to
  the rest,
  with the top div - addPage and the bottom div - trash being always
  visible.

  Here is the code im currently trying:

  !-- start sidebar2 --
  div id=sidebar2 class=sidebar
  ul
  li id=chunkListModule
  h2Chunk List/h2
  div id = addPage
  h4 align=centerDRAG HERE TO ADD TO PAGE/h4
  /div
  br /
  ul setsize=12 id=chunksList class=sortableList
  onmouseup=processChunk('chunksList', 'recreateList')
  ?php
  $myChunksList = new ChunksList();
  echo $myChunksList-BuildChunksList();
  ?
  /ul
  br /
  div id = trash
  h4 align=centerDRAG HERE TO DELETE/h4
  /div
  /ul
  /div
  !-- end sidebar2 --

  And here is the relevant parts of the CSS:

  /* Sidebar2 CSS */

  #sidebar2 {
  float: centre;
  padding: 20px 20px;
  }

  #addPage
  {
  border: 4px solid #ffd90f;
  width: 190px;
  padding: 10px;
  }

  ul.sortableList
  {
  list-style-type: none;
  padding: 0px;
  margin: 0px;
  width: 220px;
  }

  ul.sortableList li
  {
  cursor: move;
  padding: 2px 2px;
  margin: 2px 0px;
  border: 1px solid #ffd90f;
  background-color: #eee;
  }

  #trash
  {
  border: 4px solid #ffd90f;
  width: 190px;
  padding: 10px;
  }

  Any thoughts or help would be great :)

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

2009-02-26 Thread Richard Quadling

Hi.

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

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

Am I doing something wrong? Is there a workaround?

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

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

Ideas/suggestions warmly welcomed.

Regards,

Richard.

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

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

document.observe('dom:loaded', function(){
  $('dynamicContainer')
.observe('click', watchEvents) // So I can see when clicks occur -
not in my real code.
.observe('change', watchEvents)
.observe('keyup', watchEvents);
});
/script
body
div id=dynamicContainer
  form method=post action=
select id=aSelector name=bob
  option value=1One/option
  option value=2Two/option
  option value=3Three/option
  option value=4Four/option
/select
  /form
div
div id=watchedEvents/div
/body
/html

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

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



[Proto-Scripty] Re: Adding Scroll bars to list

2009-02-26 Thread Alex Mcauley

I'm still not sure what you mean by scrollable


If you mean scroll bars in an element you can achieve it like this

div style=height:100px;width:100px;overflow:auto;
Some Content that exceeds 100px by 100px will add automatic scrollbars to 
the element


/div


- Original Message - 
From: vanq69 jaed...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Thursday, February 26, 2009 3:49 PM
Subject: [Proto-Scripty] Re: Adding Scroll bars to list



Thanks for the CSS tip, im certainly not an expert with it at this
stage so what I have is
simply a rough mock up to give me some structure whilst I am doing the
coding.

RE Javascript I have all the javascript working for the sortable list
and related ajax and
php elements, its simply the creating of scroll bars for the list im
unsure of how to do -
would this need to be in javascript??

///
/// ///
///Droppable 1///
///  Fixed   ///
/// ///
///

///
/// ///
///Sortable ///
///  List  ///
/// ///
///Scrollable   ///
/// ///
/// ///
/// ///
/// ///
/// ///
///

///
/// ///
///Droppable 2///
///  Fixed   ///
/// ///
///

This is the design format I have at the moment but without the middle
bit being scrollable - this is what
I am unsure of how to do.

Hope this clears things up, thanks for the help so far :)





On Feb 26, 1:18 pm, Alex Mcauley webmas...@thecarmarketplace.com
wrote:
 Firstly in your CSS you have float:centre

 There is no float:center as far as i know .. if there were it would be
 center --- american spelling

 i also cannot see any Javascript in there to help you with

 - Original Message -
 From: vanq69 jaed...@gmail.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Thursday, February 26, 2009 11:37 AM
 Subject: [Proto-Scripty] Re: Adding Scroll bars to list

  Have had a look into this and havent been able to find a suitable
  method.

  I am aiming for having a space for 12 rows with scrollbars to get to
  the rest,
  with the top div - addPage and the bottom div - trash being always
  visible.

  Here is the code im currently trying:

  !-- start sidebar2 --
  div id=sidebar2 class=sidebar
  ul
  li id=chunkListModule
  h2Chunk List/h2
  div id = addPage
  h4 align=centerDRAG HERE TO ADD TO PAGE/h4
  /div
  br /
  ul setsize=12 id=chunksList class=sortableList
  onmouseup=processChunk('chunksList', 'recreateList')
  ?php
  $myChunksList = new ChunksList();
  echo $myChunksList-BuildChunksList();
  ?
  /ul
  br /
  div id = trash
  h4 align=centerDRAG HERE TO DELETE/h4
  /div
  /ul
  /div
  !-- end sidebar2 --

  And here is the relevant parts of the CSS:

  /* Sidebar2 CSS */

  #sidebar2 {
  float: centre;
  padding: 20px 20px;
  }

  #addPage
  {
  border: 4px solid #ffd90f;
  width: 190px;
  padding: 10px;
  }

  ul.sortableList
  {
  list-style-type: none;
  padding: 0px;
  margin: 0px;
  width: 220px;
  }

  ul.sortableList li
  {
  cursor: move;
  padding: 2px 2px;
  margin: 2px 0px;
  border: 1px solid #ffd90f;
  background-color: #eee;
  }

  #trash
  {
  border: 4px solid #ffd90f;
  width: 190px;
  padding: 10px;
  }

  Any thoughts or help would be great :)

  Regards



--~--~-~--~~~---~--~~
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: Adding Scroll bars to list

2009-02-26 Thread vanq69

That was exactly what I meant, thank you very much! This works well
for the scrolling,
however it doesnt allow me to see the drop into the droppables now.
I can make them
if the mouse is over and it works but doesnt show the droppable over
the box anymore, im
guessing there is little I can do about this? If so then its not a
major issue and the scrolling
is much more useful but would be nice to be able to have both. (if i
move the div to include the
droppable box's then they simply scroll with them which isnt what I
need)

Thanks for your help so far :)

On Feb 26, 3:56 pm, Alex Mcauley webmas...@thecarmarketplace.com
wrote:
 I'm still not sure what you mean by scrollable

 If you mean scroll bars in an element you can achieve it like this

 div style=height:100px;width:100px;overflow:auto;
 Some Content that exceeds 100px by 100px will add automatic scrollbars to
 the element

 /div

 - Original Message -
 From: vanq69 jaed...@gmail.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Thursday, February 26, 2009 3:49 PM
 Subject: [Proto-Scripty] Re: Adding Scroll bars to list

 Thanks for the CSS tip, im certainly not an expert with it at this
 stage so what I have is
 simply a rough mock up to give me some structure whilst I am doing the
 coding.

 RE Javascript I have all the javascript working for the sortable list
 and related ajax and
 php elements, its simply the creating of scroll bars for the list im
 unsure of how to do -
 would this need to be in javascript??

 ///
 ///                                                     ///
 ///                Droppable 1                    ///
 ///                  Fixed                           ///
 ///                                                     ///
 ///

 ///
 ///                                                     ///
 ///                    Sortable                     ///
 ///                      List                          ///
 ///                                                     ///
 ///                    Scrollable                   ///
 ///                                                     ///
 ///                                                     ///
 ///                                                     ///
 ///                                                     ///
 ///                                                     ///
 ///

 ///
 ///                                                     ///
 ///                Droppable 2                    ///
 ///                  Fixed                           ///
 ///                                                     ///
 ///

 This is the design format I have at the moment but without the middle
 bit being scrollable - this is what
 I am unsure of how to do.

 Hope this clears things up, thanks for the help so far :)

 On Feb 26, 1:18 pm, Alex Mcauley webmas...@thecarmarketplace.com
 wrote:
  Firstly in your CSS you have float:centre

  There is no float:center as far as i know .. if there were it would be
  center --- american spelling

  i also cannot see any Javascript in there to help you with

  - Original Message -
  From: vanq69 jaed...@gmail.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Thursday, February 26, 2009 11:37 AM
  Subject: [Proto-Scripty] Re: Adding Scroll bars to list

   Have had a look into this and havent been able to find a suitable
   method.

   I am aiming for having a space for 12 rows with scrollbars to get to
   the rest,
   with the top div - addPage and the bottom div - trash being always
   visible.

   Here is the code im currently trying:

   !-- start sidebar2 --
   div id=sidebar2 class=sidebar
   ul
   li id=chunkListModule
   h2Chunk List/h2
   div id = addPage
   h4 align=centerDRAG HERE TO ADD TO PAGE/h4
   /div
   br /
   ul setsize=12 id=chunksList class=sortableList
   onmouseup=processChunk('chunksList', 'recreateList')
   ?php
   $myChunksList = new ChunksList();
   echo $myChunksList-BuildChunksList();
   ?
   /ul
   br /
   div id = trash
   h4 align=centerDRAG HERE TO DELETE/h4
   /div
   /ul
   /div
   !-- end sidebar2 --

   And here is the relevant parts of the CSS:

   /* Sidebar2 CSS */

   #sidebar2 {
   float: centre;
   padding: 20px 20px;
   }

   #addPage
   {
   border: 4px solid #ffd90f;
   width: 190px;
   padding: 10px;
   }

   ul.sortableList
   {
   list-style-type: none;
   padding: 0px;
   margin: 0px;
   width: 220px;
   }

   ul.sortableList li
   {
   cursor: move;
   padding: 2px 2px;
   margin: 2px 0px;
   border: 1px solid #ffd90f;
   background-color: #eee;
   }

   #trash
   {
   

[Proto-Scripty] Re: Adding Scroll bars to list

2009-02-26 Thread vanq69

New code:

!-- start sidebar2 --
div id=sidebar2 class=sidebar
ul
li id=chunkListModule
h2Chunk List/h2
div id = addPage
h4 align=centerDRAG HERE TO ADD TO PAGE/h4
/div
br /
div 
style=height:300px;width:250px;overflow:auto;
ul id=chunksList class=sortableList 
onmouseup=processChunk
('chunksList', 'recreateList')
?php
$myChunksList = new 
ChunksList();
echo 
$myChunksList-BuildChunksList();
?
/ul
/div
br /
div id = trash
h4 align=centerDRAG HERE TO 
DELETE/h4
/div
/ul
/div
!-- end sidebar2 --
--~--~-~--~~~---~--~~
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: When?

2009-02-26 Thread ColinFine



On Feb 26, 9:15 am, RobG rg...@iinet.net.au wrote:

 Further, complex CSS selectors tie your code to the page layout -
 isn't the idea to separate the two?

I don't agree. As a rule it ties your code to the *classes*, and
possibly to the hierarchical (and, one would hope, logical) structure
of the page. As long as you are using HTML and not XML, this seems to
me to be an extremely good way of expressing the semantics of
elements. Agreed, classes were originally devised for CSS, but they've
come far beyond that.

In any case, I don't see what you are contrasting this with: if you
use getElementByTag and it's friends you've still to traverse the
structure in the DOM, i.e. the page layout.


 Lastly, they encourage rubbish like: tagName#someID, which is used in
 style rules because it helps the developer, but using it in a script
 selector is just plain dumb.

No disagreement.

 I can understand the use of selectors for prototyping or small things
 where speed is irrelevant, but using them as a fundamental strategy to
 get large sets of elements doesn't make sense.  Write a function to do
 it using standard host methods, it will perform much faster and be
 easier to work with.


Ummm... isn't that like saying Use high level languages by all means,
but for serious work, you should write assembler functions?
I use prototype because for me it turns Javascript from a dog I would
never want to subject myself to into a usable language.

I have recently had unwrap a CSS selection (select by class name)
because I found that while it ran well on FF, it took a ridiculous
amount of time on IE6. (As far as I can tell, IE hasn't got a 'find by
class name'). But to me that is like having to descend to low-level
programming to get round a hardware bug.

Colin

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



[Proto-Scripty] Re: Observing events on dynamic content.

2009-02-26 Thread Radoslav Stankov

You can do this little more simpler using this event delegation
methods: http://gist.github.com/66568

and then use this syntax:

$('elementId').delegate('click', '.some_selector', method);

note on the method - this variable will point to the element who
match the selector

--~--~-~--~~~---~--~~
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: newbie scriptaculous query

2009-02-26 Thread Bhudda Ben

Thank you - yeah, relative URL is ok - whole thing was a conflict
between jQuery and Prototype - they both use '$' to shorten code
footprint; working now Thanks Again

On Feb 25, 3:40 pm, Matt Foster mattfoste...@gmail.com wrote:
 Your URL is relative, you sure this is correct?

      new Ajax.PeriodicalUpdater('clock', 'required/clock/gettime.php',

 Try testing it out with a regular Ajax.Request and listening to the
 onSuccess/Failure/Exception events and see what is going on.

 --

 http://positionabsolute.net

 On Feb 25, 10:10 am, Bhudda Ben benjamin.rud...@gmail.com wrote:



  I am newbie to AJAX and scriptaculous (I know and use php  js) with
  what I hope is easy question.  I am building a new homepage for my
  company with the idea that a basic shell of links and other widgets is
  always in browser, but center section changes to provide other
  commonly used company widgets.  I have not yet started to play with
  center section - the main use of AJAX - but, and here is problem:

  Company desires  automatically updating time widget at bottom of page
  - this feature was already in use implemented in scriptaculous at our
  London office; this is why I am starting with scriptaculous rather
  than some other AJAX implementation.  I stole the following code:

  Head section:
  script src=required/scriptaculous/lib/prototype.js type=text/
  javascript/script
  script type=text/javascript
      new Ajax.PeriodicalUpdater('clock', 'required/clock/gettime.php',
  {asynchronous:true, frequency:60});
  /script

  And of course, brought all the scriptacous code over to required/lib.

  At bottom of page London original was:

  div id=clock align=center?php include (required/clock/
  gettime.php); ?/div

  I used that and also tried:

  span id=clock
                          ?php
              //include clock footer
              include (required/clock/gettime.php);
              ?
              /span

  (since I had the whole in table, thought I might need to go to span
  instead of div)

  That's it - works in London, does not work in NY for me and London guy
  who did original long gone.

  The only other difference is London site runs on Windows; mine runs on
  Linux - is that a prob?- Hide quoted text -

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



[Proto-Scripty] Delay Required after Ajax.Request() ... How to?

2009-02-26 Thread BearState


Hi,

OK,  so Mr. Noob has made a lot of progress, but has found that when
he makes an Ajax.Request(), the response is not set into the
javascript variables until after a certain amount of time, which
though small, is significant.

Some knuckleheads might well be provoked to say, Hey, I didn't get my
data.  There's a bug.

There is no bug, but there is a pain in the ...

Javascript does not have a sleep function and  using  setTimeOut in
this situation is folly because you can not proceed with the code in
any semblance until  AjaxRequest full completes returning the data.
setTimeOut will only cause one code element to deley.

How're the Prototype/Scriptaculous gurus handling this?

BearState aka. Mr. Noob  ( for the moment ).




--~--~-~--~~~---~--~~
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: Delay Required after Ajax.Request() ... How to?

2009-02-26 Thread BearState


Oh,

One additional comment ...

If I get clever and try to wait in a while loop for AjaxRequest to set
a flag that it has completed, the browser complains that some script
is attempting to make the browser to run slow, do you want to let it
run?   IE7.

So no, I can't create a slick wait loop like that either.

BearState

On Feb 26, 9:13 pm, BearState wixelb...@yahoo.com wrote:
 Hi,

 OK,  so Mr. Noob has made a lot of progress, but has found that when
 he makes an Ajax.Request(), the response is not set into the
 javascript variables until after a certain amount of time, which
 though small, is significant.

 Some knuckleheads might well be provoked to say, Hey, I didn't get my
 data.  There's a bug.

 There is no bug, but there is a pain in the ...

 Javascript does not have a sleep function and  using  setTimeOut in
 this situation is folly because you can not proceed with the code in
 any semblance until  AjaxRequest full completes returning the data.
 setTimeOut will only cause one code element to deley.

 How're the Prototype/Scriptaculous gurus handling this?

 BearState aka. Mr. Noob  ( for the moment ).
--~--~-~--~~~---~--~~
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: Delay Required after Ajax.Request() ... How to?

2009-02-26 Thread T.J. Crowder

Hi,

Rather than thinking of an Ajax request as a function call, think of
it as a message you send out.  Send it, then get on with other things,
or just wait (where waiting is not a busy-wait where the user can't do
anything).  When you get a reply, deal with the reply.  In this case,
replies are (basically) complete and failure.

So for instance, rather than this:

function getRecord(id)
{
var record;
var done;

// Get the record
done = false;
new Ajax.Request(getrecord.php, {
parameters: {id: id},
onSuccess:  function(transport) {
var json = transport.responseJSON;
if (json  json.success) {
record = json.record;
}
done = true;
},
onFailure:  function(transport) {
done = true;
}
});

// Very bad idea
while (!done) {
// Don't know what you'd do here
}

// Got the record?
if (!record) {
throw Unable to retrieve record  + id;
}

// Return the record
return record;
}

...and then calling it like this:

try
{
record = getRecord(id);
displayRecord(record);
}
catch (e)
{
displayError(e.message ? e.message : e);
}

Do this:

function getRecord(id)
{
new Ajax.Request(getrecord.php, {
parameters: {id: id},
onSuccess:  function(transport) {
var json = transport.responseJSON;
if (json  json.success) {
displayRecord(record);
}
else if (json  json.errorMessage) {
displayError(json.errorMessage);
}
else {
displayError(Unknown error getting record  + id);
}
},
onFailure:  function(transport) {
displayError(Error communicating with server);
}
});
}

Now, that combines the two -- retrieval and display -- which may not
always be what you want.  When you really want them separated, just
use callbacks:

function getRecord(id, success, failure)
{
new Ajax.Request(getrecord.php, {
parameters: {id: id},
onSuccess:  function(transport) {
var json = transport.responseJSON;
if (json  json.success) {
success(record);
}
else if (json  json.errorMessage) {
failure(json.errorMessage);
}
else {
failure(Unknown error getting record  + id);
}
},
onFailure:  function(transport) {
failure(Error communicating with server);
}
});
}

...and call it like this:

getRecord(id, displayRecord, displayError);

Note that both of those mean that when you call getRecord, it will
return before the record has been retrieved and displayed.

Initially, you'll feel a bit like your thinking is inside-out, but
once you get your head around it, a lot of things are easier if you
always think in terms of your application being in a given state and
waiting for an event to respond to, which takes it to another state.
Some states are disable all the controls until something finishes,
but most of them aren't, and so it makes for a better user experience.

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

On Feb 27, 5:16 am, BearState wixelb...@yahoo.com wrote:
 Oh,

 One additional comment ...

 If I get clever and try to wait in a while loop for AjaxRequest to set
 a flag that it has completed, the browser complains that some script
 is attempting to make the browser to run slow, do you want to let it
 run?   IE7.

 So no, I can't create a slick wait loop like that either.

 BearState

 On Feb 26, 9:13 pm, BearState wixelb...@yahoo.com wrote:

  Hi,

  OK,  so Mr. Noob has made a lot of progress, but has found that when
  he makes an Ajax.Request(), the response is not set into the
  javascript variables until after a certain amount of time, which
  though small, is significant.

  Some knuckleheads might well be provoked to say, Hey, I didn't get my
  data.  There's a bug.

  There is no bug, but there is a pain in the ...

  Javascript does not have a sleep function and  using  setTimeOut in
  this situation is folly because you can not proceed with the code in
  any semblance until  AjaxRequest full completes returning the data.
  setTimeOut will only cause one code element to deley.

  How're the Prototype/Scriptaculous gurus handling this?

  BearState aka. Mr. Noob  ( for the moment ).


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