[Proto-Scripty] Re: $$( ) returns hidden/removed tr tags

2008-09-16 Thread Matt Foster
I'd suggest using the afterFinish callback to hide the element. tr.fade({ afterFinish : function(fx){ fx.element.remove() } }); http://github.com/madrobby/scriptaculous/wikis/core-effects On Sep 16, 6:51 am, ericindc [EMAIL PROTECTED] wrote: I tried it with tr.remove( ) as well and it was

[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

[Proto-Scripty] Re: Update dropdown based on another dropdown

2008-09-19 Thread Matt Foster
Have an observer method assigned to the primary selects elements select event. The observer method executes an ajax.request. Have the onSuccess handler rebuild the secondary select element with the options returned from the request. On Sep 19, 4:33 am, jason maina [EMAIL PROTECTED] wrote: Hi

[Proto-Scripty] Re: Using Ajax.Request not call function OnSuccess

2008-09-22 Thread Matt Foster
Your this scope is lost inside the this.exito method. You need to use a closure, via the bind method to ensure the instance's reference is maintained in the asynchronous callbacks. onSuccess : this.exito.bind(this) On Sep 22, 10:14 am, Miguel Beltran R. [EMAIL PROTECTED] wrote: I don't know

[Proto-Scripty] Re: Selecting Textboxes

2008-09-24 Thread Matt Foster
Instead of relying on the object's style, just give it a class that you can filter on, that enforces the style of a blue background. $$(.blue[name='pmt'])... On Sep 24, 9:41 am, kangax [EMAIL PROTECTED] wrote: On Sep 24, 7:31 am, ColinFine [EMAIL PROTECTED] wrote: On Sep 24, 1:06 am,

[Proto-Scripty] Re: yet another show/hide example

2008-09-24 Thread Matt Foster
You could improve performance a little bit by skipping the each and using invoke. You'd have to modify some of the stuff, such as your declaration of section_id but it wouldn't be too difficult to convert. $$(a.more).invoke(observe, click, function); http://prototypejs.org/api/enumerable/invoke

[Proto-Scripty] Re: Creating classes based on HTML elements

2008-09-26 Thread Matt Foster
A very good idea, something I had pondered as well but never came up with a solution I was satisfied with. First problem with your scenario is you're sending in a string as the superclass, this isn't going to work regardless. You could use new Element('div') but this is going to create a static

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread Matt Foster
There is a trailing comma in your object that IE doesn't like, considering a syntax error. Remember when evaling something that the expression you're evaluating has to have perfect syntax as well. On Sep 28, 12:39 pm, uncleroxk [EMAIL PROTECTED] wrote: ok my JSON: {messages: {message:[

[Proto-Scripty] Re: watermarked text box

2008-10-02 Thread Matt Foster
I like to apply a background image to the input for such cases, that way the input's value is untouched yet the UI can indicate the purpose of the field. Also with an image your watermark can be a faded grey, further indicating its transparent presence. On Oct 2, 9:40 am, Christophe Porteneuve

[Proto-Scripty] Re: Form Checkbox Count

2008-10-06 Thread Matt Foster
Looks like you're going to need more data in the checkbox. As you're going to need the ID as well i'd leave that as is. But you can add an extra attribute to help with this calculation. input name=invoiveID[] value=?=$invoiceID? price=?= $invoicePrice? type=checkbox / Javascript has no

[Proto-Scripty] Re: location.hash and event handler/window event

2008-10-09 Thread Matt Foster
I take it you're trying to handle the back button, take a look at my approach, detailed in this article, http://positionabsolute.net/blog/2007/07/javascript-history-service.php On Oct 9, 3:19 pm, Mauro Marchiori Neto [EMAIL PROTECTED] wrote: i guess i need to uptate the location.hash so

[Proto-Scripty] Re: prototype and iframe

2008-10-10 Thread Matt Foster
Ditch the iframe object in favor of a DIV and things will work much smoother.. On Oct 10, 12:17 pm, Miguel Beltran R. [EMAIL PROTECTED] wrote: Hi list I have the next code but not work, iframe show nothing what I doing wrong? html ... body div id=content    div id=form_search      

[Proto-Scripty] Re: Datagrid using json

2008-10-14 Thread Matt Foster
I built some stuff, i wouldn't consider it a very robust datagrid control but I did develop two classes to deal with some basic datagrid stuff. GridBase is an abstract class that propagates events like rowover/ cellover stuff like that for handling highlights.

[Proto-Scripty] Re: Further constraints in sortable

2008-10-14 Thread Matt Foster
Apply a more specific class to the top level element that you wish to make sortable. On Oct 14, 7:57 am, Lapis [EMAIL PROTECTED] wrote: Hi! I hope someone has a good idea that can help me here. I do Sortable.create(...) on some element (div class=block /) and pass tag: 'div' and only:

[Proto-Scripty] Re: Further constraints in sortable

2008-10-15 Thread Matt Foster
, though. Still thankful for any ideas, workarounds or pointers. /P On Oct 14, 10:27 pm, Matt Foster [EMAIL PROTECTED] wrote: Apply a more specific class to the top level element that you wish to make sortable. On Oct 14, 7:57 am, Lapis [EMAIL PROTECTED] wrote: Hi! I hope

[Proto-Scripty] Re: Dynamic script file loading

2008-10-15 Thread Matt Foster
Try Googling around for lazy loading its the idea you're talking about... http://ajaxpatterns.org/On-Demand_Javascript We should write an extension for proto that does this nicely, I checked out http://www.scripteka.com/ and there is a lazy loading tag but unfortunately nothing with loading

[Proto-Scripty] Re: Select field IE problem

2008-10-20 Thread Matt Foster
Its because he's referencing the object through the options array, Proto never gets to sink its method into the object because of this traversal, while the other browsers support native extensions it works fine. $($(Birth_Day).options[0]).remove(); On Oct 20, 8:55 am, delishus [EMAIL

[Proto-Scripty] Re: Getting forms from document

2008-10-24 Thread Matt Foster
You could do this a variety of ways, using prototypes $$ method you could quickly select all form tags. Alternatively native JS dom has a quick reference to such a collection, via document.forms. As a side note, you'll want to point the onload to a reference of your function, not the result of

[Proto-Scripty] Re: Self reference class while in a function

2008-10-27 Thread Matt Foster
onDrop : handleDrop.bind(this); .. handleDrop : function(e){ this.setDragItem(...); } http://prototypejs.org/api/function/bind On Oct 27, 2:24 pm, Kris S [EMAIL PROTECTED] wrote: When creating behavior classes using lowpro, how can i reference the parent class while in a child

[Proto-Scripty] Re: Iframe issue with IE7 (probably 6)

2008-10-29 Thread Matt Foster
Are you holding a reference to an object inside the iframe? Such as contentDocument/contentWindow. These references would be bunk once the iframe refreshes. On Oct 29, 4:31 am, Thomas A [EMAIL PROTECTED] wrote: Our application is built on a static interface with HTML controls and an Iframe

[Proto-Scripty] Re: Iframe issue with IE7 (probably 6)

2008-10-29 Thread Matt Foster
Very strange, not sure if i understand completely. So there is an internal iFrame object that is getting references from its containing document object. When the iframe reloads it no longer has these references? Wouldn't a reload of the iframe force it to retrieve fresh references as everything

[Proto-Scripty] Re: Effect.toggle slide doesn't work well with unordered/ordered list elements

2008-10-31 Thread Matt Foster
Effect.Slide needs an immediate child to perform the clipping necessary for the effect. On Oct 31, 9:56 am, Paul Kim [EMAIL PROTECTED] wrote: Thanks for the solution David. Do you have any idea why this worked for Opera when the ul element wasn't encapsulated inside a div element? - Paul

[Proto-Scripty] Re: Building a lazy Loader

2008-11-06 Thread Matt Foster
What are the drawbacks of requestings the JS file via Ajax.Request and stuffing the responseText inside the innerHTML property of a generated script element? Does it have the global scope restriction like eval? Does it cause a processing bottle neck for the client? Is it supported by all

[Proto-Scripty] Re: can combine bind and defer?

2008-11-12 Thread Matt Foster
A little lost on what the question is, but I took an assumption and ran with it. The idea of stacking these methods was intriguing. Check out this code, its pretty useless really but an interesting example of object ownership and function delegation. var MyClass = function(){ this.name

[Proto-Scripty] Re: can combine bind and defer?

2008-11-12 Thread Matt Foster
A little lost on what the question is, but I took an assumption and ran with it. The idea of stacking these methods was intriguing. Check out this code, its pretty useless really but an interesting example of object ownership and function delegation. var MyClass = function(){ this.name

[Proto-Scripty] Re: help me with this simple one!

2008-11-12 Thread Matt Foster
$(main_content).fade({ duration : 1.6, afterFinish : function(fx){ fx.element.update(img src='spin2.gif'/); fx.element.appear({ duration : 1.0 }); } On Nov 12, 10:32 am, Walter Lee Davis [EMAIL PROTECTED] wrote: Use a queue, or create a new hidden image over top of the old and   fade

[Proto-Scripty] Re: Passing variables after an onComplete

2008-11-18 Thread Matt Foster
Well if you're request method is GET and you're looking in POST, there could be some issues, make sure you're using and expecting the same method type on the client and the server. On Nov 18, 7:56 am, James Hoddinott [EMAIL PROTECTED] wrote: I'm stumped again :( I have the following HTML which

[Proto-Scripty] Re: new AjaxRequest.....

2008-11-18 Thread Matt Foster
Instead of trying to keep the last reference to the XHR sent, just enforce a singleton style approach, such that the user can't request a refresh of data when a request is already pending. function fireAjax(){ if(Ajax.activeRequestCount == 0) new Ajax.Request(...); }

[Proto-Scripty] Re: Updater from within an iframe

2008-11-18 Thread Matt Foster
new parent.Ajax.Updater('target', './refresh.php5, { method: You're sending a string, try using a direct object reference... var ele = window.document.getElementById('target'); ele.innerHTML = Loading...; new parent.Ajax.Updater(ele, './refresh.php5, ... On Nov 17, 4:37 pm, ronman [EMAIL

[Proto-Scripty] Re: Updater from within an iframe

2008-11-18 Thread Matt Foster
but it didn't. On Tue, Nov 18, 2008 at 10:11 AM, Matt Foster [EMAIL PROTECTED]wrote:   new parent.Ajax.Updater('target', './refresh.php5, { method: You're sending a string, try using a direct object reference... var ele = window.document.getElementById('target'); ele.innerHTML

[Proto-Scripty] Re: Passing variables after an onComplete

2008-11-18 Thread Matt Foster
No, its all POST methods being used here.         new Ajax.Updater('respanel','data/fetchrespanel.php',{method:'get'}); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To

[Proto-Scripty] Re: Help needed

2008-11-20 Thread Matt Foster
What is going wrong with your current approach, should be no reason you can't generate a new TR element and replaceChild on the tbody object... On Nov 20, 11:46 am, jason maina [EMAIL PROTECTED] wrote: Hi, Is it possible to replace a whole row with new data/controls without interfereing

[Proto-Scripty] Re: Help needed

2008-11-21 Thread Matt Foster
Hmm, I've double checked this idea, I have no problems with replacing a TR element. element.parentNode.replaceChild(content, element) = element is null I'd have to make the assumption that your trId value doesn't correlate to an ID of any element in the document. On Nov 21, 12:06 pm, jason

[Proto-Scripty] Re: Accessing event handlers

2008-11-21 Thread Matt Foster
To elaborate on Kangax's idea, a DOM element is a dynamic object, being that you can add custom properties which can be referenced for further processing... var ele = new Element(div); ele.eventHandles = { click : handleClick, mouseover : handleMouseOver }; ele.observe(click,

[Proto-Scripty] Re: Error on Line:2271 in IE7 when using margin:0 auto - possible bug?

2008-11-21 Thread Matt Foster
You could try different variations of the declaration, maybe it just doesn't like that format. Also note that you're not setting a unit for your value, this could be considered an invalid declaration? you could try... margin:0px; margin-left:auto; margin-right:auto; It should be able to

[Proto-Scripty] Re: Fade My Pages?

2008-11-21 Thread Matt Foster
Oh wow... Hate to be the bearer of bad news Ryan, but not really You can attach an event listener to an area object, which you could attempt to harness a fade, but that would require you to make a lot of edits to the image maps. Secondly, the entire page is one image, if you take this

[Proto-Scripty] Re: Newbie Element Question

2008-11-21 Thread Matt Foster
What do I make wrong Many things... script var a = new Element('div', {id: 'my_div'}); $('my_div').style.witdh = '200px'; /script /head -You create an element, but never attach it to the DOM. -Even if you did attach it, the DOM wouldn't be ready at that point in execution, you've

[Proto-Scripty] Re: DOM popup in IE

2008-11-25 Thread Matt Foster
Why would you want to avoid position:absolute for an object which needs to sit on top of everything in the center of the document? On Nov 22, 6:10 am, Dave L [EMAIL PROTECTED] wrote: I have been struggling to get the DOM popup kit, which uses prototype, to display popups and modal dialog

[Proto-Scripty] Re: The Hop Effect

2008-11-25 Thread Matt Foster
A lot of JS is being executed, listening to scroll is like listening to mousemove, the event fires often. Scrolling up and down your page might fire off more than 100 scroll events, in combination with this, you're executing an effect each time the event is fired, furthermore the Effect

[Proto-Scripty] Re: Use slider with discontinue values

2008-11-25 Thread Matt Foster
You're sample data isn't really a range though is it? Why would you want to use an instance of ObjectRange over a regular Array? -- http://positionabsolute.net On Nov 24, 12:14 pm, T.J. Crowder [EMAIL PROTECTED] wrote: P.S : Oh and by the way, I can't post from my mail software. My mails

[Proto-Scripty] Re: onUpdate does not work with Sortable.create

2008-11-25 Thread Matt Foster
No idea if this works or not, but a quick search on Google has produced an almost identical question and answer to your issue. http://chumby.net/2008/10/27/scriptaculous-sortablecreate-onupdate-event-isnt-firing/ -- http://positionabsolute.net On Nov 22, 4:53 pm, patrick [EMAIL PROTECTED]

[Proto-Scripty] Re: Use slider with discontinue values

2008-11-26 Thread Matt Foster
You could create your slider with a range of 0 - array.length -1. Then use that value as an index to your actual data array in the onSlide/onChange events On Nov 26, 3:10 am, Nicolas Cavigneaux [EMAIL PROTECTED] wrote: Le 25 nov. 08 à 22:14, Matt Foster a écrit : You're sample data

[Proto-Scripty] Re: Very performant list filter

2008-12-01 Thread Matt Foster
I'd say your DOM traversals might add quite a bit of weight to your filter. Why select the LI element if you're really looking at its child A element's innerHTML property ? Select those nodes and skip the execution of down, should speed things up quite a bit. Also if you're using a text input

[Proto-Scripty] Re: Help, with iFrame And Parent Window

2008-12-01 Thread Matt Foster
Try Event.observe(tre, click, this.RowClick.bindAsEventListener(this)); On Dec 1, 9:15 am, Mauricio Díaz [EMAIL PROTECTED] wrote: Hi all, I have an iFrame that contains a page with my scripts,  and I want to show a popup dialog in the parent window. I can insert my popup (a div element

[Proto-Scripty] Re: Very performant list filter

2008-12-02 Thread Matt Foster
By using the keyup event you can avoid the conditions to check for change, if the user has pressed and released a key on the input then the value has changed. Also it is very wise to add the timeout, your users will thank you. document.observe(dom:loaded, function() { var list = $$(#listAll

[Proto-Scripty] Re: Extending every Ajax.Request onSuccess event

2008-12-03 Thread Matt Foster
This is why I like using an Ajax Service it creates a central instance in which all requests are generated and processed through http://positionabsolute.net/blog/2007/07/javascript-service.php On Nov 13, 5:45 am, matte [EMAIL PROTECTED] wrote: Hi, Yes it is more straight forward but

[Proto-Scripty] Re: IE eval() question...

2008-12-04 Thread Matt Foster
Try ending the statement with a semicolon, it is probably hitting the syntax error there. var stuff = eval('(function(){ ... });'); On Dec 4, 1:59 pm, yoshi [EMAIL PROTECTED] wrote: i think u guys are assuming firefox, in IE eval without the function wrapped in () does not cause syntax

[Proto-Scripty] SVN Structure

2008-12-12 Thread Matt Foster
Hey Everyone, Granted this is off the topic of prototype development directly, it will lead into it in the end. I am writing an ajax library that i'd like to A) stand alone B) work with prototype and C) work with Extjs. I'd like to put the code in Google Code and have it available for

[Proto-Scripty] Re: event.observe document

2008-12-15 Thread Matt Foster
You could also listen to those events on the input, and stop their propagation so that the document never hears of them. On Dec 15, 7:06 am, Stucture_Ulf maximilian.moulet...@gmail.com wrote: Great, I got it! Many thanks. On Dec 15, 12:35 am, Gabriel Gilini gabr...@usosim.com.br wrote:

[Proto-Scripty] Re: protocol / ajax - graceful degrade?

2008-12-15 Thread Matt Foster
I like the idea of modularity, which would be more practical for your environment. I have written an article on how Ajax.Request could be modified to accommodate for a timeout event. Feel free to read the article / source code. I wouldn't really recommend it for your live site but its perhaps

[Proto-Scripty] Re: problem: inserting html in each loop

2008-12-15 Thread Matt Foster
The text node can only exist within one div, it's not a quantum particle happily living in superposition across all five. I love it, what a brilliant way to put it. On Dec 12, 12:08 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi Cyrus, The text node can only exist within one div,

[Proto-Scripty] Re: Debugging help / suggestions

2008-12-22 Thread Matt Foster
Double check for any console.logs you may have in your code. Lingering debugging code has caused me a few headaches in the past. On Dec 22, 3:05 pm, pedz pedz...@gmail.com wrote: On Dec 22, 1:33 pm, Diodeus diod...@gmail.com wrote: You could make Ajax calls back to a logging system on the

[Proto-Scripty] Re: Re : Re : POST multipart/form-data problem (not a file upload)

2008-12-22 Thread Matt Foster
Any reason in particular you couldn't use application/x-www-form- urlencoded for your contentType? On Dec 19, 1:12 pm, Dalzhim Dalzhim dalzhim.ml...@gmail.com wrote: I finally found out what was the problem with this multipart POST which wasn't working. After many hours of investigation, I

[Proto-Scripty] Re: IE and Element#up

2009-01-02 Thread Matt Foster
Its because FF allows for native prototype extension and IE does not, such that any referenced element won't have proto's element extension methods until its been explicitly extended. a href=# onclick=$(this).up('.bla').remove()Back/a But to be honest I wouldn't use that style of event

[Proto-Scripty] Re: How to change contentType.

2009-01-02 Thread Matt Foster
Browser is opening save dialog and saveing the response into an .xls file. So your scripts are writing to the clients machine? Is the data being received over an XHR request? It wouldn't be the most fluid progress bar, but if it was an XHR you could increment a progress bar each time it moves

[Proto-Scripty] Re: Build an organization chart with prototype scriptaculous

2009-01-02 Thread Matt Foster
You could use a canvas element or SVG elements. https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas https://developer.mozilla.org/en/SVG Prototype doesn't have much support for either of these options but they're viable and you could use event listener/dom traversal with the SVG

[Proto-Scripty] Custom Property on TextNode

2009-01-05 Thread Matt Foster
Hey Everyone, I'm working on a project that swaps out text nodes. I need to save a reference to the new text node with the existing node. In FF I am able to set custom properties no problem, IE however throws an error of Object does not support this property or method. I was thinking I

[Proto-Scripty] Re: Problem with double click

2009-01-09 Thread Matt Foster
If you're traversing a collection of elements, then the first parameter in your findAll method is going to be an element. Bind is a property of a Function, not an Element, so that it would be failing on this attempt of execution. http://prototypejs.org/api/function/bind --

[Proto-Scripty] Re: Ajax.Updated DIV seems to still have the same innerHTML...

2009-01-09 Thread Matt Foster
You can pass it an element reference, however your reference of this isn't an element. It may have assumed element methods via Object.extend in your constructor but the reference is still to a function, not a DOM reference. -- http://positionabsolute.net On Jan 8, 12:04 pm, Ian R

[Proto-Scripty] Re: Having trouble with .without().

2009-01-22 Thread Matt Foster
It appears as though without accepts its values in individual parameters. Looking at the documentation it does illustrate that each value is set in as its own parameter. http://prototypejs.org/api/array/without Looking into the source it becomes clear that it uses the function's arguments as

[Proto-Scripty] Re: Prototype.js / jQuery conflict

2009-02-06 Thread Matt Foster
This is completely theoretical, and probably even more ludicrous as I think of it being plausible cross-browser... But in theory if you did something like this var A = function(){ alert(First definition);} A(); var A = function(){ alert(Second definition); }; A(); Would behave as such, so

[Proto-Scripty] Re: script requires much resources : ´-(

2009-03-18 Thread Matt Foster
You should rely more on the Effect.Morph to handle the animations and less on your own setTimeout calls, I think its compounding multiple timeout calls and morph effects which run their own intervals to manage the effect. Try getting the effect to run with one call to Effect.Morph. --

[Proto-Scripty] Re: Stopping events ..

2009-03-18 Thread Matt Foster
Event.stop(e) does indeed prevent event propagation. I would assume that your code is hitting an exception before Event.stop is being executed. Try calling Event.stop() at the very beginning of the script, before anything else, then if there are no errors, call event.form.submit() to carry

[Proto-Scripty] Re: script requires much resources : ´-(

2009-03-18 Thread Matt Foster
Hmm maybe I am not understanding what you're interface is trying to accomplish... If you've got a strip of images that you want to scroll across based on mouse movements, why don't you just wrap them in a div with an overflow and modify the scrollLeft property of the div to modify the display.

[Proto-Scripty] Re: Prevent iframe / break-away

2009-03-18 Thread Matt Foster
$(ifr).observe(beforeunload, Event.stop); Give it a whirl, I have no idea if that will work; --- http://positionabsolute.net On Mar 18, 5:27 am, Vladimir Tkach tea...@gmail.com wrote: try to use beforeunload event 2009/3/18 Karlson azagnio...@gmail.com Hi, I am trying to

[Proto-Scripty] Re: Prevent iframe / break-away

2009-03-18 Thread Matt Foster
, Matt Foster mattfoste...@gmail.com wrote: $(ifr).observe(beforeunload, Event.stop); Give it a whirl, I have no idea if that will work; --- http://positionabsolute.net On Mar 18, 5:27 am, Vladimir Tkach tea...@gmail.com wrote: try to use beforeunload event 2009/3/18 Karlson azagnio

[Proto-Scripty] Re: script requires much resources : ´-(

2009-03-19 Thread Matt Foster
After reviewing the behavior of the control I'd say it reinforces the idea that you should just set it up in a scrolling div and modify the scroll property, this would approach would alleviate much of the intense processing. You could leverage the Effect.Tween[1] method to handle most of the

[Proto-Scripty] Re: Stopping events ..

2009-03-19 Thread Matt Foster
, Alex Mcauley webmas...@thecarmarketplace.com wrote: There is no exception or error thrown in firebug !! I went round it with an inline call instead ! Thanks for help guys Alex - Original Message - From: Matt Foster mattfoste...@gmail.com To: Prototype script.aculo.us

[Proto-Scripty] Re: Ajax.Updater home-brew autocompletion timing issue

2009-03-19 Thread Matt Foster
I've got to add my two cents as well, For addressing the issue of attaching parameters to the Ajax.Request object, they're actually available in the callbacks. Each callback gets sent an Ajax.Response instance which contains the request property which in turn has the parameters property,

[Proto-Scripty] Re: Stylesheet issue with inserted elements

2009-03-19 Thread Matt Foster
Were the injected stylesheets being loaded, did you check it with firebug? Also with firebug you should inspect the control's elements and see if they're inheriting these properties and or if any of them are being overridden by another selector. IE and FF have major differences with links/hrefs

[Proto-Scripty] Re: Aborting an ajax request

2009-04-16 Thread Matt Foster
I don't really understand the logic, You have multiple forms on a particular state in your ajax application. If the user takes action to change this state you want to prompt them with the confirm window of Changes have been made, are you sure you want to discard? If they click yes- i want to

[Proto-Scripty] Re: async ajax requests and timeouts delimma

2009-04-16 Thread Matt Foster
Yeah I'd say thats a pretty good approach, if you've got 8 active requests then the timeout duration of the 9th should be affected by the number of currently active predecessors. I'd do something in the onCreate method to just set the instance's timeout universally instead of trying to

[Proto-Scripty] Re: I am not getting value from backend page

2009-04-20 Thread Matt Foster
Ooo to be honest, that is quite ugly Amlan... Having a ton of code written to an inline handler is just bad form, it would be much better to just delegate to an event handler, and even better yet, hook into this event via Event.observe... $(category).observe(change, handleChange); You'll have

[Proto-Scripty] Re: Internet Explorer 8 and new Element

2009-04-20 Thread Matt Foster
class and super are reserved words that we actually never use, but think of them as words like _if_ or _case_ Use className as the appropriate property for setting the HTML attribute of class, a bit hoaky but that is just the way it is, with or w/o prototype...

[Proto-Scripty] Re: Observe div content change?

2009-04-22 Thread Matt Foster
Anath's idea would be ideal but I am not sure how supported that event actually is. Alternatively, it'd be a bit more work but still would satisfy your event requisite of just firing off you own event when you update. var oldHTML = ele.innerHTML; ele.update(text); ele.fire(x:update, { oldHTML

[Proto-Scripty] Re: HTML breaks JSON

2009-04-24 Thread Matt Foster
What are you sending to PHP's json_encode? It is expecting a structure to serialize into a JSON syntax string. $struct = array(message = h1Hello World/h1Who says we can't have any kind of \quotes\ we want?); echo json_encode($struct); If you try to run json_encode on your already JSONified

[Proto-Scripty] Re: Event.observe

2009-04-29 Thread Matt Foster
Hey Brent, Do you have a demo page that displays this issue? My only thoughts are that the elements are getting reloaded in the DOM yet not getting the events attached. -- http://positionabsolute.net On Apr 29, 2:59 pm, BrentNicholas brentnicho...@gmail.com wrote: Hi all, So I

[Proto-Scripty] Re: pimp my snippet?

2009-04-29 Thread Matt Foster
Just to have fun with it... var val = $F(file); if(val.lastIndexOf( ) val.lastIndexOf(/)) On Apr 29, 2:52 pm, Walter Lee Davis wa...@wdstudio.com wrote: Aha, but what about spaces in folders leading up to that filename? I   don't mind those, since I only end up with the file, not the

[Proto-Scripty] Re: Extracting methods from codebase

2009-04-29 Thread Matt Foster
I'd set up each class or major structure, such as Element, Enumerable, etc etc as its own file, then define packages such as minimal, efficient, advanced, ajax...etc. Then in a server side script it will bundle these files together depending on the package so you could make a request something

[Proto-Scripty] Re: Effect.Appear doesn't work when in queue

2009-05-01 Thread Matt Foster
In looking at your code, there were a few HTML mistakes. First your try me element doesn't have a proper closing div tag its just /div no greater than to close the tag. You've also does this on your input buttons, input objects are considered simple, meaning they have no children, so having a

[Proto-Scripty] Re: Ajaxio next step?

2009-05-05 Thread Matt Foster
Another good one is www.mindmeister.com, I doubt they've got an API for you to work with but maybe you can get some ideas. Its built with Proto/scripty, but they use a canvas object instead of SVG so it could be a bonus for your IE requirement. -- http://positionabsolute.net On May 5,

[Proto-Scripty] Re: Please Help With Code

2009-05-08 Thread Matt Foster
I think he's looking for a snippet handout, by the looks of the spaghetti that he's pasted he's trying to highlight a single item in a menu. var activeElement = false; $$(ul.menu li).invoke(observe, click, function(e){ var element = e.element(); if(activeElement)

[Proto-Scripty] Re: Check element class against array

2009-05-14 Thread Matt Foster
var test = ['foo', 'bar', 'foob']; if (test.any(element.hasClassName.bind(element))) { I believe using the non-methodized version of this method would be better Element.hasClassName.curry(element); -- http://positionabsolute.net On May 14, 12:30 pm, T.J. Crowder

[Proto-Scripty] Re: Check element class against array

2009-05-14 Thread Matt Foster
bind for curry and it gave an error. On May 14, 3:32 pm, Matt Foster mattfoste...@gmail.com wrote:     var test = ['foo', 'bar', 'foob'];     if (test.any(element.hasClassName.bind(element))) { I believe using the non-methodized version of this method would be better

[Proto-Scripty] Re: How can I get a list of events fired by an object?

2009-05-21 Thread Matt Foster
You could find a list of all events and listen to them each, there isn't an all operator to listen to any event that is fired as far as I know... function allYourEventAreBelongToUs(e){ console.log(You hit an event %o, e); } $w(load unload click dblclick ...).each(function(evenType){

[Proto-Scripty] Re: Observe onmouseover and onmouseout with IE6

2009-05-21 Thread Matt Foster
What is surprising to me is that the this scope ever actually worked inside the event handlers. Had you left the handle alone I know that Proto would have bound the element to the handler such that this would assume the value of the element, but since you explicitly set this via bind in the

[Proto-Scripty] Re: How can I get a list of events fired by an object?

2009-05-26 Thread Matt Foster
src changes.   The underlying problem was how to keep an iframe sized to match its   contents. While you get one onload event when the frame finishes   loading, no others are ever fired, even when you navigate to a   different page within the iframe. Walter On May 21, 2009, at 5:05 PM, Matt

[Proto-Scripty] Re: How can I get a list of events fired by an object?

2009-05-28 Thread Matt Foster
The iframe element doesn't support any events[1]. You can indeed listen to the load event directly from the IFrame element. http://pastie.org/493154 The document that it contains may support various events (such as load, click, etc.). Why would a document inside an iframe not support these

[Proto-Scripty] Re: Event.toggle

2009-06-05 Thread Matt Foster
Is there a way to initially load the page with the map open and then close it after a timed period? Better yet, is there some way to load it with it hidden but not chopped up? Yeah, having it display:none or visibility:hidden can muck up the calculations of the containers dimensions. I'd

[Proto-Scripty] Re: HTML breaks JSON

2009-06-08 Thread Matt Foster
addslashes() off, any occurence of in the body text (eg quotes from speakers etc) breaks the code again. Does anyone have a foolproof method? Cheers Matt On Apr 24, 9:54 pm, Matt Foster mattfoste...@gmail.com wrote: What are you sending to PHP's json_encode? It is expecting

[Proto-Scripty] Re: Working out where a user is on the page

2009-06-11 Thread Matt Foster
When your event fires just get the scroll properties from the window, Prototype has a convenient method just for this purpose. http://prototypejs.org/api/document/viewport/getscrolloffsets -- http://positionabsolute.net On Jun 11, 9:30 am, Jeztah webmas...@thecarmarketplace.com wrote: At the

[Proto-Scripty] Re: Events in own Class

2009-06-29 Thread Matt Foster
I ran into this same issue and made a class to extend others from to inherit this sort of functionality. This is the article but the JS itself is a bit outdated http://positionabsolute.net/blog/2007/06/event-dispatcher.php To get the freshest JS...

[Proto-Scripty] Re: Events in own Class

2009-06-30 Thread Matt Foster
. Is it the right way or not? thanks, rgds sven On 29 Jun., 20:17, Matt Foster mattfoste...@gmail.com wrote: I ran into this same issue and made a class to extend others from to inherit this sort of functionality. This is the article but the JS itself is a bit outdatedhttp

[Proto-Scripty] Re: select option by value

2009-07-07 Thread Matt Foster
You could use many of the enumerable methods, this seems a bit verbose but gets the job done. Enumerable.find will iterate over the collection until the iteration function returns a value of true. I could have used each, but potentially would have iterated more than necessary, as we'd really

[Proto-Scripty] Re: mixin of function not found

2009-07-14 Thread Matt Foster
(Vulnerable, {   initialize: function() {     this.health = 100;     this.dead = false;   } }); var bruce = new Person; bruce.wound(55); bruce.health; //- 45 On Jul 13, 4:22 pm, Matt Foster mattfoste...@gmail.com wrote: The second argument is accepting attributes of the HTML element

[Proto-Scripty] Re: Ajax Request Timeout

2009-07-14 Thread Matt Foster
--   getStatus: function() {     try {       return this.transport.status || 0;     } catch (e) { return 0 }   } --- so Firefox must leave the status undefined. @ Matt Foster : i tried your patch but it didn't work for me

[Proto-Scripty] Re: Objects that return zero length

2009-07-14 Thread Matt Foster
in an array shouldn't automatically return length 0. On Jul 14, 1:47 pm, Matt Foster mattfoste...@gmail.com wrote:  $A(attr.edges).each(function(edge) {      this.edge.set(id, new GraphEdge(cv, id, edge));    }, this); edge is your variable, why bother trying to set function

[Proto-Scripty] Re: Ajax Request Timeout

2009-07-14 Thread Matt Foster
Yeah I discuss the idea of having its own event for timing out in my article. The argument is a timeout is a failure, its failed to retrieve a response in the given time. So a timeout is basically like an inherited event from onFailure. Question remains do you seperate the event or just add a

[Proto-Scripty] Re: Objects that return zero length

2009-07-15 Thread Matt Foster
,       edges: {         Brainwriting : {           color: black,           penwidth: 0.5,           fontname: Arial,           URL: javascript:void(predwin(2179)),           label: bull;    ,         } Ron blog.ideatree.us On Jul 14, 4:47 pm, Matt Foster mattfoste...@gmail.com wrote: Oh I get

[Proto-Scripty] Re: DataGrid

2009-07-17 Thread Matt Foster
That is nice, you should submit it to http://scipteka.com -- http://positionabsolute.net On Jul 17, 4:14 am, Alex McAuley webmas...@thecarmarketplace.com wrote: Nice data grid! ... what about inline editing of the cells ? .. i cant get it to work on firefox in your demo - Original

  1   2   >