[Prototype-core] Re: Prototype without browser?

2010-04-22 Thread Matt Foster
I've used the Enumerable methods and the core stuff like Function.bind
and Class.create in whatever ECMA flavor the Adobe programs
use(Indesign  Photoshop) so I'm sure it's possible to leverage some
things from prototype in your program.

http://www.adobe.com/devnet/photoshop/pdfs/JavaScriptReferenceGuide.pdf

--

http://positionabsolute.net


On Apr 22, 9:42 am, nlloyds nllo...@gmail.com wrote:
 On Apr 21, 6:51 am, Rüdiger Plantiko ruediger.plant...@astrotexte.ch
 wrote:

  Are you sure you are using Javascript precisely ?
  Aren't you using some kind of ECMAScript instead ?

  Well, my scripts are executed with the same library  (%systemroot%
  \system32\jscript.dll)  that is used by the Internet Explorer for
  script execution. The only difference is that there is no browser
  around and hence no global window object, no document etc.
  Instead, i execute the JS files with the cscript command.

 You're right. JScript a decently compliant engine, thought not fast.
 It does have the advantage of being installed on every Windows
 machine. Classic ASP also uses the same engine. There's a few extra
 APIs for ActiveXObjects and basic shell and window alerts (WScript.)

 Nathan

 --
 You received this message because you are subscribed to the Google Groups 
 Prototype: Core group.
 To post to this group, send email to prototype-core@googlegroups.com
 To unsubscribe from this group, send email to 
 prototype-core-unsubscr...@googlegroups.com
 For more options, visit this group 
 athttp://groups.google.com/group/prototype-core?hl=en

-- 
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en


[Prototype-core] Re: Problem with getting my data

2008-04-30 Thread Matt Foster

I like the variable names, sometimes it is such a mess!

The problem is that you aren't waiting for the reply, you're
instantiating the object and then immediately calling what should be
your call back to the request.  You need to execute the request and
then in your appendMessages method, which I don't see defined and if
its part of your mapFeed class, it would be this.appendMessages, and
even further to ensure proper scope I would bind it as well,
this.appendMessages.bind(this).In that method, you can then apply
your response's JSON information to your mess property.



On Apr 29, 12:48 am, neoline [EMAIL PROTECTED] wrote:
 Hello,
 I have a problem and I cant solve it within 2 days.

 here is a code:

 var mapFeed = Class.create({

   initialize: function() {
 this.mess = [];
   },

   latestMessages: function() {
 var appendMessages = this.collectMess.bind(this);
 var check = new Ajax.Request('/lentas/latest',{
 method: 'get',
 onComplete: appendMessages
 });
   },

   collectMess: function(r) {
 this.mess.unshift(r.responseText.evalJSON());
   },

   loadMap: function() {
 this.latestMessages();
 // debug
  alert(this.mess);
   }

 });

 var map = new mapFeed();

 map.loadMap();

 But after calling last method loadMap() I get my map.mess still empty.

 What I'm doing wrong? Please help me
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Prototype Pagination

2007-10-18 Thread Matt Foster

Hey Mislav,

Given that this is a forum dedicated to core improvements to
prototype you're correct in that this isn't perfectly suited to the
topic.  On the other hand this forum is probably the biggest hub for
prototype developers, and if not in mass than certainly in talent.
Given that, this is exactly the audience I am attempting to attract.
If the audience finds my monthly posts to be offensive I will cease
such activity because that is not going to draw positive attention.

The disclaimer aside, thanks for the response it is good to hear some
feedback.  Pagination in nature is typically server side which makes a
lot of sense.  For quite a few reasons though i have found client side
pagination to be really useful.  Creating a Google Gadget that
displayed an RSS feed in pagination form was pretty fun and given the
result set wasn't inordinately large it was a great implementation.
It wouldn't be too hard to refactor code in the gadget to display
anyone's RSS feed, if anyone is interested.  I found the pagination
control in that implementation to be a little smoother than scrolling,
when you've got a small asset that scrolls inside a larger document
that scrolls the UI can get tricky as the focus of the mouse
determines which object will scroll with the mouse wheel.

Cheers,
 Matt


On Oct 17, 8:47 am, Mislav Marohnić [EMAIL PROTECTED]
wrote:
 On 10/15/07, Matt Foster [EMAIL PROTECTED] wrote:



  I have developed a pretty smooth UI Control for handling
  client side pagination.  It is composed of 3 classes that allow for
  maximum decoupling.  In this manner the view is decoupled from the
  iteration control, such that the same iteration control can be used on
  any data set while the view can be specialized for any format of JSON
  or XML.

 I'm not sure if such announcements are suitable for this group. (Someone
 correct me if I'm wrong when stating it isn't.)

 That said: Interesting work. I handle pagination server-side myself (using
 the will_paginate plugin for Rails), but I definitely see use cases when you
 have to move this logic client-side.


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



[Prototype-core] Prototype Pagination

2007-10-15 Thread Matt Foster

Greetings Everyone,

I have developed a pretty smooth UI Control for handling
client side pagination.  It is composed of 3 classes that allow for
maximum decoupling.  In this manner the view is decoupled from the
iteration control, such that the same iteration control can be used on
any data set while the view can be specialized for any format of JSON
or XML.

http://positionabsolute.net/blog/2007/10/prototype-pagination.php

Best Regards,
 Matthew Foster


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



[Prototype-core] Re: Event methods' bug in Internet Explorer

2007-10-09 Thread Matt Foster

You sure that will fail?  I am pretty sure the static event methods
should all work with a regular event object.

Isn't it just for convenience, like the Element methods that they put
the method in as a property just for the syntactic sweetness?

Also I agree with Mislav, inline event handling is horrible practice.
Gather your elements and apply listeners, similar to how you avoid
inline markup because of CSS, now you can avoid inline markup for
javascript behavior because of prototype.  I find myself using the
same selectors in these two technologies constantly and i'll tell you,
when you come back to it a few months later you'll be happy.

Cheers,
Matt




On Oct 2, 8:26 am, Mislav Marohnić [EMAIL PROTECTED]
wrote:
 On 10/2/07, Viktor Kojouharov [EMAIL PROTECTED] wrote:



  The above snippet will cause an error in IE due to the reason that the
  event is never extended, since it doesn't go through the observe
  wrapper.

  A possible solution for this is to use the old syntax of
  Event.method(event) inside prototype itself. Or call
  Event.extend(event) at the beginning of each method.

 Exactly. Or simply return false when you are using inline event handling.
 You shouldn't use inline anyway, it's bad practice.


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



[Prototype-core] Prototype DateChooser

2007-09-17 Thread Matt Foster

Hey Everyone,


I had been looking for an implementation of a date chooser.
Many were close but I was really looking for something
more...declouped.  So i ended up taking a new approach, maybe because
im left handed.  What I wanted to do was build up the functionality of
a grid and then stack on top of that the Calendar behavior.  This is
accomplished in a series of abstract javascript classes to form a
fantastic implementation that uses an event dispatching mechanism to
notify the interface of a date selection.  Check it out if you're
interested in a very decoupled date chooser

http://positionabsolute.net/blog/2007/09/javascript-date-chooser.php

Cheers,
 Matt


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



[Prototype-core] Re: XML nodes and Element.readAttribute (IE bug)

2007-09-14 Thread Matt Foster

Wow I hate the attribute model, so broken heh.


What is wrong with the native getAttribute method, is there anything
different going on here?

Cheers,
   Matt

On Sep 13, 3:02 pm, Yanick [EMAIL PROTECTED] wrote:
 I don't know if anyone has encountered this problem before, but I was
 reading nodes from an XML document (ajax response) and I tried the
 Element.readAttribute function instead of my own home brewed
 algorithm. (This Web application goes all the way from before there
 was such function in the Prototype library...) Anyway, firefox didn't
 complain, but IE seemed to do so. Here's what I did to resolve this
 issue :

 readAttribute: function(element, name) {
 //element = $(element); // IE doesn't like this line (is it
 really necessary ?)
 if (Prototype.Browser.IE) {
   // XML nodes in IE has an array name attributes. Each index
   // is an object { name: [string], value: [mixed], ... }
   if ( element.attributes  element.attributes.length ) {
 // I'm sure some might find a better way to do this, but it
 works for now
 var attribute =
 $A(element.attributes).find(function(attribute) {return
 attribute.name==name; });
 // if we do not return here, we might throw an exception, so
 rather return null if not found
 return attribute ? attribute.value : null;
   }
   var t = Element._attributeTranslations.read;
   if (t.values[name]) return t.values[name](element, name);
   if (t.names[name]) name = t.names[name];
   if (name.include(':')) {
 return (!element.attributes || !element.attributes[name]) ?
 null :
  element.attributes[name].value;
   }
 }
 return element.getAttribute(name);
   },

 I'm sorry I'm not the best guy to provide more test with this matter,
 but I'm pretty sure some of you already have the proper setup to do
 them. So I'm leaving this into your more capable hands.

 Thank you.

 yanick


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



[Prototype-core] Save State in ajax application

2007-09-06 Thread Matt Foster

Greetings Everyone,

   I had posted about a method for handling the back and
forward buttons for ajax applications.  I have completed a
working prototype for the other half of the history coin, enabling the
bookmark.  The basic premise falls in line with many other approaches,
stashing JSON notation in the URL after a # hash symbol.  The
difference is that this approach complies with the idea of a pure
javascript XHR service, enabling your ajax application to follow the
Hollywood Principle design pattern for XHR requests.

http://positionabsolute.net/blog/2007/08/ajax-bookmark-link.php

Best Regards,
 Matthew Foster


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



[Prototype-core] Re: Fisheye control for prototype.

2007-08-20 Thread Matt Foster

That is a very keen observation, well kind of, the bounce certainly
catches my eyes.  I believe this is in FF only.  A solution is to set
the Fish Eye Toolbar's position to absolute, such that its children
are not equated in the document flow, thus when the animation occurs
it has no factor on anything descending in the document.  I'll put
that into the entry as this is a concern.

Cheers,
   Matt

On Aug 20, 1:04 pm, John Barnette [EMAIL PROTECTED] wrote:
 On 8/20/07, Mislav Marohnić [EMAIL PROTECTED] wrote:

  On 8/20/07, Matt Foster [EMAIL PROTECTED] wrote:

   The animation is smooth and the code is very extendable.

 http://positionabsolute.net/blog/2007/08/prototype-fisheye.php

  There is another glitch, and that is if I interact with the effect (move my
  mouse from left to right), some random paragraphs in the below text are
  slightly moving also. Is anyone else observing this?

 Subheadings are showing a 1px vertical jog for me (FF2 on OS X).

 ~ j.


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



[Prototype-core] Re: browser and platform info?

2007-08-17 Thread Matt Foster

 Prototype.Browser.IE and the others are booleans, not functions that
return booleans.

Cheers,
Matt

On Aug 7, 3:06 am, Lino Jan Telera [EMAIL PROTECTED] wrote:
 For browser u can write (only if you are using prototype 1.5.1)
 Prototype.Browser.IE (return true if you are using IE)
 Prototype.Browser.Opera(return true if you are using Opera)
 Prototype.Browser.WebKit(return true if you are using WebKit)
 Prototype.Browser.Gecko(return true if you are using Gecko: Mozilla,
 Firefox)

 For OS I don't know, but i think u can't do anything...

 Hope this help you...
 Hi
 Jan

 On 8/6/07, patrick.face [EMAIL PROTECTED] wrote:



  hello
  Does Prototype provide the browser and platform information? I didn't
  see it in the API. I'd like to determine if my users are on the mac
  and if so what browser.

 --
 Lino Jan Telera

 Obey your master!
 La verità nuoce solo agli incompetenti!
 
 My home page:http://www.linoproject.net
 My Google Group:http://groups.google.com/group/ajax-e-dom-italia/
 My Blog:http://frontiereweb.blogspot.com/
 My ICQ UIN  : 81834420
 Jabber  : janosh(at)jabber.org
 SKYPE  : linotelera
 


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