Re: [Moo] Re: My will won't let me switch from mootools to Jquery

2013-08-12 Thread nwhite
Oops typo! There isn't any real gains from defining the prototype like I did, I was doing it to show how you can define a "class" in a way similar to mootools. However compared to your example it offers memory and initialization improvements. With your example every time I initialize a new class I

Re: [Moo] Re: My will won't let me switch from mootools to Jquery

2013-08-12 Thread nwhite
Utan, I value your passion and I don't want to discourage you. Mootools code is great, I absolutely love it. I truly believe that hanging out on this list and reading the code made me a better developer. It's important to remember the context of when Mootools was created and the problems it was s

Re: [Moo] Drag.Group.js

2011-06-21 Thread nwhite
http://www.nwhite.net/?p=266 sorry about the downtime.. old host.. auto renew didn't work with new cc # :) On Tue, Jun 21, 2011 at 3:06 AM, Robert wrote: > On Nathan White blog there was once a group drag class for selected > moving elements in groups. > The blog is no more and I wonder if that

Re: [Moo] Exercise in Callbacks [#bestpractices]

2010-06-25 Thread nwhite
On Fri, Jun 25, 2010 at 11:19 AM, Paul Saukas wrote: > good god that was typed to fast :) correction to basic English . > > > > A callback by my understanding (self taught so be warned) is > > Function B called on completion of Function A from within Function A . > Whereas Function B is an argu

Re: [Moo] Re: Navigation class -- seeking input!

2010-06-24 Thread nwhite
On Thu, Jun 24, 2010 at 2:28 PM, אריה גלזר wrote: > Adnre - mine is actually roughly based on digitarld's lib (which is for moo > 1.1). > Ryan - i've looked at your example before, and i've thought about switching > to it. the problem is that it uses a lot of calls to element storage for > each o

Re: [Moo] Rounding to the nearest Nth value in array [bestpractice]

2010-06-21 Thread nwhite
It depends on why you want to optimize. Currently, the code works fine unless you pass a number out of range and try to round down. In your example I expect rounding 400 down would return 240 and not 0, and -10 return 0 instead of undefined. For me the Array.filter callbacks are the most inefficie

Re: [Moo] Because StackOverflow is cool, I created a proposal for a mootools overflow

2010-06-17 Thread nwhite
I don't think its a replacement either but it could help with visibility and perceptions with people outside of the mootools community. ie: http://www.google.com/trends?q=jquery%2C+mootools&ctab=0&geo=all&date=all On Thu, Jun 17, 2010 at 1:57 PM, Ryan Florence wrote: > A mootools specific stack

Re: [Moo] MOOTools/AJAXian way to dynamically build forms

2010-04-02 Thread nwhite
http://mootools.net/shell/AuTAm/ On Fri, Apr 2, 2010 at 4:00 PM, Charles Parcell wrote: > The topic I am asking about is not MOOTools specific, but I am want to > build it within MOOTools so it is relative. > > I have been an old school fool for a long time. Been getting wet in > MOOTools to buil

Re: [Moo] Removing items from a select box

2010-02-26 Thread nwhite
http://www.propertymaps.com/blog/2008/04/10/dynamically-populating-select-elements-with-javascript/ Explains the issues in greater detail On Fri, Feb 26, 2010 at 5:15 PM, Matthew Hazlett wrote: > Sry that was my bad I forgot to create the class :-) Your way does work > outside of a class, but

Re: [Moo] memory consumption of Class instances

2009-12-16 Thread nwhite
> > > You can test for memory leaks quite easily. Simply create a test (say, it > creates an instance of your class), and put it in a loop that executes, say, > 1000 times. Open up a memory viewer (for OSX it's just the Activity > Monitory) and load your page. Then reload it. You should see the mem

Re: [Moo] domready & labJS

2009-11-23 Thread nwhite
>From the site: Bottom line: *only* the few special scripts out there, like libraries, that do their own DOM-ready detection, and don't do so in a dynamically-loaded-after-page-load safe way, will have possible problems if loaded by LABjs, so avoid it *only* in those rare cases. Simply load those s

[Moo] Re: Mootools Factory Pattern: input needed

2009-11-04 Thread nwhite
I know there is issues with onload on scripts. The implementation isn't the same across browsers and I know its broken in some older ones. If you really need this behavior you could use the Request object. Request.JS = new Class({ Extends : Request, options : { context : window }, success : func

[Moo] Re: Concurrent morphs/tweens?

2009-10-22 Thread nwhite
Fx.Elements On Thu, Oct 22, 2009 at 4:53 PM, rutherford wrote: > > Don't suppose there's a way of morphing/tweening multiple elements > simultaneously?

[Moo] Re: Mootools Inpinity Slider - a slider ui control that allows an infinite amount of pins

2009-09-25 Thread nwhite
++ nice use of Class.Refactor On Fri, Sep 25, 2009 at 9:06 AM, csuwldcat wrote: > > if you want a double pinned slider (or need many more pins - for a > Photoshop-type gradient selector for instance) you can't really do > much better than this plugin, it uses a more OO aproach via the > Class.re

[Moo] Re: error in Firefox OS X

2009-09-19 Thread nwhite
It's firebug. Try upgrading to the latest version of firebug. I know there is a lot of work going into making it more stable. On Saturday, September 19, 2009, Jon Hancock wrote: > > This happens on Firefox 3.0.14, OS X 10.5.8. > Here's the error: > > [Exception... "Component returned failure cod

[Moo] Re: Find element at coordinate (x,y)

2009-09-16 Thread nwhite
> Did you try event.target? > :S > > event.target is great. but what event do you fire and how do you fire it at a specific x,y position? > > -- > Fábio Miranda Costa > Solucione Sistemas > Front-End Engineer > http://meiocodigo.com > > > > On Wed, Sep 16, 2009 at 8:36 PM, Y. Leretaille > wrote

[Moo] Re: MilkChart

2009-09-15 Thread nwhite
Actually raphael is svg not canvas. > Good work. And here is a beautyful canvas lib http://raphaeljs.com/, > and it can works on IE, also support animatation. Maybe you have > interesting to see it. >

[Moo] Re: Horizontal slide onto page from off the right edge possible?

2009-09-15 Thread nwhite
no problem On Tue, Sep 15, 2009 at 4:56 PM, Robert wrote: > > nwhite, > > That actually worked great. Check my new sample here: > > http://stoeber.us/tnet/test4.html > > Many thanks. > >

[Moo] Re: Horizontal slide onto page from off the right edge possible?

2009-09-15 Thread nwhite
what if you make a like #ads. put both your right and left slide in there. // css .rs_outer_wrapper { position: relative; } #ads { position: absolute; width: 100%; left : 0px; top: 100px; // may need adjusting height: 250px; // may need adjusting overflow: hidden; } yo

[Moo] Re: Problem with JSON and HTML

2009-09-12 Thread nwhite
pasting so much code into the mailing list is generally frowned upon because of formatting and readability issues. Consider posting your issues to mooshell or pastie. Check out http://www.jsonlint.com/ it is very helpful at locating syntax errors in json

[Moo] Re: Optimal way to add events to array of elements

2009-09-10 Thread nwhite
$$('a.delete').addEvent('click',qDelete); On Thu, Sep 10, 2009 at 7:41 AM, Itay Moav wrote: > Currently I am doing something on the line of: > > $$('a.delete').each(function(a){a.addEvent('click',qDelete)}); > > Where qDelete is a function name I wish to fire when the event happens. > Is t

[Moo] Re: techniques for url hash changes

2009-09-09 Thread nwhite
The Facebook API is built with a huge amount of dependency on this. They use polling. I don't see any other way around but to use polling. I've always used something in the range of 100-200ms. Its not like its a taxing process. It will only fire after any immediate code is completed. 2009/9/9 Fábi

[Moo] Re: Mootools 1.1 Fx.Styles Demo Converted to 1.2

2009-09-02 Thread nwhite
Fx.Morph On Wed, Sep 2, 2009 at 11:38 AM, Jon Robinson wrote: > > Hey guys, > > First let me say I am a mootools newbie, so forgive my ignorance. I > have been trying implement the mootools Fx.styles demo which gives a > cool hover transition: http://demos111.mootools.net/Fx.Styles > > I noticed

[Moo] Re: on hover pause stop scroll effect for ticker

2009-08-31 Thread nwhite
> > http://woork.blogspot.com/2008/07/useful-tips-to- > > enrich-your-html-forms.html">Useful tips to enrich your HTML Forms > > > >In this post I want to share some simple tips useful to > > enrich your forms with va

[Moo] Re: on hover pause stop scroll effect for ticker

2009-08-31 Thread nwhite
this code seems to be 1.11 I made some changes to make it 1.2 compatible. http://mooshell.net/sB7vD/ Changes: 1. used Implements : [Options] instead of the recreating the 'setOptions' method. this removed the object.Extend reference 2. There was some weird stuff with element dimensions el.getSiz

[Moo] Re: populating class variables within a request onSuccess

2009-08-27 Thread nwhite
drew.. your setting this values on an ajax request. but your calling alert before the ajax call even gets back. This is where you need to use events. I made changes so the data gets set and shows in the alert when it is updated. http://mooshell.net/ezgn6/ On Thu, Aug 27, 2009 at 1:13 PM, drew n

[Moo] Re: wrap element's html

2009-08-27 Thread nwhite
Your solution is far from ideal. What your doing to the DOM is brutal. Your recreating every node in the page. By doing this any event listeners you have on an element is lost. The solution I provided above is superior because its faster, and doesn't break existing events. If the syntax seemed to

[Moo] Re: wrap element's html

2009-08-27 Thread nwhite
> One would ask the question "Why don’t you just output the wrapper div in > your html?" > Sometimes you don't have full control over the html generation. @atwork8 I thought your tone was a bit rude especially when your asking for help. A bit of diplomacy will get you farther. I would use adopt

[Moo] Re: How to disable autoselect test on mouse DBLClick event?

2009-08-26 Thread nwhite
yeah yeah... I don't learn unless I get burned. I would like to point out that disabling selection in most circumstances is bad from a usability perspective. On Wed, Aug 26, 2009 at 1:18 PM, Oskar Krawczyk wrote: > Starting to get the feeling that my messages are invisible? :-) > O. > > On 26 Au

[Moo] Re: How to disable autoselect test on mouse DBLClick event?

2009-08-26 Thread nwhite
> No it needs to take effect before the actual dblclick event is fired. If > you try to put it inside, the dblclick fires before the select gets disabled > and the text will still get selected. > yeah I just tested it... flicker... :( Blows my theory... well it works for mousemove ;-) > > O

[Moo] Re: How to disable autoselect test on mouse DBLClick event?

2009-08-26 Thread nwhite
> You can only accomplish this with css to my knowledge: > I really think this is what the DOM Range API was designed for. The technique I mentioned above is what I used in Lasso. I call it on every mousemove. If I am correct this catches the browser before the redraw. I just played around with:

[Moo] Re: How to disable autoselect test on mouse DBLClick event?

2009-08-26 Thread nwhite
Range API stuff. If I have actions that could cause native DOM element selection I add this to my class and call it during the event. this.removeDOMSelection = (document.selection && document.selection.empty) ? function(){ document.selection.empty(); } : (wi

[Moo] Re: question about classes and custom events.

2009-08-26 Thread nwhite
@Dimitar you almost got it. var ninja = new Class({ Implements: [Options, Events], // added Options // added options to class options : { onLoad: function() { alert("loaded!"); } // moved custom event here! }, initialize: function(options) { this.setOptions

[Moo] Re: question about classes and custom events.

2009-08-26 Thread nwhite
There is a note at the bottom of docs for the Options on the Class Extraspage: If a Class has Eventsimplemented, every option beginning with 'on' and followed by a capital

[Moo] Re: Dynamic Dropdownlists

2009-08-24 Thread nwhite
interface your use to with a typical html node. On Mon, Aug 24, 2009 at 7:28 AM, nwhite wrote: > > > On Mon, Aug 24, 2009 at 7:17 AM, Steve Onnis wrote: > >> So if it doesnt mix then dont mix it and you dont have to mix it. Why >> would you mix it when it is as si

[Moo] Re: Dynamic Dropdownlists

2009-08-24 Thread nwhite
is cleaner, and easier to debug. > > ------ > *From:* nwhite [mailto:changereal...@gmail.com] > *Sent:* Monday, 24 August 2009 9:56 PM > > *To:* mootools-users@googlegroups.com > *Subject:* [Moo] Re: Dynamic Dropdownlists > > new Option isn

[Moo] Re: Dynamic Dropdownlists

2009-08-24 Thread nwhite
et it to >> work. *new Option()* just works and always has so i dont see it being >> bad especially when you are dealing with older browsers >> >> -- >> *From:* nwhite [mailto:changereal...@gmail.com] >> *Sent:* Monday, 24 August 2009

[Moo] Re: Dynamic Dropdownlists

2009-08-24 Thread nwhite
I wrote a post a while ago about the bugs/features surrounding dynamic population of a select form. http://www.propertymaps.com/blog/2008/04/10/dynamically-populating-select-elements-with-javascript/ On Mon, Aug 24, 2009 at 3:23 AM, Steve Onnis wrote: > selects are funny like that > > I woul

[Moo] Re: Class question

2009-08-20 Thread nwhite
thing like > > > this: > > > > > Class.Mutators.initialize = function(initialize){ > > >return function(){ > > >var result = initialize.apply(this, arguments); > > >if ($defined(this.functionToCall)) { > >

[Moo] Re: Class question

2009-08-20 Thread nwhite
What if you made it so your extended classes don't have an initialize method. Create another function like 'setup', 'render' or 'init'. In your base class in your initialize method check for this method and execute. Then your base class has full control of the subclass execution, return state.

[Moo] Re: Binding example in MooTools Essentials Appendix

2009-08-13 Thread nwhite
The quick solution ['blue','green','yellow'].each(function(value, index,arr){ alert('item ' + index + ' is ' + value); if (index ==arr.length-1) arr[index] = 'orange'; //Changes the last item in the array to 'orange' }); each has a third parameter that it passes to your anonymous function. Th

[Moo] Re: A Set Implementation for MooTools

2009-08-11 Thread nwhite
Nice stuff! I just implemented it, works great. On Tue, Aug 11, 2009 at 8:48 PM, Aaron Newton wrote: > I can't wait until the forge is released so stuff like this can get into a > directory of awesome user contributions. Nice work. > > > On Tue, Aug 11, 2009 at 6:35 PM, David Nolen wrote: > >> I

[Moo] Re: Conflict between MS Ajax and MooTools...

2009-08-03 Thread nwhite
if your able to post a test page with the code stubs so it generates the error, it would be easier for others how to advise you on your possible solutions. I suspect the culprit is for( in ){ ... } statements within the MS code. If these are being used on arrays then yes, you would get that error

[Moo] Re: Conflict between MS Ajax and MooTools...

2009-08-03 Thread nwhite
> 2. I don't think so. You can only tween stuff that has some mathematical > logic, like borders, colors, dimensions, etc. What would you expect to > happen when you "tween" a background image? Fade? yeah you couldn't do background-image, but background-position is possible.

[Moo] Re: Map Navigation COntrol

2009-08-02 Thread nwhite
Fabio is right on the right track. The way Google Maps handles is: 1. setting the map container to position: relative; 2. using small images, they serve 256x256 sq/px images. 3. Having logic to calculate the view area. depending on the size of the viewport they load in adjacent tiles. On smaller

[Moo] Re: Need help with code move from 1.1 to 1.2

2009-07-20 Thread nwhite
not sure what was going on with extending Fx.Tween. I don't have time to look at it... I took your code and instead of using a wrapper Fx.Opacity, I just used Fx.Tween and modified your start, set methods to use the proper syntax. This worked for me. window.addEvent("domready",function(){

[Moo] Re: Need help with code move from 1.1 to 1.2

2009-07-20 Thread nwhite
x27;t working at all. > > Might you have any suggestions on how to circumvent this error? Thanks > again for the help. > > On Jul 20, 2:00 pm, nwhite wrote: > > Fx.Tween operates a bit differently then 1.1. If you create your > Fx.Opacity > > class a bit differently you

[Moo] Re: Need help with code move from 1.1 to 1.2

2009-07-20 Thread nwhite
Fx.Tween operates a bit differently then 1.1. If you create your Fx.Opacity class a bit differently you shouldn't have any issues. This might help get you started. Fx.Opacity = new Class({ Extends : Fx.Tween, initialize : function(el,options){ this.now = 1; this.parent(

[Moo] Re: HTML request response [object Text]

2009-07-20 Thread nwhite
I personally don't see why it is such a bad thing to utilize. Technically its not returning an array, its an Elements object. So there is a lot of flexibility that comes with it. All the cases you describe that create errors are bad form if you don't have sanity checking on your data if you know th

[Moo] Re: custom attributes, (css) classes.. what to use?

2009-07-15 Thread nwhite
Steve you just beat me too it. Personally, I usually follow Aaron's logic. Classes seem to make sense and work for me 99% of the time. It is also handy when something does change in the presentation layer because the hooks for css is already in place. This wouldn't be an issue if all browsers suppo

[Moo] Re: custom attributes, (css) classes.. what to use?

2009-07-15 Thread nwhite
You could always create a custom DTD ( http://www.alistapart.com/articles/customdtd/). or create a namespace inside your XHTML document, like MathML ( http://www.alistapart.com/articles/customdtds2/) I have dabbled in both methods. Stealing a bit from the second article I personally don't always

[Moo] Re: Best practice: using hasClass or store/retrieve?

2009-07-02 Thread nwhite
http://www.alistapart.com/articles/customdtd/ to make those custom attributes valid. On Thu, Jul 2, 2009 at 1:47 PM, nutron wrote: > Use storage to store information about elements. If you have elements that > are related to each other (such as a tab related to the content it displays) > you sh

[Moo] Re: Fx.Slide and Table Rows

2009-06-26 Thread nwhite
TR elements aren't really designed to function in this way, in addition there are many known quirks when scripting tables. Unless you have a high threshold for pain I would look at changing my html structure first. You seem to have a lot of needless markup. Name Place Number

[Moo] Re: Image rotation

2009-06-26 Thread nwhite
well the events conflict... what if you register the rotate with a shift+click? Problem is it still is a bit tricky because the classes wrap the event handlers. I am not sure what Rotate code your using. I assume your using the Drag/Drag.Move class in -more for the dragging. This might be how I ac

[Moo] Re: multiple selectors within "getElements"

2009-06-26 Thread nwhite
$(document.body).getElements('.class1, .class2'); On Fri, Jun 26, 2009 at 7:47 AM, blakerblaker wrote: > > Heya, > > I'm curious on how I would call multiple selectors within a single > "get elements" tag. . . ? > > For example, I want to both ".class1" and ".class2" within the > following functi

[Moo] Re: alter image fade code

2009-06-26 Thread nwhite
How I have accomplished this is use a bit of css (background-image). When the image opacity = 1 change the background-image to the next image. As you fade the image out it will look like the background image is fading in. Once opacity = 0 move background image to image set opacity = 1 and change ba

[Moo] Re: preview pics like tips

2009-06-26 Thread nwhite
I put up some sample code. Its not exactly what you want but it should give you a clear picture on how to accomplish your goal. The class in the page is called 'Follower' it take two parameters. 1. the element that you want to mousemove event to trigger on and 2. the element you want to hide and sh

[Moo] Re: create and inserting multiple elements

2009-06-18 Thread nwhite
new Element('tr',{ 'html' : 'blah blah' }); On Thu, Jun 18, 2009 at 5:19 PM, james_027 wrote: > > hi, > > base on the docs and mootoorials, mootools provide an easy way of > creating a element then put them anywhere you want. what if I want to > create and put a inside the wherein the could

[Moo] Re: new Element() performance in IE7

2009-06-17 Thread nwhite
Your code example isn't really a fair comparison. Yes, it is always going to be slower, and yes Fabio's suggestion is valid for speed especially if you don't plan to extend the elements with events. In your pure DOM code you clone the elements, in the mootools snippet your creating a new element ev

[Moo] Re: MooCrop's replacement

2009-06-15 Thread nwhite
page : { x: d[2]+this.offset.left, y: d[3]+this.offset.top}}); > > should be replaced by > > > this.move({ page : { x: d[0] + d[2]+this.offset.left, y: d[1] + > d[3]+this.offset.top}}); > > otherwise the height and width won't be set properly > > anyway you did a

[Moo] Re: singleton mutator with 1.2.2?

2009-06-10 Thread nwhite
: > > > > On May 11, 3:40 am, nwhite wrote: > > I shared this with Scott Kyle and he made the code a lot more sexier > based > > off of the this._init_ idea. Damn why didn't I think of that ;-) > http://gist.github.com/100694 > > > Right, > > Hum..

[Moo] Re: Growl on Request Possible?

2009-06-04 Thread nwhite
done http://gist.github.com/123828/ On Thu, Jun 4, 2009 at 2:11 PM, Dailce wrote: > > Your the best, works great. I was really hoping to have the growl > center on the page, looking at how to do it now, but I'm no pro. > Bevel would be great. Thanks for the help. >

[Moo] Re: Required Files

2009-06-04 Thread nwhite
I agree with Aaron this isn't the place I would be putting the code. In addition the code seems too limiting and doesn't account for other classes actually loading the files. If I really needed such a feature I think I would make a dependency abstract class that I could implement into my widget cla

[Moo] Re: Growl on Request Possible?

2009-06-04 Thread nwhite
oment. I removed bevel but this code works for me now in 1.2.2 http://gist.github.com/123828 good luck On Thu, Jun 4, 2009 at 1:27 PM, nwhite wrote: > Ok it looks like I got it working in 1.2.2 I'll post in 15... just cleaning > up > > > On Thu, Jun 4, 2009 at 1:15 PM, nw

[Moo] Re: Growl on Request Possible?

2009-06-04 Thread nwhite
Ok it looks like I got it working in 1.2.2 I'll post in 15... just cleaning up On Thu, Jun 4, 2009 at 1:15 PM, nwhite wrote: > The issue is that growl is using 1.2beta which is pretty old. If you look > at the code it uses setHtml and the like. > > On Thu, Jun 4, 2009 at 1:00

[Moo] Re: Growl on Request Possible?

2009-06-04 Thread nwhite
The issue is that growl is using 1.2beta which is pretty old. If you look at the code it uses setHtml and the like. On Thu, Jun 4, 2009 at 1:00 PM, Thierry bela nanga wrote: > try to use the growl-uncompressed.js for debugging, > the one you use seems to be minified, and then hard to debug. > >

[Moo] Re: Required Files

2009-06-03 Thread nwhite
I highly recommend that you check out Scott Kyle's 'initialize' Mutator. It is much more generic by allowing you to add to Class.Initializers. http://gist.github.com/100694 On Wed, Jun 3, 2009 at 4:39 AM, eskimoblood wrote: > > I've wrote a class mutator that load required files before initia

[Moo] Re: pass() buggy

2009-05-21 Thread nwhite
ike to have the event object as well, so typically I do: el.addEvent('click', fn.bindWithEvent(el,[1,2,3]); 2009/5/21 Fábio Costa > Thats a good choice. > Thanks nathan. > > Fábio Miranda Costa > Engenheiro de Computação > http://meiocodigo.com > >

[Moo] Re: pass() buggy

2009-05-21 Thread nwhite
var fn = function(){ console.log(this,arguments); }; var el = $('anchor'); el.addEvent('click', fn.pass([1,2,3],el)); 2009/5/21 Fábio Costa > Ok, i really appreciate the chat and help. > Have a nice day. > > > Fábio Miranda Costa > Engenheiro de Computaç

[Moo] Re: Good use of delay

2009-05-19 Thread nwhite
well you can get the sources of the images right? new Asset.images([img_1, img_2, img_3, img_4], { onComplete: function(){ // you can now run your code safely from here } }); On Tue, May 19, 2009 at 4:51 PM, asgaroth.belem wrote: > > Its not just 1 image, so if i use onload I w

[Moo] Re: SlideIn(), SlideOut()....but only to specific height

2009-05-13 Thread nwhite
ouch and I forogt to take out the console.debug I need to be more careful. On Wed, May 13, 2009 at 4:33 PM, nwhite wrote: > slight typo in usage: > > new Fx.Slide2(el,{outHeight : 40}); > > should be: > > new Fx.Slide(el,{outHeight : 40}); > > > > On Wed, M

[Moo] Re: SlideIn(), SlideOut()....but only to specific height

2009-05-13 Thread nwhite
3, 2009 at 4:15 PM, nwhite wrote: > >> >> Well your use case is a bit beyond the scope of Fx.Slide but Mootools >> architecture makes it easy to adapt for your own solution: >> >> // start is the brains that all actions are routed through in >> Fx.Sl

[Moo] Re: Using a variable's content as a Hash key

2009-05-13 Thread nwhite
ted out, you can't assign keys with references in object literals And yes hash.set() basically does what Christoph just did. > > > On May 13, 10:23 pm, Annis McKenzie > wrote: > > Thanks, it works! :) > > > > On May 13, 9:46 pm, nwhite wrote: >

[Moo] Re: SlideIn(), SlideOut()....but only to specific height

2009-05-13 Thread nwhite
Well your use case is a bit beyond the scope of Fx.Slide but Mootools architecture makes it easy to adapt for your own solution: // start is the brains that all actions are routed through in Fx.Slide so we need to modify it. All I did was copy the method from Fx.Slide Fx.Slide.impl

[Moo] Re: Using a variable's content as a Hash key

2009-05-13 Thread nwhite
var hash = $H(); hash.set(this.options.whatever,'some value'); On Wed, May 13, 2009 at 12:31 PM, Sanford Whiteman < sa...@cypressintegrated.com> wrote: > > > I'm feeling a little bit stumped but is there a way to use a > > variable's content as a Hash key? > > Not in an object literal. > > But i

[Moo] Re: singleton mutator with 1.2.2?

2009-05-11 Thread nwhite
ance and is linked to a object. > > Fábio Miranda Costa > Engenheiro de Computação > http://meiocodigo.com > > > On Sun, May 10, 2009 at 8:00 PM, nwhite wrote: > >> @christoph I agree the benefits of having a Singleton pattern in >> javascript are extremely limi

[Moo] Re: singleton mutator with 1.2.2?

2009-05-10 Thread nwhite
@christoph I agree the benefits of having a Singleton pattern in javascript are extremely limited. When developers are first introduced to OO paradigms they typically fall in love with Singletons for all the wrong reasons. With that said I do think there are a few use cases where it could prove adv

[Moo] Re: singleton mutator with 1.2.2?

2009-05-10 Thread nwhite
I borrowed the ideas from Scott Kyle's work. I made a hook so the initialize Mutator is not so expensive as well. Singleton is now in 1.2.2 http://gist.github.com/109094 2009/5/10 Fábio Costa > This looks like a static class more than the singleton pattern. > > > Fábio Miranda Costa > Engen

[Moo] Re: Slider - how to get onBeforeStart dragging event?

2009-05-04 Thread nwhite
Generally as a rule of thumb if you need to modify the Mootools code your probably doing something wrong. Slider doesn't have an onBeforeStart event. However the Drag class is wrapped by Slider. If I needed to get at that particular event I would mySlider = new Slider(...); mySlider.drag.addEvent

[Moo] Re: question about $defined (now $exists)

2009-04-29 Thread nwhite
obj == undefined) return false; } return true; } On Tue, Apr 28, 2009 at 4:58 PM, nwhite wrote: > > sure. Again, I don't see the need for such a thing as I don't use this >> pattern so often... >> > > Agreed. I generally think its a bad pattern however i

[Moo] Re: Implementing classes that use initialize

2009-04-29 Thread nwhite
if you upgrade to 1.2.2 you could use the new Class.Refactor in -more. On Wed, Apr 29, 2009 at 12:14 AM, Michal Charemza wrote: > > Hi, > > I'm trying to make a class quite modular, so I would like to break it up > into a number of smaller classes. However, each of these classes requires > some a

[Moo] Re: question about $defined

2009-04-28 Thread nwhite
> > > On Tue, Apr 28, 2009 at 4:08 PM, nwhite (via Nabble) < > ml-user%2b93763-1341009...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2737607&i=0> > > wrote: > >> >>> window.has('foo.bar') or something... >>

[Moo] Re: Drag.Move() slow for images

2009-04-28 Thread nwhite
> > > Why even scale the image when you're already scrolling around to view > it? > Agreed. If the image is super large you could always tile your images and use google maps api, the tile overlay ;-) > > On Apr 29, 12:38 am, TheIvIaxx wrote: > > ok so i jumped the gun on ie being faster :) >

[Moo] Re: question about $defined

2009-04-28 Thread nwhite
> > > On Tue, Apr 28, 2009 at 2:55 PM, nwhite (via Nabble) < > ml-user%2b93763-1341009...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2737486&i=0> > > wrote: > >> is there any issue with the $classExists function above? >>

[Moo] Re: question about $defined

2009-04-28 Thread nwhite
is there any issue with the $classExists function above? it seems to me it would be a little less verbose in some cases and clearer to understand. for example if I want to test for Request.JSONP if(!!window.Request && !!window.Request.JSONP ) // do something instead becomes: if($classExists('Re

[Moo] Re: question about $defined

2009-04-28 Thread nwhite
yeah not what he wants though he has an interesting use case. $defined is a simple test. return (obj != undefined); in your case pull this out an wrap it in a try/catch try{ return (Drag != undefined); } catch(err){ return false; } I kinda like the idea of testing for classes within the fr

[Moo] Re: MooTools and Public APIs (Twitter, Last.fm, etc)

2009-04-27 Thread nwhite
permission" so to speak. > > On Apr 27, 8:17 pm, nwhite wrote: > > Depends on the service. I know Twitter is pretty liberal. After all their > > snippet does exactly that, hits the server on every page load, and they > > freely give the js snippet away. What'

[Moo] Re: MooTools and Public APIs (Twitter, Last.fm, etc)

2009-04-27 Thread nwhite
oks like it would do what I need but I've > realized that the PHP might be inevitable if I don't want to have > issues with the common API rate limits. Otherwise you're hitting the > API servers on every page load and you will be quickly throttled. > > On Apr 27, 7:45 pm

[Moo] Re: MooTools and Public APIs (Twitter, Last.fm, etc)

2009-04-27 Thread nwhite
have you checked out Request.JSONP? http://mootools.net/docs/more/Request/Request.JSONP it provides an onComplete event listener. On Mon, Apr 27, 2009 at 5:20 PM, pradador wrote: > > I wanted to add a couple of widgets to a homepage I'm designing. > There's plenty of PHP libraries out there bu

[Moo] Re: Struggling with chain

2009-04-27 Thread nwhite
@michal I like your thinking out loud. I'm not sure any of that is worth it. The only place I see this really applying is with Fx and it is simple enough to manage with onComplete. I realize the functionality of 'run' is pretty weak, late night ideas rarely pan out. I could see some very limited u

[Moo] Re: Struggling with chain

2009-04-27 Thread nwhite
n(this.fn2.bind(this)); >> >> then fn1 has to have this in it: >> >> fn1: function(){ >> ...some logic that you want to execute >> this.callChain(); >> return this; >> } >> >> On Sun, Apr 26, 2009 at 6:17 PM, nwhite (via Nabble) >> wrote:

[Moo] Re: Struggling with chain

2009-04-26 Thread nwhite
if(this.options.preload){ new Asset.images(['/images/myImage.png', '/images/myImage2.gif'], { onComplete: this.setUp }); } On Sun, Apr 26, 2009 at 6:06 PM, mmjaeger wrote: > > I'm not sure whether that would work. > > the following code actually does work but I hopped there is an e

[Moo] Re: setStyles({object})?

2009-04-17 Thread nwhite
I don't think you can concat or use var replacement when defining the key in new objects in javascript. That is why the original prototype author defined styles in two statements. style = $extend({ "float": a, marginTop: this.closeDimensions[s].height + 'px' } style["padding" + a.ca

[Moo] Re: MooCrop / Lasso.Crop / Problems with centered Images

2009-04-17 Thread nwhite
adjust your styling. maybe try putting a wrapper div around your image. I have started to make some updates to Lasso.Crop. I am hoping to get a solid release out in the next week or two. Lots of bugs have already been fixed. sorry for the delays. On Fri, Apr 17, 2009 at 12:42 PM, Micha wrote:

[Moo] Re: MooCrop - Problem with removeOverlay

2009-04-17 Thread nwhite
Ah it looks like that line wasn't changed for 1.2 change this.wrapper.remove(); to: this.wrapper.dispose(); On Fri, Apr 17, 2009 at 6:38 AM, Micha wrote: > > Hi, > > did anybody solve the problem with the removeOverlay()-function in the > updated MooCrop-Class? > I always get the error "th

[Moo] Re: Pass Variable to an Anonymous Function

2009-04-16 Thread nwhite
Inside your .each your creating an anonymous function for each anchor. The problem is your 'message' variable is not contained to that function. This is one of the messy details of javascript and not mootools specific. In order to keep the proper scope of your 'message' variable you need to add the

[Moo] Re: Drag.Move() slow for images

2009-04-14 Thread nwhite
I'm not sure how your using Drag.Move but I would recommend giving Scroller a try. Harald has this page http://digitarald.de/playground/fly-over-background/ it would probably take some work but should give you a good starting point. A while back I did some testing using background-position but foun

[Moo] Re: Question about .getElementById()

2009-04-13 Thread nwhite
I am not sure if (1) is a big deal since they are treated as strings. it shouldn't matter. (2) is the issue. Maybe use 'class' instead of 'id'? then you could do something: $('list1').getElement('.title').get('html'); notice the .get() instead of innerHTML. more of the moo way of doing things.

[Moo] Re: Need some help with Request

2009-04-12 Thread nwhite
1. you mentioned html you might look at Request.HTML2. onComplete fires when the request is complete you probably want to attach an event listener to onSuccess. 3. onSuccess receives multiple parameters depending on which class you end up using Request or Request.HTML make sure the param you want

[Moo] Re: Fx.Presets / Fx.Chains Plugin Feedback Request

2009-04-08 Thread nwhite
Michal, I remember your post. I have actually been thinking about Fx.Presets recently as I recall the ability to manage animate/control multiple elements with a single Fx instance. I think this is a great idea as it could save a lot on cpu utilization. I have not looked closely at the code nor impl

  1   2   3   >