[Proto-Scripty] Re: menu bar

2008-11-19 Thread Brian Williams
I really recommend that you do some serious research on basic CSS... this
may sound cocky, but that's a CSS101 question.

position:fixed



On Thu, Nov 20, 2008 at 12:12 AM, jason maina <[EMAIL PROTECTED]> wrote:

>
> How do i have it fixed at a certain point on the interface
> irrespective of scrolling & jumpy repositioning while scrolling?
> Thank you for the ideas though.
>
> Regards
> Jason
>
> On 11/19/08, Brian Williams <[EMAIL PROTECTED]> wrote:
> > the UL tag will also degrade somewhat gracefully for hand held browsers
> >
> >
> >
> > On Wed, Nov 19, 2008 at 10:24 AM, K.C.Leung <[EMAIL PROTECTED]> wrote:
> >
> >>
> >> I think all the menu should be base on "ul" --> "li" --> "ul" -->
> >> "li", "li" .
> >> Then you can design your style by yourself to make it look like "menu"
> >>
> >> On Nov 19, 10:50 pm, "jason maina" <[EMAIL PROTECTED]> wrote:
> >> > Hi guys/galz,
> >> >
> >> > Would like to make a menu like the one for facebook, any ideas??
> >> >
> >> > Regards
> >> > Jason
> >>
> >> >
> >>
> >
> > >
> >
>
> --
> Sent from Gmail for mobile | mobile.google.com
>
> >
>

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



[Proto-Scripty] Re: menu bar

2008-11-19 Thread jason maina

How do i have it fixed at a certain point on the interface
irrespective of scrolling & jumpy repositioning while scrolling?
Thank you for the ideas though.

Regards
Jason

On 11/19/08, Brian Williams <[EMAIL PROTECTED]> wrote:
> the UL tag will also degrade somewhat gracefully for hand held browsers
>
>
>
> On Wed, Nov 19, 2008 at 10:24 AM, K.C.Leung <[EMAIL PROTECTED]> wrote:
>
>>
>> I think all the menu should be base on "ul" --> "li" --> "ul" -->
>> "li", "li" .
>> Then you can design your style by yourself to make it look like "menu"
>>
>> On Nov 19, 10:50 pm, "jason maina" <[EMAIL PROTECTED]> wrote:
>> > Hi guys/galz,
>> >
>> > Would like to make a menu like the one for facebook, any ideas??
>> >
>> > Regards
>> > Jason
>>
>> >
>>
>
> >
>

-- 
Sent from Gmail for mobile | mobile.google.com

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



[Proto-Scripty] So Beyond Novice, I Know

2008-11-19 Thread Bobby.D

I realize how novice this question is...but

I need to return a javascript line of code instead of returning text.

I need "dsJobs.loadData()" to execute upon completion, however, even
after a week off (My appendix and I got in a big fight) I still can't
figure this out.

Help, please
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Focused field

2008-11-19 Thread Hector Virgen
That's true, and yes that CSS selector should include buttons.

If you're building your DOM dynamically, you may want to create a form
element factory. Then this can automatically add the focus observer each
time you create a form element.

var focused;

function onElementFocus(event)
{
focused = event.element();
}

function createFormElement(type, attributes)
{
return new Element(type, attributes).observe('focus', onElementFocus);
}

// create a form element

var button = createElement('button', {name: 'myButton'}).update('Click
me!');
$(document.body).insert(button);

-Hector


On Wed, Nov 19, 2008 at 8:07 PM, kangax <[EMAIL PROTECTED]> wrote:

>
> On Nov 19, 3:39 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote:
> > A prototype way might go something like this (untested):
> > var focused;
> >
> > Event.observe(document, 'dom:loaded', function()
> > {
> > $$('input, select, textarea').invoke('observe', 'focus',
> function(event)
> > {
> > focused = event.element();
> > });
> >
> > });
> >
>
> It just wouldn't work with dynamically added content : )
> Also, shouldn't `BUTTON` be there as well?
>
> > -Hector
>
> [...]
>
> --
> kangax
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread kangax

On Nov 19, 5:46 pm, Jay <[EMAIL PROTECTED]> wrote:
> I was trying to scale down the example to the essence of the issue. Of
> course, $('Contents') should be interchangeable with $$('#Contents'),
> except that is the bug - it doesn't work on Safari or IE. In the real
> world, I might want the selector to be more like $$('table#tblTMRoster
> tbody tr td.countChecked'+i) - while there may be many tables with
> such cells, I only want one table's worth. Another bug for another day
> is this: even if there is only one table in the page, $$('tbody tr
> td.countChecked'+i) returns not only the td's in the tbody, but also
> the ones in the tfoot, and the only workaround I could come up with
> was to prepend the table id on the selector to make it work.
>
> Finally, while one assumes id's ought to be unique, $$('#contents')
> returns an array of all elements with any case-variations like
> contents, Contents, conTents, whatever. At least that bug is on
> Safari, however not in Firefox nor IE. So again, if there is any way
> to make Prototype.js wrap up these browser inconsistencies, it would
> be a boon for the programmer.

Does this also happen with a valid doctype?

>
> Cheers,
> --Jay

[...]

--
kangax
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Focused field

2008-11-19 Thread kangax

On Nov 19, 3:39 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote:
> A prototype way might go something like this (untested):
> var focused;
>
> Event.observe(document, 'dom:loaded', function()
> {
>     $$('input, select, textarea').invoke('observe', 'focus', function(event)
>     {
>         focused = event.element();
>     });
>
> });
>

It just wouldn't work with dynamically added content : )
Also, shouldn't `BUTTON` be there as well?

> -Hector

[...]

--
kangax
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: select only text (i.e. textnodes, probably) using $$

2008-11-19 Thread Jay

I notice you have an uppercase letter in your $$ selector. I don't
know, but this could cause you some problems if you are not using
Firefox. Please see the discussion called 'cross browser $$ selector
problems'. You should not need to do this, but just for a test, try
making all id's and class names completely lowercase and see if that
helps. It is only a workaround, but if that works for you it would be
evidence of a cross-browser issue in prototype.

On Nov 19, 6:22 pm, lskatz <[EMAIL PROTECTED]> wrote:
> Hi,
> I want to automatically set up abbreviation tags everywhere in my
> document, and it works great, except I am altering the innerHTML to do
> so and sometimes some crazy results happen.  For instance, an input's
> value should be untouched because the value should not be value=" title='united states of america'>USA"
>
> I believe the way to go would be to select for textnodes but I cannot
> figure out why that wouldn't work.  Anyway, any help to fix my code
> would be appreciated (I hope the indentation is preserved when I post
> this).
>
> // find and add in abbr all over the place!
> var replacing={
>                 'TSV':'Tab-Separated Values',
>                 'CSV':'Comma-Separated Values',
>                'STs?':'Sequence Type',
>                'CCs?':'Clonal Complex',
>                'MGIP':'Meningococcus Genome Informatics Platform',
>                'MLST':'Multilocus Sequence Typing',
>                'GIT':'Georgia Institute of Technology',
>                'CDC':'Centers for Disease Control and Prevention',
>                'OMP':'Outer Membrane Protein'
>             };
> $$('.systemMessage, .body p,.body
> div,label,h1,h2,h3,h4,.menu.firefox').each(function(el){
>   if(el.hasClassName('doNotDisturb')){
>     return; // equivalent to a continue inside of an each loop
>   }
>   el.select('text').each(function(s){
>     debug('textNode: '+s);
>   });
>   for(var k in replacing){
>     var v=replacing[k];
>         var find=new RegExp('\\b('+k+')\\b','g');
>         // I should use something like innerContext or innerText
> instead of innerHTML
>         el.update(el.innerHTML.replace(find,"
> $1",''));
>    }
>
> });
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Scriptacuous: autocomplete How do I update my database in PHP after the string is found

2008-11-19 Thread alohaaaron

Thanks. Updating into the database is working now!  But when I select
one result from the list of results using the arrow keys the incorrect
selection is updated in the database.

If I don't use the arrow keys and just select the first result then
the correct result is in the database.  How do I make sure the result
the user selects is put into the database?  It seems to give me the
first result in the list by default.

Thanks!

On Nov 19, 1:48 pm, "Ron Newman" <[EMAIL PROTECTED]> wrote:
> If you're asking about the PHP part, all you need is an ID field in your
> database table:
>
> table fields:
> ID
> UNIQUE_CUST_ID
>
> Judging by your code, UNIQUE_CUST_ID is probably text, something you can
> enter in a user form.  I'd change it to something meaningful, like
> 'ARTISTNAME'.  And ID would be just a number assigned by the database.  It
> should be defined 'auto_increment' so that it is automatically assigned
> whenever you add a new entry, and is guaranteed to always be unique.
>
> So, you change:
>  $sql = "SELECT ARTISTNAME FROM tablename WHERE ARTISTNAME LIKE '%" .
> $_POST['search'] . "%'";
>
> To:  "SELECT ID, ARTISTNAME..."
>
> Then using your code below, you get
> $data["ID"]  has the ID number in it,
> $data["ARTISTNAME"] has the name.
>
> Then the crux of the matter:
> You do an UPDATE:
> $sql = UPDATE tablename set ARTISTNAME='your new value' WHERE ID=$data["ID"]
>
> This is two database queries.  You can do it in one, but I'd get this going
> first.  To do it in one, you use 'ON DUPLICATE ENTRY..." and some more
> stuff.
>
> Ron
>
> On Wed, Nov 19, 2008 at 3:22 PM, alohaaaron <[EMAIL PROTECTED]> wrote:
>
> > Hi, I'm trying to update my database with the string that is selected
> > by the user but am not sure how to do so?  Thank you.
>
> > Here is my call in html.
>
> > 
> > 
>
> >  
> >                                  > language='javascript'
> > charset='utf-8'>
> >                                 //  >                                          new
> > Ajax.Autocompleter('search','autocomplete_choices','ajax-
> > autocompletion/server.php',{minChars: 3,afterUpdateElement :
> > getSelectedId});
> >                                // ]]>
>
> >                                function getSelectedId(text, li) {
> >                                        $('artist_id').value=li.id;
> >                                }
> >                                
>
> > The PHP code from wiseguys
>
> >        $sql = "SELECT UNIQUE_CUST_ID FROM MyDB WHERE UNIQUE_CUST_ID
> > LIKE
> > '%" . $_POST['search'] . "%'";
> >        $rs = mysql_query($sql);
> > ?>
>
> > 
>
> > 
> >  
> > 
> > 
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: select only text (i.e. textnodes, probably) using $$

2008-11-19 Thread Gabriel Gilini
You could check if the firstChild of the element in question is a textNode.

i.e.:

var c = el.firstChild;
if(c.nodeType == 3){ //text node
   el.update(...);
}

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Wed, Nov 19, 2008 at 9:22 PM, lskatz <[EMAIL PROTECTED]> wrote:

>
> Hi,
> I want to automatically set up abbreviation tags everywhere in my
> document, and it works great, except I am altering the innerHTML to do
> so and sometimes some crazy results happen.  For instance, an input's
> value should be untouched because the value should not be value=" title='united states of america'>USA"
>
> I believe the way to go would be to select for textnodes but I cannot
> figure out why that wouldn't work.  Anyway, any help to fix my code
> would be appreciated (I hope the indentation is preserved when I post
> this).
>
> // find and add in abbr all over the place!
> var replacing={
>'TSV':'Tab-Separated Values',
>'CSV':'Comma-Separated Values',
>   'STs?':'Sequence Type',
>   'CCs?':'Clonal Complex',
>   'MGIP':'Meningococcus Genome Informatics Platform',
>   'MLST':'Multilocus Sequence Typing',
>   'GIT':'Georgia Institute of Technology',
>   'CDC':'Centers for Disease Control and Prevention',
>   'OMP':'Outer Membrane Protein'
>};
> $$('.systemMessage, .body p,.body
> div,label,h1,h2,h3,h4,.menu.firefox').each(function(el){
>  if(el.hasClassName('doNotDisturb')){
>return; // equivalent to a continue inside of an each loop
>  }
>  el.select('text').each(function(s){
>debug('textNode: '+s);
>  });
>  for(var k in replacing){
>var v=replacing[k];
>var find=new RegExp('\\b('+k+')\\b','g');
>// I should use something like innerContext or innerText
> instead of innerHTML
>el.update(el.innerHTML.replace(find,"
> $1",''));
>   }
> });
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] select only text (i.e. textnodes, probably) using $$

2008-11-19 Thread lskatz

Hi,
I want to automatically set up abbreviation tags everywhere in my
document, and it works great, except I am altering the innerHTML to do
so and sometimes some crazy results happen.  For instance, an input's
value should be untouched because the value should not be value="USA"

I believe the way to go would be to select for textnodes but I cannot
figure out why that wouldn't work.  Anyway, any help to fix my code
would be appreciated (I hope the indentation is preserved when I post
this).

// find and add in abbr all over the place!
var replacing={
'TSV':'Tab-Separated Values',
'CSV':'Comma-Separated Values',
   'STs?':'Sequence Type',
   'CCs?':'Clonal Complex',
   'MGIP':'Meningococcus Genome Informatics Platform',
   'MLST':'Multilocus Sequence Typing',
   'GIT':'Georgia Institute of Technology',
   'CDC':'Centers for Disease Control and Prevention',
   'OMP':'Outer Membrane Protein'
};
$$('.systemMessage, .body p,.body
div,label,h1,h2,h3,h4,.menu.firefox').each(function(el){
  if(el.hasClassName('doNotDisturb')){
return; // equivalent to a continue inside of an each loop
  }
  el.select('text').each(function(s){
debug('textNode: '+s);
  });
  for(var k in replacing){
var v=replacing[k];
var find=new RegExp('\\b('+k+')\\b','g');
// I should use something like innerContext or innerText
instead of innerHTML
el.update(el.innerHTML.replace(find,"
$1",''));
   }
});

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread Jay

I was trying to scale down the example to the essence of the issue. Of
course, $('Contents') should be interchangeable with $$('#Contents'),
except that is the bug - it doesn't work on Safari or IE. In the real
world, I might want the selector to be more like $$('table#tblTMRoster
tbody tr td.countChecked'+i) - while there may be many tables with
such cells, I only want one table's worth. Another bug for another day
is this: even if there is only one table in the page, $$('tbody tr
td.countChecked'+i) returns not only the td's in the tbody, but also
the ones in the tfoot, and the only workaround I could come up with
was to prepend the table id on the selector to make it work.

Finally, while one assumes id's ought to be unique, $$('#contents')
returns an array of all elements with any case-variations like
contents, Contents, conTents, whatever. At least that bug is on
Safari, however not in Firefox nor IE. So again, if there is any way
to make Prototype.js wrap up these browser inconsistencies, it would
be a boon for the programmer.

Cheers,
--Jay

On Nov 19, 1:57 pm, "Alex Mcauley" <[EMAIL PROTECTED]>
wrote:
> $$() with # does not return anything more in the array than one element
> because id's should be unique ... its in the 
> docshttp://www.prototypejs.org/api/utility/dollar-dollar
>
> $$('#contents');
> // -> same as $('contents'), only it returns an array anyway (even though
> IDs must be unique within a document).
> you will be better off using $('abc') to gather your results as its cross
> browser and works as expected on all platforms supportedRegards
> Alex
>
> - Original Message -
> From: "Jay" <[EMAIL PROTECTED]>
> To: "Prototype & script.aculo.us" 
> Sent: Wednesday, November 19, 2008 4:34 PM
> Subject: [Proto-Scripty] cross browser $$ selector problems
>
> > Hi All,
>
> > I seem to be painted into a corner with use of $$ with respect to case
> > sensitivity of the id attribute of html elements. I get completely
> > opposite results between Firefox, Safari, and IE. All three work
> > differently. With an id such as "aBc", Firefox can only find it with $$
> > ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> > i.e. not at all case sensitive. I have a test case below - just run on
> > different browsers, and you will see different results.
>
> > Thanks,
> > --Jay
>
> > 
> > 
> > test4
> > http://ussda.demosphere.com/common/js/ps1.8.1/
> > prototype.js" language="JavaScript" type="text/javascript">
> > 
> > 
>
> >   mixed case 
> > 
>
> > 
> > var Test$$ = {
>
> >  test: function(x){
> >    return '\n $$("'+x+'").length = ' + $$(x).length;
> >  },
>
> >  setup: function() {
> >    var s = navigator.userAgent + ':';
> >    [true,false].each(function(dcase){
> >      s += '\n';
> >      ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
> >        if (dcase) x = x.toLowerCase();
> > s += Test$$.test(x);
> >      })
> >    })
> >    alert(s);
> >  }
>
> > }
>
> > document.observe('dom:loaded', function(){
> >  Test$$.setup();
> > });
>
> > 
>
> > 
> > 
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread Jay

Yes, you have captured the essence of the issue - unexpectedly
inconsistent results across browsers, with no apparent workaround
except to make all id's and all class names lower case. On my tests
using Windows XP Pro SP3, the browser versions were Firefox 3.0.4, IE
6.0.2900, and Safari 3.2. On the Mac OS X 10.5.4, I only have Safari
3.1.2, and it gives the same results as the Windows version.

Not sure why you think we can ignore the scenario where the case of
the ID is different: since case is significant, Safari and IE should
not find it, yet they do. Only Firefox properly finds no match.

On Nov 19, 2:41 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> Hi Jay,
>
> Thanks for this.  We can ignore the results for when the case of the
> ID you're requesting is different from the case of the ID on the
> table, since case is significant in IDs[1] -- not that I'm surprised
> to see that IE is, um, different there.
>
> So to my mind, that leaves us with this anomalous result:  If you have
> an element with an ID containing at least one upper-case character,
> the ID is not matched by selectors such as $$('#MyID') or $$
> ('table#MyID').  You should be getting back an array with one element;
> you're getting back no elements.  The selector works if the ID is in
> all lower-case (I checked).  Naturally, you can get around this using $
> (), but that's not necessarily the point. :-)
>
> Separately, a second result I noticed looking at the above:  Class
> selectors don't work on Safari if the class has an upper-case
> character in it.  Your element with the class "De" doesn't get matched
> by $$('td.De'), but it does if I change the class and selector to both
> be all lower-case.
>
> Does that capture it?
>
> Thanks again,
>
> [1]http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.2
>
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Nov 19, 4:34 pm, Jay <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I seem to be painted into a corner with use of $$ with respect to case
> > sensitivity of the id attribute of html elements. I get completely
> > opposite results between Firefox, Safari, and IE. All three work
> > differently. With an id such as "aBc", Firefox can only find it with $$
> > ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> > i.e. not at all case sensitive. I have a test case below - just run on
> > different browsers, and you will see different results.
>
> > Thanks,
> > --Jay
>
> > 
> > 
> > test4
> > http://ussda.demosphere.com/common/js/ps1.8.1/
> > prototype.js" language="JavaScript" type="text/javascript">
> > 
> > 
>
> >           mixed case 
> > 
> > 
>
> > 
> > var Test$$ = {
>
> >   test: function(x){
> >     return '\n $$("'+x+'").length = ' + $$(x).length;
> >   },
>
> >   setup: function() {
> >     var s = navigator.userAgent + ':';
> >     [true,false].each(function(dcase){
> >       s += '\n';
> >       ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
> >         if (dcase) x = x.toLowerCase();
> >         s += Test$$.test(x);
> >       })
> >     })
> >     alert(s);
> >   }
>
> > }
>
> > document.observe('dom:loaded', function(){
> >   Test$$.setup();
>
> > });
>
> > 
>
> > 
> > 
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Scriptacuous: autocomplete How do I update my database in PHP after the string is found

2008-11-19 Thread Ron Newman
If you're asking about the PHP part, all you need is an ID field in your
database table:

table fields:
ID
UNIQUE_CUST_ID

Judging by your code, UNIQUE_CUST_ID is probably text, something you can
enter in a user form.  I'd change it to something meaningful, like
'ARTISTNAME'.  And ID would be just a number assigned by the database.  It
should be defined 'auto_increment' so that it is automatically assigned
whenever you add a new entry, and is guaranteed to always be unique.

So, you change:
 $sql = "SELECT ARTISTNAME FROM tablename WHERE ARTISTNAME LIKE '%" .
$_POST['search'] . "%'";

To:  "SELECT ID, ARTISTNAME..."

Then using your code below, you get
$data["ID"]  has the ID number in it,
$data["ARTISTNAME"] has the name.

Then the crux of the matter:
You do an UPDATE:
$sql = UPDATE tablename set ARTISTNAME='your new value' WHERE ID=$data["ID"]


This is two database queries.  You can do it in one, but I'd get this going
first.  To do it in one, you use 'ON DUPLICATE ENTRY..." and some more
stuff.

Ron




On Wed, Nov 19, 2008 at 3:22 PM, alohaaaron <[EMAIL PROTECTED]> wrote:

>
> Hi, I'm trying to update my database with the string that is selected
> by the user but am not sure how to do so?  Thank you.
>
> Here is my call in html.
>
> 
> 
>
>  
>  language='javascript'
> charset='utf-8'>
> //   new
> Ajax.Autocompleter('search','autocomplete_choices','ajax-
> autocompletion/server.php',{minChars: 3,afterUpdateElement :
> getSelectedId});
>// ]]>
>
>function getSelectedId(text, li) {
>$('artist_id').value=li.id;
>}
>
>
> The PHP code from wiseguys
>
>$sql = "SELECT UNIQUE_CUST_ID FROM MyDB WHERE UNIQUE_CUST_ID
> LIKE
> '%" . $_POST['search'] . "%'";
>$rs = mysql_query($sql);
> ?>
>
> 
>
> 
>  
> 
> 
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Scriptaclous Problem

2008-11-19 Thread alohaaaron

Thanks colin!

On Nov 12, 4:16 am, ColinFine <[EMAIL PROTECTED]> wrote:
> On Nov 11, 4:45 pm,alohaaaron<[EMAIL PROTECTED]> wrote:
>
> ...
>
> > I also can't get the results to show by just the first letter.  Say if
> > the list contains coffee and frank, I type f and just want frank to be
> > found, not coffee.  But it shows both frank and coffee.  Here is the
> > link
>
> > here is the php lookup
>
> >         $sql = "SELECT UNIQUE_CUST_ID FROM test2 WHERE UNIQUE_CUST_ID LIKE
> > '%" . $_POST['search'] . "%'";
> >         $rs = mysql_query($sql);
> > ?>
>
> That's because you're telling it in the SQL to match any string
> containing (not just starting with) the search string.
>
> Change
>  '%" . $_POST['search'] . "%'";
> to
>  '" . $_POST['search'] . "%'";
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Scriptacuous: autocomplete How do I update my database in PHP after the string is found

2008-11-19 Thread alohaaaron

Hi, I'm trying to update my database with the string that is selected
by the user but am not sure how to do so?  Thank you.

Here is my call in html.




  
 
 // 

function getSelectedId(text, li) {
$('artist_id').value=li.id;
}


The PHP code from wiseguys

$sql = "SELECT UNIQUE_CUST_ID FROM MyDB WHERE UNIQUE_CUST_ID
LIKE
'%" . $_POST['search'] . "%'";
$rs = mysql_query($sql);
?>




  


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: menu bar

2008-11-19 Thread Brian Williams
the UL tag will also degrade somewhat gracefully for hand held browsers



On Wed, Nov 19, 2008 at 10:24 AM, K.C.Leung <[EMAIL PROTECTED]> wrote:

>
> I think all the menu should be base on "ul" --> "li" --> "ul" -->
> "li", "li" .
> Then you can design your style by yourself to make it look like "menu"
>
> On Nov 19, 10:50 pm, "jason maina" <[EMAIL PROTECTED]> wrote:
> > Hi guys/galz,
> >
> > Would like to make a menu like the one for facebook, any ideas??
> >
> > Regards
> > Jason
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Focused field

2008-11-19 Thread Hector Virgen
A prototype way might go something like this (untested):
var focused;

Event.observe(document, 'dom:loaded', function()
{
$$('input, select, textarea').invoke('observe', 'focus', function(event)
{
focused = event.element();
});
});


-Hector


On Wed, Nov 19, 2008 at 7:50 AM, EMoreth <[EMAIL PROTECTED]> wrote:

>
> You can play with something like this:
>
> 
> 
> 
> var CurrentObj;
> 
> 
> 
> 
> 
> 
> 1
> 
> 
>
> It is not prototype based but is very usefull.(Not tested in other
> than IE)
>
> Emoreth
>
> On 19 nov, 09:25, Jeztah <[EMAIL PROTECTED]> wrote:
> > Is there a mthod on prototype or nativejs to work out what part of the
> > document the user is focused on currently ?
> >
> > I am trying to iron out a bug in somehting and need to work out what
> > element they are currently on (form/div/span etc etc)
> >
> > Regards
> > Alex
>
> >
>

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



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread T.J. Crowder

Sorry for the double-post:  What version of Safari are you using and
on what platform?  I've replicated the results in my post with Safari
3.1.2 for Windows on Windows XP.

-- T.J.

On Nov 19, 7:41 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> Hi Jay,
>
> Thanks for this.  We can ignore the results for when the case of the
> ID you're requesting is different from the case of the ID on the
> table, since case is significant in IDs[1] -- not that I'm surprised
> to see that IE is, um, different there.
>
> So to my mind, that leaves us with this anomalous result:  If you have
> an element with an ID containing at least one upper-case character,
> the ID is not matched by selectors such as $$('#MyID') or $$
> ('table#MyID').  You should be getting back an array with one element;
> you're getting back no elements.  The selector works if the ID is in
> all lower-case (I checked).  Naturally, you can get around this using $
> (), but that's not necessarily the point. :-)
>
> Separately, a second result I noticed looking at the above:  Class
> selectors don't work on Safari if the class has an upper-case
> character in it.  Your element with the class "De" doesn't get matched
> by $$('td.De'), but it does if I change the class and selector to both
> be all lower-case.
>
> Does that capture it?
>
> Thanks again,
>
> [1]http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.2
>
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Nov 19, 4:34 pm, Jay <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I seem to be painted into a corner with use of $$ with respect to case
> > sensitivity of the id attribute of html elements. I get completely
> > opposite results between Firefox, Safari, and IE. All three work
> > differently. With an id such as "aBc", Firefox can only find it with $$
> > ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> > i.e. not at all case sensitive. I have a test case below - just run on
> > different browsers, and you will see different results.
>
> > Thanks,
> > --Jay
>
> > 
> > 
> > test4
> > http://ussda.demosphere.com/common/js/ps1.8.1/
> > prototype.js" language="JavaScript" type="text/javascript">
> > 
> > 
>
> >           mixed case 
> > 
> > 
>
> > 
> > var Test$$ = {
>
> >   test: function(x){
> >     return '\n $$("'+x+'").length = ' + $$(x).length;
> >   },
>
> >   setup: function() {
> >     var s = navigator.userAgent + ':';
> >     [true,false].each(function(dcase){
> >       s += '\n';
> >       ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
> >         if (dcase) x = x.toLowerCase();
> >         s += Test$$.test(x);
> >       })
> >     })
> >     alert(s);
> >   }
>
> > }
>
> > document.observe('dom:loaded', function(){
> >   Test$$.setup();
>
> > });
>
> > 
>
> > 
> > 
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread T.J. Crowder

Hi Jay,

Thanks for this.  We can ignore the results for when the case of the
ID you're requesting is different from the case of the ID on the
table, since case is significant in IDs[1] -- not that I'm surprised
to see that IE is, um, different there.

So to my mind, that leaves us with this anomalous result:  If you have
an element with an ID containing at least one upper-case character,
the ID is not matched by selectors such as $$('#MyID') or $$
('table#MyID').  You should be getting back an array with one element;
you're getting back no elements.  The selector works if the ID is in
all lower-case (I checked).  Naturally, you can get around this using $
(), but that's not necessarily the point. :-)

Separately, a second result I noticed looking at the above:  Class
selectors don't work on Safari if the class has an upper-case
character in it.  Your element with the class "De" doesn't get matched
by $$('td.De'), but it does if I change the class and selector to both
be all lower-case.

Does that capture it?

Thanks again,

[1] http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.2

--
T.J. Crowder
tj / crowder software / com

On Nov 19, 4:34 pm, Jay <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I seem to be painted into a corner with use of $$ with respect to case
> sensitivity of the id attribute of html elements. I get completely
> opposite results between Firefox, Safari, and IE. All three work
> differently. With an id such as "aBc", Firefox can only find it with $$
> ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> i.e. not at all case sensitive. I have a test case below - just run on
> different browsers, and you will see different results.
>
> Thanks,
> --Jay
>
> 
> 
> test4
> http://ussda.demosphere.com/common/js/ps1.8.1/
> prototype.js" language="JavaScript" type="text/javascript">
> 
> 
>
>           mixed case 
> 
>
> 
> var Test$$ = {
>
>   test: function(x){
>     return '\n $$("'+x+'").length = ' + $$(x).length;
>   },
>
>   setup: function() {
>     var s = navigator.userAgent + ':';
>     [true,false].each(function(dcase){
>       s += '\n';
>       ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
>         if (dcase) x = x.toLowerCase();
>         s += Test$$.test(x);
>       })
>     })
>     alert(s);
>   }
>
> }
>
> document.observe('dom:loaded', function(){
>   Test$$.setup();
>
> });
>
> 
>
> 
> 
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to override / hack Element.update function?

2008-11-19 Thread EMoreth

I had this kind of problem some time ago..

I had a table that was generated by javascript showing values that
were added to the database from all users. So when the administrator
needed to get the full table it took years to load.

This kind of thing is generally only text data, with no "script" tags
that needed to be evaluated (this consumes a lot if time on
Prototype.Element.update method).

Check if you can change some if your update codes to innerHTML's,
probably lots of them will don't need to be evaluated ass javascript
scripts.

In the case you are adding Object Elements try element.wrap
('span').innerHTML this still intends to be faster than update()
(again for not evaluating script tags).


EMoreth

On 19 nov, 09:33, kangax <[EMAIL PROTECTED]> wrote:
> polydor wrote:
> > Hi,
>
> > I want to make a huge table using Prototype.  my script has 2900 calls
> > to Element.update. These calls lasts 4 seconds, which is a lot.  This
> > is mainly taken up by the regular expressions in the function, to
> > identify scripts inside the body I want to insert in the node.  By
> > just removing these script-related code out of the update-function, I
> > have a huge performance boost.
>
> > I don't want to customize my local prototype.js file, but want to
> > override the function.  I tried something like this:
>
> > Element.Methods.update = function(element, content) {
> >     element = $(element);
> >     if (content && content.toElement) content = content.toElement();
> >     if (Object.isElement(content)) return element.update().insert
> > (content);
> >     content = Object.toHTML(content);
> >     element.innerHTML = content;
> > //    element.innerHTML = content.stripScripts();
> > //    content.evalScripts.bind(content).defer();
> >     return element;
> > };
>
> > This didn't change my method.
>
> > Adding a new method
> > Element.Methods.simpleUpdate = function(element, content) {
> > ...
> > or
> > Object.extend(Element, {
> > simpleUpdate: function(element, content) {
> > ...
>
> > doesn't work either.
>
> > How can I get it work, or is there an alternative in which I don't
> > have to use the update-function, besides updating it by changing the
> > innerHTML property myself.
>
> Is there a reason you wish to use `update` over just assigning to
> `innerHTML` directly? I would suggest to go with the latter one, but
> if you must:
>
> Element.addMethods({
>   update: function(){ ... }
>
> });
>
> P.S. Also, don't forget that Element#update (among others) is
> redefined for IE later during initialization time.
>
> --
> kangax- Ocultar texto entre aspas -
>
> - Mostrar texto entre aspas -

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Portal Interface

2008-11-19 Thread disccomp

Bugs Fixed, now works as expected in the tested browsers, watch window
added to the sample page.

Tested Browsers:
FireFox 1.5.0.10, 2.0.0.6, 3.04
Safari 3.04, 3.2
IE 7.0.5730.11, 8.0.6001.18241
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Passing variables after an onComplete

2008-11-19 Thread EMoreth

I don't know if i really understood the problem here...

But onComplete gets a XMLHttpRequest object. that has your server
response on XMLHttpRequest.responseText. in your case:
val.responseText.

Passing val as a parameter is a fully new Object as a value of
parameter. This is not allowed...

Had you tried this ??

EMoreth

On 19 nov, 05:50, "James Hoddinott" <[EMAIL PROTECTED]> wrote:
> 2008/11/18 Matt Foster <[EMAIL PROTECTED]>:
>
>
>
> >> No, its all POST methods being used here.
>
> >> >>         new 
> >> >> Ajax.Updater('respanel','data/fetchrespanel.php',{method:'get'});
>
> Ah, that looks to be an error between whats on my server and what I
> pasted into my email; I must have altered it afterwards having
> noticed!
>
> --
> James Hoddinott

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Creating New Dom elements with Prototype don't display in IE, hmm?

2008-11-19 Thread Outpost

That worked like a charm. Added a tbody and IE fell right in line.
Thanks for the feed back.

Cheers,
MK


On Nov 18, 5:16 pm, "Jonathan Rosenberg" <[EMAIL PROTECTED]> wrote:
> Not much info to go on, but ... are you using tables?  If so, did you include 
> tbody, tfoot & theadelements?
>
> --
> Jonathan Rosenberg
> Founder & Executive Director, Tabby's Placehttp://www.tabbysplace.org/
>
> > -Original Message-
> > From:prototype-scriptaculous@googlegroups.com [mailto:[EMAIL PROTECTED] On
> > Behalf Of Outpost
> > Sent: Tuesday, November 18, 2008 12:30
> > To:Prototype& script.aculo.us
> > Subject: 
> > [Proto-Scripty]CreatingNewDomelementswithPrototypedon'tdisplayinIE,hmm?
>
> > Hi,
>
> > I am writing a simple calendar script. UsingPrototype(1.6) I update
> > the calendar's tablecreatingand insertingnewelements(TR, TD) for
> > the days in to theDOM, applying Click Events to the TD along the way.
>
> > The calendar works great on everything butIE(6,7), where the calendar
> > simply disappears when it is initialized.
> > InIEI have verified thenewDOMelementshave been created, they
> > simply do notdisplayin the browser, no errors reported by the
> > browser either.
>
> > If I change the script to generate the calendar as an HTML string and
> > use the Element.update(htmStr) it displays inIEjust fine, however I
> > loose the ability to add Click Events to the calendar days while I
> > generate thenewcalendar.
>
> > Any ideas whyIEsimply will notdisplaythenewDOMelements?
>
> > Any thoughts?
>
> > Michael Klauss

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: menu bar

2008-11-19 Thread K.C.Leung

I think all the menu should be base on "ul" --> "li" --> "ul" -->
"li", "li" .
Then you can design your style by yourself to make it look like "menu"

On Nov 19, 10:50 pm, "jason maina" <[EMAIL PROTECTED]> wrote:
> Hi guys/galz,
>
> Would like to make a menu like the one for facebook, any ideas??
>
> Regards
> Jason

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: InPlaceEditor Is there a way to control the sending?

2008-11-19 Thread EMoreth

You can do it if you want to. But one of the great things of
inPlaceEditor is to update database on live and to have the updated
feedback.

If tou change this yuu will have to create a way to tell the users
wich fields were updated and wich were not. (And depending on how many
fields he had edited he will not remember what he wrote on that...).

The total calls to your server should not worry you, because nowadays
it is better to have lots of small connections than have one single
connection doing lots of stuff.
Try to think like this: If your server can attend 20 people at same
time, and you have 200 people using it.If half of them save a huge
thing almost in the same time, the last one will wait lots of time to
get a answer, but if all of them start to make little and fast changes
all time, none of them will wait to much.

If you are experiencing server problems, try to use (if you are not) a
persistent connection with the bank. This can down load you server a
lot.

EMoreth

On 19 nov, 03:29, disappearedng <[EMAIL PROTECTED]> wrote:
> Hi everyone,
> I have played around the InPlaceEditor for a while now and I notice
> that upon completion of the text field, the InPlaceEditor immediately
> makes a call the url supplied by the user.
>
> I think this is kind of inefficient. Is there a way such that upon
> complete, I can write a function that can push the value of the text
> into a queue and hence reduce the total number of calls to my server?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Strange Fade/Appear behavior in IE

2008-11-19 Thread lagoa89

Hi Glenn,

I had the same problem with scriptaculous fade in IE; your suggestion
of setting the style to include "overflow:hidden" worked very well.

Thank you!

David

On Oct 3, 8:00 pm, Glenn Wang <[EMAIL PROTECTED]> wrote:
> Thanks for your response. I tried as you mentioned, but couldn't get
> the afterFinish:function() part to work properly, and it didn't help
> with IE's behavior.
>
> Out of pure luck, I think I've stumbled upon the solution--add
> "Overflow: Hidden" to the style of each frame's DIV.
>
> On Oct 3, 9:38 pm, Diodeus <[EMAIL PROTECTED]> wrote:
>
> > For starters, don't use setTimeout to control the flipping of slides.
> > Use the built-in delay function.
>
> > Instead of this:
>
> >  setTimeout("Effect.Appear('slideshow" + frame + "');", 1000);
>
> > Do this:
>
> > new Effect.Appear('slideshow'+frame,{delay:1.0})
>
> > If you need to call another function after the effect runs, do this:
>
> > new Effect.Appear('slideshow'+frame,{delay:1.0, afterFinish:function()
> > {somethingElse()}})

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Focused field

2008-11-19 Thread EMoreth

You can play with something like this:




var CurrentObj;






1



It is not prototype based but is very usefull.(Not tested in other
than IE)

Emoreth

On 19 nov, 09:25, Jeztah <[EMAIL PROTECTED]> wrote:
> Is there a mthod on prototype or nativejs to work out what part of the
> document the user is focused on currently ?
>
> I am trying to iron out a bug in somehting and need to work out what
> element they are currently on (form/div/span etc etc)
>
> Regards
> Alex

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



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread Alex Mcauley

$$() with # does not return anything more in the array than one element 
because id's should be unique ... its in the docs
http://www.prototypejs.org/api/utility/dollar-dollar


$$('#contents');
// -> same as $('contents'), only it returns an array anyway (even though 
IDs must be unique within a document).
you will be better off using $('abc') to gather your results as its cross 
browser and works as expected on all platforms supportedRegards
Alex
- Original Message - 
From: "Jay" <[EMAIL PROTECTED]>
To: "Prototype & script.aculo.us" 
Sent: Wednesday, November 19, 2008 4:34 PM
Subject: [Proto-Scripty] cross browser $$ selector problems


>
> Hi All,
>
> I seem to be painted into a corner with use of $$ with respect to case
> sensitivity of the id attribute of html elements. I get completely
> opposite results between Firefox, Safari, and IE. All three work
> differently. With an id such as "aBc", Firefox can only find it with $$
> ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> i.e. not at all case sensitive. I have a test case below - just run on
> different browsers, and you will see different results.
>
> Thanks,
> --Jay
>
> 
> 
> test4
> http://ussda.demosphere.com/common/js/ps1.8.1/
> prototype.js" language="JavaScript" type="text/javascript">
> 
> 
>
>   mixed case 
> 
>
> 
> var Test$$ = {
>
>  test: function(x){
>return '\n $$("'+x+'").length = ' + $$(x).length;
>  },
>
>  setup: function() {
>var s = navigator.userAgent + ':';
>[true,false].each(function(dcase){
>  s += '\n';
>  ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
>if (dcase) x = x.toLowerCase();
> s += Test$$.test(x);
>  })
>})
>alert(s);
>  }
>
> }
>
> document.observe('dom:loaded', function(){
>  Test$$.setup();
> });
>
> 
>
> 
> 
>
>
> >
> 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] cross browser $$ selector problems

2008-11-19 Thread Jay

Hi All,

I seem to be painted into a corner with use of $$ with respect to case
sensitivity of the id attribute of html elements. I get completely
opposite results between Firefox, Safari, and IE. All three work
differently. With an id such as "aBc", Firefox can only find it with $$
('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
i.e. not at all case sensitive. I have a test case below - just run on
different browsers, and you will see different results.

Thanks,
--Jay



test4
http://ussda.demosphere.com/common/js/ps1.8.1/
prototype.js" language="JavaScript" type="text/javascript">



  mixed case 



var Test$$ = {

  test: function(x){
return '\n $$("'+x+'").length = ' + $$(x).length;
  },

  setup: function() {
var s = navigator.userAgent + ':';
[true,false].each(function(dcase){
  s += '\n';
  ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
if (dcase) x = x.toLowerCase();
s += Test$$.test(x);
  })
})
alert(s);
  }

}

document.observe('dom:loaded', function(){
  Test$$.setup();
});







--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Focused field

2008-11-19 Thread Matt Foster

Tricky stuff, focus doesn't bubble so you can't watch it up top and
flag the target like you could with click...

I'd collect all elements that support the focus event, watch for it
and manage the reference of lastFocused to determine what the user is
currently focused on.



On Nov 19, 7:25 am, Jeztah <[EMAIL PROTECTED]> wrote:
> Is there a mthod on prototype or nativejs to work out what part of the
> document the user is focused on currently ?
>
> I am trying to iron out a bug in somehting and need to work out what
> element they are currently on (form/div/span etc etc)
>
> Regards
> Alex
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Is there a way to produce something similar to Google Calendar's Grid

2008-11-19 Thread George

TJ - Have a look at Scal - I've hacked it up a bit to suit myself, but
it's a great place to start:

http://scal.fieldguidetoprogrammers.com/scal-v02-documentation/scal-demo

Interestingly, it even has a google calendar skin.

All the best

George

On Nov 19, 10:51 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> > Is there a way to produce a grid whereby clicking the anywhere on the
> > grid will result in an action that I would like to perform
> > specifically to that point?
> > ...
> > something that can behave like this (maybe a white button)
> > ...
>
> Yes, that's not a problem, you can use divs or spans, since you get
> "click" events on all elements, not just buttons.
>
> Here's a quick example:  http://pastie.org/318600
>
> That uses:
>
> * The Prototype dom:loaded event[1] to trigger page initialization
> * Element#observe[2] to watch the div containing the calendar for
> clicks on it or its descendants
> * Event#findElement[3] to find the element that was actually clicked.
> Event#findElement accepts a CSS selector and finds the first matching
> element starting from the element that was actually clicked and then
> looking up through its ancestors.  Very handy for event delegation,
> which is what we're doing here to avoid having to watch each day
> individually.
> * Event#pointerX[4] and Event#pointerY to find out where the mouse was
> clicked
>
> [1]http://prototypejs.org/api/document/observe
> [2]http://prototypejs.org/api/element/observe
> [3]http://prototypejs.org/api/event/findElement
> [4]http://prototypejs.org/api/event/pointerX
>
> HTH,
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Nov 19, 6:33 am, disappearedng <[EMAIL PROTECTED]> wrote:
>
> > Hi everyone
> > Is there a way to produce a grid whereby clicking the anywhere on the
> > grid will result in an action that I would like to perform
> > specifically to that point? I know I sound confusing but I am actually
> > looking for something similar to google's calendar. Is there something
> > out there that is similar - when you click on a particular box, a
> > dialog pops up and ask you what the event details are etc etc.
>
> > Is there a way to make an entire area populated with a unit of
> > something that can behave like this (maybe a white button) and then
> > generating tons of these to cover an entire area?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: $('tableid').down('tbody').insert(tr, 'top') working but...

2008-11-19 Thread jason maina
Thanx it works like a charm bet thats what i was missing thanx again


On Wed, Nov 19, 2008 at 7:33 PM, George <[EMAIL PROTECTED]>wrote:

>
> For what it's worth, I thought the syntax was
>
> insert({top : 'tr'})
>
> Give that a whirl
>
> All the best
>
> George
>
> On Nov 19, 4:27 pm, "jason maina" <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > As per the subject i'm building DOM elements on the fly and its working
> nice
> > but when i try to insert a new row with controls to add new entry the row
> > goes to the bottom of the table, could i be missing anything??
> >
> > code:http://pastie.org/318817
> >
> > Kind regards
> > Jason
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: cross browser $$ selector problems

2008-11-19 Thread Jay

sorry, I meant to make the prototype library src link more generic
before sending - just point it to your favorite 1.6.0.3 link

On Nov 19, 11:34 am, Jay <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I seem to be painted into a corner with use of $$ with respect to case
> sensitivity of the id attribute of html elements. I get completely
> opposite results between Firefox, Safari, and IE. All three work
> differently. With an id such as "aBc", Firefox can only find it with $$
> ('#aBc') and Safari can find it only with $$('#abc'). IE finds both,
> i.e. not at all case sensitive. I have a test case below - just run on
> different browsers, and you will see different results.
>
> Thanks,
> --Jay
>
> 
> 
> test4
> http://ussda.demosphere.com/common/js/ps1.8.1/
> prototype.js" language="JavaScript" type="text/javascript">
> 
> 
>
>           mixed case 
> 
>
> 
> var Test$$ = {
>
>   test: function(x){
>     return '\n $$("'+x+'").length = ' + $$(x).length;
>   },
>
>   setup: function() {
>     var s = navigator.userAgent + ':';
>     [true,false].each(function(dcase){
>       s += '\n';
>       ['table#aBc1','#aBc1','table#aBc1 td.De'].each(function(x){
>         if (dcase) x = x.toLowerCase();
>         s += Test$$.test(x);
>       })
>     })
>     alert(s);
>   }
>
> }
>
> document.observe('dom:loaded', function(){
>   Test$$.setup();
>
> });
>
> 
>
> 
> 
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: $('tableid').down('tbody').insert(tr, 'top') working but...

2008-11-19 Thread George

For what it's worth, I thought the syntax was

insert({top : 'tr'})

Give that a whirl

All the best

George

On Nov 19, 4:27 pm, "jason maina" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> As per the subject i'm building DOM elements on the fly and its working nice
> but when i try to insert a new row with controls to add new entry the row
> goes to the bottom of the table, could i be missing anything??
>
> code:http://pastie.org/318817
>
> Kind regards
> Jason
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: $('tableid').down('tbody').insert(tr, 'top') working but...

2008-11-19 Thread Hector Virgen
I believe Element#insert() expects an object as its parameter, like this:

$('tableid').down('tbody').insert({top: tr});

http://prototypejs.org/api/element/insert

-Hector


On Wed, Nov 19, 2008 at 8:27 AM, jason maina <[EMAIL PROTECTED]> wrote:

> Hi,
>
> As per the subject i'm building DOM elements on the fly and its working
> nice but when i try to insert a new row with controls to add new entry the
> row goes to the bottom of the table, could i be missing anything??
>
> code:
> http://pastie.org/318817
>
> Kind regards
> Jason
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] $('tableid').down('tbody').insert(tr, 'top') working but...

2008-11-19 Thread jason maina
Hi,

As per the subject i'm building DOM elements on the fly and its working nice
but when i try to insert a new row with controls to add new entry the row
goes to the bottom of the table, could i be missing anything??

code:
http://pastie.org/318817

Kind regards
Jason

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Nulling or stopping Dynamic Variables

2008-11-19 Thread Alex Mcauley

As an added bonus totally unforseen by me, when removing the element that 
the object was initialized in - it seems to remove the object too ...

i.e the Object was created in an ajax callback in an element .. once i 
applied $('div').remove(); to the element that created it then it seems to 
remove it !!!

Bonus :D

Regards
Alex


- Original Message - 
From: "T.J. Crowder" <[EMAIL PROTECTED]>
To: "Prototype & script.aculo.us" 
Sent: Wednesday, November 19, 2008 12:56 PM
Subject: [Proto-Scripty] Re: Nulling or stopping Dynamic Variables



Hi Alex,

You can do this pretty easily with properties of an object.  The cool
thing about properties of objects in JavaScript (well, *one* of the
cool things) is that you can reference them both literally using
dotted notation and via a string using bracket notation.
Consequently, these snippets are all functionally identical;

1) x = myobject.myproperty;
2) x = myobject['myproperty'];
3) x = myobject[s]; // (assuming 's' is a variable containing the
string "myproperty")
4) x = myobject['my' + s]; // (assuming 's' contains the string
"property")

You get the idea.

So somewhere appropriate (if it has to be global, so be it, but if you
can avoid that...), create an object that will contain these:
* * * *
var pebag = {};
* * * *

Then make your references properties on that object:
* * * *
pebag.checkRecord_123423414 = new PeriodicalExecuter(function() {
testingRecord('123423414');
},7);
* * * *

Then when you want to get rid of them:
* * * *
delete pebag['checkRecord_' + s];
* * * *
...where 's' is a variable containing the string '123423414'.

If you prefer not using something like 'pebag', you could use the
window object (and many do), but FWIW I'd recommend using something
specially for the purpose; the namespace of the window object tends to
get crowded, not least because of the Horror of Implicit Globals.[1]

[1] http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html

HTH,
--
T.J. Crowder
tj / crowder software / com

On Nov 19, 12:12 pm, Jeztah <[EMAIL PROTECTED]> wrote:
> Mornign Guys/Girls
>
> I am having some trouble nulling out or stopping some dynamic
> variables i have created ...
>
> I have built a dynamic window system which does alot of things, one is
> checking a database to ensure the most up to date information is in
> input boxes ... Now to check this i create a dynamic variable when the
> contents is loaded via an ajax request...
>
> [code]
>
> checkRecord_ = new PeriodicalExecuter(function()
> {
>
> testingRecord('');
>
> },7);
>
> [/code]
>
> in this rand is just a unix epoch on when the page was created and is
> referenced throughout the whole entire page and all its elements ...
>
> for those that dont know php here is a simpler version of the code
> [code]
>
> checkRecord_123423414 = new PeriodicalExecuter(function() {
>
> testingRecord('123423414');
>
> },7);
>
> [/code]
>
> in the DOM there is now a variable called
> "checkRecord_123423414" (please bear in mind this is dynamic so i cant
> just do checkRecord_123423414=null; when i want to null it or stop the
> object as the ending string is allways different dependant on what
> page you are on ...
>
> Now the problem i get is when closing the windows in the system (which
> are just div containers) i have to stop observing alot of stuff ...
> this is done quite easily with stopObserving();
>
> But i need to stop the PeriodicalExecutor from continuing once the
> window is closed ...
>
> i have tried to use "checkRecord_+e.stop();" (`e` is the random string
> passed to it) but it gives me a syntax error
> i have tried to use "checkRecord_+e=null;" but the interpretor does
> not recognise the dynamic variable . is there a way i can assign
> the variable to something so it inherits all of the things i need to
> stop in it ..
>
> Something like (PSUEDO CODE)
> [psuedo code]
> var blah='checkRecord_'+e;
> blah=null;
> [/psuedo code]
>
> Will this inherit the "new PeriodicalExecutor" stuff in it so i can
> null the object and stop it listening ?
>
> It allready half works just by closing the window, but if you close it
> while its doing a request (testingRecord();)
> it moans about things being null (as they are removed from the dom
> prior to the object being nulled out !!!
>
> Sorry if this makes no sense at all !! if anything needs clarifying
> please ask
>
> Regards
> Alex



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



[Proto-Scripty] menu bar

2008-11-19 Thread jason maina
Hi guys/galz,

Would like to make a menu like the one for facebook, any ideas??

Regards
Jason

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Nulling or stopping Dynamic Variables

2008-11-19 Thread Alex Mcauley

Thanks TJ, i will implement it now ... i didnt realise i could use brackets 
and dots on global variables !!..

being a javascript newbie of only a year i guess thats why !!

Thanks Again

Alex

- Original Message - 
From: "T.J. Crowder" <[EMAIL PROTECTED]>
To: "Prototype & script.aculo.us" 
Sent: Wednesday, November 19, 2008 12:56 PM
Subject: [Proto-Scripty] Re: Nulling or stopping Dynamic Variables



Hi Alex,

You can do this pretty easily with properties of an object.  The cool
thing about properties of objects in JavaScript (well, *one* of the
cool things) is that you can reference them both literally using
dotted notation and via a string using bracket notation.
Consequently, these snippets are all functionally identical;

1) x = myobject.myproperty;
2) x = myobject['myproperty'];
3) x = myobject[s]; // (assuming 's' is a variable containing the
string "myproperty")
4) x = myobject['my' + s]; // (assuming 's' contains the string
"property")

You get the idea.

So somewhere appropriate (if it has to be global, so be it, but if you
can avoid that...), create an object that will contain these:
* * * *
var pebag = {};
* * * *

Then make your references properties on that object:
* * * *
pebag.checkRecord_123423414 = new PeriodicalExecuter(function() {
testingRecord('123423414');
},7);
* * * *

Then when you want to get rid of them:
* * * *
delete pebag['checkRecord_' + s];
* * * *
...where 's' is a variable containing the string '123423414'.

If you prefer not using something like 'pebag', you could use the
window object (and many do), but FWIW I'd recommend using something
specially for the purpose; the namespace of the window object tends to
get crowded, not least because of the Horror of Implicit Globals.[1]

[1] http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html

HTH,
--
T.J. Crowder
tj / crowder software / com

On Nov 19, 12:12 pm, Jeztah <[EMAIL PROTECTED]> wrote:
> Mornign Guys/Girls
>
> I am having some trouble nulling out or stopping some dynamic
> variables i have created ...
>
> I have built a dynamic window system which does alot of things, one is
> checking a database to ensure the most up to date information is in
> input boxes ... Now to check this i create a dynamic variable when the
> contents is loaded via an ajax request...
>
> [code]
>
> checkRecord_ = new PeriodicalExecuter(function()
> {
>
> testingRecord('');
>
> },7);
>
> [/code]
>
> in this rand is just a unix epoch on when the page was created and is
> referenced throughout the whole entire page and all its elements ...
>
> for those that dont know php here is a simpler version of the code
> [code]
>
> checkRecord_123423414 = new PeriodicalExecuter(function() {
>
> testingRecord('123423414');
>
> },7);
>
> [/code]
>
> in the DOM there is now a variable called
> "checkRecord_123423414" (please bear in mind this is dynamic so i cant
> just do checkRecord_123423414=null; when i want to null it or stop the
> object as the ending string is allways different dependant on what
> page you are on ...
>
> Now the problem i get is when closing the windows in the system (which
> are just div containers) i have to stop observing alot of stuff ...
> this is done quite easily with stopObserving();
>
> But i need to stop the PeriodicalExecutor from continuing once the
> window is closed ...
>
> i have tried to use "checkRecord_+e.stop();" (`e` is the random string
> passed to it) but it gives me a syntax error
> i have tried to use "checkRecord_+e=null;" but the interpretor does
> not recognise the dynamic variable . is there a way i can assign
> the variable to something so it inherits all of the things i need to
> stop in it ..
>
> Something like (PSUEDO CODE)
> [psuedo code]
> var blah='checkRecord_'+e;
> blah=null;
> [/psuedo code]
>
> Will this inherit the "new PeriodicalExecutor" stuff in it so i can
> null the object and stop it listening ?
>
> It allready half works just by closing the window, but if you close it
> while its doing a request (testingRecord();)
> it moans about things being null (as they are removed from the dom
> prior to the object being nulled out !!!
>
> Sorry if this makes no sense at all !! if anything needs clarifying
> please ask
>
> Regards
> Alex



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



[Proto-Scripty] Re: Nulling or stopping Dynamic Variables

2008-11-19 Thread T.J. Crowder

Hi Alex,

You can do this pretty easily with properties of an object.  The cool
thing about properties of objects in JavaScript (well, *one* of the
cool things) is that you can reference them both literally using
dotted notation and via a string using bracket notation.
Consequently, these snippets are all functionally identical;

1) x = myobject.myproperty;
2) x = myobject['myproperty'];
3) x = myobject[s]; // (assuming 's' is a variable containing the
string "myproperty")
4) x = myobject['my' + s]; // (assuming 's' contains the string
"property")

You get the idea.

So somewhere appropriate (if it has to be global, so be it, but if you
can avoid that...), create an object that will contain these:
* * * *
var pebag = {};
* * * *

Then make your references properties on that object:
* * * *
pebag.checkRecord_123423414 = new PeriodicalExecuter(function() {
testingRecord('123423414');
},7);
* * * *

Then when you want to get rid of them:
* * * *
delete pebag['checkRecord_' + s];
* * * *
...where 's' is a variable containing the string '123423414'.

If you prefer not using something like 'pebag', you could use the
window object (and many do), but FWIW I'd recommend using something
specially for the purpose; the namespace of the window object tends to
get crowded, not least because of the Horror of Implicit Globals.[1]

[1] http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html

HTH,
--
T.J. Crowder
tj / crowder software / com

On Nov 19, 12:12 pm, Jeztah <[EMAIL PROTECTED]> wrote:
> Mornign Guys/Girls
>
> I am having some trouble nulling out or stopping some dynamic
> variables i have created ...
>
> I have built a dynamic window system which does alot of things, one is
> checking a database to ensure the most up to date information is in
> input boxes ... Now to check this i create a dynamic variable when the
> contents is loaded via an ajax request...
>
> [code]
>
> checkRecord_ = new PeriodicalExecuter(function()
> {
>
>                 testingRecord('');
>
>  },7);
>
> [/code]
>
> in this rand is just a unix epoch on when the page was created and is
> referenced throughout the whole entire page and all its elements ...
>
> for those that dont know php here is a simpler version of the code
> [code]
>
> checkRecord_123423414 = new PeriodicalExecuter(function() {
>
>                 testingRecord('123423414');
>
>  },7);
>
> [/code]
>
> in the DOM there is now a variable called
> "checkRecord_123423414" (please bear in mind this is dynamic so i cant
> just do checkRecord_123423414=null; when i want to null it or stop the
> object as the ending string is allways different dependant on what
> page you are on ...
>
> Now the problem i get is when closing the windows in the system (which
> are just div containers) i have to stop observing alot of stuff ...
> this is done quite easily with stopObserving();
>
> But i need to stop the PeriodicalExecutor from continuing once the
> window is closed ...
>
> i have tried to use "checkRecord_+e.stop();" (`e` is the random string
> passed to it) but it gives me a syntax error
> i have tried to use "checkRecord_+e=null;"  but the interpretor does
> not recognise the dynamic variable . is there a way i can assign
> the variable to something so it inherits all of the things i need to
> stop in it ..
>
> Something like (PSUEDO CODE)
> [psuedo code]
> var blah='checkRecord_'+e;
> blah=null;
> [/psuedo code]
>
> Will this inherit the "new PeriodicalExecutor" stuff in it so i can
> null the object and stop it listening ?
>
> It allready half works just by closing the window, but if you close it
> while its doing a request (testingRecord();)
> it moans about things being null (as they are removed from the dom
> prior to the object being nulled out !!!
>
> Sorry if this makes no sense at all !! if anything needs clarifying
> please ask
>
> Regards
> Alex
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Draggable element with position:fixed is fighting with the scroll bar

2008-11-19 Thread bidllc

Seems that setting ghosting:false (which I think is the deafualt
anyway) solved the problem.

On Nov 18, 8:09 pm, bidllc <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have an draggable element with a css position attribute that has a
> value of 'fixed.'  I'm calling Position.cumulativeOffset($
> ('taskbar')); via the onEnd option so the element is in the right
> place when I go to drag it again.
>
> Everything is working well, except when the page scrolls in any
> direction.  When the page scrolls it seems that the position attribute
> of the element changes with the scrolling (understandably), but the
> problem is that the original position before the page scrolls is where
> the element (the ghost) appears when I attempt to drag it again. So
> the ghosting effect starts where the element was prior to the page
> scroll. The element actually moves to where I move the cursor but it's
> not in sync...
>
> Any way to fix this? It only needs to work in Firefox.
>
> Thanks!
>
> Rich
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to override / hack Element.update function?

2008-11-19 Thread kangax

polydor wrote:
> Hi,
>
> I want to make a huge table using Prototype.  my script has 2900 calls
> to Element.update. These calls lasts 4 seconds, which is a lot.  This
> is mainly taken up by the regular expressions in the function, to
> identify scripts inside the body I want to insert in the node.  By
> just removing these script-related code out of the update-function, I
> have a huge performance boost.
>
> I don't want to customize my local prototype.js file, but want to
> override the function.  I tried something like this:
>
> Element.Methods.update = function(element, content) {
> element = $(element);
> if (content && content.toElement) content = content.toElement();
> if (Object.isElement(content)) return element.update().insert
> (content);
> content = Object.toHTML(content);
> element.innerHTML = content;
> //element.innerHTML = content.stripScripts();
> //content.evalScripts.bind(content).defer();
> return element;
> };
>
> This didn't change my method.
>
> Adding a new method
> Element.Methods.simpleUpdate = function(element, content) {
> ...
> or
> Object.extend(Element, {
> simpleUpdate: function(element, content) {
> ...
>
> doesn't work either.
>
> How can I get it work, or is there an alternative in which I don't
> have to use the update-function, besides updating it by changing the
> innerHTML property myself.

Is there a reason you wish to use `update` over just assigning to
`innerHTML` directly? I would suggest to go with the latter one, but
if you must:

Element.addMethods({
  update: function(){ ... }
});

P.S. Also, don't forget that Element#update (among others) is
redefined for IE later during initialization time.

--
kangax
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Focused field

2008-11-19 Thread Jeztah

Is there a mthod on prototype or nativejs to work out what part of the
document the user is focused on currently ?

I am trying to iron out a bug in somehting and need to work out what
element they are currently on (form/div/span etc etc)

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



[Proto-Scripty] Nulling or stopping Dynamic Variables

2008-11-19 Thread Jeztah

Mornign Guys/Girls

I am having some trouble nulling out or stopping some dynamic
variables i have created ...

I have built a dynamic window system which does alot of things, one is
checking a database to ensure the most up to date information is in
input boxes ... Now to check this i create a dynamic variable when the
contents is loaded via an ajax request...

[code]

checkRecord_ = new PeriodicalExecuter(function()
{

testingRecord('');

 },7);

[/code]

in this rand is just a unix epoch on when the page was created and is
referenced throughout the whole entire page and all its elements ...

for those that dont know php here is a simpler version of the code
[code]

checkRecord_123423414 = new PeriodicalExecuter(function() {

testingRecord('123423414');

 },7);

[/code]

in the DOM there is now a variable called
"checkRecord_123423414" (please bear in mind this is dynamic so i cant
just do checkRecord_123423414=null; when i want to null it or stop the
object as the ending string is allways different dependant on what
page you are on ...

Now the problem i get is when closing the windows in the system (which
are just div containers) i have to stop observing alot of stuff ...
this is done quite easily with stopObserving();

But i need to stop the PeriodicalExecutor from continuing once the
window is closed ...

i have tried to use "checkRecord_+e.stop();" (`e` is the random string
passed to it) but it gives me a syntax error
i have tried to use "checkRecord_+e=null;"  but the interpretor does
not recognise the dynamic variable . is there a way i can assign
the variable to something so it inherits all of the things i need to
stop in it ..

Something like (PSUEDO CODE)
[psuedo code]
var blah='checkRecord_'+e;
blah=null;
[/psuedo code]

Will this inherit the "new PeriodicalExecutor" stuff in it so i can
null the object and stop it listening ?


It allready half works just by closing the window, but if you close it
while its doing a request (testingRecord();)
it moans about things being null (as they are removed from the dom
prior to the object being nulled out !!!

Sorry if this makes no sense at all !! if anything needs clarifying
please ask

Regards
Alex





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



[Proto-Scripty] How to override / hack Element.update function?

2008-11-19 Thread polydor

Hi,

I want to make a huge table using Prototype.  my script has 2900 calls
to Element.update. These calls lasts 4 seconds, which is a lot.  This
is mainly taken up by the regular expressions in the function, to
identify scripts inside the body I want to insert in the node.  By
just removing these script-related code out of the update-function, I
have a huge performance boost.

I don't want to customize my local prototype.js file, but want to
override the function.  I tried something like this:

Element.Methods.update = function(element, content) {
element = $(element);
if (content && content.toElement) content = content.toElement();
if (Object.isElement(content)) return element.update().insert
(content);
content = Object.toHTML(content);
element.innerHTML = content;
//element.innerHTML = content.stripScripts();
//content.evalScripts.bind(content).defer();
return element;
};

This didn't change my method.

Adding a new method
Element.Methods.simpleUpdate = function(element, content) {
...
or
Object.extend(Element, {
simpleUpdate: function(element, content) {
...

doesn't work either.

How can I get it work, or is there an alternative in which I don't
have to use the update-function, besides updating it by changing the
innerHTML property myself.




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Is there a way to produce something similar to Google Calendar's Grid

2008-11-19 Thread T.J. Crowder

Hi,

> Is there a way to produce a grid whereby clicking the anywhere on the
> grid will result in an action that I would like to perform
> specifically to that point?
> ...
> something that can behave like this (maybe a white button)
> ...

Yes, that's not a problem, you can use divs or spans, since you get
"click" events on all elements, not just buttons.

Here's a quick example:  http://pastie.org/318600

That uses:

* The Prototype dom:loaded event[1] to trigger page initialization
* Element#observe[2] to watch the div containing the calendar for
clicks on it or its descendants
* Event#findElement[3] to find the element that was actually clicked.
Event#findElement accepts a CSS selector and finds the first matching
element starting from the element that was actually clicked and then
looking up through its ancestors.  Very handy for event delegation,
which is what we're doing here to avoid having to watch each day
individually.
* Event#pointerX[4] and Event#pointerY to find out where the mouse was
clicked

[1] http://prototypejs.org/api/document/observe
[2] http://prototypejs.org/api/element/observe
[3] http://prototypejs.org/api/event/findElement
[4] http://prototypejs.org/api/event/pointerX

HTH,
--
T.J. Crowder
tj / crowder software / com

On Nov 19, 6:33 am, disappearedng <[EMAIL PROTECTED]> wrote:
> Hi everyone
> Is there a way to produce a grid whereby clicking the anywhere on the
> grid will result in an action that I would like to perform
> specifically to that point? I know I sound confusing but I am actually
> looking for something similar to google's calendar. Is there something
> out there that is similar - when you click on a particular box, a
> dialog pops up and ask you what the event details are etc etc.
>
> Is there a way to make an entire area populated with a unit of
> something that can behave like this (maybe a white button) and then
> generating tons of these to cover an entire area?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] InPlaceEditor Is there a way to control the sending?

2008-11-19 Thread disappearedng

Hi everyone,
I have played around the InPlaceEditor for a while now and I notice
that upon completion of the text field, the InPlaceEditor immediately
makes a call the url supplied by the user.

I think this is kind of inefficient. Is there a way such that upon
complete, I can write a function that can push the value of the text
into a queue and hence reduce the total number of calls to my server?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Draggable element with position:fixed is fighting with the scroll bar

2008-11-19 Thread bidllc

Hi,

I have an draggable element with a css position attribute that has a
value of 'fixed.'  I'm calling Position.cumulativeOffset($
('taskbar')); via the onEnd option so the element is in the right
place when I go to drag it again.

Everything is working well, except when the page scrolls in any
direction.  When the page scrolls it seems that the position attribute
of the element changes with the scrolling (understandably), but the
problem is that the original position before the page scrolls is where
the element (the ghost) appears when I attempt to drag it again. So
the ghosting effect starts where the element was prior to the page
scroll. The element actually moves to where I move the cursor but it's
not in sync...

Any way to fix this? It only needs to work in Firefox.

Thanks!

Rich

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Passing variables after an onComplete

2008-11-19 Thread James Hoddinott

2008/11/18 Matt Foster <[EMAIL PROTECTED]>:
>
>> No, its all POST methods being used here.
>
>> >> new 
>> >> Ajax.Updater('respanel','data/fetchrespanel.php',{method:'get'});

Ah, that looks to be an error between whats on my server and what I
pasted into my email; I must have altered it afterwards having
noticed!

-- 
James Hoddinott

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Is there a way to produce something similar to Google Calendar's Grid

2008-11-19 Thread disappearedng

Hi everyone
Is there a way to produce a grid whereby clicking the anywhere on the
grid will result in an action that I would like to perform
specifically to that point? I know I sound confusing but I am actually
looking for something similar to google's calendar. Is there something
out there that is similar - when you click on a particular box, a
dialog pops up and ask you what the event details are etc etc.

Is there a way to make an entire area populated with a unit of
something that can behave like this (maybe a white button) and then
generating tons of these to cover an entire area?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] The Hop Effect

2008-11-19 Thread Adam Rochford

Prototype JavaScript framework, version 1.6.0.3
scriptaculous.js v1.8.1

I am currently running a script that has a menu that scrolls down as
you scroll down.  You can see it here
http://www.law.indiana.edu/lawlibrary/research/guides/european/index_hop.shtml
.  But you can also a notice that when the scrolling stops theres a
"hop" or a flash or redraw happening making it not seem as a smooth as
it should.  Is there a remedy for this or is there code in here that
should not be here?  All advice is welcome.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Popup window

2008-11-19 Thread Cristisor

This is exactly what I need. Thank you!

On Nov 17, 1:04 pm, "Mona Remlawi" <[EMAIL PROTECTED]> wrote:
> take a look at  [http://prototype-window.xilinus.com/] prototype based
> window class that does confirm windows and others. ..
>
> On Mon, Nov 17, 2008 at 11:48 AM, Cristisor <[EMAIL PROTECTED]> wrote:
>
> > Hi! I'm trying to build a popup window, something like the "confirm"
> > box, but with more than Ok and Cancel. Can someone give me a start, I
> > don't know how to make everything behind it read only so that the user
> > can't click another link before he confirms his option? Thank you!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---