[Proto-Scripty] Accept Droppable by Tag

2009-09-26 Thread Vaie Lab

Hi,

I know you can accept droppable by css class, but is there a way to
accept them by tag name, like all the img?

Thank

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

2009-09-26 Thread BKDotCom

Is it possible to change/modify the tabindex through javascript/DOM ?

I've tried Element.writeAttribute()    successfully changes the
tabidex atribute, but doesn't affect the taborder..
likewise, changing the value of node.tabIndex, doesn't seem to have
any affect..

So, can the tab-order be changed dynamically ?

--~--~-~--~~~---~--~~
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] Sortables / Draggables issue

2009-09-26 Thread rd

I am making a tabstrip control in which I wish to be able to re-order
tabs using Sortables as well as drag tabs to a deletion drop-zone to
delete them.

I have coded up a sample here:
http://test.rehandalal.com/tabstrip

The DEL box should act as a deletion drop-zone, and when tabs are
dragged into it they should be deleted, however I am currently unable
to drag tabs in there and I was wondering if anyone had any
suggestions?

Furthermore although sorting works fine when the tab strip is scrolled
to 0 on the x-axis, as you begin to scroll right the sorting feature
seems to behave in an odd manner and no longer sorts correctly. The
further right you move, the worse the problem gets. Does anyone know
any work arounds?

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] Re: Range utility increment

2009-09-26 Thread T.J. Crowder

All right, lads, let's move along...  Each approach has its benefits
and costs, it all depends on what problem you're solving.

Matt, FWIW, I think you'd want to override the `include` method as
well, as others a NumberRange with even numbers would include 3.  At
that point you're overriding most of ObjectRange, so I'd probably just
start from Enumerable.  This is not intended as a dig.

-- T.J.

On Sep 25, 9:51 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 Omg get over yourself you have taken what i said completely the wrong way..

 What arrogant plug was that?...

 Lets take your code and look at it shall we...

 30+ lines for no reason other than Hey look at me, i can write a
 function/class in 30 lines that only needs to be 5.

 Chill out dude, i wasn't knocking your code, it was just OTT.

 You can continue to think you are right which is arrogance in itself...
 there is more than one way to skin a cat.

 TJ's/My loop that took all of 30 seconds to create is faster no doubt, has
 less weight and does the job. I personaly have better things to do than
 write some amazing class to achieve what can be done in 30 seconds -
 evidently you do not so good luck with that.

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Matt Foster mattfoste...@gmail.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, September 25, 2009 9:16 PM
 Subject: [Proto-Scripty] Re: Range utility increment

  That only gives you even or odd increments to the top number...

 Incorrect, notice the constructor method? It ensures that the number
 given is even such that you'll never get a range of odd numbers.
 Granted the last line of the Jojo's question was

  Let's say count up by 2's: [2,4,6,8,10].  How do you do this?

 Hence why I went with this specific implementation, to demonstrate how
 you can create classes that the ObjectRange class can use to create
 proper ranges.  I didn't feel it was necessary to abstract out the
 class such that it covers all bases but demonstrate how to do it one
 way and then Jojo could modify for their own purposes.

  Better to go with my/TJ's loop

 What an arrogant plug of your own spaghetti code and hasty discredit
 to my contribution.  Exposing your shortfalls isn't difficult, you
 aren't creating a range object, completely bypassing the ObjectRange's
 functionality and just simply creating a hacked out array.

 So to put the nail in the coffin, here is the classes abstracted out

 var IncrementNumber = Class.create({
 initialize : function(num, increment){
 this.num = num;
 this.increment = increment;},

 succ : function(){
 return this.clone(this.num + this.increment, this.increment);},

 clone : function(num, increment){
 return new IncrementNumber(num, increment);},

 toString : function(){
 return this.num;}
 });

 var EvenNumber = Class.create(IncrementNumber,
 {
 initialize : function($super, num){
 $super(num, 2);
 this.num = (num % 2 == 1) ? num - 1 : num;},

 clone : function(num, increment){
 return new EvenNumber(num);}
 });

 var NumberRange = Class.create(ObjectRange,
 {
 _each: function(iterator) {
 var value = this.start;
 while (this.include(value.num)) {
   iterator(value.num);
   value = value.succ();

 }
 },
 });

 var bottom = new IncrementNumber(-10, 2);
 //var bottom = new EvenNumber(-20);
 var top = new EvenNumber(25);
 var range = $A(new NumberRange(bottom, top));

 console.log(range);

 nothing gets me fired up like a flame...

 On Sep 25, 2:25 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:



  That only gives you even or odd increments to the top number...

  WHat if you wanted every 5th number ...

  Better to go with my/TJ's loop

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Matt Foster mattfoste...@gmail.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, September 25, 2009 5:57 PM
  Subject: [Proto-Scripty] Re: Range utility increment

  I'd just use an 'iterator' class to do this...

  var EvenNumber = Class.create(
  {
  initialize : function(num){
  this.num = (num % 2 == 1) ? num - 1 : num;
  },
  succ : function(){
  return new EvenNumber(this.num + 2);
  },
  toString : function(){
  return this.num;
  }
  });

  var bottom = new EvenNumber(1);

  var top = new EvenNumber(21);
  var range = $A($R(bottom, top));

  console.log(range);

  I had done this to a much greater extent in my date range selector
  gadget. Where it became the master range, held a range of calendar
  objects, which were in themselves ranges of date objects... fun stuff.

 https://positionabsolute.net/blog/2008/01/google-calendar-date-range-...

  ps just looking over that, should rename that class to
  PositiveEvenNumber, only going to work one way, but you get the idea

  On Sep 25, 4:15 am, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   function everyOther(start, end, increment) {
   var n;
   var 

[Proto-Scripty] Re: Observe new elements

2009-09-26 Thread Rick Waldron
var _observers

On Thu, Sep 24, 2009 at 5:41 AM, Alex McAuley 
webmas...@thecarmarketplace.com wrote:

  You need to stopObserving the old ones relative to your element (cleans
 up the observers) and add a new observer as normal

 HTH

 Alex Mcauley
 http://www.thevacancymarket.com

 - Original Message -
 *From:* Russell Keith russell.ke...@aacreditunion.org
 *To:* prototype-scriptaculous@googlegroups.com
 *Sent:* Wednesday, September 23, 2009 10:27 PM
 *Subject:* [Proto-Scripty] Observe new elements

  If I am adding elements to a page after the DOM is loaded, how do I add
 my existing Element.observe to it?



 Russell


 


--~--~-~--~~~---~--~~
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: Observe new elements

2009-09-26 Thread Rick Waldron
Whoops! I hit shift or control return and well... sent that too early.

Anyway, I always do this...


var Observers = function () {

// your observers go in here...

};

Ajax.Responders.register({
onComplete: function () {
 Observers();
}
});

document.observe('dom:loaded', function () {
   Observers();
});



On Sat, Sep 26, 2009 at 5:56 PM, Rick Waldron waldron.r...@gmail.comwrote:

 var _observers


 On Thu, Sep 24, 2009 at 5:41 AM, Alex McAuley 
 webmas...@thecarmarketplace.com wrote:

  You need to stopObserving the old ones relative to your element (cleans
 up the observers) and add a new observer as normal

 HTH

 Alex Mcauley
 http://www.thevacancymarket.com

 - Original Message -
  *From:* Russell Keith russell.ke...@aacreditunion.org
 *To:* prototype-scriptaculous@googlegroups.com
 *Sent:* Wednesday, September 23, 2009 10:27 PM
 *Subject:* [Proto-Scripty] Observe new elements

  If I am adding elements to a page after the DOM is loaded, how do I add
 my existing Element.observe to it?



 Russell


 



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