Check e.keyCode. For numbers it should be in range 48...57, for letters
a...z in range 97...122 (for Shift-a..z also 97...122, so you need extra
check for Shift key). Other way is to use onkeypress event - it will have
proper codes for a...z and A...Z, but is more browser-specific even with
The order of observers is not guaranteed. IRL, IE6-8 use LIFO, other
browsers use FIFO order to call observers.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
Prettyphoto is based on jQuery, so you need to read about
jQuery.noConflict(). But there in internet is a couple of another lightboxes
based on Prototype (you can search at http://scripteka.com/), maybe they
will fit your needs.
--
You received this message because you are subscribed to the
At least the possibility to fix documentation typos and wrong code samples
will be the great leap forward. Many of the tickets at
https://prototype.lighthouseapp.com/projects/42103-prototype-documentation/tickets
are more than 6 months old.
--
You received this message because you are
Maybe
window.scrollBy(0, 0);
can help?
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/rmxmr8wZ_asJ.
To post to this group, send
Do you talking about visual effects in Chrome while browsing the source
tree? This is special effect somewhere in bundle_github.js (look for CSS
class js-slide-to).
1. You can download that JS file and look into it for concrete working
example.
2. With Prototype you can set global event
about
unobtrusive creation? You can create DatePicker and ComboBox when the input
field becomes focused first time.
--
With best regards,
Victor
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
Sometimes IE refuses to insert options created with new Element() or
innerHTML into SELECT or OPTGROUP. Approach with new Option() is more
reliable (at least for me) while still cross-browser.
--
You received this message because you are subscribed to the Google Groups
Prototype
+1 for mouse wheel event and ajax abort and timeout.
String.prototype.trim AKA strip() is already here.
E-mail validation pattern is under big question, e.g. regexp fully
compatible with RFC 2822 will look like
var lis = $('slide-images').getElementsByTagName('li');
nobody knows about $$ and CSS selectors :)
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
You can invert your {'fields': [{'field':'fname', 'col':2}, {'field':'ssn',
'col':5}]} to something like ['field0', 'field1', 'fname', 'field3',
'field4', 'ssn'] and then zip it (Enumerable#zip) with every CSV row.
--
You received this message because you are subscribed to the Google Groups
I think it will be slower than separate selectors:
1. Single complex selector will require additional time to parse and merge
nodes into single result.
2. After that you will use additional checks - the same as in your
selectors.
--
You received this message because you are subscribed to the
I see in Firefox 3.6 that z-index is not changed at all.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/lP4DA5SSbLAJ.
To post to
I used similar things with
new Element(tagName, {style:...})
earlier, but after strange behavior of IE I prefer to use
new Element(tagName).setStyle({width:x,height:y})
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this
For Enumeration (Hash, ObjectRange etc.) use Enumeration#each
var index = -1;
enumeration.each(function(e, i) {
if (e === 'bar') {
index = i;
// looking for the first occurrence
throw $break;
}
});
for Array you can use shorter
var index = ['foo','bar','baz'].indexOf('bar');
Sorry for late answer, but there are my few coins on custom attributes.
For XHTML solution exists many years - from the beginning of XHTML itself:
XML namespaces. Define custom attributes in custom namespace, and the
resulting XHTML page will be perfectly valid. Example (stripped from working
Hello Andrew!
Great to see that someone from developers still reading this list. You
didn't cleared the situation about lighthouse bug tracker and code patches.
Will someone somehow react to the bug messages, questions about code,
proposed patches etc.? Or posting bugs/wishes/patches in bug
Hi!
If you like to browse source code, then you can answer by yourself. Just
search for prototype_event_registry in sources.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
OK, it is used in stopObserving to clean observers, mainly for IE (look at
function _destroyCache) to prevent memory leaks.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
You can highlight matched characters while creating response on the server
side like in this sample:
optionspan class=\informal\This will not pass into
answer/spanbHighlighted part/bNot highlighted part/option
--
You received this message because you are subscribed to the Google Groups
Also why you cannot override some method? It is simple like
Ajax.MyAutocompleter = Class.create(Ajax.Autocompleter, {
onComplete: function($super, request) {
$super(request);
}
});
or you want to replace existing method in existing class?
--
You received this message because you are
I think it should look like
var base = Class.create({
iterations: 0,
initialize: function(item) {
this.iterations++;
//this.collection = [];
this.collection.push(item);
console.log('Iterations: %s, Number items in Collection: %s',
this.iterations,
Fine. Here is a list of my Prototype tickets (not counting tickets for
Prototype documentation):
1269https://prototype.lighthouseapp.com/projects/8886/tickets/1269-eventjs-bug-in-issimulatedmouseenterleaveeventnew
event.js
- bug in
It's kinda feature, not issue ;) You expect that method references in
base.prototype will be visible in child classes, and array reference behaves
similarly.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion
cleanWhitespace should not be recursive, at least for inline elements. E.g.
for HTML fragment bithe/i ispace/i/b user will see output *
thespace* (single word) instead of *the space* (two distinct space-separated
words), which isn't correct.
--
You received this message because you are
For me it is just Prototype (without dot-j-s)
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/mhngjWsE3-sJ.
To post to this group,
GET requests are
idempotenthttp://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html:
the side-effects of N 0 identical requests is the same as for a single
request, so from the browser and proxy point of view repeating GET requests
should return the same result, and they can instantly use cached
Can you give more info? The full text in popup? What is window.js? Why you
want to use both Prototype and jQuery on the same page? Where is your
jQuery.noConflict()?
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this
After jQuery.noConflict() all the functionality of jQuery is still
accessible - just replace $ with jQuery everywhere you need to use
jQuery. Look at documentation http://api.jquery.com/jQuery.noConflict/.
--
You received this message because you are subscribed to the Google Groups
Prototype
You can use some dispatching mechanism, e.g.:
1. HTML: all your clickable elements have special class or attribute like
a class=widget chooserchooser/a
or
a data-widget-type=chooserchooser/a
2. JS: your single observer finds somehow your desired element and
dispatches event accordingly to the
I think there is some problem in your code, because code similar to your
description exists e.g. in Scriptaculous:
Effect.Base = Class.create({
position: null,
start: function(options) {
...
},
...
});
Effect.Parallel = Class.create(Effect.Base, {
initialize: function(effects) {
Problem is somehow related to XHTML and IE9.
If you occasionally serve document as xhtml+xml, document should pass
validation to work in browser. I've noticed form name=... in your
example, but *name* attribute is obsolete for *form* tag in XHTML1.0, or
maybe you have *nbsp;* somewhere in your
I used the form name attribute as a way of knowing which AJAX module to
call on behalf of that form. That allows my dofill() to serve many forms.
This can be made via CSS classes, not name attributes.
I've seen very few pages of any type that validates 100%
1-2 errors/warnings does not
I've seen on github that event system is reworked, but this is still work
in progress. You can download bleeding-edge version and test for yourself.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web
Jon Dow == John Doe? ;)
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/2jp7KMInIvAJ.
To post to this group, send email to
Here is the code (borrowed from some project) I'm using for bubbling focus
and blur events:
/**
* Bubbling focus:in and focus:out events.
* Usage:
* document.on(focus:in, selector, focusHandler); // on focus
* document.on(focus:out, selector, blurHandler); // on blur
*/
(function() {
you suggest adding one special class or attribute to all clickable
elements, so that in my observer I can check for that class/attribute in
the very first line minimizing the amount of if statements
yes
PLUS you suggest to delegate the triggered event to the [clicked] element
to
You are trying to invoke methods on not extended element in IE8, right?
E.g. instead of $(element).fire(some:thing) you are using
element.fire(some:thing).
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on
So you plan to receive JSON from server, then convert it to HTML and insert
into page? HTML fragments are much easier in writing/validating/processing.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the
[offtop]
Jessica, do you know about much shorter synonym of
document.getElementById()?
[/offtop]
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
Cool
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/mOo4ab0uQ-UJ.
To post to this group, send email to
Take a look at RightJS http://rightjs.org/ - it is very close to
Prototype+Scripty, and (still) has very operative support at Google
groupshttps://groups.google.com/forum/?hl=rupli=1#%21forum/rightjs
--
You received this message because you are subscribed to the Google Groups
Prototype
Also CoffeeScript sometimes generates very ugly code. Example:
CoffeeScript:
SelectParser.select_to_array = (select) -
parser = new SelectParser()
parser.add_node( child ) for child in select.childNodes
parser.parsed
Generated JavaScript:
SelectParser.select_to_array = function(select) {
Is Scripty2 still developed? Or it is as alive (half-dead, actually) as
Prototype? I've posted tickets on both projects in Lighthouseapp but no
response...
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on
1. Declaration with value assignment
2. Declare loop variables and cache length inside of for() - this can
increase performance http://jsperf.com/caching-array-length/67 - caching
length outside of for() is slower in almost all results (all Firefox and
Safari, IE9 and some Chrome results)
3.
Don't worry - use Function#bind():
Event.on($(id), click, function (event, element) {
// this === element === $(id)
});
var object = {};
Event.on($(id), click, function (event, element) {
// this === object
// element === $(id)
}.bind(object));
--
You received this message because you
this.constructor
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/PyRvfGebg24J.
To post to this group, send email to
As part of scriptaculous' unit test:
testAnonSubclass: function() {
var C1 = Class.create({
method1: function() {
return C1;
}
}), C2 = Class.create(C1, {
method2: function() {
return C2;
},
Hello!
...everyone who was using autocompleter in production has a couple of
patches :(
let's start to share?
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
automagically
:)
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/je-nzPkGXDEJ.
To post to this group, send email to
Hello!
One of the big issues I rand into was the way different browsers
handle scrolling the results window, and how the window controls is
treated as a loss of focus in some browsers.
Do you can describe this with more words? I cannot remember such problem,
at least as the big issue.
I
On browsers other than FF, clicking on the scroll bar would cause a
loss of focus, which would hide the results window.
I've fixed this too ;)
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web
What is
var Errror;
Error = {
};
(note the difference between *Errror* and *Error*)
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
Hello!
I just thought there would be a common pattern to this problem as i
almost can't believe that we're the first ones that need to 'pause'
event handlers without removing them.
Yes, this is a common problem without easy solution. As T.J. Crowder said,
better try to find another
1. You cannot use the name `Error` - there is already global object named
Errorhttps://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error.
Try with another name.
2. You can shorten your code a bit:
var User = Class.create({
// methods
});
--
You received this message because
1. Element identifiers should be unique, in other words, if any form or
field has identifier - it should not repeat in other forms.
2. When submitting form via script, it has option for the name of desired
submit button, e.g. for form with two submit buttons:
form id=formId2
input type=submit
Using Prototype 1.7, Scriptaculous 1.9, Ajaxtags 1.5.7-SNAPSHOT - all
autocompleters are working fine in any imaginable browser, including
Firefox 3.6 - 10.0.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion
You shouldn't pass non-functions to Element.addMethods(SELECT, {}). You
have fields like __ddObject in your _selectOptions - they are causing error
while IE tries to methodize() them.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us
NOTE: doesn't work in IE9, but seems to work in IE7, and IE8.
This example doesn't work in FF 10 also.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
Whoops, I was wrong :)
The problem is in _selectOptions.size() - there is already property named
`size` in HTMLSelectElement (at least both in IE and FF) and in cannot be
overwritten properly.
--
You received this message because you are subscribed to the Google Groups
Prototype
Thanks for the tip Victor. I do try to decode with IE, and I am using
IETester, but my primary box is IE9, so it is a bit tricky. I suppose if I
didn't have all your help I'd be forced to undust and old machine!
I use Vista + IE8 + latest IE9 platform preview + IETester (with IE6...IE8
Is this supported across all the browsers? I'm still hoping to get some
input on the setValue method and the encoding that takes place behind the
sheets. I'd like to use this method and don't understand the behavior.
setValue() for hidden input just assigns
element.value = value;
This is on the prototype.js file (version 1.5.0)
all other browsers are fine
Do you have tried to update to newest Prototype and Scriptaculous versions?
Also you maybe forgot to use $() on element before invoking methods from
Prototype and Scripty - this is common problem in IE.
--
You
I want to delete the a href=http://www.google.com; and the / a
If I understood, you need to read about string operations and regular
expressions in JavaScript, e.g. from
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace
--
You received this message
new Effect.SlideDown(expandEle, {duration: 3});
, But to no avail
What exactly is not working? You can make example at jsbin.com - we can
find some solution faster.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view
I am having a problem with a plug in I am using. ContentFlow.
It works fine in all browsers except IE8 and 7,
Are you talking about jQuery plugin ContentFlow? Then try to use
jQuery.noconflict() http://api.jquery.com/jQuery.noConflict/
--
You received this message because you are
When a user loads my page for the first time on an iPhone, the two
portions of the page generated by an Ajax.Updater call are garbled -
they look as if a binary file were injected into the page or the
character map was scrambled. If the user then reloads the page, or
uses the page's
Is the response header `Content-Type` always properly set? (e.g.
Content-Type: text/html;charset=UTF-8)
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
This turned out to be a page loading/timing issue. The original poster
resolved it by switching from document.observe('dom:loaded… to
Event.observe(window,'load'…
Does dom:loaded
not trigger correctly on the iPhone or something?
It sounds possible. Prototype now has 4 ways to detect
Is qunit not working when Prototype is on page? AFAIK it isn't depending on
any framework http://docs.jquery.com/Qunit To use QUnit, you have to
include its qunit.js http://code.jquery.com/qunit/qunit-git.js and
qunit.css http://code.jquery.com/qunit/qunit-git.css files and provide a
basic
Same browser (Safari.latest) on the same computer, the Prototype method
gives me a security failure (Origin [my host] is not allowed by
Access-Control-Allow-Origin.) while the long-hand XHR (inside a Prototype
observer) just works without any comment:
Two differences I can notice:
1.
Is header 'Access-Control-Allow-Origin' present in responses for both
examples?
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
It seems to be an issue on their server (BaseHTTP/0.3 Python/2.7.1+
according to FireBug). I'll file a bug and see what happens.
XHR without setRequestHeader sends usual 'GET' request:
Request URL: http://zip.elevenbasetwo.com/?zip=a
Request Method: GET
Status Code: 404 Not Found
*Request
Where is the second argument in multiplier()? I'll try to explain in
example:
function multiplier(obj, times) {
times = isNaN(times) ? 2 : times;
if (typeof obj.value != 'undefined') {
return obj.value * times;
} else {
alert(obj + ': does not have a value property!');
}
}
IMHO this happens because you make connections between objects of different
windows (opener and popup): arrXXX in popup window points to objects from
opener, opener element attributes point to strings/functions belonging to
particular popup window (which is really closed). Array in opener
I created a few widgets for the prototype and script.aculo.us.
See here https://github.com/fntzr/astra_z
In your Get started instruction script goes before link - some people
probably will literally copy this sample. Would be more correct to show
that styles should be included before
Hi!
Do you use any source formatting tools? Formatted source will be easier to
develop/support.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
It is very doubtful to me that someone was able to write OOP code
(e.g. return this.sub_total() + this.tax()), CSS selectors, properly use
inject() in calculations but wasn't able to replace character in string
literals.
--
You received this message because you are subscribed to the Google
Try to use unicode \u00a3 instead of single character £
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/-RT66iGyuVEJ.
To post to
Maybe try Object.toJSON() and then String#evalJSON()? You'll be
transferring to main context single string.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
Is this correct?
this.__z__handleSubmit = this.form.on('submit', this.__handleSubmit.
bindAsEventListener(this));
Is the bindAsEventListener necessary? I want to get back the Event
Handler so I can later destroy it with:
this.__z__handleSubmit.stop();
this.__handleSubmit.bind(this)
In short words, B element after dragging becomes z-index: 0 instead of
original z-index: auto and establishes new local stacking context. The
logic in startDrag()/finishDrag() methods should be fixed to properly
restore initial z-index for z-index: auto (now it defaults to 0).
--
You received
How can it be fixed?
in startDrag() (dragdrop.js):
if (this.options.zindex) {
// FIXED z-index: auto - z-index: 0
// was this.originalZ = parseInt(Element.getStyle(this.element,
'z-index') || 0, 10);
this.originalZ = Element.getStyle(this.element, 'z-index');
That is not conveniently tied to any event handler, so what is the
convenient means of disconnecting it, as in __eventHandler.stop(); ?
Sorry, I've not completely understood this phrase. I'll repeat myself:
// start observer - bindAsEventListener isn't needed
this.__z__handleSubmit =
When using v1.6.0.2 and serializing a form with a multiple select list,
I would get its value like myselect[]=foomyselect[]=bar.
In v1.7.0.0 it's posting the value like myselect[]=foo,bar. This does
not work properly on the backend (Rails).
Is this expected behavior?
Yes, Prototype 1.7
Hello!
You can do it in many ways:
1. Create an empty placeholder for hidden input (div at the bottom of your
form). You can then easily replace content of this div and don't care about
multiple inputs:
addElement: function () {
$(totalsContainer).update('input type=hidden id=finaltons
First fix missing *.js and *.gif files and incorrect markup.
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/A4of2UOIkWIJ.
To post
Here is the page being called . . .
script type=text/javascript
sayHi = function(){
alert ('Hi');
};
/script
input type=button value=Click Me onclick=sayHi()/
My problem is that if I replace *alert* with *document.write* then the
page gets replaced with a new page. I thought the
// select all div.item element within the current div.product-grid
element
var columns = r.select('div.item');
// make each div.item element as high as the current div.product-grid
element
columns.invoke('setStyle', {height: rowHeight + 'px'});
Theoretically it is needed when you want to explore hierarchy of classes,
practically it was used only once in jPlex http://code.google.com/p/jplex/
--
You received this message because you are subscribed to the Google Groups
Prototype script.aculo.us group.
To view this discussion on the web
It may fail because this code may overwrite element's properties (and in
some browsers like IE and Opera some attributes, mapped as element
properties). E.g. $(someInput).store(name, foo).store(type, bar);
Better will be some separate container to store values inside, but this
leads to
Internet explorer doesn't like object definitions without quotes around
the names
Hmm... example from Prototype 1.7 sources:
Object.extend(methods, {
getStorage: getStorage,
store: store,
retrieve: retrieve
});
Quotes are required for properties matching reserved
Form.YooEventObserver = Class.create({Abstract.EventObserver, {
minQueryLength: 3,
getValue: function() {
// return YAHOO.util.Connect.setForm(this.element);
//return Form.serialize(this.element);
},
// ... other methods
});
--
You received this message because you are
Hello!
I need some more ideas how to enumerate all classes - find at runtime (in
browser) all classes created with Class.create(). My initial approach:
function enumerateClasses() {
for (var p in window) {
var c = window[p];
if (Object.isFunction(c)
Would this construction:
e._prototypeStorage = e._prototypeStorage || {}
fall afoul of the issue that Jason pointed out? Would IE bork the
assignment because the key wasn't in hash form and quoted?
It will work fine. I've not found any specific property name which will
require quotes
I've had many instances where a javascript block would work in modern
standards compliant browsers yet fail silently in IE until I put quotes in,
single or double.
Please, show any example of such code.
--
You received this message because you are subscribed to the Google Groups
1. /assets/preload.js:1 http://yoopedia.dev/assets/preload.js
1. Uncaught ReferenceError: Form is not defined
yoo:361http://yoopedia.dev/mainpage/yoo#_=_
1. Uncaught ReferenceError: Form is not defined
yoo:549http://yoopedia.dev/mainpage/yoo#_=_
1. Uncaught
Yes these are loaded properly, here are the include order of these file
Can you verify this in your browser? Also, there may be syntax error in
some of javascript files. Try to comment them one by one until error
message (Uncaught Error: ExecJS::ProgramError: Unexpected token: operator
I checked the response header and it's
Content-Type:
text/html; charset=UTF-8.
Unfortunately I couldn't check the response because it's empty.
Is response empty in network sniffer/web inspector? Or in javascript code?
Printing the return-part in my controller I got the correct
Is response empty in network sniffer/web inspector? Or in javascript code?
The response is already empty in web inspector.
Very bad
You should check if it is actually written to HTTP response (maybe
response is already flushed).
If I return some HTML in addition to my base64 string
1 - 100 of 129 matches
Mail list logo