[Proto-Scripty] Re: hide() not working for me on IE

2009-07-01 Thread Lavanya Shastri

It works if you do this:

function hideElement(id){   
 $(id).style.display='none';
}   


   function fileUploaded(id, filename) {
   var uploadingMessage = $(id).select('span
[class~=uploadingmessage]')[0]

 ;
uploadingMessage.hide();

var a = new Element('a', {
''href' : javascript:hideElement(' + id + ');
   false;
}).update((alpha));

}


On Mon, Jun 29, 2009 at 12:28 PM, ls86 lavanyashas...@gmail.com wrote:

 Hi,

 I am new to Prototype and here is a code snippet that works perfectly
 on firefox but doesnt work on IE for some reason.If anyone knows whats
 wrong here or can help me out in any way I'd really appreciate it.

function fileUploaded(id, filename) {
var uploadingMessage = $(id).select('span
 [class~=uploadingmessage]')[0];
uploadingMessage.hide();

var a = new Element('a', {
'href' : #alpha,
onclick : $(' + id + ').hide();return
 false;
}).update((alpha));

}

 Thanks,
 LS

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



[Proto-Scripty] How can apply CSS into element created by createElement('div')?

2009-07-01 Thread serenobs

Hi.

I wrote something like below:

in CSS
#Window {
background-color: #cc;
border: 1px solid;
}

in javascript
var w = document.createElement('div');
w.id = 'Window';


With above code, CSS's property dosen't affect the w element.
What's wrong?

Thanks in advance.

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



[Proto-Scripty] How to get size of div before showing?

2009-07-01 Thread serenobs

Hi.

I'd like to know the size of div before showing.
For example,

.my {
   position: absolute;
}

with this css, size is not determined yet.
I want to place this div at center of viewport after calling
Ajax.updater
But I can get only initial size unless show element.

How can I get right size?

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



[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?

2009-07-01 Thread T.J. Crowder

Hi,

It should apply to it automatically (assuming you do actually append
that element somewhere after creating it -- you don't show your code
for doing that).

If you're not seeing the CSS applied correctly and can't immediately
figure out why, I'd recommend picking up with Step #3 from this
troubleshooting list:
http://proto-scripty.wikidot.com/faq#xyzprob

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


On Jun 30, 4:09 pm, serenobs seren...@gmail.com wrote:
 Hi.

 I wrote something like below:

 in CSS
 #Window {
     background-color: #cc;
     border: 1px solid;

 }

 in javascript
 var w = document.createElement('div');
 w.id = 'Window';

 With above code, CSS's property dosen't affect the w element.
 What's wrong?

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



[Proto-Scripty] prototype window check?

2009-07-01 Thread Stefan Meyer

i want to know  when a prototype window is open like this

alert(top.Windows.focusedWindow.getId());


when the window is open , all works fine and i get a id, but when
window isnt open, i get now info and the script stops without errors.

how can i catch this?

the lib is this

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



[Proto-Scripty] Re: determine if dom:onload has happened yet?

2009-07-01 Thread Alex McAuley

Its not down to any javascript library to throw errors if something has 
happened once and cant happen again... You can modify the source or add 
methods to it if you wish to set a global variable that it has happened and 
check that each time it is called if you wish...

Alex
- Original Message - 
From: disccomp discc...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Wednesday, July 01, 2009 6:44 AM
Subject: [Proto-Scripty] Re: determine if dom:onload has happened yet?



 In any case; If an event can only happen once, shouldn't prototype
 throw some error that you can no longer register such an event after
 it has been called?
 
 


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



[Proto-Scripty] Re: How to get size of div before showing?

2009-07-01 Thread serenobs

Even it has contents but in hidden, still don't know the size?

I mean

1. div doesn't have any contents, so size is not determined yet.
2. after 1, div fulfilled remotely by Ajax.updater. so it has contents
now.
3. But it is not rendered yet(because this element is hidden field
now)

At this moment, is it impossible to get the size of element?

On 7월1일, 오후5시32분, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 You cant get the size unless it has either A. Content inside it (which gives
 it a width and height by the browser or B. set the size with css / inline
 styling

 HTH
 Alex



 - Original Message -
 From: serenobs seren...@gmail.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 30, 2009 9:40 PM
 Subject: [Proto-Scripty] How to get size of div before showing?

  Hi.

  I'd like to know the size of div before showing.
  For example,

  .my {
position: absolute;
  }

  with this css, size is not determined yet.
  I want to place this div at center of viewport after calling
  Ajax.updater
  But I can get only initial size unless show element.

  How can I get right size?- 원본 텍스트 숨기기 -

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



[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?

2009-07-01 Thread serenobs

Thanks for reply.
It worked by using className.
I'm not sure about why id was not working, but anyway it is working
now using className. :)

On 7월1일, 오후4시18분, T.J. Crowder t...@crowdersoftware.com wrote:
 Hi,

 It should apply to it automatically (assuming you do actually append
 that element somewhere after creating it -- you don't show your code
 for doing that).

 If you're not seeing the CSS applied correctly and can't immediately
 figure out why, I'd recommend picking up with Step #3 from this
 troubleshooting list:http://proto-scripty.wikidot.com/faq#xyzprob

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

 On Jun 30, 4:09 pm, serenobs seren...@gmail.com wrote:



  Hi.

  I wrote something like below:

  in CSS
  #Window {
  background-color: #cc;
  border: 1px solid;

  }

  in javascript
  var w = document.createElement('div');
  w.id = 'Window';

  With above code, CSS's property dosen't affect the w element.
  What's wrong?

  Thanks in advance.- 원본 텍스트 숨기기 -

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



[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?

2009-07-01 Thread Maarten

On 1 jul, 10:56, serenobs seren...@gmail.com wrote:

 I'm not sure about why id was not working, but anyway it is working
 now using className. :)

the value you used for your id attribute was 'Window', and identifier
values are not allowed to start with a capital letter, so I'm guessing
'window' would have worked.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to get size of div before showing?

2009-07-01 Thread Vladimir Tkach
Fast solution
- $(div.my).hide();
- update div's content by ajax / js
- get $(div.my).height() / width()
- $(div.my).show()

2009/6/30 serenobs seren...@gmail.com


 Hi.

 I'd like to know the size of div before showing.
 For example,

 .my {
   position: absolute;
 }

 with this css, size is not determined yet.
 I want to place this div at center of viewport after calling
 Ajax.updater
 But I can get only initial size unless show element.

 How can I get right size?

 



-- 
Best Regards,
Vladimir Tkach

+972-54-7574166
tea...@gmail.com

http://teamco-anthill.blogspot.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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: resize problem.

2009-07-01 Thread Vladimir Tkach
screen its reserved word in js


2009/7/1 serenobs seren...@gmail.com


 I missed it.
 I'm using prototype 1.6.1.RC3.

 On 7월1일, 오후6시08분, serenobs seren...@gmail.com wrote:
  Hi again :)
 
  I'm new to prototype, javascript and I got many problems
  so please understand my bunch of questions :)
 
  Here is my question.
  I'd like to replace my div when window resized.
  I coded like below:
  script
  function onBodyLoad() {
  var onResize = function(e) {
  var viewport = document.viewport.getDimensions();
  var screen = $('screen');
  var s_view = screen.getDimensions();
 
  screen.style.positon = 'absolute';
  screen.style.left = (viewport.width - s_view.width)/2+'px';
  screen.style.top = (viewport.height - s_view.height)/2+'px';
  };
 
  Element.observe(window, 'resize', onResize);};
 
  /script
  body onLoad=new onBodyLoad()
 
  I can see onResize was called.
  But IE, viewport.width returns 0, and FF returns right number.
  and both screen element doesn't move its position.
 
  What's wrong with above code?
 



-- 
Best Regards,
Vladimir Tkach

+972-54-7574166
tea...@gmail.com

http://teamco-anthill.blogspot.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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: MySQL - order ID

2009-07-01 Thread WLQ

Right, shouldn't then that be 'widgets'? Because the table of our
original sortable list were controlled by the widgets table. So like:
if($master = MyActiveRecord::FindById('widgets',$original)){


 Originals is a table in the database, it contains one of each type of  
 thing you wish to be able to clone into the clones table.  
 MyActiveRecord creates a PHP class for each table you wrap it  
 around, and each row of the table becomes an object of that class when  
 you request it through MAR.

 In short, this line:

 if($master = MyActiveRecord::FindById('originals',$original)){

 ...if it finds a table called 'originals' in your database, will  
 return the row with the ID matching $original (or false).

 Walter

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



  It says - Class originals does not exist
  Where does the originals class comes from? What is the originals from
  the code above?

  If this is the code you are using (and I've added the missing close
  parenthesis), then the fact that you are getting a 200 back (and a  
  new
  ID) means that you have successfully created a new clone. Otherwise,
  you should be getting a 500 or 404 back.

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

          header('HTTP/1.0 404 Missing',true,404);

  }

  Visit your test page with Firefox and with the Console tab of Firebug
  open. Make sure Firebug is set to show XHR transactions. You should  
  be
  able to observe the request to create_clone, and see the reply from
  the server. The reply should be the new ID of your clone. If it  
  isn't,
  then you have more debugging to do.

  Things to check here:

  * Have you included/required the library (MyActiveRecord) in this
  script, and have you defined the constants it needs (MySQL address  
  and
  credentials, also known as a DSN).
  * Have you got a MySQL table called clones?
  * Have you enabled error reporting on your server for your test  
  pages,
  so you can see the PHP errors as they whiz by?
  * Have you ordered that fat book I recommended?

  Debugging PHP is like playing Whack-a-Mole. You fix one thing, and
  another pops up. You iterate, in other, more dainty words.

  Walter

  On Jun 28, 2009, at 12:04 PM, WLQ wrote:

  Also I've used that clone.php you gave, the only thing it doesn't do
  is change the MySQL table itself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: resize problem.

2009-07-01 Thread serenobs

i used screen as a example.
I used another word in real code.

On 7월1일, 오후6시38분, Vladimir Tkach tea...@gmail.com wrote:
 screen its reserved word in js

 2009/7/1 serenobs seren...@gmail.com







  I missed it.
  I'm using prototype 1.6.1.RC3.

  On 7월1일, 오후6시08분, serenobs seren...@gmail.com wrote:
   Hi again :)

   I'm new to prototype, javascript and I got many problems
   so please understand my bunch of questions :)

   Here is my question.
   I'd like to replace my div when window resized.
   I coded like below:
   script
   function onBodyLoad() {
       var onResize = function(e) {
           var viewport = document.viewport.getDimensions();
           var screen = $('screen');
           var s_view = screen.getDimensions();

           screen.style.positon = 'absolute';
           screen.style.left = (viewport.width - s_view.width)/2+'px';
           screen.style.top = (viewport.height - s_view.height)/2+'px';
       };

       Element.observe(window, 'resize', onResize);};

   /script
   body onLoad=new onBodyLoad()

   I can see onResize was called.
   But IE, viewport.width returns 0, and FF returns right number.
   and both screen element doesn't move its position.

   What's wrong with above code?

 --
 Best Regards,
 Vladimir Tkach

 +972-54-7574166
 tea...@gmail.com

 http://teamco-anthill.blogspot.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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to get size of div before showing?

2009-07-01 Thread serenobs

it didn't work properly.
my code was something like that,
but after update div's content by ajax.updater
element.getWidth/Height doesn't return right size.
that method returned previous size(=size before call ajax.updater).

On 7월1일, 오후6시37분, Vladimir Tkach tea...@gmail.com wrote:
 Fast solution
 - $(div.my).hide();
 - update div's content by ajax / js
 - get $(div.my).height() / width()
 - $(div.my).show()

 2009/6/30 serenobs seren...@gmail.com







  Hi.

  I'd like to know the size of div before showing.
  For example,

  .my {
    position: absolute;
  }

  with this css, size is not determined yet.
  I want to place this div at center of viewport after calling
  Ajax.updater
  But I can get only initial size unless show element.

  How can I get right size?

 --
 Best Regards,
 Vladimir Tkach

 +972-54-7574166
 tea...@gmail.com

 http://teamco-anthill.blogspot.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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: MySQL - order ID

2009-07-01 Thread WLQ

But here's what I get in error:
array_shift() [function.array-shift]: The argument should be an array

On this line:
array_shift($data);


 Yes. Like any example that you will ever find on the Web, this one  
 needs to be adjusted to match your environment. Some basic fluency in  
 PHP is a requirement to use the MAR system, it can't divine everything  
 for you.

 Walter

 On Jul 1, 2009, at 5:57 AM, WLQ wrote:



  Right, shouldn't then that be 'widgets'? Because the table of our
  original sortable list were controlled by the widgets table. So like:
  if($master = MyActiveRecord::FindById('widgets',$original)){

  Originals is a table in the database, it contains one of each type of
  thing you wish to be able to clone into the clones table.
  MyActiveRecord creates a PHP class for each table you wrap it
  around, and each row of the table becomes an object of that class  
  when
  you request it through MAR.

  In short, this line:

  if($master = MyActiveRecord::FindById('originals',$original)){

  ...if it finds a table called 'originals' in your database, will
  return the row with the ID matching $original (or false).

  Walter

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

  It says - Class originals does not exist
  Where does the originals class comes from? What is the originals  
  from
  the code above?

  If this is the code you are using (and I've added the missing close
  parenthesis), then the fact that you are getting a 200 back (and a
  new
  ID) means that you have successfully created a new clone.  
  Otherwise,
  you should be getting a 500 or 404 back.

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

          header('HTTP/1.0 404 Missing',true,404);

  }

  Visit your test page with Firefox and with the Console tab of  
  Firebug
  open. Make sure Firebug is set to show XHR transactions. You should
  be
  able to observe the request to create_clone, and see the reply from
  the server. The reply should be the new ID of your clone. If it
  isn't,
  then you have more debugging to do.

  Things to check here:

  * Have you included/required the library (MyActiveRecord) in this
  script, and have you defined the constants it needs (MySQL address
  and
  credentials, also known as a DSN).
  * Have you got a MySQL table called clones?
  * Have you enabled error reporting on your server for your test
  pages,
  so you can see the PHP errors as they whiz by?
  * Have you ordered that fat book I recommended?

  Debugging PHP is like playing Whack-a-Mole. You fix one thing, and
  another pops up. You iterate, in other, more dainty words.

  Walter

  On Jun 28, 2009, at 12:04 PM, WLQ wrote:

  Also I've used that clone.php you gave, the only thing it  
  doesn't do
  is change the MySQL table itself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: MySQL - order ID

2009-07-01 Thread WLQ

But here's what I get in error:
array_shift() [function.array-shift]: The argument should be an array

On this line:
array_shift($data);


 Yes. Like any example that you will ever find on the Web, this one  
 needs to be adjusted to match your environment. Some basic fluency in  
 PHP is a requirement to use the MAR system, it can't divine everything  
 for you.

 Walter

 On Jul 1, 2009, at 5:57 AM, WLQ wrote:



  Right, shouldn't then that be 'widgets'? Because the table of our
  original sortable list were controlled by the widgets table. So like:
  if($master = MyActiveRecord::FindById('widgets',$original)){

  Originals is a table in the database, it contains one of each type of
  thing you wish to be able to clone into the clones table.
  MyActiveRecord creates a PHP class for each table you wrap it
  around, and each row of the table becomes an object of that class  
  when
  you request it through MAR.

  In short, this line:

  if($master = MyActiveRecord::FindById('originals',$original)){

  ...if it finds a table called 'originals' in your database, will
  return the row with the ID matching $original (or false).

  Walter

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

  It says - Class originals does not exist
  Where does the originals class comes from? What is the originals  
  from
  the code above?

  If this is the code you are using (and I've added the missing close
  parenthesis), then the fact that you are getting a 200 back (and a
  new
  ID) means that you have successfully created a new clone.  
  Otherwise,
  you should be getting a 500 or 404 back.

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

          header('HTTP/1.0 404 Missing',true,404);

  }

  Visit your test page with Firefox and with the Console tab of  
  Firebug
  open. Make sure Firebug is set to show XHR transactions. You should
  be
  able to observe the request to create_clone, and see the reply from
  the server. The reply should be the new ID of your clone. If it
  isn't,
  then you have more debugging to do.

  Things to check here:

  * Have you included/required the library (MyActiveRecord) in this
  script, and have you defined the constants it needs (MySQL address
  and
  credentials, also known as a DSN).
  * Have you got a MySQL table called clones?
  * Have you enabled error reporting on your server for your test
  pages,
  so you can see the PHP errors as they whiz by?
  * Have you ordered that fat book I recommended?

  Debugging PHP is like playing Whack-a-Mole. You fix one thing, and
  another pops up. You iterate, in other, more dainty words.

  Walter

  On Jun 28, 2009, at 12:04 PM, WLQ wrote:

  Also I've used that clone.php you gave, the only thing it  
  doesn't do
  is change the MySQL table itself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: resize problem.

2009-07-01 Thread Rick Waldron
As a helpful sidenot, i think you'd benefit from NOT using onload=





script
document.observe('dom:loaded', function () {
var onResize = function(e) {
   var viewport = document.viewport.getDimensions();
   var screen = $('screen');
   var s_view = screen.getDimensions();

   screen.style.positon = 'absolute';
   screen.style.left = (viewport.width - s_view.width)/2+'px';
   screen.style.top = (viewport.height - s_view.height)/2+'px';
   };

   Element.observe(window, 'resize', onResize);
});
/script
body




On Wed, Jul 1, 2009 at 9:13 AM, serenobs seren...@gmail.com wrote:


 i used screen as a example.
 I used another word in real code.

 On 7월1일, 오후6시38분, Vladimir Tkach tea...@gmail.com wrote:
  screen its reserved word in js
 
  2009/7/1 serenobs seren...@gmail.com
 
 
 
 
 
 
 
   I missed it.
   I'm using prototype 1.6.1.RC3.
 
   On 7월1일, 오후6시08분, serenobs seren...@gmail.com wrote:
Hi again :)
 
I'm new to prototype, javascript and I got many problems
so please understand my bunch of questions :)
 
Here is my question.
I'd like to replace my div when window resized.
I coded like below:
script
function onBodyLoad() {
var onResize = function(e) {
var viewport = document.viewport.getDimensions();
var screen = $('screen');
var s_view = screen.getDimensions();
 
screen.style.positon = 'absolute';
screen.style.left = (viewport.width - s_view.width)/2+'px';
screen.style.top = (viewport.height - s_view.height)/2+'px';
};
 
Element.observe(window, 'resize', onResize);};
 
/script
body onLoad=new onBodyLoad()
 
I can see onResize was called.
But IE, viewport.width returns 0, and FF returns right number.
and both screen element doesn't move its position.
 
What's wrong with above code?
 
  --
  Best Regards,
  Vladimir Tkach
 
  +972-54-7574166
  tea...@gmail.com
 
  http://teamco-anthill.blogspot.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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: MySQL - order ID

2009-07-01 Thread WLQ

But here's what I get in error:
array_shift() [function.array-shift]: The argument should be an array

On this line:
array_shift($data);


 Yes. Like any example that you will ever find on the Web, this one  
 needs to be adjusted to match your environment. Some basic fluency in  
 PHP is a requirement to use the MAR system, it can't divine everything  
 for you.

 Walter

 On Jul 1, 2009, at 5:57 AM, WLQ wrote:



  Right, shouldn't then that be 'widgets'? Because the table of our
  original sortable list were controlled by the widgets table. So like:
  if($master = MyActiveRecord::FindById('widgets',$original)){

  Originals is a table in the database, it contains one of each type of
  thing you wish to be able to clone into the clones table.
  MyActiveRecord creates a PHP class for each table you wrap it
  around, and each row of the table becomes an object of that class  
  when
  you request it through MAR.

  In short, this line:

  if($master = MyActiveRecord::FindById('originals',$original)){

  ...if it finds a table called 'originals' in your database, will
  return the row with the ID matching $original (or false).

  Walter

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

  It says - Class originals does not exist
  Where does the originals class comes from? What is the originals  
  from
  the code above?

  If this is the code you are using (and I've added the missing close
  parenthesis), then the fact that you are getting a 200 back (and a
  new
  ID) means that you have successfully created a new clone.  
  Otherwise,
  you should be getting a 500 or 404 back.

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

          header('HTTP/1.0 404 Missing',true,404);

  }

  Visit your test page with Firefox and with the Console tab of  
  Firebug
  open. Make sure Firebug is set to show XHR transactions. You should
  be
  able to observe the request to create_clone, and see the reply from
  the server. The reply should be the new ID of your clone. If it
  isn't,
  then you have more debugging to do.

  Things to check here:

  * Have you included/required the library (MyActiveRecord) in this
  script, and have you defined the constants it needs (MySQL address
  and
  credentials, also known as a DSN).
  * Have you got a MySQL table called clones?
  * Have you enabled error reporting on your server for your test
  pages,
  so you can see the PHP errors as they whiz by?
  * Have you ordered that fat book I recommended?

  Debugging PHP is like playing Whack-a-Mole. You fix one thing, and
  another pops up. You iterate, in other, more dainty words.

  Walter

  On Jun 28, 2009, at 12:04 PM, WLQ wrote:

  Also I've used that clone.php you gave, the only thing it  
  doesn't do
  is change the MySQL table itself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: MySQL - order ID

2009-07-01 Thread WLQ

But here's what I get in error:
array_shift() [function.array-shift]: The argument should be an array

On this line:
array_shift($data);


 Yes. Like any example that you will ever find on the Web, this one  
 needs to be adjusted to match your environment. Some basic fluency in  
 PHP is a requirement to use the MAR system, it can't divine everything  
 for you.

 Walter

 On Jul 1, 2009, at 5:57 AM, WLQ wrote:



  Right, shouldn't then that be 'widgets'? Because the table of our
  original sortable list were controlled by the widgets table. So like:
  if($master = MyActiveRecord::FindById('widgets',$original)){

  Originals is a table in the database, it contains one of each type of
  thing you wish to be able to clone into the clones table.
  MyActiveRecord creates a PHP class for each table you wrap it
  around, and each row of the table becomes an object of that class  
  when
  you request it through MAR.

  In short, this line:

  if($master = MyActiveRecord::FindById('originals',$original)){

  ...if it finds a table called 'originals' in your database, will
  return the row with the ID matching $original (or false).

  Walter

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

  It says - Class originals does not exist
  Where does the originals class comes from? What is the originals  
  from
  the code above?

  If this is the code you are using (and I've added the missing close
  parenthesis), then the fact that you are getting a 200 back (and a
  new
  ID) means that you have successfully created a new clone.  
  Otherwise,
  you should be getting a 500 or 404 back.

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

          header('HTTP/1.0 404 Missing',true,404);

  }

  Visit your test page with Firefox and with the Console tab of  
  Firebug
  open. Make sure Firebug is set to show XHR transactions. You should
  be
  able to observe the request to create_clone, and see the reply from
  the server. The reply should be the new ID of your clone. If it
  isn't,
  then you have more debugging to do.

  Things to check here:

  * Have you included/required the library (MyActiveRecord) in this
  script, and have you defined the constants it needs (MySQL address
  and
  credentials, also known as a DSN).
  * Have you got a MySQL table called clones?
  * Have you enabled error reporting on your server for your test
  pages,
  so you can see the PHP errors as they whiz by?
  * Have you ordered that fat book I recommended?

  Debugging PHP is like playing Whack-a-Mole. You fix one thing, and
  another pops up. You iterate, in other, more dainty words.

  Walter

  On Jun 28, 2009, at 12:04 PM, WLQ wrote:

  Also I've used that clone.php you gave, the only thing it  
  doesn't do
  is change the MySQL table itself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: MySQL - order ID

2009-07-01 Thread Walter Lee Davis

Which means it's not getting an array. So look and see what it IS  
getting. What is the value of $data at that point? (Use echo(),  
print_r(), something like that to output the value.)

I can see the error right away, looking back over the code. It's a  
fairly stupid error on my part introduced while refactoring the  
working code into an example you could pick apart and learn from.

I want you to find it, because otherwise you will never stand on your  
own here.

Walter

On Jul 1, 2009, at 10:31 AM, WLQ wrote:


 But here's what I get in error:
 array_shift() [function.array-shift]: The argument should be an array

 On this line:
 array_shift($data);


 Yes. Like any example that you will ever find on the Web, this one
 needs to be adjusted to match your environment. Some basic fluency in
 PHP is a requirement to use the MAR system, it can't divine  
 everything
 for you.

 Walter

 On Jul 1, 2009, at 5:57 AM, WLQ wrote:



 Right, shouldn't then that be 'widgets'? Because the table of our
 original sortable list were controlled by the widgets table. So  
 like:
 if($master = MyActiveRecord::FindById('widgets',$original)){

 Originals is a table in the database, it contains one of each  
 type of
 thing you wish to be able to clone into the clones table.
 MyActiveRecord creates a PHP class for each table you wrap it
 around, and each row of the table becomes an object of that class
 when
 you request it through MAR.

 In short, this line:

 if($master = MyActiveRecord::FindById('originals',$original)){

 ...if it finds a table called 'originals' in your database, will
 return the row with the ID matching $original (or false).

 Walter

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

 It says - Class originals does not exist
 Where does the originals class comes from? What is the originals
 from
 the code above?

 If this is the code you are using (and I've added the missing  
 close
 parenthesis), then the fact that you are getting a 200 back  
 (and a
 new
 ID) means that you have successfully created a new clone.
 Otherwise,
 you should be getting a 500 or 404 back.

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

 header('HTTP/1.0 404 Missing',true,404);

 }

 Visit your test page with Firefox and with the Console tab of
 Firebug
 open. Make sure Firebug is set to show XHR transactions. You  
 should
 be
 able to observe the request to create_clone, and see the reply  
 from
 the server. The reply should be the new ID of your clone. If it
 isn't,
 then you have more debugging to do.

 Things to check here:

 * Have you included/required the library (MyActiveRecord) in this
 script, and have you defined the constants it needs (MySQL  
 address
 and
 credentials, also known as a DSN).
 * Have you got a MySQL table called clones?
 * Have you enabled error reporting on your server for your test
 pages,
 so you can see the PHP errors as they whiz by?
 * Have you ordered that fat book I recommended?

 Debugging PHP is like playing Whack-a-Mole. You fix one thing,  
 and
 another pops up. You iterate, in other, more dainty words.

 Walter

 On Jun 28, 2009, at 12:04 PM, WLQ wrote:

 Also I've used that clone.php you gave, the only thing it
 doesn't do
 is change the MySQL table itself.
 


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



[Proto-Scripty] iterator.call is not a function

2009-07-01 Thread Ian R


Ok. So I have a structure like this:

div class=fp_YouTube

div class=player
object width=425 height=349 ... /object
/div

ol class=playlist
li id=YouTubeID_w7naKj-z5So ... /li
li id=YouTubeID_naiN5V4Q1rI ... /li
/ol

/div

And eventually what I am doing is replacing the contents of player
with a new video, based on observing a click on one of the list items
in playlist.  I've done it before but I'm trying to prototypejs it
up a little nicer.

SO... I have this JS code going:

$$('div.fp_YouTube').each(function(el)  {
var player = el.select('.player');
var playlist = el.select('.playlist');
playlist.select('li').each(function(video)  {
console.log(video.id);
});
});

But it is not

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



[Proto-Scripty] iterator.call is not a function

2009-07-01 Thread Ian R


Ok. So I have a structure like this:

div class=fp_YouTube

div class=player
object width=425 height=349 ... /object
/div

ol class=playlist
li id=YouTubeID_w7naKj-z5So ... /li
li id=YouTubeID_naiN5V4Q1rI ... /li
/ol

/div

And eventually what I am doing is replacing the contents of player
with a new video, based on observing a click on one of the list items
in playlist.  I've done it before but I'm trying to prototypejs it
up a little nicer.

SO... I have this JS code going:

$$('div.fp_YouTube').each(function(el)  {
var player = el.select('.player');
var playlist = el.select('.playlist');
playlist.select('li').each(function(video)  {
console.log(video.id);
});
});


But firebug is telling me this:

iterator.call is not a function -- prototype.js (line 661)

I've noticed that if I console.log the original el variable, it
looks like div class=fp_YouTube but if I log the playlist
variable, it comes out as  [ol.playlist] ... is it returning a 1-item
array?  Is there something I am fundamentally misunderstanding,
something I need to do in order to work with playlist the way I've
been working with el?

Thanks in advance, and pardon this message for misfiring and sending
before I was ready.

Ian

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



[Proto-Scripty] Re: MySQL - order ID

2009-07-01 Thread Alex McAuley

Or just do 

if(is_array($data)) {
array_shift($data);
}


HTH Alex
- Original Message - 
From: Walter Lee Davis wa...@wdstudio.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, July 01, 2009 5:56 PM
Subject: [Proto-Scripty] Re: MySQL - order ID



 Which means it's not getting an array. So look and see what it IS
 getting. What is the value of $data at that point? (Use echo(),
 print_r(), something like that to output the value.)

 I can see the error right away, looking back over the code. It's a
 fairly stupid error on my part introduced while refactoring the
 working code into an example you could pick apart and learn from.

 I want you to find it, because otherwise you will never stand on your
 own here.

 Walter

 On Jul 1, 2009, at 10:31 AM, WLQ wrote:


 But here's what I get in error:
 array_shift() [function.array-shift]: The argument should be an array

 On this line:
 array_shift($data);


 Yes. Like any example that you will ever find on the Web, this one
 needs to be adjusted to match your environment. Some basic fluency in
 PHP is a requirement to use the MAR system, it can't divine
 everything
 for you.

 Walter

 On Jul 1, 2009, at 5:57 AM, WLQ wrote:



 Right, shouldn't then that be 'widgets'? Because the table of our
 original sortable list were controlled by the widgets table. So
 like:
 if($master = MyActiveRecord::FindById('widgets',$original)){

 Originals is a table in the database, it contains one of each
 type of
 thing you wish to be able to clone into the clones table.
 MyActiveRecord creates a PHP class for each table you wrap it
 around, and each row of the table becomes an object of that class
 when
 you request it through MAR.

 In short, this line:

 if($master = MyActiveRecord::FindById('originals',$original)){

 ...if it finds a table called 'originals' in your database, will
 return the row with the ID matching $original (or false).

 Walter

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

 It says - Class originals does not exist
 Where does the originals class comes from? What is the originals
 from
 the code above?

 If this is the code you are using (and I've added the missing
 close
 parenthesis), then the fact that you are getting a 200 back
 (and a
 new
 ID) means that you have successfully created a new clone.
 Otherwise,
 you should be getting a 500 or 404 back.

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

 header('HTTP/1.0 404 Missing',true,404);

 }

 Visit your test page with Firefox and with the Console tab of
 Firebug
 open. Make sure Firebug is set to show XHR transactions. You
 should
 be
 able to observe the request to create_clone, and see the reply
 from
 the server. The reply should be the new ID of your clone. If it
 isn't,
 then you have more debugging to do.

 Things to check here:

 * Have you included/required the library (MyActiveRecord) in this
 script, and have you defined the constants it needs (MySQL
 address
 and
 credentials, also known as a DSN).
 * Have you got a MySQL table called clones?
 * Have you enabled error reporting on your server for your test
 pages,
 so you can see the PHP errors as they whiz by?
 * Have you ordered that fat book I recommended?

 Debugging PHP is like playing Whack-a-Mole. You fix one thing,
 and
 another pops up. You iterate, in other, more dainty words.

 Walter

 On Jun 28, 2009, at 12:04 PM, WLQ wrote:

 Also I've used that clone.php you gave, the only thing it
 doesn't do
 is change the MySQL table itself.
 


 
 


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



[Proto-Scripty] Re: iterator.call is not a function

2009-07-01 Thread Alex McAuley

Is it returning an array ?

Check with

$$('div.fp_YouTube').each(function(el) {
var player = el.select('.player');
var playlist = el.select('.playlist');
alert(playlist); // see if its an object
return;
playlist.select('li').each(function(video) {
console.log(video.id);
});
});

if it is returning an array then try

$$('div.fp_YouTube').each(function(el) {
var player = el.select('.player');
var playlist = el.select('.playlist');
$(playlist).select('li').each(function(video) {
console.log(video.id);
});
});

HTH

Alex




- Original Message - 
From: Ian R i...@fairmountfair.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Wednesday, July 01, 2009 6:22 PM
Subject: [Proto-Scripty] iterator.call is not a function




 Ok. So I have a structure like this:

 div class=fp_YouTube

 div class=player
 object width=425 height=349 ... /object
 /div

 ol class=playlist
 li id=YouTubeID_w7naKj-z5So ... /li
 li id=YouTubeID_naiN5V4Q1rI ... /li
 /ol

 /div

 And eventually what I am doing is replacing the contents of player
 with a new video, based on observing a click on one of the list items
 in playlist.  I've done it before but I'm trying to prototypejs it
 up a little nicer.

 SO... I have this JS code going:

 $$('div.fp_YouTube').each(function(el) {
 var player = el.select('.player');
 var playlist = el.select('.playlist');
 playlist.select('li').each(function(video) {
 console.log(video.id);
 });
 });


 But firebug is telling me this:

 iterator.call is not a function -- prototype.js (line 661)

 I've noticed that if I console.log the original el variable, it
 looks like div class=fp_YouTube but if I log the playlist
 variable, it comes out as  [ol.playlist] ... is it returning a 1-item
 array?  Is there something I am fundamentally misunderstanding,
 something I need to do in order to work with playlist the way I've
 been working with el?

 Thanks in advance, and pardon this message for misfiring and sending
 before I was ready.

 Ian

 
 


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



[Proto-Scripty] Re: MySQL - order ID

2009-07-01 Thread WLQ

I understand I should put this:
if(is_array($data)) {
array_shift($data);
}

Instead of:
array_shift($data);

 Or just do 

 if(is_array($data)) {
     array_shift($data);

 }

 HTH Alex

 - Original Message -
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, July 01, 2009 5:56 PM
 Subject: [Proto-Scripty] Re: MySQL - order ID

  Which means it's not getting an array. So look and see what it IS
  getting. What is the value of $data at that point? (Use echo(),
  print_r(), something like that to output the value.)

  I can see the error right away, looking back over the code. It's a
  fairly stupid error on my part introduced while refactoring the
  working code into an example you could pick apart and learn from.

  I want you to find it, because otherwise you will never stand on your
  own here.

  Walter

  On Jul 1, 2009, at 10:31 AM, WLQ wrote:

  But here's what I get in error:
  array_shift() [function.array-shift]: The argument should be an array

  On this line:
  array_shift($data);

  Yes. Like any example that you will ever find on the Web, this one
  needs to be adjusted to match your environment. Some basic fluency in
  PHP is a requirement to use the MAR system, it can't divine
  everything
  for you.

  Walter

  On Jul 1, 2009, at 5:57 AM, WLQ wrote:

  Right, shouldn't then that be 'widgets'? Because the table of our
  original sortable list were controlled by the widgets table. So
  like:
  if($master = MyActiveRecord::FindById('widgets',$original)){

  Originals is a table in the database, it contains one of each
  type of
  thing you wish to be able to clone into the clones table.
  MyActiveRecord creates a PHP class for each table you wrap it
  around, and each row of the table becomes an object of that class
  when
  you request it through MAR.

  In short, this line:

  if($master = MyActiveRecord::FindById('originals',$original)){

  ...if it finds a table called 'originals' in your database, will
  return the row with the ID matching $original (or false).

  Walter

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

  It says - Class originals does not exist
  Where does the originals class comes from? What is the originals
  from
  the code above?

  If this is the code you are using (and I've added the missing
  close
  parenthesis), then the fact that you are getting a 200 back
  (and a
  new
  ID) means that you have successfully created a new clone.
  Otherwise,
  you should be getting a 500 or 404 back.

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

          header('HTTP/1.0 404 Missing',true,404);

  }

  Visit your test page with Firefox and with the Console tab of
  Firebug
  open. Make sure Firebug is set to show XHR transactions. You
  should
  be
  able to observe the request to create_clone, and see the reply
  from
  the server. The reply should be the new ID of your clone. If it
  isn't,
  then you have more debugging to do.

  Things to check here:

  * Have you included/required the library (MyActiveRecord) in this
  script, and have you defined the constants it needs (MySQL
  address
  and
  credentials, also known as a DSN).
  * Have you got a MySQL table called clones?
  * Have you enabled error reporting on your server for your test
  pages,
  so you can see the PHP errors as they whiz by?
  * Have you ordered that fat book I recommended?

  Debugging PHP is like playing Whack-a-Mole. You fix one thing,
  and
  another pops up. You iterate, in other, more dainty words.

  Walter

  On Jun 28, 2009, at 12:04 PM, WLQ wrote:

  Also I've used that clone.php you gave, the only thing it
  doesn't do
  is change the MySQL table itself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: iterator.call is not a function

2009-07-01 Thread Ian R


I did check on the array situation -- it's so good and bad that
finally turning to this forum and *writing it all down* usually solves
the problem!

In the above case, $(playlist).select('li').each didn't work, but
playlist[0].select('li').each does.

I'm not sure that I exactly LOVE how that works, but it's not
terrible.  If there's a better way, I'd love to know about it.

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



[Proto-Scripty] Re: Creating new lines and bypassing them through escapeHTML

2009-07-01 Thread Kash

Hi T.J.,

I finally got around trying your recommendation and it worked
flawlessly. Thanks a ton.

--
Kash

On Jun 13, 3:32 am, T.J. Crowder t...@crowdersoftware.com wrote:
 Hi,

 String#escapeHTML doesn't do anything with embedded newlines; it
 Converts HTML special characters to their entity equivalents.
 Newlines aren't special HTML characters, they're just whitespace.

 You can easily do what you want with a String#replace[1]:

     after = before.replace(/\n/g, br/);

 Be sure you do the replace *after* you escape the HTML, otherwise
 you'll end up with the br/ displayed literally.  So:

     after = before.escapeHTML().replace(/\n/g, br/);

 I don't think browsers ever put a \r before the \n in textareas, but I
 couldn't swear to it, so if it were me I'd probably hedge my bets and
 optionally include it:

     after = before.escapeHTML().replace(/\r?\n/g, br/);

 [1]https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global...

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

 On Jun 12, 8:36 pm, Kash kaushikagra...@gmail.com wrote:

  Hey Guys,

  I am using the escapeHTML() string function in the following manner.

  $('divElement').update( stringInput.escapeHTML() );

  Now my stringInput is something like This is a test\nThis should be a
  new line!!!

  The \n does not show up as a new line on my HTML page. Was hoping
  someone could guide me what a work around could be so that a new line
  shows up on my HTML page. I did try putting lt;br#47;gt; instead of
  \n. But it just shows up as something weird on the HTML page. Please
  help.

  P.s: I would still like to keep using escapeHTML, so a solution which
  doesn't involve removing escapeHTML from the code would help...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: iterator.call is not a function

2009-07-01 Thread Rick Waldron
The reason you need to use an index on playlist is because select returns an
array, so... instead of using the index[0] the way you've done, you can send
it back to the el.select():


$$('div.fp_YouTube').each(function(el)  {
   var player   = el.select('.player')[0]; // --- right here!
   var playlist = el.select('.playlist li'); // also... select your li's
here, this will save you another select() call on the next line!
   playlist.each(function(video)  { // -- neater.
   console.log(video.id);
   });
});


Have a look:

http://jsbin.com/avedu


Rick




On Wed, Jul 1, 2009 at 1:37 PM, Ian R i...@fairmountfair.com wrote:



 I did check on the array situation -- it's so good and bad that
 finally turning to this forum and *writing it all down* usually solves
 the problem!

 In the above case, $(playlist).select('li').each didn't work, but
 playlist[0].select('li').each does.

 I'm not sure that I exactly LOVE how that works, but it's not
 terrible.  If there's a better way, I'd love to know about it.

 Thanks!
 Ian
 


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



[Proto-Scripty] Re: horizontel scrollbar

2009-07-01 Thread david

Hi jan,

you can use the live pipe extension, have a look at 
http://livepipe.net/control/scrollbar

--
david

On 25 juin, 10:24, Bangthat headkid bangthathead...@gmail.com wrote:
 hello everybody,

 im not really into javascript . just want to change my normal
 horizontel scrollbar to this one on this 
 sitehttp://www.elizabethweinberg.com/music/
 that slider fuction is so awesome. love that minimal style.
 i have the prototype scriptaculous and the ?divslider 0.1? (dont know
 if its needed) in the header of my file.
 but now i dont know how to activate it. i read a lot about on the
 scriptaculous website (getting started) but dont understand it.

 which commands oder html i have to put it my html site?

 greets

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



[Proto-Scripty] Re: shift/move the scroll bar with prototype

2009-07-01 Thread david

Hi Stucture_Ulf,

I think that it could be simply done with an Effect.Morph using the
margin of the table to set it's position inside the div.
So when need to center the specified row on the div, just calculate
it's position (It's perhaps the difficult part) inside the div, and
set margin accordingly to center it.
When saying it could be the difficult part, it's because I never use
table, because you should be able to do the same with pure div.

second think, I did not catch why you should not use scroll because of
the overflow hidden property ?? but I could miss something :((
--
david

On 26 juin, 12:08, Stucture_Ulf maximilian.moulet...@gmail.com
wrote:
 Hello!

 I have a table, placed in a div, with height specified  and overflow
 set to hidden. This table is used to list several posts and the
 details for each post is placed under the div containing the table.

 I'm looking for a solution on how to scroll the list through prototype/
 javascript, I want highlight a certain row in the table and move so
 that this row is centered in the table div. Using the .scroll() method
 won't work, because of the overflow hidden. I'm looking for a way to
 shift/move the scroll bar through script. Would be grateful for any
 tips or hints.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] InPlaceEditor Newbie

2009-07-01 Thread MANismyname

What is the best way of going about invoking the

.stripScripts().stripTags();

string from prototype before the information is passed from the
Scriptaculous InPlaceEditor to the server to be processed?

script type=text/javascript
var test = new Ajax.InPlaceEditor($('test'),'_proc.jsp',{
rows:10, cols:40,
externalControl:
'test_control', externalControlOnly: 'true',
ajaxOptions: {method: 'post'},
paramName: 'test'});
/script

When the information is inputted into my database it still has the
HTML code in it if HTML code is typed into the editor.

I looked at this:

http://www.prototypejs.org/api/string/stripTags

but dont understand how to get it to work with the inplaceedit.

Thank you for your help!

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



[Proto-Scripty] Re: Ajax.Updater - relative positioning - a footer - and IE7

2009-07-01 Thread david

Hi,

Just a guess, could'nt you try to set a position value to the
footer ?? perhaps to IE7 only ??
btw, I am sure that help will come quicker in a CSS group :))

--
david

On 30 juin, 15:43, mtm81 i...@patchworkmedia.co.uk wrote:
 In IE7, the following page loads some content in two areas of the page
 using an AJAX.Updater call.

 All very simple.

 However, at the bottom of the page a footer with a negative margin to
 get it into position.

 On all the other non ajax pages of the site, this CSS layout works
 without issue, however on the page causing a problem, when the main
 content is reloaded (and therefore the overall height of the page is
 changed), the footer does not re-position.

 this is IE7 only..

 can anyone shed any light on how I can stop this happening?

 http://www.flex-ability.co.uk/markets.asp

 then click any of the options within the pie chart...

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



[Proto-Scripty] Re: prototype window check?

2009-07-01 Thread david

hi Stefan,

you could use try-catch :))
but I think depending to the exemple that besied testing directly the
top.Windows.focusedWindow.getId(), perhaps test if top.Windows exist
and if top.Windows.focusedWindow exist before, so if not exist don't
try to get the id.

it's just a guess, beause I have no code to test... http://www.pastie.org/
to post some code or live exemple :))

--
david

On 1 juil, 10:26, Stefan Meyer rumpel...@gmx.de wrote:
 i want to know  when a prototype window is open like this

 alert(top.Windows.focusedWindow.getId());

 when the window is open , all works fine and i get a id, but when
 window isnt open, i get now info and the script stops without errors.

 how can i catch this?

 the lib is this

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



[Proto-Scripty] Re: InPlaceEditor Newbie

2009-07-01 Thread david

Hi Matt,
bad idea, you should rely on server script to clear user input, not in
client side.
btw, the stripTag method does what you need. To integrate it in the
AJAX.inPlaceEditor, just use the callback parameter on its creation.
As doc says:
 A function that will get executed just before the request is sent
to the server, should return the parameters to be sent in the URL.
Will get two parameters, the entire form and the value of the text
control. 

--
david

On 1 juil, 23:12, MANismyname matthewallannew...@yahoo.com wrote:
 What is the best way of going about invoking the

 .stripScripts().stripTags();

 string from prototype before the information is passed from the
 Scriptaculous InPlaceEditor to the server to be processed?

 script type=text/javascript
 var test = new Ajax.InPlaceEditor($('test'),'_proc.jsp',{
                                         rows:10, cols:40,
                                         externalControl:
 'test_control', externalControlOnly: 'true',
                                         ajaxOptions: {method: 'post'},
 paramName: 'test'});
 /script

 When the information is inputted into my database it still has the
 HTML code in it if HTML code is typed into the editor.

 I looked at this:

 http://www.prototypejs.org/api/string/stripTags

 but dont understand how to get it to work with the inplaceedit.

 Thank you for your help!

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



[Proto-Scripty] Re: Weird Problems with Morph on IE8

2009-07-01 Thread david

Hi Tim,
perhaps with code it could help, please, use www.pastie.org to share
some code, or perhaps live exmple.

-
david

On 29 juin, 06:36, Timothy R. Butler tbut...@uninetsolutions.com
wrote:
 Hi everyone,
 I've been tinkering with Effect.Morph to create a nifty overlay of
 semi-transparent bars (images with varying z-index values to allow
 them to overlay) that move around as slides change on a page (see
 serverforest.com/demos/schuette).

 This works great on Firefox and Safari, but the bars do not morph at
 all on IE 8. Can anyone offer any insight into what might be amiss?

 Thanks a ton!

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



[Proto-Scripty] Re: INVALID_CHARACTER_ERR: DOM Exception 5 with Apple Safari

2009-07-01 Thread david

Hi Christoph,

if you can't find a problem with code and all execution environment,
image how hard it could be for us.
please send exemple

--
david

On 28 juin, 17:36, chkdes...@googlemail.com
chkdes...@googlemail.com wrote:
 Hello

 I got the following error with safari and prototype.js with the newest
 versions (1.6.1 rc3 and 1.6.0.3):

 INVALID_CHARACTER_ERR: DOM Exception 5 (Line 2151 in v1.6.1 RC3)

 I can't find why. Every other Browser works fine.

 With Version 1.6.0.2 (included in Lightbox 2.0) everything works fine.

 Does anyone knows a workaround or is that a bug in the newer versions?

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



[Proto-Scripty] Re: MySQL - order ID

2009-07-01 Thread Walter Lee Davis

You're solving the wrong problem, then. Keep looking, it's right there  
in front of you.

Walter

On Jul 1, 2009, at 1:36 PM, WLQ wrote:


 I understand I should put this:
 if(is_array($data)) {
array_shift($data);
 }

 Instead of:
 array_shift($data);

 Or just do 

 if(is_array($data)) {
 array_shift($data);

 }

 HTH Alex

 - Original Message -
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, July 01, 2009 5:56 PM
 Subject: [Proto-Scripty] Re: MySQL - order ID

 Which means it's not getting an array. So look and see what it IS
 getting. What is the value of $data at that point? (Use echo(),
 print_r(), something like that to output the value.)

 I can see the error right away, looking back over the code. It's a
 fairly stupid error on my part introduced while refactoring the
 working code into an example you could pick apart and learn from.

 I want you to find it, because otherwise you will never stand on  
 your
 own here.

 Walter

 On Jul 1, 2009, at 10:31 AM, WLQ wrote:

 But here's what I get in error:
 array_shift() [function.array-shift]: The argument should be an  
 array

 On this line:
 array_shift($data);

 Yes. Like any example that you will ever find on the Web, this one
 needs to be adjusted to match your environment. Some basic  
 fluency in
 PHP is a requirement to use the MAR system, it can't divine
 everything
 for you.

 Walter

 On Jul 1, 2009, at 5:57 AM, WLQ wrote:

 Right, shouldn't then that be 'widgets'? Because the table of our
 original sortable list were controlled by the widgets table. So
 like:
 if($master = MyActiveRecord::FindById('widgets',$original)){

 Originals is a table in the database, it contains one of each
 type of
 thing you wish to be able to clone into the clones table.
 MyActiveRecord creates a PHP class for each table you wrap it
 around, and each row of the table becomes an object of that  
 class
 when
 you request it through MAR.

 In short, this line:

 if($master = MyActiveRecord::FindById('originals',$original)){

 ...if it finds a table called 'originals' in your database, will
 return the row with the ID matching $original (or false).

 Walter

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

 It says - Class originals does not exist
 Where does the originals class comes from? What is the  
 originals
 from
 the code above?

 If this is the code you are using (and I've added the missing
 close
 parenthesis), then the fact that you are getting a 200 back
 (and a
 new
 ID) means that you have successfully created a new clone.
 Otherwise,
 you should be getting a 500 or 404 back.

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

 header('HTTP/1.0 404 Missing',true,404);

 }

 Visit your test page with Firefox and with the Console tab of
 Firebug
 open. Make sure Firebug is set to show XHR transactions. You
 should
 be
 able to observe the request to create_clone, and see the reply
 from
 the server. The reply should be the new ID of your clone. If  
 it
 isn't,
 then you have more debugging to do.

 Things to check here:

 * Have you included/required the library (MyActiveRecord) in  
 this
 script, and have you defined the constants it needs (MySQL
 address
 and
 credentials, also known as a DSN).
 * Have you got a MySQL table called clones?
 * Have you enabled error reporting on your server for your  
 test
 pages,
 so you can see the PHP errors as they whiz by?
 * Have you ordered that fat book I recommended?

 Debugging PHP is like playing Whack-a-Mole. You fix one thing,
 and
 another pops up. You iterate, in other, more dainty words.

 Walter

 On Jun 28, 2009, at 12:04 PM, WLQ wrote:

 Also I've used that clone.php you gave, the only thing it
 doesn't do
 is change the MySQL table itself.
 


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



[Proto-Scripty] Re: Ajax.Autocompleter error in IE 6

2009-07-01 Thread Momal

Thank you Sabri,

this patch works very fine.

On May 6, 7:05 pm, Sabri LABBENE sabri.labb...@gmail.com wrote:
 Hi,
 You need to apply a small patch to your prototype.js
 Instead of  while ((element = element.parentNode)  element !=
 document.body, put:
 while ((element = element.parentNode)  element != document.body 
 Object.isElement(element))

 I have the 1.6.1_rc2 and the patch is to apply in Line 2411.
 If you have a different version of prototype, the patch can also work.

 Even if IE sucks, it still be considered as the corporate web browser in
 many companies :-(

 -- Sabri.

 On Wed, May 6, 2009 at 5:12 PM, Alex McAuley 

 webmas...@thecarmarketplace.com wrote:

  IE6 sucks dont support it .. if developers stop supporting it then it
  will force change in the industry and we wont have these headaches anymore!

  - Original Message -
  From: virchete virch...@gmail.com
  To: Prototype  script.aculo.us 
  prototype-scriptaculous@googlegroups.com
  Sent: Wednesday, May 06, 2009 4:05 PM
  Subject: [Proto-Scripty] Ajax.Autocompleter error in IE 6

   hello,

   I have been looking for the solution in the web and I didn't find
   anything. My problem appears only in IE and works fine in Firefox. The
   problem is the following:

   -The first time that I write something I don't receive the list. If
   you stop writting (for example 1 second) and then continue writting or
   deleting.. (pressing a key) you receive the list of items. But the
   first time you do not receive anything.

   -Just to confirm where is the error I have made the following checks:
        -The server receives the ajax request.
        -The server response correctly the Ajax request with a list of
   results.
   Then no result is displayed.

   Could someone tell me what is the function in controls.js or other
   file of prototype that take the response of the server, parse and
   include in the div specified in the Ajax.Autocompleter request.

   Thanks

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



[Proto-Scripty] problem with Effects.Fade/Appear

2009-07-01 Thread Genieciel

Hello Group,

I'm a rookie at those Web2 tricks but I'm trying to get there.

I've been programming other languages for a long time, but this is
something else ;-)

Well I almost accomplished what I wanted until I had to move one DIV
inside the main DIV...

To make a story short, I use a DIV including a IMG to perform a
slideshow.  The pictures, description and url are retrived from an
ajax call.  To make it look better, I'm using the Effect.appear/fade..

The problem I'm having now is that I set my second div to an relative
positionning (to have it shown near the middle of the picture) with

position:relative;
top:-73px;

That make the second div not to appear/fade anymore...  If I remove
the positionning, the inner DIV goes at the bottom of the main div and
then the Effect works as it should...

Any hint of what I'm doing wrong ??

You will find the demo page and all the scripting at http://dev.genieciel.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 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Charset, again

2009-07-01 Thread Tiago Becker

Hello!

Is there a way to force prototype to respond with the corret encoding?
I'm getting strange characters on my page (not the usual '?' char...
seems like a square with ff fd chars on it...)

I could fix this by encoding my python (backend) code with utf-8, but
then it doesnt work on the server machine o_0

I'm using prototype for about half an year now, and i needed another
server, so i installed ubuntu 8.04.
On the old machine, it was 6.06 and it worked well. I configured
apache on the 8.04 machine exactly  as the 6.06 one (ISO-8859-1).

Thanks in advance,

Tiago Becker

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



[Proto-Scripty] Safari 4 will not finish download with 1.6.1

2009-07-01 Thread Seppo

Hi,
Anyone else having prototype 1.6.1 (RC2  RC3) to not finish loading
on Safari 4 (4.0.1)?

Safari's Activity window shows extra about:blank page about to be
loaded causing page not to finish the loading. Previous versions did
not have this.

Sample html file:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
head
titlePrototype Test/title
script src=prototype.js type=text/javascript/script
/head
body
pPrototype Test /p
/body
/html

Will produce following lines in Safari's Activity window

about:blank
file:///Users/Harpo/Desktop/proto.html
file:///Users/Harpo/Desktop/prototype.js

The download of about:blank file will not finish.

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



[Proto-Scripty] Problem rendering toggle effect on site with multiple javascripts linked.

2009-07-01 Thread Frank1978

Tutorial: 
http://www.tutorialspoint.com/script.aculo.us/scriptaculous_toggle_effect.htm
Test file:
http://www.ofsgraphics.com/test/effects_toggle_test.html

Test file Implemented (ABOUT PAGE LINK):
http://www.ofsgraphics.com/test/index.html

Effect page (about page html, page where the effect occurs):
http://www.ofsgraphics.com/test/about.html

Problem:
Looking at the test file, the toggle appear effect (from
scipt.aculo.us) works seamlessly on it's own window, div, and style.
I basically ripped off most of the style sheet because I have my own
css to be implemented on my index page.

Now, looking at my index page the toggle appear effect does not render
properly.
http://www.ofsgraphics.com/test/index.html (Click on ABOUT US)

Here's how I set up my index/main page (linking all the scripts):
http://www.ofsgraphics.com/test/js/
script src=js/prototype.js type=text/javascript/script
script src=js/scriptaculous.js type=text/javascript/script
script src=js/unittest.js type=text/javascript/script
The above scripts were saved in my index file to render the effects
when the about page is being loaded in the content div

script type=text/javascript src=js/jquery-1.3.2.js/script
script type=text/javascript src=js/sliding_effect.js/script
script type=text/javascript src=js/noreload.js/script
These scripts are from jsquery that are currently used to give the
navigation slide effect (sliding_effect.js), no page refresh
(noreload.js)

Secondly, I kept this function in the about page (simplified, no js
and css)
a href=# onclick=Effect.toggle('d3','appear'); return
false;Toggle appear/a
div id=d3 style=display:none;div style=background-
color:#FF;width:650px;padding:10px;

So basically whenever my index page loads the about page using the
sliding navigation buttons, it should render the java scripts linked
from my index to the about page and the function supports the script
which can be found on the about page.
At first I thought the content div might be messing up the height
when It tries to load the div d3 from the about page but I don't
think that is the case.  My question is, does the linking of multiple
java script files specifically from different java script sources mix
up the rendering/animation I wanted to achieve?

Thank you very much in advance.  Hope to receive your feedbacks.

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



[Proto-Scripty] Re: How can apply CSS into element created by createElement('div')?

2009-07-01 Thread T.J. Crowder

@OP:

It's something else about your page, using the ID *does* work.[1]

[1] http://pastie.org/531685

@Maarten:

 the value you used for your id attribute was 'Window', and identifier
 values are not allowed to start with a capital letter

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

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

 ...I'm guessing
 'window' would have worked.

FWIW, I'd avoid using window as an ID.  Bound to confuse IE. ;-)
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Jul 1, 10:24 am, Maarten maartenwie...@gmail.com wrote:
 On 1 jul, 10:56, serenobs seren...@gmail.com wrote:

  I'm not sure about why id was not working, but anyway it is working
  now using className. :)

 the value you used for your id attribute was 'Window', and identifier
 values are not allowed to start with a capital letter, so I'm guessing
 'window' would have worked.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---