[mochikit] Can't Connect an onClick Function to Document

2007-02-23 Thread machineghost

I have an object:
function myObject(e){
connect(document, 'onclick', this.someFunction);
}
myObject.prototype.someFunction = *STUFF*

The object is initialized as the onClick action of an HTML Input
element:
connect(myInput, 'onclick', function(e){var myObjectInstance = new
myObject(e);});

If I click on the input, the object gets instantiated just fine (no
errors).  However, the moment I click anywhere in the document I get
the following error:
src has no properties
connect(undefined, "onclick", function(), undefined)Signal.js
(line 628)
myObject()js_myFile... (line 193)
(no name)(click clientX=0, clientY=0)Signal.js (line 553)
[Break on this error] var isDOM = !!(src.addEventListener ||
src.attachEvent);

I'm pulling my hair out trying to figure out why Mochikit thinks that
document doesn't exists; can anyone please help?


--~--~-~--~~~---~--~~
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: Trouble with draggable.js

2007-02-23 Thread ceir...@gmail.com

It would also seem to be an issue with nested divs. I'm working on
redesigning the gallery to work with fewer divs.


--~--~-~--~~~---~--~~
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: Trouble with draggable.js

2007-02-23 Thread ceir...@gmail.com

Got it. The images are preventing the box from dragging. Now I know
there has to be some sort of solution to this because I know I've seen
folks use this code with images. Any know how. Alas, I don't know
javascript.

On Feb 23, 12:31 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Okay, after testing a whole bunch of things the code doesn't seem to
> work possibly because of:
>
> nested divs?
> images being included in the divs?
>
> I tried dumping all my css styles except for .draggable and it still
> doesn't work. Also I made a little red box that DOES work with this
> code:
> Test
>
> So It doesn't seem my CSS is throwing it off.
>
> In the event PHP was throwing it off I copied and pasted the code the
> PHP would generate onto a test page and tried it. The result is the
> same. Nada. The red box moves, but the badge in the code above does
> not.
>
> On Feb 23, 10:32 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > BTW, I'm on a Mac using FF (Mac) 2.0 and Safari 2.0.4. I'm currently
> > running on a virtual host. This code is not working on either Safari
> > or FF for Mac.
>
> > The divs are being generated by a PHP include(), but that shouldn't
> > cause problems should it?
>
> > On Feb 23, 10:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > I have. I've checked to see if the files are loading and everything,
> > > and they are. I've also added everything from MochiKit to the page
> > > header, including DragAndDrop.js. Still nothing.
>
> > > As for the error:
>
> > > Error: dojo is not defined
> > > Source File: /__package__.js
> > > Line: 1
>
> > > This could be the issue, but I don't recall needing __package__.js for
> > > what I'm trying to do.
>
> > > On Feb 23, 8:37 am, "Matthew Kwiecien" <[EMAIL PROTECTED]> wrote:
>
> > > > It looks like everything should work properly. Have you tried including 
> > > > this
> > > > line on your page yet?
>
> > > > 
>
> > > > What errors do you get in the js console?


--~--~-~--~~~---~--~~
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: Trouble with draggable.js

2007-02-23 Thread ceir...@gmail.com

Okay, after testing a whole bunch of things the code doesn't seem to
work possibly because of:

nested divs?
images being included in the divs?

I tried dumping all my css styles except for .draggable and it still
doesn't work. Also I made a little red box that DOES work with this
code:
Test

So It doesn't seem my CSS is throwing it off.

In the event PHP was throwing it off I copied and pasted the code the
PHP would generate onto a test page and tried it. The result is the
same. Nada. The red box moves, but the badge in the code above does
not.



On Feb 23, 10:32 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> BTW, I'm on a Mac using FF (Mac) 2.0 and Safari 2.0.4. I'm currently
> running on a virtual host. This code is not working on either Safari
> or FF for Mac.
>
> The divs are being generated by a PHP include(), but that shouldn't
> cause problems should it?
>
> On Feb 23, 10:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > I have. I've checked to see if the files are loading and everything,
> > and they are. I've also added everything from MochiKit to the page
> > header, including DragAndDrop.js. Still nothing.
>
> > As for the error:
>
> > Error: dojo is not defined
> > Source File: /__package__.js
> > Line: 1
>
> > This could be the issue, but I don't recall needing __package__.js for
> > what I'm trying to do.
>
> > On Feb 23, 8:37 am, "Matthew Kwiecien" <[EMAIL PROTECTED]> wrote:
>
> > > It looks like everything should work properly. Have you tried including 
> > > this
> > > line on your page yet?
>
> > > 
>
> > > What errors do you get in the js console?


--~--~-~--~~~---~--~~
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: Trouble with draggable.js

2007-02-23 Thread ceir...@gmail.com

BTW, I'm on a Mac using FF (Mac) 2.0 and Safari 2.0.4. I'm currently
running on a virtual host. This code is not working on either Safari
or FF for Mac.

The divs are being generated by a PHP include(), but that shouldn't
cause problems should it?

On Feb 23, 10:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I have. I've checked to see if the files are loading and everything,
> and they are. I've also added everything from MochiKit to the page
> header, including DragAndDrop.js. Still nothing.
>
> As for the error:
>
> Error: dojo is not defined
> Source File: /__package__.js
> Line: 1
>
> This could be the issue, but I don't recall needing __package__.js for
> what I'm trying to do.
>
> On Feb 23, 8:37 am, "Matthew Kwiecien" <[EMAIL PROTECTED]> wrote:
>
> > It looks like everything should work properly. Have you tried including this
> > line on your page yet?
>
> > 
>
> > What errors do you get in the js console?


--~--~-~--~~~---~--~~
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: Trouble with draggable.js

2007-02-23 Thread ceir...@gmail.com

I have. I've checked to see if the files are loading and everything,
and they are. I've also added everything from MochiKit to the page
header, including DragAndDrop.js. Still nothing.

As for the error:

Error: dojo is not defined
Source File: /__package__.js
Line: 1

This could be the issue, but I don't recall needing __package__.js for
what I'm trying to do.

On Feb 23, 8:37 am, "Matthew Kwiecien" <[EMAIL PROTECTED]> wrote:
> It looks like everything should work properly. Have you tried including this
> line on your page yet?
>
> 
>
> What errors do you get in the js console?


--~--~-~--~~~---~--~~
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: Trouble with draggable.js

2007-02-23 Thread Matthew Kwiecien
It looks like everything should work properly. Have you tried including this
line on your page yet?



What errors do you get in the js console?

--~--~-~--~~~---~--~~
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: Trouble with draggable.js

2007-02-23 Thread ceir...@gmail.com

Here's draggable.js:

/*

Drag: A Really Simple Drag Handler

*/
Drag = {
_move: null,
_down: null,

start: function(e) {
e.stop();

// We need to remember what we're dragging.
Drag._target = e.target();

/*
There's no cross-browser way to get offsetX and offsetY,
so we
have to do it ourselves. For performance, we do this once
and
cache it.
*/
Drag._offset = Drag._diff(
e.mouse().page,
getElementPosition(Drag._target));

Drag._move = connect(document, 'onmousemove', Drag._drag);
Drag._down = connect(document, 'onmouseup', Drag._stop);
},

_offset: null,
_target: null,

_diff: function(lhs, rhs) {
return new MochiKit.Style.Coordinates(lhs.x - rhs.x, lhs.y -
rhs.y);
},

_drag: function(e) {
e.stop();
setElementPosition(
Drag._target,
Drag._diff(e.mouse().page, Drag._offset));
},

_stop: function(e) {
disconnect(Drag._move);
disconnect(Drag._down);
}
};

connect(window, 'onload',
function() {
/*
Find all DIVs tagged with the draggable class, and connect
them to
the Drag handler.
*/
var d = getElementsByTagAndClassName('DIV', 'draggable');
forEach(d,
function(elem) {
connect(elem, 'onmousedown', Drag.start);
});

});

connect(window, 'onload',
function() {
var elems = getElementsByTagAndClassName("A", "view-source");
var page = "draggable/";
for (var i = 0; i < elems.length; i++) {
var elem = elems[i];
var href = elem.href.split(/\//).pop();
elem.target = "_blank";
elem.href = "../view-source/view-source.html#" + page +
href;
}
});



On Feb 22, 7:29 pm, "Matthew Kwiecien" <[EMAIL PROTECTED]> wrote:
> Unless I'm mis-remembering, you need to include DragAndDrop.js as it's not
> loaded by default.
>
> I'd need to see what's in draggable.js to say anything more.
>
> On 2/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I've been using the draggable demo .js on the site to try get a div on
> > a web site I'm working on to be draggable. So far I'm not having any
> > luck and I don't really know why.
>
> > Here's the html:
>
> >  > "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
> > http://www.w3.org/1999/xhtml";>
> > 
> > Test
> >  > href='style.css' />
> > 
> > 
> > 
> > 
> > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc eget
> > nunc. In hac habitasse platea dictumst. Vivamus quis quam. In ut
> > ligula in lectus mattis volutpat. Sed tempus consectetuer dui. Integer
> > ipsum. Aenean quis risus eu nunc feugiat malesuada. Praesent posuere
> > volutpat mi. Curabitur ligula neque, faucibus ut, mattis non, egestas
> > ut, quam. Sed arcu. Lorem ipsum dolor sit amet, consectetuer
> > adipiscing elit. Etiam volutpat, ante ut gravida tristique, sem velit
> > tempor augue, ut tempor massa velit eget nisl. Donec vitae nisl. In
> > vel turpis. Nulla tempor.
> > Ut vulputate, ligula quis dictum fringilla, massa risus ullamcorper
> > libero, at viverra justo libero vel massa. Mauris fringilla justo quis
> > erat. Suspendisse auctor. Suspendisse odio erat, venenatis vitae,
> > rutrum a, convallis at, pede. Cras tristique hendrerit leo. In
> > porttitor egestas nunc. Integer varius vulputate nisi. Duis diam
> > purus, iaculis ut, mollis egestas, aliquet at, odio. Mauris neque
> > libero, gravida sed, auctor a, faucibus nec, neque. Suspendisse
> > ultricies. Suspendisse potenti. Praesent malesuada aliquam pede. Nam
> > venenatis scelerisque lorem. Aliquam erat volutpat. Quisque faucibus
> > erat vel mauris. Aliquam erat volutpat. Morbi tincidunt aliquam ante.
> > Mauris semper, ante vel ullamcorper fermentum, eros mauris fringilla
> > magna, ut interdum enim enim dapibus turpis.
>
> > This through
> > Flickr  > href="http://www.flickr.com/photos/[EMAIL PROTECTED]/258563293"> > src="http://static.flickr.com/112/258563293_a672fff083_m.jpg"/> > div>http://www.flickr.com/
> > photos/[EMAIL PROTECTED]/215824196">http://static.flickr.com/
> > 79/215824196_3dfca1ebf3_m.jpg"/> > div>
>
> > Nullam scelerisque, turpis eu interdum molestie, nulla velit auctor
> > ligula, vitae nonummy justo nibh at quam. Quisque ultrices faucibus
> > est. Nulla facilisi. Pellentesque scelerisque turpis ut tortor. Fusce
> > adipiscing mollis tortor. Praesent fermentum libero commodo mauris.
> > Maecenas suscipit nonummy dolor. Suspendisse eget lorem. Duis tempus,
> > ante in pulvinar dapibus, nibh mauris placerat tellus, eu euismod
> > dolor mi sit amet enim. Aenean iaculis suscipit dolor. Ut varius, urna
> > at imperdiet dapibus, nibh ligula sagittis turpis, vitae aliquam pede
> > purus id ante. Donec nec enim. Vestibulum tempus tortor nec dui
> > feugiat faucibus.
> > Nulla facilisi. Aliq

[mochikit] Date Picker

2007-02-23 Thread Pearl

On click event of a button I am dynamically creating a form. Form has
a calendar date picker in it. Can I some how use turbogears
calendarDatePicker widget in this case?

Regards
Roopesh


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