[Proto-Scripty] submiting form created by Ajax.inPlaceEditor

2008-09-17 Thread Tokeiito

Is there a way to triger submit by using object i get after: var
editor = new Ajax.InPlaceEditor(...); ?

Why i'm asking, i need to edit three elements in one time. So when
user clicks on External Control button (all lements are set to the
same button), i get three froms opened and now i need to submit/cancel
them with one button too.

--~--~-~--~~~---~--~~
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: Possible bug in Sortable.create?

2008-09-17 Thread Condor

Hi Diodeus,

Thanks for your reply.  You're absolutely right, I had missed  
including the wrapping table elements in the snippet.  I was able to  
find the problem however and it had to do with an error in the table  
elements themselves and had nothing to do with Sortable functionality.

Sorry for the noise, but thank you very much for the help.

- Jim

On Sep 16, 2008, at 7:11 AM, Diodeus wrote:


 It seemed to work for me. Perhaps I don't understand what you mean.

 On Sep 15, 9:50 pm, Yoji [EMAIL PROTECTED] wrote:
 Hi all,

 I'm new to the list so I apologize if this has been brought up and/or
 solved before... I'm having trouble using the scriptaclous sortable
 feature on form input elements.

 I'm trying to create a sortable list of input text elements to be
 entered by the user, however once a row is moved the input elements  
 of
 that row are removed from the Form parentNode.

 I've included a code snippet of what I currently have below, but if
 you'd like a full implementation to play with I can provide that as
 well.

 Any guidance would be greatly appreciated.

 Thanks,
 Jim

 form name=mainForm enctype=multipart/form-data method=post
 action=...

div style=text-align:center
  div class=grid
div class=head
  div class=cc_col1Name/div
  div class=cc_col2nbsp;/div
  div class=cc_col3Tag/div
  div class=cc_col4nbsp;/div
/div
ul id=list
li id=names_0
  div class=cc_col1input id=name
 type=text name=name0/div
  div class=cc_col2nbsp;/div
  div class=cc_col3input id=tag
 type=text name=tag0/div
  div class=cc_col4-/div
  div class=clearnbsp;/div
/li

li id=names_1
  div class=cc_col1input id=name
 type=text name=name1/div
  div class=cc_col2nbsp;/div
  div class=cc_col3input id=tag
 type=text name=tag1/div
  div class=cc_col4-nbsp;+/div
  div class=clearnbsp;/div
/li

/ul
input type=button value=checkMe
 onclick=iterator1(this.form)
  /div
  p id=info/p

  script type=text/javascript
  //![CDATA[
  function iterator1(oForm) {
// array table dump
var x =
 open('','','width=600,left=200,top=50,scrollbars,status=0');
x.document.open('text/plain');
var e = oForm.elements;
for (var i in e) x.document.write(i + ': ' + e[i]
 + ' [' + e[i].name + '] - ' + e[i].value + ' *** \n');
x.document.close();
  }
  function writeOrder() {
// onscreen debug
var order = Sortable.sequence('list');
var el, list = '', i = 0;
while (el = document.mainForm.elements[i++]) {
  if (el.nodeName == 'INPUT'  el.type == 'text')
 {
if (i  0) {
  list += 'br';
}
list += '[' + el.name + '], ' + el.value;
  }
}
$('info').innerHTML = order + 'brbr' + list;
  }
  Sortable.create(list, {hoverclass:'rowHover',
 onUpdate:function(request){writeOrder();}});
  //]]
  /script

 /form
 


--~--~-~--~~~---~--~~
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] Event.stop(event) and IE7

2008-09-17 Thread kukipei

Hi to all,

I want to stop propagation of alt keyup event.
This is a part of the code:

Event.observe(document, 'keyup', function(event)
{
Event.stop(event);
if (event.keyCode == 18)//alt key
{
if($('temp_1_2').disabled == false)
{
if (pointerForSmoke == 0)
{
set_crack_s1($('first_smoke'));
pointerForSmoke++;
}
else if(pointerForSmoke == 1) .


It works fine with ff3 and safari, but it is nor working with IE7.
When I press alt key it selects file button in menu bar. How can I
override this.
I am using prototype 1.6.

Best Regards,
Predrag

--~--~-~--~~~---~--~~
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] Ajax.PeriodicalUpdater in IE

2008-09-17 Thread voracious_reader

Hi,

I'm having issues on IE. Mozilla seems to be fine. I have used it in a
JSP. I am clearing cache in the JSP. I just want to display the same
JSP. I don't know what's wrong. Can somebody help me?

Thanks,

Here is the function -
new Ajax.PeriodicalUpdater('top', '/mypackage/list.jsp',
{method:'GET',frequency:60,decay:2});

--~--~-~--~~~---~--~~
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] MemoryLeak vs Ajax.Autocomplete

2008-09-17 Thread Jean-Philippe Encausse

Hi,
I have a little neebie design question (more than an issue) using
this code:

new Ajax.Autocompleter(elm,div, url, { ... });

- I do not have reference to created instance and there is no
destructor on autocomplete.
- I give a DOM element to the constructor that is referenced by
autocomplete.

So the JS World have reference to the DOM world. Is it a Memory Leak
issue ?
And now if I add cycle référence like:

elm.autocomplete = new Ajax.Autocompleter(elm,div, url, { ... });

I'm asking this question because I always thought that we should
reference ids in javascript and use $() function.

Regards,
Jp
--~--~-~--~~~---~--~~
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: Apply an effect to every element _except_ one

2008-09-17 Thread Matt

On Sep 16, 5:29 pm, Diodeus [EMAIL PROTECTED] wrote:
 One way would be to grab the nodes, use a loop, and skip over the
 element that has the special class.

 Something like this:

 div id='container'
 divX/div
 divX/div
 div class='special'don't hide me/div
 divX/div
 /div
 a href='javascript://' onclick='hideExcept(special)'hide most/a
 script type=text/javascript
 function hideExcept(notMe) {
 myNodes = $('container').select('div')
 for(x=0;xmyNodes.length;x++) {
 if(!$(myNodes[x]).hasClassName(notMe)) {
 Element.hide(myNodes[x])
 }
 }}

 /script


Thanks for this. I've had some success, but also some new issues.
Here's my function - it's supposed to show a child box and shrink its
parent, as well as shrink other boxes on the same level as the parent,
but smaller. Essentially, say you have three boxes on level 1 and you
click box 3, I want the script to then shrink box 1 and 2 to 20% and
shrink box 3 to 30% (so you know which one was clicked) and then
display a new box that's a child of box3.

function showBox(boxToShow, boxToHide)
{

// hide any existing level 2 box containers
Element.hide('level2');

// show the relevant box in a fancy way
Effect.toggle(boxToShow, 'appear');
new Effect.Grow(boxToShow, 120);

myNodes = $('level1').select('div') // grab all divs inside
'container'
for(x=0;xmyNodes.length;x++) { // loop through each div
if(!$(myNodes[x]).hasClassName(boxToHide)) { // if class is 
called
in function name, don't hide it
new Effect.Scale(myNodes[x], 30, {scaleX: true, scaleY: 
true,
scaleContent: false}); // scales everything except boxToHide
}
}

// shrink the parent box down too, but not as much
new Effect.Scale(boxToHide,40,{scaleX: true, scaleY: true,
scaleContent: false});

}


I'm calling the function like this:

div class=box green 1A a href=javascript://
onclick=showBox('level2a', this.parentNode)
div class=box green 1B a href=javascript://
onclick=showBox('level2b', this.parentNode)

The end result is that when clicking on the first box, div 1A shrinks
to 40% and div 1B shrinks to 30%, but when clicking the second box,
they scale down properly (with div 1B remaining 10% bigger than div 1A
but then when the animation ends, div 1B flickers down to 30% so it's
the same size as 1A still. I've probably made this more complex
sounding than it is, but does anyone have any ideas?

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



[Proto-Scripty] Re: How to handle different forms

2008-09-17 Thread luftikus143

 You may need to add a form tag (using new Element) then put the
 contents of your form inside it. Alternately, you can have the form
 tag as part of your HTML to begin with.

Thanks a lot! How does this new Element thing work? Do you have by
chance a quick example?

Thanks anyway, I'll see what I can do.
--~--~-~--~~~---~--~~
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] Event listeners in Ajax.InPlaceEditor

2008-09-17 Thread Tokeiito
Hello,

is there a way to disable keyboard listeners in Ajax.InPlaceEditor? at the
moment the only way i found is edit scriptaculous controls.js and add new
option: DisableListeners({listeners to disable here});

Respecfully,

Darius Tumas (a.k. Tokeiito)

mob.: +370 631 13666
www.tokeiito.eu

--~--~-~--~~~---~--~~
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 item inside container w overflow:hidden , zindex issue ...

2008-09-17 Thread david

Hi prima,

just one remark when using z-index: be sure to have the CSS property
position set to absolute otherwhise the z-index does not work.

--
david

On 15 sep, 15:06, prima [EMAIL PROTECTED] wrote:
 Hey,

 Even i am facing the same problem.
 I tried to play with the zindex propert but in vain
 I have develped a page where i have to implement a swapping
 functionality.
 The swapping take place between 4 divs which are under a parent div.

 Problem:
 the dragging object always remains below the target drop object.
 I tried to edit the zindex property but it seems to be not working :(

 On Sep 14, 9:35 am, Erwin [EMAIL PROTECTED] wrote:

  Hi

  I got a problem when dragging an item from such a container, the item
  get hidden by the container when dragging it out... I know it's a z-
  index problem, but I cannot find a neat solution  (tried a patch into
  dragdrop.js to bind/unbind a clone to the body.. but seems not being
  working well  would prefer a CSS solution..)

  here is the CSS (without height, width to make it clear), and only one
  item (id: user_1)
  so, when dragging this item, it is not seen pass ing over all other
  areas, especially the dropping zone (the drag/drop is successfull...
  the dropping zone highlights correctly, ... the item revet correctly,
  just passing through is not visible  how can I try to solve this
  issue ?  thanks a lot for yoru help !!

  body
  div id=workspace
     div class=carousel style=position:relative; 
         div class=container  style=position:absolute;
  overflow:hidden 
              div class=items  style=position:absolute 
                  div class=item style=position:relative 
                           div class=key captionAdams, John/div
                           div class=email[EMAIL PROTECTED]/
  div
                           script type=text/javascript
                          //![CDATA[
                             new Draggable(user_1, { revert:true  })
                          //]]
                          /script
                  /div
              /div
         /div
      /div
  /div

  div id:dropping_zone
  ...
  /div
  /body
--~--~-~--~~~---~--~~
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: Ajax.PeriodicalUpdater in IE

2008-09-17 Thread bluezehn

Hi,
This is really difficult to help you with from the details you've
given.
Firstly not specifying the version of IE makes it very difficult to
help at all.

All I can do is suggest adding callbacks to the PeriodicalUpdater,
such as an onComplete, just to alert hello world everytime a request
finishes. Something is going wrong somewhere - you need to use
debugging on callbacks to work out at which point it is- is the
periodical updater not invoking the update, is the server not
responding, or is the periodical updater not dealing with the server's
response correctly - it's likely to be one of those issues. Work it
out and we'll go from there.

Also, replacing the jsp with an html file that just prints the time or
something could be another very useful thing to do. It may be a JSP
issue in which case the only advice you'll get from me is stop coding
in such an agricultural language for the web ;-)

On Sep 16, 11:06 pm, voracious_reader [EMAIL PROTECTED] wrote:
 Hi,

 I'm having issues on IE. Mozilla seems to be fine. I have used it in a
 JSP. I am clearing cache in the JSP. I just want to display the same
 JSP. I don't know what's wrong. Can somebody help me?

 Thanks,

 Here is the function -
 new Ajax.PeriodicalUpdater('top', '/mypackage/list.jsp',
 {method:'GET',frequency:60,decay:2});
--~--~-~--~~~---~--~~
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: IE6 odd behaviour while loading ajax

2008-09-17 Thread david

Hi Nelson,

you could try the onComplete event for the ajax request, perhaps it
handle more case than just onSuccess ?

--
david

On 17 sep, 03:07, Diogo Neves [EMAIL PROTECTED] wrote:
 On Tue, Sep 16, 2008 at 10:26 AM, Nelson Lim [EMAIL PROTECTED] wrote:

  Hi guys,

  I'm new to prototype. I've been using it to load a panel by writing
  what I get from pd_builddetails.html into a div tag using innerHTML.
  This works fine with firefox, but on IE6, its a little unpredictable.
  I have it working sometimes, but after awhile of clicking around, it
  seems to be loading for a very looong time.
  Closing the browser and restarting it again, seems to solve this
  problem. Anyone experience this before?

  Thanks in advance!

  Nelson

   //Loads the Build Details Panel
     function loadBuildDetails(buildID){
                  new Ajax.Request('pd_builddetails.html',
         {
             method:'get',
             parameters: {buildID: buildID },
             onLoading: function() {

  document.getElementById(builddetails_panel).innerHTML=pIMG
  src='images/spinner.gif' border=0 align='left' height=16
  width=16STRONGnbsp;Loading.../STRONG
             },
             onSuccess: function(transport){
                response = transport.responseText || no response
  text;
                //response = response.trim();

  document.getElementById(builddetails_panel).innerHTML=response;
             },
             onFailure: function(){ alert('Something went wrong. with
  build details panel..') }
         });
     }

 Hi, it seams fine to me, except that the p doesn't close...
 And plz, don't use 'document.getElementById('xxx')' on prototype... it seams
 ugly compared with '$('xxx')'

 --
 Thanks,

 Diogo Neves
 Web Developer @ SAPO.pt by PrimeIT.pt
--~--~-~--~~~---~--~~
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: Event.stop(event) and IE7

2008-09-17 Thread bluezehn

Does it stop propagation of other keys? If so I doubt there's much you
can do about this. Maybe IE instantly fires two events - one on the
specific element which bubbles up and another straight to IE itself.
I'd say it would be confusing to users to alter the action of the alt
key anyway. If I used the alt key regularly to access the file menu
then you stopped it from doing that, that would get me pissed with
your website. Sorry if that's not particularly what you wanted to
hear...

On Sep 16, 10:40 pm, kukipei [EMAIL PROTECTED] wrote:
 Hi to all,

 I want to stop propagation of alt keyup event.
 This is a part of the code:

 Event.observe(document, 'keyup', function(event)
 {
 Event.stop(event);
         if (event.keyCode == 18)//alt key
         {
                 if($('temp_1_2').disabled == false)
                 {
                         if (pointerForSmoke == 0)
                         {
                                 set_crack_s1($('first_smoke'));
                                 pointerForSmoke++;
                         }
                         else if(pointerForSmoke == 1) .

 It works fine with ff3 and safari, but it is nor working with IE7.
 When I press alt key it selects file button in menu bar. How can I
 override this.
 I am using prototype 1.6.

 Best Regards,
 Predrag
--~--~-~--~~~---~--~~
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: Event listeners in Ajax.InPlaceEditor

2008-09-17 Thread bluezehn

What do you mean by keyboard listeners? Do you mean observers to the
onkeyup action? Why would you want to do this?

As a side note it's much better to extend the inPlaceEditor than edit
the source code.

You can extend classes like this (if you didn't know already!):

Ajax.MyInPlaceEditor = Class.create(Ajax.InPlaceEditor, {
  additionalFunction: function()
  {
 /* do something */
  });

On Sep 17, 11:55 am, Tokeiito [EMAIL PROTECTED] wrote:
 Hello,

 is there a way to disable keyboard listeners in Ajax.InPlaceEditor? at the
 moment the only way i found is edit scriptaculous controls.js and add new
 option: DisableListeners({listeners to disable here});

 Respecfully,

 Darius Tumas (a.k. Tokeiito)

 mob.: +370 631 13666www.tokeiito.eu
--~--~-~--~~~---~--~~
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: IE6 odd behaviour while loading ajax

2008-09-17 Thread bluezehn

I find onSuccess and actually onLoading to be quite unreliable. I
stick exclusively to onCreate and onComplete (in which you can switch
on the response.status - anything starting with 2 is good). I can
guarantee you won't have any problems with this approach, and I know
other people have reported issues with onSuccess and onFailure even
though the API reccommends their use over branching on the status
within onComplete.

On Sep 17, 12:48 pm, david [EMAIL PROTECTED] wrote:
 Hi Nelson,

 you could try the onComplete event for the ajax request, perhaps it
 handle more case than just onSuccess ?

 --
 david

 On 17 sep, 03:07, Diogo Neves [EMAIL PROTECTED] wrote:

  On Tue, Sep 16, 2008 at 10:26 AM, Nelson Lim [EMAIL PROTECTED] wrote:

   Hi guys,

   I'm new to prototype. I've been using it to load a panel by writing
   what I get from pd_builddetails.html into a div tag using innerHTML.
   This works fine with firefox, but on IE6, its a little unpredictable.
   I have it working sometimes, but after awhile of clicking around, it
   seems to be loading for a very looong time.
   Closing the browser and restarting it again, seems to solve this
   problem. Anyone experience this before?

   Thanks in advance!

   Nelson

    //Loads the Build Details Panel
      function loadBuildDetails(buildID){
                   new Ajax.Request('pd_builddetails.html',
          {
              method:'get',
              parameters: {buildID: buildID },
              onLoading: function() {

   document.getElementById(builddetails_panel).innerHTML=pIMG
   src='images/spinner.gif' border=0 align='left' height=16
   width=16STRONGnbsp;Loading.../STRONG
              },
              onSuccess: function(transport){
                 response = transport.responseText || no response
   text;
                 //response = response.trim();

   document.getElementById(builddetails_panel).innerHTML=response;
              },
              onFailure: function(){ alert('Something went wrong. with
   build details panel..') }
          });
      }

  Hi, it seams fine to me, except that the p doesn't close...
  And plz, don't use 'document.getElementById('xxx')' on prototype... it seams
  ugly compared with '$('xxx')'

  --
  Thanks,

  Diogo Neves
  Web Developer @ SAPO.pt by PrimeIT.pt
--~--~-~--~~~---~--~~
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: Event listeners in Ajax.InPlaceEditor

2008-09-17 Thread Tokeiito
I need that cause with one External Control button, user opens three edit
boxes and if user hits enter or esc submits/cancels only that fields where
user worked at the moment.

Will try to extend that class. Thank you.

Respectfully,

Darius Tumas (a.k. Tokeiito)

mob.: +370 631 13666
www.tokeiito.eu


2008/9/17 bluezehn [EMAIL PROTECTED]


 What do you mean by keyboard listeners? Do you mean observers to the
 onkeyup action? Why would you want to do this?

 As a side note it's much better to extend the inPlaceEditor than edit
 the source code.

 You can extend classes like this (if you didn't know already!):

 Ajax.MyInPlaceEditor = Class.create(Ajax.InPlaceEditor, {
  additionalFunction: function()
  {
 /* do something */
  });

 On Sep 17, 11:55 am, Tokeiito [EMAIL PROTECTED] wrote:
  Hello,
 
  is there a way to disable keyboard listeners in Ajax.InPlaceEditor? at
 the
  moment the only way i found is edit scriptaculous controls.js and add
 new
  option: DisableListeners({listeners to disable here});
 
  Respecfully,
 
  Darius Tumas (a.k. Tokeiito)
 
  mob.: +370 631 13666www.tokeiito.eu
 


--~--~-~--~~~---~--~~
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 can we make XHR (AJAX ) calls to other domain ?

2008-09-17 Thread Rama

ok understood.

then how can we  make AJAX (XHR) calls to other domain ?

Is it actually possible?


Regards
rama





On Sep 17, 4:49 am, Diogo Neves [EMAIL PROTECTED] wrote:
 Hi,



 On Wed, Sep 17, 2008 at 12:38 AM, Rama [EMAIL PROTECTED] wrote:

  iam  not violating the same origin policy that which the  browers
  follow.

  Scenario1 )Script is  loading from  mydomain.com,script is
  residing  on the same mydomain.com

  in this case everything is  working fine.

  Scnario2) Script is loading from  mydomain.com, script  is residing on
  other domain say xyza.com

 Even though script is residing on xyza.com
the script downloaded form mydomain.com is making calls
  Ajax calls (XHR request/response) to only mydomain.com

 in the above case it is still not violating th same
  ORgin policy.

 Wrong... the domain of the webpage is what counts, not the script domain...
 But u can always use the appendChild tecnique...





 in the second scenario also it should work
  correctly.but it is not working ...

i could not able to figure it out the mistake that  iam
  doing.

  On Sep 17, 12:23 am, Diodeus [EMAIL PROTECTED] wrote:
   Assuming you are attempting to make an Ajax call to a server that is
   not in your web page's domain, it is a deliberate security restriction
   in the browser designed to prevent cross-site scripting (XSS) attacks.

   On Sep 16, 1:34 pm, Rama [EMAIL PROTECTED] wrote:

hi,

i have developed a widget/badge in javasript. (using prototypejs)

It is working  well on my  own site.  but when placed on other
domains  AJAX(XHR) requests are not working porperly.

Can anyone  please guide us  on why the ajax(XHR)  calls/requests  are
not working when placed on other doman.

Regards
rama

 --
 Thanks,

 Diogo Neves
 Web Developer @ SAPO.pt by PrimeIT.pt
--~--~-~--~~~---~--~~
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: Event.stop(event) and IE7

2008-09-17 Thread kukipei

In IE7 with Event.stop(event);  I can not stop propagation for any
key. It is look like It doesn't work for keyup event
--~--~-~--~~~---~--~~
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 can we make XHR (AJAX ) calls to other domain ?

2008-09-17 Thread bluezehn

A suggestion: make them to your domain, then have a server side script
on the same domain which uses something akin to php's curllib to make
a request to another server and return that server's response. I don't
know any other way in which this is possible.

On Sep 17, 1:07 pm, Rama [EMAIL PROTECTED] wrote:
 ok understood.

 then how can we  make AJAX (XHR) calls to other domain ?

 Is it actually possible?

 Regards
 rama

 On Sep 17, 4:49 am, Diogo Neves [EMAIL PROTECTED] wrote:

  Hi,

  On Wed, Sep 17, 2008 at 12:38 AM, Rama [EMAIL PROTECTED] wrote:

   iam  not violating the same origin policy that which the  browers
   follow.

   Scenario1 )    Script is  loading from  mydomain.com,script is
   residing  on the same mydomain.com

                       in this case everything is  working fine.

   Scnario2) Script is loading from  mydomain.com, script  is residing on
   other domain say xyza.com

                  Even though script is residing on xyza.com
                 the script downloaded form mydomain.com is making calls
   Ajax calls (XHR request/response) to only mydomain.com

                  in the above case it is still not violating th same
   ORgin policy.

  Wrong... the domain of the webpage is what counts, not the script domain...
  But u can always use the appendChild tecnique...

                  in the second scenario also it should work
   correctly.but it is not working ...

                 i could not able to figure it out the mistake that  iam
   doing.

   On Sep 17, 12:23 am, Diodeus [EMAIL PROTECTED] wrote:
Assuming you are attempting to make an Ajax call to a server that is
not in your web page's domain, it is a deliberate security restriction
in the browser designed to prevent cross-site scripting (XSS) attacks.

On Sep 16, 1:34 pm, Rama [EMAIL PROTECTED] wrote:

 hi,

 i have developed a widget/badge in javasript. (using prototypejs)

 It is working  well on my  own site.  but when placed on other
 domains  AJAX(XHR) requests are not working porperly.

 Can anyone  please guide us  on why the ajax(XHR)  calls/requests  are
 not working when placed on other doman.

 Regards
 rama

  --
  Thanks,

  Diogo Neves
  Web Developer @ SAPO.pt by PrimeIT.pt
--~--~-~--~~~---~--~~
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 can we make XHR (AJAX ) calls to other domain ?

2008-09-17 Thread Rama

ok.
The above solution works when javascript is on my domain.
((in javascript) instead of cross domain i will interact with my
server , the server will fetch that page)

But what to do when iam placing the javascript from mydomain.com in
another domain say xyz.com where the javascript loaded from
mydomain.com on a page at xyz.com wants to interact with the
mydomain.com server.

in those case How should we do cross domain Ajax (or XHR calls)?

(the above scenario is occurring for me while building a small widget
(javascript based) which any websites can put on their page )).where
iam actually planning to bring data for the widget by calling  AJAX./
XHR call to my server.


regards
rama


On Sep 17, 5:46 pm, bluezehn [EMAIL PROTECTED] wrote:
 A suggestion: make them to your domain, then have a server side script
 on the same domain which uses something akin to php's curllib to make
 a request to another server and return that server's response. I don't
 know any other way in which this is possible.

 On Sep 17, 1:07 pm, Rama [EMAIL PROTECTED] wrote:

  ok understood.

  then how can we  make AJAX (XHR) calls to other domain ?

  Is it actually possible?

  Regards
  rama

  On Sep 17, 4:49 am, Diogo Neves [EMAIL PROTECTED] wrote:

   Hi,

   On Wed, Sep 17, 2008 at 12:38 AM, Rama [EMAIL PROTECTED] wrote:

iam  not violating the same origin policy that which the  browers
follow.

Scenario1 )Script is  loading from  mydomain.com,script is
residing  on the same mydomain.com

in this case everything is  working fine.

Scnario2) Script is loading from  mydomain.com, script  is residing on
other domain say xyza.com

   Even though script is residing on xyza.com
  the script downloaded form mydomain.com is making calls
Ajax calls (XHR request/response) to only mydomain.com

   in the above case it is still not violating th same
ORgin policy.

   Wrong... the domain of the webpage is what counts, not the script 
   domain...
   But u can always use the appendChild tecnique...

   in the second scenario also it should work
correctly.but it is not working ...

  i could not able to figure it out the mistake that  iam
doing.

On Sep 17, 12:23 am, Diodeus [EMAIL PROTECTED] wrote:
 Assuming you are attempting to make an Ajax call to a server that is
 not in your web page's domain, it is a deliberate security restriction
 in the browser designed to prevent cross-site scripting (XSS) attacks.

 On Sep 16, 1:34 pm, Rama [EMAIL PROTECTED] wrote:

  hi,

  i have developed a widget/badge in javasript. (using prototypejs)

  It is working  well on my  own site.  but when placed on other
  domains  AJAX(XHR) requests are not working porperly.

  Can anyone  please guide us  on why the ajax(XHR)  calls/requests  
  are
  not working when placed on other doman.

  Regards
  rama

   --
   Thanks,

   Diogo Neves
   Web Developer @ SAPO.pt by PrimeIT.pt
--~--~-~--~~~---~--~~
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: Apply an effect to every element _except_ one

2008-09-17 Thread Diodeus

As usual, I should have added but Kangax probably does this in one
line of code. :)

On Sep 17, 5:32 am, Matt [EMAIL PROTECTED] wrote:
 On Sep 16, 5:29 pm, Diodeus [EMAIL PROTECTED] wrote:



  One way would be to grab the nodes, use a loop, and skip over the
  element that has the special class.

  Something like this:

  div id='container'
  divX/div
  divX/div
  div class='special'don't hide me/div
  divX/div
  /div
  a href='javascript://' onclick='hideExcept(special)'hide most/a
  script type=text/javascript
  function hideExcept(notMe) {
  myNodes = $('container').select('div')
  for(x=0;xmyNodes.length;x++) {
  if(!$(myNodes[x]).hasClassName(notMe)) {
  Element.hide(myNodes[x])
  }
  }}

  /script

 Thanks for this. I've had some success, but also some new issues.
 Here's my function - it's supposed to show a child box and shrink its
 parent, as well as shrink other boxes on the same level as the parent,
 but smaller. Essentially, say you have three boxes on level 1 and you
 click box 3, I want the script to then shrink box 1 and 2 to 20% and
 shrink box 3 to 30% (so you know which one was clicked) and then
 display a new box that's a child of box3.

 function showBox(boxToShow, boxToHide)
 {

 // hide any existing level 2 box containers
 Element.hide('level2');

 // show the relevant box in a fancy way
 Effect.toggle(boxToShow, 'appear');
 new Effect.Grow(boxToShow, 120);

 myNodes = $('level1').select('div') // grab all divs inside
 'container'
 for(x=0;xmyNodes.length;x++) { // loop through each div
 if(!$(myNodes[x]).hasClassName(boxToHide)) { // if class is 
 called
 in function name, don't hide it
 new Effect.Scale(myNodes[x], 30, {scaleX: true, 
 scaleY: true,
 scaleContent: false}); // scales everything except boxToHide
 }
 }

 // shrink the parent box down too, but not as much
 new Effect.Scale(boxToHide,40,{scaleX: true, scaleY: true,
 scaleContent: false});

 }

 I'm calling the function like this:

 div class=box green 1A a href=javascript://
 onclick=showBox('level2a', this.parentNode)
 div class=box green 1B a href=javascript://
 onclick=showBox('level2b', this.parentNode)

 The end result is that when clicking on the first box, div 1A shrinks
 to 40% and div 1B shrinks to 30%, but when clicking the second box,
 they scale down properly (with div 1B remaining 10% bigger than div 1A
 but then when the animation ends, div 1B flickers down to 30% so it's
 the same size as 1A still. I've probably made this more complex
 sounding than it is, but does anyone have any ideas?

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



[Proto-Scripty] Re: How to handle different forms

2008-09-17 Thread Diodeus

To insert something into the DOM use this. You can add other
attributes as well. Read the Prototype docs.

$(someDiv).insert(new Element(form, { id: 'moo' }))



On Sep 17, 6:53 am, luftikus143 [EMAIL PROTECTED] wrote:
  You may need to add a form tag (using new Element) then put the
  contents of your form inside it. Alternately, you can have the form
  tag as part of your HTML to begin with.

 Thanks a lot! How does this new Element thing work? Do you have by
 chance a quick example?

 Thanks anyway, I'll see what I can do.
--~--~-~--~~~---~--~~
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: Apply an effect to every element _except_ one

2008-09-17 Thread Richard Quadling
2008/9/17 Diodeus [EMAIL PROTECTED]


 As usual, I should have added but Kangax probably does this in one
 line of code. :)

 On Sep 17, 5:32 am, Matt [EMAIL PROTECTED] wrote:
  On Sep 16, 5:29 pm, Diodeus [EMAIL PROTECTED] wrote:
 
 
 
   One way would be to grab the nodes, use a loop, and skip over the
   element that has the special class.
 
   Something like this:
 
   div id='container'
   divX/div
   divX/div
   div class='special'don't hide me/div
   divX/div
   /div
   a href='javascript://' onclick='hideExcept(special)'hide most/a
   script type=text/javascript
   function hideExcept(notMe) {
   myNodes = $('container').select('div')
   for(x=0;xmyNodes.length;x++) {
   if(!$(myNodes[x]).hasClassName(notMe)) {
   Element.hide(myNodes[x])
   }
   }}
 
   /script
 
  Thanks for this. I've had some success, but also some new issues.
  Here's my function - it's supposed to show a child box and shrink its
  parent, as well as shrink other boxes on the same level as the parent,
  but smaller. Essentially, say you have three boxes on level 1 and you
  click box 3, I want the script to then shrink box 1 and 2 to 20% and
  shrink box 3 to 30% (so you know which one was clicked) and then
  display a new box that's a child of box3.
 
  function showBox(boxToShow, boxToHide)
  {
 
  // hide any existing level 2 box containers
  Element.hide('level2');
 
  // show the relevant box in a fancy way
  Effect.toggle(boxToShow, 'appear');
  new Effect.Grow(boxToShow, 120);
 
  myNodes = $('level1').select('div') // grab all divs inside
  'container'
  for(x=0;xmyNodes.length;x++) { // loop through each div
  if(!$(myNodes[x]).hasClassName(boxToHide)) { // if class
 is called
  in function name, don't hide it
  new Effect.Scale(myNodes[x], 30, {scaleX: true,
 scaleY: true,
  scaleContent: false}); // scales everything except boxToHide
  }
  }
 
  // shrink the parent box down too, but not as much
  new Effect.Scale(boxToHide,40,{scaleX: true, scaleY: true,
  scaleContent: false});
 
  }
 
  I'm calling the function like this:
 
  div class=box green 1A a href=javascript://
  onclick=showBox('level2a', this.parentNode)
  div class=box green 1B a href=javascript://
  onclick=showBox('level2b', this.parentNode)
 
  The end result is that when clicking on the first box, div 1A shrinks
  to 40% and div 1B shrinks to 30%, but when clicking the second box,
  they scale down properly (with div 1B remaining 10% bigger than div 1A
  but then when the animation ends, div 1B flickers down to 30% so it's
  the same size as 1A still. I've probably made this more complex
  sounding than it is, but does anyone have any ideas?
 
  Matt
 

Its disgusting what Kangax can do in 1 line!

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

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



[Proto-Scripty] Re: how can we make XHR (AJAX ) calls to other domain ?

2008-09-17 Thread Ryan Gahl
To repeat previous answers, you cannot make XHR calls cross domain from the
browser (you seem not to be understanding that point).

Having said that, there are two ways to solve your problem though...

One, distribute your widget as an iframe that points to a page on your
domain instead of as script people put on their pages.
Two, create your back end (the one that the AJAX calls are being made to
now) to be capable of returning pure javascript, and instead of doing XHR
calls to that endpoint, use dynamic script tag injection. For details on how
to do that, use Google.




On Wed, Sep 17, 2008 at 8:30 AM, Rama [EMAIL PROTECTED] wrote:


 ok.
 The above solution works when javascript is on my domain.
 ((in javascript) instead of cross domain i will interact with my
 server , the server will fetch that page)

 But what to do when iam placing the javascript from mydomain.com in
 another domain say xyz.com where the javascript loaded from
 mydomain.com on a page at xyz.com wants to interact with the
 mydomain.com server.

 in those case How should we do cross domain Ajax (or XHR calls)?

 (the above scenario is occurring for me while building a small widget
 (javascript based) which any websites can put on their page )).where
 iam actually planning to bring data for the widget by calling  AJAX./
 XHR call to my server.


 regards
 rama


 On Sep 17, 5:46 pm, bluezehn [EMAIL PROTECTED] wrote:
  A suggestion: make them to your domain, then have a server side script
  on the same domain which uses something akin to php's curllib to make
  a request to another server and return that server's response. I don't
  know any other way in which this is possible.
 
  On Sep 17, 1:07 pm, Rama [EMAIL PROTECTED] wrote:
 
   ok understood.
 
   then how can we  make AJAX (XHR) calls to other domain ?
 
   Is it actually possible?
 
   Regards
   rama
 
   On Sep 17, 4:49 am, Diogo Neves [EMAIL PROTECTED] wrote:
 
Hi,
 
On Wed, Sep 17, 2008 at 12:38 AM, Rama [EMAIL PROTECTED]
 wrote:
 
 iam  not violating the same origin policy that which the  browers
 follow.
 
 Scenario1 )Script is  loading from  mydomain.com,script is
 residing  on the same mydomain.com
 
 in this case everything is  working fine.
 
 Scnario2) Script is loading from  mydomain.com, script  is
 residing on
 other domain say xyza.com
 
Even though script is residing on xyza.com
   the script downloaded form mydomain.com is making
 calls
 Ajax calls (XHR request/response) to only mydomain.com
 
in the above case it is still not violating th same
 ORgin policy.
 
Wrong... the domain of the webpage is what counts, not the script
 domain...
But u can always use the appendChild tecnique...
 
in the second scenario also it should work
 correctly.but it is not working ...
 
   i could not able to figure it out the mistake that
  iam
 doing.
 
 On Sep 17, 12:23 am, Diodeus [EMAIL PROTECTED] wrote:
  Assuming you are attempting to make an Ajax call to a server that
 is
  not in your web page's domain, it is a deliberate security
 restriction
  in the browser designed to prevent cross-site scripting (XSS)
 attacks.
 
  On Sep 16, 1:34 pm, Rama [EMAIL PROTECTED] wrote:
 
   hi,
 
   i have developed a widget/badge in javasript. (using
 prototypejs)
 
   It is working  well on my  own site.  but when placed on other
   domains  AJAX(XHR) requests are not working porperly.
 
   Can anyone  please guide us  on why the ajax(XHR)
  calls/requests  are
   not working when placed on other doman.
 
   Regards
   rama
 
--
Thanks,
 
Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt
 



-- 
Ryan Gahl
Manager, Senior Software Engineer
Nth Penguin, LLC
http://www.nthpenguin.com
--
WebWidgetry.com / MashupStudio.com
Future Home of the World's First Complete Web Platform
--
Inquire: 1-920-574-2218
Blog: http://www.someElement.com
LinkedIn Profile: http://www.linkedin.com/in/ryangahl

--~--~-~--~~~---~--~~
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: submiting form created by Ajax.inPlaceEditor

2008-09-17 Thread Justin Perkins

On Tue, Sep 16, 2008 at 2:21 PM, Tokeiito [EMAIL PROTECTED] wrote:

 Is there a way to triger submit by using object i get after: var
 editor = new Ajax.InPlaceEditor(...); ?

You might try calling editor.handleFormSubmission(), although that
method expects an event argument it appears to be safe to call it
without arguments.

-justin

--~--~-~--~~~---~--~~
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] multipart/form-data and prototype

2008-09-17 Thread BrentNicholas

I've read that Prototype can not seralize files that have been
selected for upload in the form. Found this out the hard way
Hrmm. Every thing else loaded... where's my file?

Is this still the case?

I've read that most people do an iFrame solution.
Anyone have other ideas?

Thanks for your time,
BN

--~--~-~--~~~---~--~~
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: multipart/form-data and prototype

2008-09-17 Thread Matt Foster

Greetings Brent,

   Its not that Prototype has somehow neglected this aspect, but
simply the fact that an input type='file' cannot be transferred as you
have expected.  Its value is a path, not the source of the file
itself. There are very strict rules on this input type for security
reasons.  Javascript never has access to the source of the file so it
can't be placed into an XHR request.  As you noted you can keep a
stateful web app and load the files via an off screen  IFRAME.  This
is the best approach while sticking to DHTML, there are more advanced
solutions using a Flash object but thus requiring your users to have
the plugin.

Regards,
 Matt


On Sep 17, 12:14 pm, BrentNicholas [EMAIL PROTECTED] wrote:
 I've read that Prototype can not seralize files that have been
 selected for upload in the form. Found this out the hard way
 Hrmm. Every thing else loaded... where's my file?

 Is this still the case?

 I've read that most people do an iFrame solution.
 Anyone have other ideas?

 Thanks for your time,
 BN
--~--~-~--~~~---~--~~
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: Disable form submission

2008-09-17 Thread bluezehn

There's a method on forms you want: form#disable() or form#enable().
Then it's just a case of finding the element. You could do this
through $$ or select() or have a look at the inplaceeditor source
code. As I remember, the form element is stored as something like
_form on each instance of the class. Extend the inplaceeditor and add
a function that looks like this:

disable: function() { this._formElement.disable(); }

and then you can call it from wherever.

You may also want to extend and override the function which handles
the click on the submit button - currently the whole form dissapears
to show the word saving... which I didn't like either because it
makes validation even server side very different.

On Sep 17, 7:43 pm, Tokeiito [EMAIL PROTECTED] wrote:
 Hello,

 I cant find any where, how to disable Ajax.InPlaceEditor(); created form
 submission when user hits Enter key.

 Respectfull,

 Darius Tumas (a.k. Tokeiito)

 mob.: +370 631 13666www.tokeiito.eu
--~--~-~--~~~---~--~~
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: AJAX autocompleter

2008-09-17 Thread bluezehn

I couldn't find the same issue. Are you sure it's not some of your
code or a callback you've written or something that's causing this?
Maybe post your code so someone can take a look at it.

On Sep 17, 8:31 pm, Jack D [EMAIL PROTECTED] wrote:
 Hi,
    Does any one has any update regarding the IE issue of memory leak for
 autocompleter? The IE size goes on increasing for autocompleter  never
 comes down

 Thanks!

 On Mon, Sep 15, 2008 at 5:46 PM, Jack D [EMAIL PROTECTED] wrote:
   Hi bluezehn,
       Thanks for the reply!

        Regarding Item 1, I'm using IE 6.0 on Windows XP Professional. the
  memory goes on increasing continoulsy as I go on using AJAX in
  autocompleter. I also observed that the memory increases with all browsers.
  With Firefox, the speed with which it increases is relatively slow. If IE is
  taking 100 MB, then firefox will take around 60 MBHowever, the memory
  increases  thts for sureeventually browser starts responding
  slowly.

         I'll appreciate if you can look into it.
  Thanks!

    On Mon, Sep 15, 2008 at 4:06 PM, bluezehn [EMAIL PROTECTED]wrote:

  Hi there,
  In response to question 1, what version of IE are you using? Let me
  know and I'll see if I can replicate this.

  2: You always have to load all of prototype. You can as you point out
  just load specific parts of scriptaculous. In my opinion, it's not
  worth bothering with. The download size you save for the user is
  negligible - less than something like a 100x100 image I think. I'm not
  sure which module of scriptaculous the autocompleter is in, but I'm
  sure you can find it in the API somewhere. Seriously don't worry about
  it though - was working on a plone site at work today and had a look
  at the source code - plone had imported jquery for fun, then about 20
  other javascript files for various kss stuff and kupu functions and
  god knows what else.
  In short, it's never going to be the bottleneck of a site's
  performance.

  On Sep 15, 6:10 pm, Jack D [EMAIL PROTECTED] wrote:
   Hi,
      I'm using 1.8.1 AJAX autocompleter. So far so good.

      Question 1:
    I've set minchar to 1. When I type say a in search text box, it
  displays
   hints. If I do it again  again on this page (delete a  then again
  type
   a), I can see some memory leak. When I kept my Windows Task Manager
  open,
   the Mem Usgae for IEXPLORE kept on increasing. It started from 25MB 
  went
   to 200MB. The more you keep typing a or searching different words, the
   memory goes on increasing. The CPU usage goes to 70% as well but it
  comes
   down to 0% as soon as the hints are displayed. However, the memory does
  not
   go down at all. Is Scruptaculous leaking memory?? Once the memory goes
   beyond 200 MB for IEXPLORE, the browser responds real SLOW. Same is the
   bahaviour with Firefox.

      Can any tell me if scriptaculous is leaking memory  how to fix it??

      Question 2:
    I'm including follwoign 2 scripts in all pages wherever I need to call
  the
   autocompleter:
    script language=JavaScript type=text/Javascript
   src=javascripts/scriptaculous/prototype.js/script
      script language=JavaScript type=text/Javascript
   src=javascripts/scriptaculous/scriptaculous.js/script

     I wanna know if including above scripts loads all the other libraries
  as
   well or how exactly does it work? I mean I want to make sure that it
  shoould
   only include automecomplete stuff which I needed.

     I saw few ppl using following:

    script language=JavaScript type=text/Javascript
   src=javascripts/scriptaculous/scriptaculous.js?load=effects/script

     Can any one tell me including specific loads will improve performance?
   Also, in case of autocompleter, what should I pass as a parameter to
  load
   for both scriptaculous.js  prototype.js?

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



[Proto-Scripty] Re: Disable form submission

2008-09-17 Thread Tokeiito
this method form#disable()/enable() disables all form thats not what i'm
searching.

I'm searching how to disable submission on Enter key. User still can edit
text in field, he still can submit form by clicking button, but he can't
submit it with Key Enter. Everything is simple if its regular form. But how
to do that in form created by Ajax.InPlaceEditor() ?

Resectfully,

Darius Tumas (a.k. Tokeiito)

mob.: +370 631 13666
www.tokeiito.eu


2008/9/17 bluezehn [EMAIL PROTECTED]


 There's a method on forms you want: form#disable() or form#enable().
 Then it's just a case of finding the element. You could do this
 through $$ or select() or have a look at the inplaceeditor source
 code. As I remember, the form element is stored as something like
 _form on each instance of the class. Extend the inplaceeditor and add
 a function that looks like this:

 disable: function() { this._formElement.disable(); }

 and then you can call it from wherever.

 You may also want to extend and override the function which handles
 the click on the submit button - currently the whole form dissapears
 to show the word saving... which I didn't like either because it
 makes validation even server side very different.

 On Sep 17, 7:43 pm, Tokeiito [EMAIL PROTECTED] wrote:
  Hello,
 
  I cant find any where, how to disable Ajax.InPlaceEditor(); created
 form
  submission when user hits Enter key.
 
  Respectfull,
 
  Darius Tumas (a.k. Tokeiito)
 
  mob.: +370 631 13666www.tokeiito.eu
 


--~--~-~--~~~---~--~~
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: Disable form submission

2008-09-17 Thread Justin Perkins

To add to the list of ideas, I would recommend you override the
Ajax.InPlaceEditor#checkForEscapeOrReturn method to do what you want
since that's where this submit event is getting fired from.

Ajax.InPlaceEditor.addMethods({
  checkForEscapeOrReturn: function(e) {
if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return;
if (Event.KEY_ESC == e.keyCode)
  this.handleFormCancellation(e);
else if (Event.KEY_RETURN == e.keyCode)
  return; //this.handleFormSubmission(e);
  }
});

Ideally you would pass in an extra option when instantiating the IPE
and then in the above code snippet you could check for the existence
of an option before blocking the form submit event.

-justin

P.S. Your users might see this as a bug since submitting a form on
return key press is expected behavior.

--~--~-~--~~~---~--~~
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] Drag / Drop with TinyMCE

2008-09-17 Thread dante2010

Hi,

I am using TinyMCE as my editor and I have it attached to a textarea
within a LI element that has been set as sortable using
scriptaculous.

My problem is that when this LI containing TinyMCE is dragged and
dropped it seemingly disables TinyMCE totally.  I can still see the
editor, but I can't click any buttons or type any text within the
editor window.

This only happens in Firefox.  Everything works nicely in IE6+.

Anyone else come across this issue before?

--~--~-~--~~~---~--~~
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] Drag and Drop with overflow auto

2008-09-17 Thread Anulith

Hello all, I am trying to create a web app that will let you drag
items from a left pane to a right pane.  These panes must have
overflow: auto on because there will definitely be more data in them
than can fit in the provided space.  The problem is that when overflow
is set to auto, the div expands when the draggable object reaches the
extents instead of the object existing outside that div while being
dragged.  See attached code for an example of what I mean.  If you
remove the overflow: auto line then everything works as I want it to.

--Begin Code

html
head
titleScriptaculous drag and drop overflow test/title
style
div.container
{
width: 95%;
background-color: #CCC;
margin-left: 10px;
height: 300px;
}

div.frame
{
width: 98%;
overflow: auto;
background-color: #FFF;
margin: 0px auto;
}

div.object
{
width: 100px;
height: 100px;
margin-left: 10px;
margin-bottom: 5px;
}

div.blue
{
background-color: #00F;
}

div.red
{
background-color: #F00;
}
/style
script src=prototype.js type=text/javascript/script
script src=scriptaculous.js type=text/javascript/script
script
function Move(drag, drop, e)
{
alert(dropped  + drag.id +  on  + drop.id);
}

function Setup()
{

Droppables.add(document.getElementById(container1), {onDrop:
Move, containment: false});

Droppables.add(document.getElementById(container2), {onDrop:
Move, containment: false});

new 
Draggable(document.getElementById(object_1), {revert:
true});
new 
Draggable(document.getElementById(object_2), {revert:
true});
}
/script
/head
body onload=Setup();
div style=width: 50%; float: right; border-left:2px solid 
black;
div class=frame
div id='container2' class=container/div
/div
/div
div style=width: 50%;
div class=frame
div id='container1' class=container
div id=object_1 class=object red
/div
div id=object_2 class=object blue
/div
/div
/div
 /div
/body
/html


--End Code

--~--~-~--~~~---~--~~
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] Droppables containment limitation?

2008-09-17 Thread Grego

I am playing with draggables and droppables and it appears that the
containment option on Droppables has a limitation (or feature) -
namely, that you need to supply the id of the direct parent of the
draggables.

If you supply an id of say, the parent of the parent, then the
draggable 'grandchild' will not be considered a valid draggable for
the drop zone.

For example, given this html ...

 div id=dragSrcDiv
ul id=dragSrcList
  li1/li
/ul
/div
div id=dragDstDiv
ul id=dragDstList
/ul
/div

... then this code will not allow the drop...

  Droppables.add(dragDstDiv, {
containment: dragSrcDiv,

... whereas this code will allow the drop...

  Droppables.add(dragDstDiv, {
containment: dragSrcList,

Silly me - I thought containment meant containment, instead
containment seems to mean parent. Do I have this right? If so, is it
called 'containment' based on some hopeful future or is just misnamed
and should really be called 'parent'?


--~--~-~--~~~---~--~~
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: AJAX autocompleter

2008-09-17 Thread Jack D
Hi bluezehn,
Here is the code:

input name=modelName id=modelName maxlength=100 size=100 value=
class=button type=text autocomplete=off
span id=inprogress style=display: noneimg src=images/inprogress.gif
alt=Working... //span
div id=companyHint class=autocomplete/div
script type=text/javascript
new Ajax.Autocompleter(modelName, companyHint, abc.php, {paramName:
modelName, minChars: 2, indicator: 'inprogress', callback: null,
afterUpdateElement: getSelectedId});
function getSelectedId(text, li) {
 $('company_id').value = li.id;
 $('company_name').value = text.value;
}
/script

abc.php
===
?php
require_once(io.inc);
$CBO = new db();
$ModelDetails = '';
$modelName = $_POST[modelName];
if (strlen(trim($modelName))  0) {
 $CompanyDetails = $CBO-GetCompanyNames($companyName);
} else {
 header(Location: index.php);
}
echo $ModelDetails;
?

io.inc
==
$resultList = ;
$workList = array();
$sql = SELECT id, name, swing FROM model WHERE upper(name) like upper(?)
ORDER BY name;
$dbResult = $this-dbHandle-query($sql, array('%'.$modelName.'%'));
if (DB::isError($dbResult)) {
 return false;
} else {
 while ($workList = $dbResult-fetchRow(DB_FETCHMODE_ASSOC)) {
  $resultList .= li id=\. $workList[id] . \;
  $resultList .=  preg_replace(/($modelName)/i, strong$1/strong,
$workList['name']);
  $resultList .=  span class=\informal\;
  $resultList .=   ( . $workList[swing] . );
  $resultList .=  /span;
  $resultList .= /li;
 }

 if ($resultList == ) {
  $resultList = ulliNo Match Found/li/ul;
 } else {
  $resultList = ul.$resultList./ul;
 }
 return $resultList;
}

Can you help me please?

Thanks!!!
On Wed, Sep 17, 2008 at 12:49 PM, bluezehn [EMAIL PROTECTED]wrote:


 I couldn't find the same issue. Are you sure it's not some of your
 code or a callback you've written or something that's causing this?
 Maybe post your code so someone can take a look at it.

 On Sep 17, 8:31 pm, Jack D [EMAIL PROTECTED] wrote:
  Hi,
 Does any one has any update regarding the IE issue of memory leak for
  autocompleter? The IE size goes on increasing for autocompleter  never
  comes down
 
  Thanks!
 
  On Mon, Sep 15, 2008 at 5:46 PM, Jack D [EMAIL PROTECTED] wrote:
Hi bluezehn,
Thanks for the reply!
 
 Regarding Item 1, I'm using IE 6.0 on Windows XP Professional.
 the
   memory goes on increasing continoulsy as I go on using AJAX in
   autocompleter. I also observed that the memory increases with all
 browsers.
   With Firefox, the speed with which it increases is relatively slow. If
 IE is
   taking 100 MB, then firefox will take around 60 MBHowever, the
 memory
   increases  thts for sureeventually browser starts responding
   slowly.
 
  I'll appreciate if you can look into it.
   Thanks!
 
 On Mon, Sep 15, 2008 at 4:06 PM, bluezehn 
 [EMAIL PROTECTED]wrote:
  
   Hi there,
   In response to question 1, what version of IE are you using? Let me
   know and I'll see if I can replicate this.
 
   2: You always have to load all of prototype. You can as you point out
   just load specific parts of scriptaculous. In my opinion, it's not
   worth bothering with. The download size you save for the user is
   negligible - less than something like a 100x100 image I think. I'm not
   sure which module of scriptaculous the autocompleter is in, but I'm
   sure you can find it in the API somewhere. Seriously don't worry about
   it though - was working on a plone site at work today and had a look
   at the source code - plone had imported jquery for fun, then about 20
   other javascript files for various kss stuff and kupu functions and
   god knows what else.
   In short, it's never going to be the bottleneck of a site's
   performance.
 
   On Sep 15, 6:10 pm, Jack D [EMAIL PROTECTED] wrote:
Hi,
   I'm using 1.8.1 AJAX autocompleter. So far so good.
 
   Question 1:
 I've set minchar to 1. When I type say a in search text box, it
   displays
hints. If I do it again  again on this page (delete a  then
 again
   type
a), I can see some memory leak. When I kept my Windows Task
 Manager
   open,
the Mem Usgae for IEXPLORE kept on increasing. It started from 25MB
 
   went
to 200MB. The more you keep typing a or searching different words,
 the
memory goes on increasing. The CPU usage goes to 70% as well but it
   comes
down to 0% as soon as the hints are displayed. However, the memory
 does
   not
go down at all. Is Scruptaculous leaking memory?? Once the memory
 goes
beyond 200 MB for IEXPLORE, the browser responds real SLOW. Same is
 the
bahaviour with Firefox.
 
   Can any tell me if scriptaculous is leaking memory  how to fix
 it??
 
   Question 2:
 I'm including follwoign 2 scripts in all pages wherever I need to
 call
   the
autocompleter:
 script language=JavaScript type=text/Javascript
src=javascripts/scriptaculous/prototype.js/script
   script language=JavaScript type=text/Javascript

[Proto-Scripty] Re: toHTML() doesn't work

2008-09-17 Thread yawnmoth



On Sep 17, 5:55 pm, Ken Snyder [EMAIL PROTECTED] wrote:
 yawnmoth wrote:
 http://www.frostjedi.com/terra/scripts/demo/prototype01.html

  Shouldn't that give you a popup with some HTML code inside it?  What
  happens, instead, when I run it is that I get an error - last.toHTML
  is not a function.

  Any ideas?

 AFAIK Prototype does not have an Element#toHTML method.  Maybe you are
 thinking of Element#inspect()? What are you trying to accomplish with
 toHTML?

It's Object#toHTML:

http://www.prototypejs.org/api/object/tohtml
--~--~-~--~~~---~--~~
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: toHTML() doesn't work

2008-09-17 Thread Justin Perkins

On Wed, Sep 17, 2008 at 8:00 PM, yawnmoth [EMAIL PROTECTED] wrote:
 It's Object#toHTML:

 http://www.prototypejs.org/api/object/tohtml

Yes, like Object.toHTML(someObject), not someObject.toHTML().

--~--~-~--~~~---~--~~
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 handle different forms

2008-09-17 Thread luftikus143

Thanks.

I know have something like this:


function variables()
{
var url = '/xxx/etc/php/fill_variable_list.php';
var target = 'output-div';
var pars = 'selectedKeyword=.str_replace( , +,
$selectedKeyword).selected_ids=[EMAIL PROTECTED](+,
$selected_ids).requestedDatasettype=.
$_POST['requestedDatasettype'].';
var myAjax = new Ajax.Updater(target, url, {method: 'get',
parameters: pars});
$('output-div').insert(new Element('form', { id:
'form_define_dataset' }))
}

It's not working. So, I guess, I haven't really understood the thing
correctly (I am far away from that...). Do you have any tip for me
what I should do?

Thanks for your precious help!


On Sep 17, 3:35 pm, Diodeus [EMAIL PROTECTED] wrote:
 To insert something into the DOM use this. You can add other
 attributes as well. Read the Prototype docs.

 $(someDiv).insert(new Element(form, { id: 'moo' }))

 On Sep 17, 6:53 am, luftikus143 [EMAIL PROTECTED] wrote:

   You may need to add a form tag (using new Element) then put the
   contents of your form inside it. Alternately, you can have the form
   tag as part of your HTML to begin with.

  Thanks a lot! How does this new Element thing work? Do you have by
  chance a quick example?

  Thanks anyway, I'll see what I can do.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---