[mochikit] Re: Quick Signal Performance Question

2008-02-08 Thread Beau Hartshorne

On 8-Feb-08, at 12:28 PM, machineghost wrote:

> In other words, if I don't want to hassle with storing idents, what
> method is "best" for disconnecting signals?

I've never tested this. If you write a quick benchmark, would you mind  
sharing the results with us?

Thanks,
Beau

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



[mochikit] Re: problem with getElementPosition

2007-12-02 Thread Beau Hartshorne

Felipe,

getElementPosition works for most simple cases. In general, the more  
complicated the CSS is, the less reliable it is. We'd need to see a  
very simple test to see what the problem is, and even then, I'm not  
sure if we could work around it.

Beau

On 1-Dec-07, at 7:11 PM, Felipe Alcacibar B wrote:

>
> I'm creating a dinamic menu Object with MochiKit all works fine, but
> in getElementPostition i got some troubles with the position that it
> gives to me.
>
> i'm using the follow html structure to cerate the menu.
>
> 
>   
>menu 1
>
> 
>  menu 1-1
>
>   
> 
>
> But getElementPosition gives me a position like the childs divs is not
> hided, and like a vertical list (without the float: left option).
>
> it is a bug or a bad use of the function?
>
> i got some example  in http://devel.tryer.cl/fullplanet/ab/ 
> menutest.php
> i explain it.
>
> the a alerts, it is to stop a compiler to see how is the position of
> the li curernt element.
> the red divs, are appedned to the body with de x and y coordinates
> gived from geElementPosition.
>
> acknowledged greetings.
>
> Felipe Alcacibar.
> Development of systems and solutions.
>
>
> >


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



[mochikit] Re: setOpacity, MSIE and tr

2007-11-08 Thread Beau Hartshorne

Felipe,

Thanks for this -- would you mind creating a ticket in trac with your  
code?

Beau

On 8-Nov-07, at 7:39 AM, Felipe Alcacibar B wrote:

>
> Hi, i am a happy user of MochiKit, well, i need to apply opacity
> filter to a tr element, (table row) but it works in firefox and do not
> work on MSIE, i cannot understand why, then when i read the msfn, i
> got it, the problem is the "opacity filter" does not work on tr
> elements, and then i made some modifications to a setOpacity function,
> i post it, maybe can be useful.
>
>setOpacity: function (elem, o) {
>elem = MochiKit.DOM.getElement(elem);
>var self = MochiKit.Style;
>
>   if(/MSIE/.test(navigator.userAgent) && 
> elem.nodeName.toLowerCase()
> == "tr") {
>   var cellTags = ['TD', 'td', 'th', 'TH'];
>   while( cellTag = cellTags.shift()) {
>   if(cellsList = 
> elem.getElementsByTagName(cellTag)) {
>   for(i=0;i self.setOpacity(cellsList[i],
> o);
>   }
>   }
>   } else {
>   if (o == 1) {
>   var toSet = /Gecko/.test(navigator.userAgent) 
> && !(/Konqueror|
> AppleWebKit|KHTML/.test(navigator.userAgent));
>   elem.style["opacity"] = toSet ? 0.99 : 1.0;
>   if (/MSIE/.test(navigator.userAgent)) {
>   elem.style['filter'] =
>   self.getStyle(elem, 
> 'filter').replace(/alpha\([^\)]*\)/gi, '');
>   }
>   } else {
>   if (o < 0.1) {
>   o = 0;
>   }
>   elem.style["opacity"] = o;
>   if (/MSIE/.test(navigator.userAgent)) {
>   elem.style['filter'] =
>   self.getStyle(elem, 
> 'filter').replace(/alpha\([^\)]*\)/gi, '') +
> 'alpha(opacity=' + o * 100 + ')';
>   }
>   }
>   }
>},
>
>
> cheers
> Felipe.
>
>
> >


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



[mochikit] Re: Mochikit preventDefault() example don't work

2007-11-05 Thread Beau Hartshorne

That sounds like a browser problem. Some keyboard event's can't be  
overridden.

Beau

On 5-Nov-07, at 10:27 AM, Rodrigo Avila wrote:

>
> Hi all,
>
> I'm trying to use the Mochikit example (http://www.mochikit.com/doc/
> html/MochiKit/Signal.html) in 4 browsers: Safari, Opera, Firefox e IE
> (all in Windows Vista). But the "Check this box to test
> preventDefault() in your browser" checkbox don't work for F1 key in IE
> and Safari (when I hit F1 with the checkbox checked, the help screen
> appears). Someone can talk me how I can make this work?
>
>
> >


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



[mochikit] Re: window onclick doesn't work in IE

2007-10-19 Thread Beau Hartshorne

On 19-Oct-07, at 2:30 AM, Olli Wang wrote:

> Hi, I just tried:
>
> connect(window, 'onclick', function () {alert('test')})
>
> When I click on the window I should get an alert message. But it works
> fine on Fx, Safari and Opera, but not in IE 6 and IE 7. What's wrong
> about this function for IE? Any help would be appreciated.

Olli, try connecting to the document object. That might do what you  
want. So:

connect(document, 'onclick', function () {alert('test')})

Beau


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



[mochikit] Re: "event.target" missing

2007-09-27 Thread Beau Hartshorne

On 26-Sep-07, at 10:59 PM, hzlabs wrote:

> But what i did expect was, that when i send a signal to the target via
> the
> "signal" function - "myImg" in your example - the event object "e"
> should
> contain both e.target() ("myImg") and e.src() ("myP"). The later as
> the
> DOM element the function is connected to the event, target as the
> element the signal was sent to..

Helmut,

This looks useful. I'd encourage you to try to modify Signal to make  
it work the way you'd like, and submit a code patch to http:// 
trac.mochikit.com/. If it looks OK, I'll commit the change to MochiKit.

Thank you!
Beau




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



[mochikit] Re: Where to start with google-map like thing

2007-09-13 Thread Beau Hartshorne

> I'm really new to javascript and Mochikit, but with python
> experience.  I have been playing a bit with Mochikit, but I haven't
> quite gotten the knack of it yet.
>
> I would like to display a relatively large image in pieces with user
> interaction (simple scrolling of the image).  I can leave the AJAX
> stuff out for now.  I just want to load the image and be able to grab
> is and move it up and down in a window.  Any suggestions about what
> pieces I should look at to accomplish the task?

Sean,

Have a look at MochiKit.Signal and MochiKit.Style. When you're ready
for the AJAX, look at MochiKit.Async. The doc index is here:
http://www.mochikit.com/doc/html/MochiKit/index.html

Beau

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



[mochikit] Re: Activity

2007-08-18 Thread Beau Hartshorne

On 18-Aug-07, at 8:44 AM, Lee Connell wrote:

> Mochikit hasn't seen any activity in the revision history at least
> since 06, is mochikit fading?

We're pretty busy with our own projects, and haven't had much time to  
tag a release. /trunk is very stable, and is updated with features  
and bugfixes regularly:

http://trac.mochikit.com/browser/mochikit/trunk

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



[mochikit] Re: signals, onload, maybe too late?

2007-08-17 Thread Beau Hartshorne

On 14-Aug-07, at 8:34 AM, csnyder wrote:

> The standard way to solve this problem seems to be implementing your
> own ondomload event. Perhaps this is something to be included in
> future versions of MochiKit (I'm using 1.3) as it would certainly make
> JavaScript suck less.
>
> Here's my hack implementation as a basic example. It requires a  class="bottom"> at the end of the document, right before
> ...
>
> // signal ondomload when body element has loaded
> // loosely based on http://brothercake.com/site/resources/scripts/ 
> domready/
> ondomloadTries = 0;
> ondomloadDelay = 500;
> ondomloadInterval = setInterval( function() {
>   ondomloadTries++;
>   if ( ondomloadTries >= 12) {
> log("Too many ondomload tries, something went wrong.");
> clearInterval( ondomloadInterval );
>   }
>   bodies = getElementsByTagAndClassName('p', 'bottom');
>   log("Looking for body",ondomloadTries,bodies);
>   if ( bodies.length > 0 ) {
> log("signal ondomload!");
> try {
>   signal(window,'ondomload');
> }
> catch ( e ) {
>   log("EXCEPTION",e.message,e.errors);
> }
> clearInterval( ondomloadInterval );
>   }
> }, ondomloadDelay );

I haven't looked into this recently, but I was never happy with the  
way the ondomload stuff was implemented. In my code, I tend to do  
just add a  tag just before . So in this case, you'd  
do something like: