Re: [Rails-spinoffs] Addressing a class, rather than an id?

2005-12-07 Thread sam

Quoting Raymond Brigleb <[EMAIL PROTECTED]>:


So my question is: am I barking up the wrong tree? Is there an easy  
way to address CSS properties of a class of objects on a page, or do  
I need to loop through them individually somehow? Has anyone tackled  
this one?




If I understand your question right, take a look at the utils.js in
Scriptaculous. It provides a set of functions for handling CSS classes under
the Element.Class "namespace". E.g. Element.Class.add(element, "someclass")
Element.Class.has, Element.Class.remove, etc. I've added a 
Element.Class.replace
and a few other helpers, I'm sure you'll find your own extensions 
necessary but

its a useful start.

hth
Sam (-i-am)



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Centering one Div within Another

2006-06-09 Thread Sam
Title: Message



Is there a 
prototype.js or script.aculo technique to easily center one div within 
another?
 
SamC
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Centering one Div within Another

2006-06-09 Thread Sam
Title: Message



 >  Is 
there a prototype.js or script.aculo technique to easily center one div within 
another? 
 
A few more words of 
explanation...
 
- I'm familiar with centering 
DIVs using margin: 0 auto 0 auto;  I need this DIV to be centered top 
to bottom, left to right...
 
--- and it needs to work in IE 5.5, 
which is another level of 
difficulty.
 
I've tried writing a _javascript_ to 
get the height / width of both DIVs.  It isn't easy when either of the DIVs 
has height:auto;  height will 
return "null".
 
Sam 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Centering one Div within Another

2006-06-09 Thread Sam
>Even if prototye had one, according to
>http://wiki.script.aculo.us/scriptaculous/show/SupportedBrowsers, IE 5.5
isn't
>supported.

Sorry I brought up 5.5.  I'd noticed prototype.js' browser support earlier
and gone ahead.  So far, I've made a couple of 5.5 modifications to
prototype.js.  setStyle / getStyle had to try/capture error on
cursor:pointer and switch to cursor:hand... and more.  I don't use all of
prototype.  What I do use is a benefit to development.

Still, if there a good technique to center a couple of divs top/bottom,
left/right, I'd be interested.  Even if it is restricted to the browsers
supported by prototype.js (which is quite a few...)

Sam




___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Centering one Div within Another

2006-06-09 Thread Sam
Title: Message



 >  Try here for cross-browser viewport 
support:
 
 > 
 http://www.quirksmode.org/viewport/compatibility.htmlQuirksmode does 
it again.  
 
Still 
some work to get there, but this is a start.  I was sure this problem 
must have been solved with _javascript_ hundreds of times, but Google doesn't 
pop up solutions.
 
Sam 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Scripts.aculo Highlight (and others)

2006-06-10 Thread Sam
Title: Message



I have a solution to 
this problem, but I'd like to know if there is a more common solution that 
doesn't require modifications to the Effects code. I wonder if I'm doing 
something that made a non-problem a problem.
 
Almost any of the 
Scripts demos have a race condition...  if the script is called again (new 
instance of the effect), before the first instance completes, the final 
element may have different characteristics than the 
original.
 
A good demo of this 
is the Effects.Highlight
 
http://wiki.script.aculo.us/scriptaculous/show/CombinationEffectsDemo
 
Note the color of 
the element on page load.  Click several times, being sure to click while 
the highlight is in progress.  The final color of the element will not 
match the original.  Subsequent instances of the Highlight effect have 
captured the background color "in progress" and restored the final background 
color to the "in progress" color.
 
I had to add code to 
gate requests to Highlight when in progress.  It required a modification to 
Highlight to callback on completion to open the gate.
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Tooltips

2006-06-10 Thread Sam
Title: Message



 
Anyone know of 
a tooltip extension which uses script.aculo or prototype?  e.g., hover 
a mouse on an object and pop-up a "help" dialogue?
 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Tooltips

2006-06-12 Thread Sam
Title: Message



Thanks 
for the tooltip pointers.  I'm sure I can make do with one of these.  
I won't have a chance to evaluate any of these until later this 
week.
 
The 
solutions posted show that the term "tooltip" can describe different 
functionalities.
 
 1 - there are solutions that pull up the ALT or TITLE tag, and 
that's very cool and simple...  I think I may go with 
this.
 
 2 - for more complex "help" tooltips, some solutions take a pointer 
to a hidden  which contains complex markup and accepts CSS.  

 
Sort 
of a revelation for me that there are different kinds of 
tooltips.
 
Thanks,
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] IE rendering of Sliders

2006-06-12 Thread Sam
Title: Message



 Small point, 
has anyone noticed that the sliders don't render properly in IE 
6.0?
 
http://wiki.script.aculo.us/scriptaculous/show/SliderDemo
 
I've dabbled with 
the HTML and CSS and got 'em to render properly in IE 6 (and IE 5.5... yes, I 
know...)
 
 .slider-track 
{  width:50px;  height:5px;  
background-color:gray;
  position:relative; /* IE fix 
*/ }.slider-handle 
{  width:5px;  height:10px;  background-color:#F00;  cursor:move;  position:absolute; 
/* IE fix */    }

 
One 
of the fixes is the HTML comment above tells IE there's no innerHTML, so 
the font-size won't make the contrastHandle larger than 10px.  Eliminate 
the comment, or include a blank space and the handle  will grow to 
the font-size, which may be larger than 10px.  Sure, you could shrink the 
font-size, but this avoids the issue entirely.
 
The 
other fix is: position the handle absolutely... IE wants to make the outer div 
expand to accommodate the handle, so the position:absolute removes it from 
the content, and doesn't change the behavior or rendering in any way.  (The 
outer (track) div must be positioned, for the position absolute to 
work).
 
Seems to render correctly in IE 6 and 5.5 
now.
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Ajax - preloading images

2006-06-12 Thread Sam
Title: Message



I could experiment 
to figure this out, but maybe the work has been done so I'm going to 
ask.
 
Using Ajax, if I 
wanted to preload several (20) small (<1K) images, behind the 
scenes... would I...
 
 1 - Queue the 
loading of the images with Ajax one at a time, asynchronously, and ignore 
the completion results.  Would this result in the image being in the 
browser's cache even if the Ajax returned result was not attached to the 
DOM?
 
 2 - Queue the 
loading of an HTML page that refers to all of the images  
Must the Ajax page loaded content be attached to the DOM for the 
images to be loaded, or can I forget about that and assume the images will 
load?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Array.prototype.push()

2006-06-12 Thread Sam
>Gotcha.  If you fix it so that array.push works, it'll throw another
>error.  I kept fixing them until I got to the 'for el in array' error,
>which I didn't know how to fix.  So, best not to include prototype.js if
>you want to support IE 5, or if you know some magic that makes the
>For...in work, then go nuts.

I encountered one of these for/loop errors in prototype with IE 5.5.  For
some reason, a generated Array had a length property that 5.5 couldn't read.

Knowing that 5.5 *shouldn't* have a problem with array length, (and not
knowing what internal anomaly in the array was inducing this 5.5 behavior),
I copied the array to a new variable, copied it back (overwriting the
original).  The loop worked fine after that.

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Code comments?

2006-06-12 Thread Sam
A little OT.  Hope you don't mind...  here is a function which modifies a
value in an external stylesheet (works in Firefox, IE 6, IE 5.5)...

I've rewritten it using prototype.js structures and suspect there are some
additional optimizations which could be made.  There may be a way to use
findAll or another equivalency operator to test for the innermost equality
and perform the assignment if it's true?

Comments appreciated...

Sam

cssSelectorUpdate2:function(sSelector, sProperty, sValue) {
// Update the property value for a specific sSelector in a stylesheet
for(var i = 0; document.styleSheets.length > i; i++) { //
Mozilla
var oRules = document.styleSheets[i].rules ||
document.styleSheets[i].cssRules;
for(var j = 0; oRules.length > j; j++)  {
var sSelectors = oRules[j].selectorText;
// string of all selectors on this line
var aSelectors = sSelectors.split(',');
// separate all selectors
for(var k=0; khttp://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Loading CSS for AJAX apps.

2006-06-15 Thread Sam
Title: Message



function LoadCSS(file){
var head = 
document.getElementsByTagName('head').item(0)
var linkTag = 
$('loadCSS');
if(linkTag) 
head.removeChild(linkTag);
csslink = 
document.createElement('link');
csslink.href = 
"">
csslink.rel = 
'stylesheet';
csslink.type = 
'text/css';
csslink.id = 
'loadCSS';
head.appendChild(csslink)
}
 
Nice.  I'd like to 
hear of any cross-browser support issues, or lack of.  I can see this 
being useful in my application if it works.  Has anyone tried this in 
Safari?
 
Sam 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Detecting Body Onload

2006-06-16 Thread Sam
Title: Message



I have a piece of 
code that "waits" for body onload.  Every 30ms, it tests 
$('body').
 
Seems that isn't 
always good enough.  I've hit situations where the DOM is "partially" 
loaded somehow.
 
I fixed matters by 
setting a global flag...
 

 
which provides a 
better test... of course I could always
 

 
but I had wanted to 
keep my HTML markup JS free...  Is there a reliable way to 
test for body loaded and not include an onload handler in the HTML 
markup?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Detecting Body Onload

2006-06-16 Thread Sam
Title: Message



 >  Or, in script (assuming you're using 
prototype) > 
 Event.observe(window, "load", myHandler); 
I 
wasn't aware that window load did the job.  I'll look 
into it.
 
Did I 
read somewhere that window load waits for all images on the page to be 
loaded?
 
Sam 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Detecting Body Onload

2006-06-16 Thread Sam
Title: Message



 > Ha, seems that Thomas just blogged on this 
yesterday... 

 > http://mir.aculo.us/articles/2006/06/15/solving-the-onload-woe

Following this 
link, I came to this:
 
http://agileweb.org/articles/2006/06/16/speeding-up-onload 
 
which 
has a link:
 
http://dev.rubyonrails.org/ticket/5414
 
indicating a patch is supplied for prototype.js for "faster" onLoad 
handling.
 
Anyone 
have an idea when the beta of this copy of prototype.js will be 
available?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Detecting Body Onload

2006-06-19 Thread Sam
I've been following the body Onload discussion with interest.  Not having
had access to this solution when developing my application, I resorted to
building a scheduler class:"Executive" which fielded the HTML-coded events
from



>From there, it's easy to imagine that the Executive class handles the
dispatching of events to other Classes waiting for body Onload and Unload
events.  I have confidence that these events fire correctly in all browsers
when the DOM is loaded and the images are still in-download-progress,
providing a "fast" javascript initialization.  This is the only event-markup
on my page(s), and it seems a reasonable trade-off.

So... I have a couple of questions:

How much better is it to have a class to handle event dispatching Onload
rather than hardcoding the event?

Second - are there any (significant) unresolved cross-browser issues with
the class FastInit ?

Sam




___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] PNG and Alpha-Transparency

2006-06-19 Thread Sam
Title: Message



Is there a prototype 
/ extension which will assist in cross-browser support of PNG 
images?
 
http://www.alistapart.com/articles/pngopacity/
 
It seems to me that 
a class could be developed which would zip through the DOM and make changes 
where needed for IE 5.5 / IE 6.0 to handle PNG images.
 
I don't want to 
write one if it's been done before.
 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] PNG and Alpha-Transparency

2006-06-19 Thread Sam
I'm looking over these scripts for PNG transparency.  So many variables, so
little time...

Things to consider:  size of the code, reliability, but what is bothering me
is some of the scripts modify the  to the point that I am concerned
about whether the ID I have assigned to the image, along with the events,
will survive.  This would kill my application.

Of course I can test but first...

I normally use "View Generated Source" from the NLIS (in IE) or
http://chrispederick.com 's "Web Developer" for Firefox to view the HTML
additions and updates made by JavaScript.  Both have worked flawlessly in
the past.

However, using Dean Edward's IE7, the NLIS "View Generated Source", shows no
changes to the HTML at all.  This can't be true, so I have two problems.
Why is NLIS not showing the changes, and (2) What is Dean Edwards method?
Does it  the  and nuke the  like the other
solutions?

Last, it seems like the solutions I've tested leave IE 6 in a "loading page"
state.  The status bar shows it's loading the png image, and the cursor is
an hourglass when hovered on the browser menus (but the browser is not
"locked")  yet the page appears fully rendered.  I wonder what's up with
that, and that makes (3) problems that need answers.

I'm digging away, if anyone knows the answer, it could save me some time.

Sam




___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] PNG and Alpha-Transparency

2006-06-19 Thread Sam
Thank you everyone for forwarding the references to so many good PNG
solutions.  I was able to resolve my  issues posted earlier and can now say
some of the solutions seem very good.

Dean Edward's solution is neat in that it doesn't require wrapping the 
with spans and the http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html

Which gives a 4Kb JavaScript and renders nearly an identical solution as
shown by "View Generated Source".  Retains the http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] PNG and Alpha-Transparency

2006-06-19 Thread Sam
Title: Message



Ken,Thanks for the snippet.  It was so 
short even I could understand the code.Here's a snippet to modify 
the filename on mouseover / mouseout for pngs in IE or whatever browser.  
IT checks for the filter style and if present, modifies that attribute, not the 
src attribute.
function pngHover(event) { if(event.type 
== 'mouseover')  {  if(this.style.filter) // add -hover to 
filename on mouseover   this.style.filter = 
this.style.filter.replace('.png', 
'-hover.png');  else   this.src = 
"" '-hover.png'); } else 
{  if(this.style.filter) // remove -hover from filename on 
mouseout   this.style.filter = 
this.style.filter.replace('-hover.png', 
'.png');  else   this.src = 
"" '.png'); }}
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Multiple Ajax.Request or Ajax.Updater

2006-06-20 Thread Sam
var call1 = new Ajax.Updater(
'id1',
'/foo1.html',
{
method: 'post'
});

var call2 = new Ajax.Updater(
'id2',
'/foo2.html',
{
method: 'post'
});

Looks like there's no parameters.  Would method: 'get' perform any better?

3 seconds?  Is there a network problem or a large chunk of data?

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Implementing a boolean "switch" in a Class

2006-06-20 Thread Sam
Title: Message



I need a single 
boolean which would be "globally" accessible to all instances of a 
class.  Seems like the boolean should be in the class prototype, but I 
was troubled by the difficulty of setting the prototype boolean to 
true.  Maybe I'm missing something?
 
var MyObject = 
Class.create();
 
MyObject.prototype = 
{
 bSwitch: 
false,
 ... other 
methods and properties
}
 
var oMyOb1 = new 
MyObject();
var oMyOb2 = new 
MyObject();
alert(oMyOb1.bSwitch); // reports false 
alert(oMyOb2.bSwitch); // reports 
false
 
Now set the value of 
bSwitch to true so all the oMyObN's will see a true value.
 
I can see the 
following methods...
 
// __proto__ works 
in Firefox/Safari but isn't available in IE...
oMyOb1.__proto__.bSwitch = true; 

alert(oMyOb1.bSwitch); // reports true 
alert(oMyOb2.bSwitch); // reports 
true
 
// This changes bSwitch 
for a single instance.  Not in the prototype.
oMyOb1.bSwitch = 
true;

alert(oMyOb1.bSwitch); // reports true 
alert(oMyOb2.bSwitch); // reports false, not 
what we want.
 
// Seems strange to me to reference the Class, but this 
works...
MyObject.prototype.bSwitch = true; 

alert(oMyOb1.bSwitch); 
// reports true 
alert(oMyOb2.bSwitch); // reports 
true
 
// It's a little more satisfying to create a 
method to hide this reference to the class...

MyObject.prototype = 
{
 bSwitch: 
false,
 setSwitch: 
function() {MyObject.prototype.bSwitch = true;} 
}
// Now this works, and only requires a 
reference to a method on an instance 
oMyOb1.setSwitch(); 

alert(oMyOb1.bSwitch); // reports true 
alert(oMyOb2.bSwitch); // reports 
true
 

// I thought all 
objects had prototypes.  Why doesn't this work?
oMyOb1.prototype.bSwitch = true;  // error:  oMyOb1 
is not a function
 Is there another method that I've missed?  
Did prototype.js extend __proto__ to work in IE?
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Implementing a boolean "switch" in a Class

2006-06-21 Thread Sam
Title: Message


Nope... in fact this is one of the "dynamic" benefits of a prototype based 
object system.  Changing the prototype of the "class" function (the 
function from which the other references are constructed), changes the state of 
all instances automatically. MyObject.prototype.bSwitch = true; is the 
correct way to achieve what you are looking for. Why would you want to do this 
by using an instance of said class? It seems to me you'd _want_ to _not_ have to 
know what instances are floating around in your application, so the "class" 
function's prototype is the natural place to make this change. In other words, 
you have 10 widgets and a couple of flibbets, maybe a few woozles on your page, 
each of them possibly containing N instances of MyObject. Why would you want to 
have to know the name of one of those instances to set this switch across all of 
them... see my point? 
After declaring the Class, I've never had to mess with 
a class before.  This takes some getting used to, and it seems strange that 
I can't reference the class / constructor from an instance without knowing 
the constructor's name???
 
I was under a mistaken assumption 
that
 
oMyObj1.prototype
 
would move up the prototype chain to reach the constructor 
function MyObject. 
 
If
 
var oMyObj5 = new 
MyObject();
 
doesn't it make sense that there should be a pointer on the 
oMyObj5 object which points back to the constructor function?  Without 
__proto__, there's no way to reach back to the constructor without 
knowing the constructor's name?
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Implementing a boolean "switch" in a Class

2006-06-21 Thread Sam
Title: Message



Also... you said:** After declaring the Class, I've never had to mess with 
a class before.:-) you're still thinking of _javascript_ as a classical OO 
language, when it's not. Embrace the power of the 
prototype.Yes, my problem is getting to the point where 
this "feels" right.  
 
oMyObject.constructor.prototype.bSwitch = true; // doesn't produce an 
error, and doesn't change the global value in the class prototype, so what 
is it changing?
 

var test = function () {}
test.prototype = {color: 'red'};
var oTest1 = new test();
var oTest2 = new test();
oTest2.__proto__.color = 'blue';
alert('oTest1:color=' + oTest1.color + ' oTest2:color=' + oTest2.color); // blue blue
test.prototype.color = 'green';
alert('oTest1:color=' + oTest1.color + ' oTest2:color=' + oTest2.color); // green green
oTest1.constructor.prototype.color = 'purple';
alert('oTest1:color=' + oTest1.color + ' oTest2:color=' + oTest2.color); // green green -- not what we want
  ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

RE: [Rails-spinoffs] Implementing a boolean "switch" in a Class

2006-06-21 Thread Sam
Title: Message



Hmm, interesting. Frankly, i have no idea about the constructor thing -- 
half expected it to throw an error. But I'm still not sure why you're so 
reluctanct to use the main prototype; this is what it's for. Ultimately, you're 
looking for a way to use an instance to _get_at_ the main prototype... so why 
not just do it directly? It's a feature of the language, man. 
test.prototype.color = 'purple'; 
I 
believe you are right.  It took a little getting used to, so no 
problem, and I'm glad to have had some confirmation of that approach in this 
thread.
 
So... 
what does oMyInstance.contructor point to and how would I find out?  
;-)
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Implementing a boolean "switch" in a Class

2006-06-21 Thread Sam
Title: Message



Not sure... but i'd start by inspecting it, using various different 
"classes"...for (var p in oMyInstance.constructor){
alert("p = " + 
oMyInstance[p]);}
 Seems to point to nothing in Firefox anyway, the only 
property returned is:  color='purple';
 

[Rails-spinoffs] Ajax in IE 5.5 / Win 98

2006-06-22 Thread Sam
Title: Message



Are Ajax requests 
available in IE 5.5 / Win 98?
 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Ajax in IE 5.5 / Win 98

2006-06-22 Thread Sam
Title: Message




 >  As 
far as I know, all the way back to 5.0.  Prototype, however, doesn’t work 
in 5.0, but does work in 5.5 when things like array.push() and for…in were added 
(odd that such basic language features were missing from 
5.0).
 
 
I'm getting an Ajax error loading a URL.  I don't 
have much diagnostic code... ;-)
 
  loadPageError:  function(request) 
{   alert('An error occurred loading the URL: ' + 
this.URL);  },
Does the parameter (request) or the "this" object hold error information 
that I can alert?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Ajax in IE 5.5 / Win 98

2006-06-22 Thread Sam
Title: Message



My earlier question wasn't stated 
well...
 
I get an Ajax onFailure error in IE 
5.5/Windows 98 only.  Here's the 
request...
 
   new Ajax.Request 
(sUrl{ method:  'get', 
 parameters: '', 
 onFailure: this.loadPageError.bind(this), onComplete: this.loadPageFinish.bind(this),
 onException: 
this.loadPageException.bind(this)});
Looking at prototype.js, the success / failure routines 
are called with parameters:
 
onSuccess(transport, json)  OR 
 onFailure(transport, json)
 
The 
parameter transport is confusingly referred to as "request" in most 
software I've seen using prototype.js, but transport does return 
transport.status, which has a value of 501 in IE 5.5.  
 
Using 
Google, "XMLHTTP 501", I found this thread
 
http://www.html.com/forums/_javascript_/10018-ajax-problem-501-not-implemented.html
 
which 
goes into a lot of other detail on this error but suggests the server is 
responding 501 because it receives a "get" not a "GET".
 
Now 
maybe Windows 98 should make this case-correction of get to GET, but I simply 
changed my call (shown above) to method: "GET" and IE 5.5 / Win98 is working 
fine now.
 
Seems 
to me that this is a rare error, but prototype.js would be a better place for 
this fix... especially since line 674:
 
  if (this.options.method 
== 'get' && parameters.length > 0)
will 
fail if the user passes "GET".
 
Sam
 
 
 
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Ajax in IE 5.5 / Win 98

2006-06-22 Thread Sam
Title: Message



I 
think the fix for Ajax 501 error in prototype.js would be to force the method to 
upper case on the transport.open line 679
 
  
this.transport.open(this.options.method.toUpperCase(), 
this.url,
 
Sam

___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Ajax in IE 5.5 / Win 98

2006-06-22 Thread Sam
Title: Message



I 
don't have any idea how to log a bug report so if anyone here would do it that 
would be fine with me.
 
Sam
 
 

-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
Gregory HillSent: Thursday, June 22, 2006 3:26 PMTo: 
rails-spinoffs@lists.rubyonrails.orgSubject: RE: [Rails-spinoffs] 
Ajax in IE 5.5 / Win 98

That would definitely 
do it.  Send a bug report to Sam, who maintains prototype.  He’s never 
replied to my bugs in the past, but most of them eventually got fixed.  
Should probably also fix that line where it looks for ‘get’ to compare in lower 
case, while you’re at it. That way it’ll accept any case and send it on 
correctly.
 
if 
(this.options.method.toLowerCase() == ‘get’)
 





From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of SamSent: Thursday, June 22, 2006 1:20 
PMTo: rails-spinoffs@lists.rubyonrails.orgSubject: RE: [Rails-spinoffs] Ajax in IE 5.5 / Win 
98
 

I think the fix for 
Ajax 501 error 
in prototype.js would be to force the method to upper case on the 
transport.open line 679

 

  
this.transport.open(this.options.method.toUpperCase(), 
this.url,

 

Sam

 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Ajax in IE 5.5 / Win 98

2006-06-22 Thread Sam
I'd encourage you to learn.  It's good for the soul.  And it tastes
great.  AND it's less filling.

http://dev.rubyonrails.org/

OK.  I've submitted a ticket with the patch.

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] multi file uploader

2006-06-23 Thread Sam
Looks good.  How about posting a URL explaining how it works ?

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] OT: Debugging iBook --- help

2006-06-23 Thread Sam
Title: Message



This is way OT, but 
here goes...
 
I've had an iBook 
for 2 days now and am debugging a web built with prototype/script aculo / 
windows / etc...  I have no real experience on a Mac.
 
Occasionally, 
there's no better way to debug _javascript_ than an alert in a loop... 
Once I have 
the information information I want from the alert, the loop may want to execute 
another 300 times.  I have no idea how to kill Safari like I would do 
on a PC: CTRL+ALT+DEL, select the task, and stop.  Any help on how to abort 
Safari when it is hovering on an alert?
 
Second,  any 
suggestion as to a good _javascript_ debugger for Safari?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] JavaScript Compression

2006-06-25 Thread Sam
Title: Message



Is there a good 
windows-based _javascript_ compressor which will reliably compress script aculo 
and prototype?
 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] JavaScript Compression

2006-06-25 Thread Sam
http://dojotoolkit.org/docs/compressor_system.html

Sounds promising.  I'll see if I can survive the setup !  ;-)

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] JavaScript Compression

2006-06-25 Thread Sam
> It is Java-based, so should run on windows without a problem. It isn't a 
> polished GUI at the moment, you'll need to do a bit of scripting to get it

> set up.  More details here:

> http://dojotoolkit.org/docs/compressor_system.html

Here's a batch file I used to compress all my JavaScripts... It put the
compressed *.js files in a subfolder compress, and references the rhino.jar
on my drive D. 

MD compress
FOR %%f IN (*.js) DO java -jar d:\rhino\custom_rhino.jar -c %%f >
compress/%%f 2>&1
Pause

I see about a 30% to 40% reduction in file size, and amazingly, everything
ran the first time.  Compressed prototype.js, script aculo, windows and
more...

I imagine the success of this compression engine is due to the hooks into
the Mozilla JavaScript engine to get the parsing correct...

I'm happy to have found this tool.

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] JavaScript Compression

2006-06-26 Thread Sam
Title: Message



Can _javascript_ files be gzip'ed in advance, stored on a server and 
delivered reliably to all browsers?  Any browser 
exceptions?
 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Prototype Ajax event handlers

2006-06-26 Thread Sam

function updateCalendar(today, id){
   new Ajax.Updater("calendars", "calendar.inc.php",
 {asynchronous: true,
  onCreate: function(){ showBusy },
  onComplete: function(){ hideBusy },
  method: "get",
  parameters: "today=" + today +"&hotel_id=" +
""
  });
}

It doesn't take long to pull a request.  Maybe the hide event occurs before
the show event has a chance to display?  Did you try to breakpoint (or
alert();) these handlers ?

If you want to show an activity icon, there's also a "global" way of  doing
this:

// Show Ajax progress indicator
var myGlobalHandlers = {
onCreate:   function() {
$('ajaxworking').style.visibility = 'visible';
},

onComplete: function() {
$('ajaxworking').style.visibility = 'hidden';
}
};
Ajax.Responders.register(myGlobalHandlers); // Register
the handlers for content update

And if you need a spinner...

http://www.napyfab.com/ajax-indicators/

The only comment I have on the code you've written, is sometimes I need to
.bind(this) to the event handlers: e.g., OnComplete: showBusy()...  Oops,
there's the problem.  You didn't include parens to invoke your handler.

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


Re: [Rails-spinoffs] Drag'n'drop DOM elements between (I)FRAMEs

2006-06-26 Thread sam
I have *heard* of people doing this by using the parent window to  
store and mediate state between the 2 child iframe windows. So when a  
drag was in progress, and the mouse coord reached the edge of the  
iframe window, you would notify the other iframe to start listening  
for mouseover events and create the illusion of a seamless "drag". But  
I've never actually seen it done - and as you can imagine it would be  
prone to all kinds of problems with missed events.


Also, it should go without saying that all partipating documents would  
have to be under the same domain.


Sam
-i-am

Quoting Lindsey Simon <[EMAIL PROTECTED]>:


No, you cannot do that. Dragging into window instances across others
should not allow this for security reasons anyhow. It would be cool
though, as then you could drag draggables from one window to another.
This has nothing to do with Mozilla Firefox.


___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Ajax - Inserting selected elements from request.responseText

2006-06-26 Thread Sam
Title: Message



After retrieving a 
URL using an Ajax.Request...
 
function onComplete 
(request, json) {
// 
request.responseText holds the entire page
 
Only the 
content contained in elementID = 'source' is intended for 
display
 
At this time, the 
following code works, but it disturbingly copies the entire page from 
the source URL into the target DIV
 

$('target').innerHTML = request.responseText; // copy the entire page
$('target').innerHTML = $('source').innerHTML; // remove everything bur 
the content of element 'source'
 
Any suggestion for a method to copy only 
the innerHTML of 'source'  ?
 
Sam
 
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Re: Ajax - Inserting selected elements fromrequest.responseText

2006-06-27 Thread Sam
Sam wrote:
> After retrieving a URL using an Ajax.Request...
>  
> function onComplete (request, json) {
> // request.responseText holds the entire page
>  
> Only the content contained in elementID = 'source' is intended for display
>  
> At this time, the following code works, but it disturbingly copies the 
> entire page from the source URL into the target DIV
>  
> $('target').innerHTML = request.responseText; // copy the entire page
> $('target').innerHTML = $('source').innerHTML; // remove everything bur 
> the content of element 'source'
>  
> Any suggestion for a method to copy only the innerHTML of 'source'  ?

Mark wrote:
>You'd probably have to use Javascript's regular expression matching
>to extract the section of the page text string that's inside the tag
>having the id="source" attribute.

Ack!  I was hoping I could manipulate the incoming stuff with more of an
"out of " experience.

oMyDiv = document.createElement('div'); // this div isn't attached to the
dom

oMyDiv.innerHTML = request.responseText ; // Stuff the external page URL
into this DIV

// hocus pocus... 
$('target').innerHTML = oMyDiv.getElementByID('source').innerHTML ;  // in
your dreams

My understanding is that until the incoming 'source' HTML is attached to the
DOM, it stays as HTML and isn't OO.  If this is right, then yes, I'd need a
regEx.

I'm off to the regEx forum for assistance.  This problem is what regEx was
created for.  Anyone have a regEx to pull the content of element 'source'
out of a page?

Thomas - thanks for your comments.  I'm stuck reading html from a
non-scripting server, so I've got to do this the hard way, but thanks.

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Re: Ajax - Inserting selected elementsfromrequest.responseText

2006-06-27 Thread Sam
Mark wrote:
>If your problem is not speed, but having the whole page flash briefly, you
>can use this method within an invisible div (div.style.display = 'none').

Good question.  I think the answer is: "it bothers me".  I know that sounds
bad, but I could be influenced into not caring.  I see no performance hit,
no flash, and I test in several browsers: FF, IE, Safari.  It bothers me to
be stuffing DOCTYPE,  into a div contained in an already
well-formed DOM.  It seems like something bad *should* happen, but nothing
has (yet).

If anyone can confirm that this is a regular practice and I shouldn't worry
about it, I think I could walk away from this problem.  

BTW: I don't want to use an iFrame to hold the document.  I'm trying to keep
the page frameless.

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] iframe ... does it have an innerHTML ?

2006-06-27 Thread Sam
Title: Message



If I dynamically 
create a hidden iframe, how could I add a document in a string to that 
element?
 
e.g.,
 
var sDocument = 
'Hello 
world.';
 
I've tried several 
variations of appendChild, innerHTML, document.innerHTML, 
createTextNode.
 
Argh!
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] iframe ... does it have an innerHTML ?

2006-06-28 Thread Sam
Title: Message




Important 
to remember that using document.open/close/write from _javascript_ during 
non-loading period will cause the current document context to reset, meaning you 
lose what was previously there.
 
-  
var 
iFrame = document.createElement(‘IFRAME’);
-  
iFrame.src 
= "" //pretty sure you don’t need this
-  
iFrame.contentWindow.document.body.innerHTML 
= “blarrr”;
-  
iFrame.contentWindow.document.body.innerHTML 
+= “more BLAR”;
 
resetting the 
context of the enclosing body?  This means reloading an iframe 
will ...  fire a body onload event or 
what?
 
are you sure it 
doesn't reset the context of the iframe alone? (hopeful 
look)
 

 
  .. so using 
innerHTML avoids the context reset altogether...
 
thanks
 

 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] iframe ... does it have an innerHTML ?

2006-06-28 Thread Sam
Title: Message



Lets go 
to www.google.com

 
In the 
URL/address bar, clear any text there.
Type:    _javascript_:document.write(‘omg where did 
google go’ );
Press 
enter.
No 
onload, but google is now gone!
--
 
Thanks.  One last question to clean 
up...
 
oMyDiv = 
document.createElement('div');
document.body.appendChild(oMyDiv);
sMyText = 'Howdy!  This is western 
text!';
oMyDiv.innerHTML = 
sMyText;
oMyText = 
document.createTextNode(sMyText);
oMyDiv.appendChild(oMyText);
Does one method of adding innerHTML have benefits / 
features that the other does not?
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] iframe ... does it have an innerHTML ?

2006-06-28 Thread Sam
Title: Message




My use 
of innerHTML was only offered just in case he was going to be adding multiple 
strings to the IFRAME not knowing that using document.write clears the 
previously outputted text. I was hoping to head off future problems with the 
same issue for a developer new to 
_javascript_.
 
Your 
solution is truly a correct solution too. I was just trying to help the new 
guy.
 
The 
new guy appreciates your help...
 
Sam 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Event.observe for href

2006-06-28 Thread Sam
I'd like to have an onclick triggered by a href, but since href's
don't have id's, how do I use the Event.observe syntax with an href?

Just put an ID on the href.  It's allowed.



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Looking for Javascript IDE

2006-06-29 Thread Sam
Title: Message



Do any 
of these IDE environments have built-in FTP which will move "modified" files to 
the remote site?
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Ajax.Request abort question

2006-06-29 Thread Sam
Title: Message



im using an Ajax.Request to hit a java servlet and do some processing. 
during this time, if the user feels the process is taking too long, he/she can 
hit a cancel button to kill the request...    by calling 
the  abort function off of the transport, 
will that kill the processing that my server is doing as well or just make the 
client think that the process has ended?
 
right now i cant seem to get the servlet to stop processing even though the 
abort method has been called, im starting to think the abort method isnt the 
magic bullet that i was lazily hoping for can anyone help me out? 
-
 
I 
haven't had to do anything like this (yet), so I am not much help, but I will be 
interested in following this thread.
 
On 
this note, I have no idea if server-side SQL scripts are aborted if a user hits 
the "stop" button on a browser before the page is fully 
loaded.
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Ajax.Updater

2006-06-29 Thread Sam
Title: Message



Good 
point.  I had stayed away from this thread, but I was wondering why this 
alternative wasn't considered:
 
Add an 
HTML comment to the responseText (the content), e.g., 
 

 
(It 
could even be the first line)
 
Any 
condition (string, numeric or both) could tell the client-side a message without 
mucking with the Http conditions, which are tricky enough as they 
are.
 
Maybe 
the content is XML?  Add an XML element that describes the 
condition...  I suppose it depends heavily on the type of data 
stream...  perhaps modifying the http in (some) situations is 
correct.
 
BTW:  I've observed that when onFailure is called, onComplete is 
called immediately after.  I was surprised, and it changes what 
processing is expected in each handler.
 
Sam
 
 

-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
Martinez, AndrewSent: Thursday, June 29, 2006 8:54 
AMTo: rails-spinoffs@lists.rubyonrails.orgSubject: RE: 
[Rails-spinoffs] Ajax.Updater

I don’t mean to hijack the thread. I might 
possibly be misunderstanding Il Neofita’s intentions with positive/negative 
feedback. Just for clarifications here are the two meanings I can 
see:
 
1)   The Ajax 
operation was being used to send data to the server, the server would return a 
true/false value based upon that data that was computed server 
side.
 
2)   The Ajax 
operation was being attempted and the positive/negative feedback is being used 
to determine if the server is present, not present, or if the request failed due 
to some other network related problem.
 
 
Now, if we are in situation #1, is it 
really a good idea to use HTTP response failure headers, thus triggering the 
onFailure event, to signify an invalid computational value? Won’t we then lose 
the ability to tell if the serer is simply not present? I would imagine it would 
be better for the server to send response text back to the client that signifies 
a failure. Reserving error responses for situation 2, when we really need to 
know that the Ajax request isn’t being computed as a failure, it just isn’t 
reaching the server properly.
 
 
Unless situation #2 is what Il Neofita’s 
intention the entire time, then I am sorry to waste time.
 
There is of course another situation, where 
I am completely misunderstanding the importance of 
onFailure…..
 
-Andrew Martinez
 
-Original 
Message-
From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] Behalf Of Il 
Neofita
Sent: Thursday, June 29, 2006 4:08 
AM
To: 
rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] 
Ajax.Updater
 
Thank you, now everything is 
clear.
On 6/29/06, Thomas Fuchs 
<[EMAIL PROTECTED]> wrote:
A HTTP server returns a HTTP status code 
with every answer. The Ajax.Request object knows
about this, and will execute the onSuccess 
function only if a non-error status code was returned
(normally "200 OK"). You can also fine-tune 
this by using the various methods described on 
the Wiki page Martin 
mentioned.
 
Note that your server-side web development 
framework should allow you to set these status
codes. What do you use on the 
server?
 
For more info about this, see 
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html .
 
-Thomas
 
 
Am 28.06.2006 um 18:41 schrieb Il 
Neofita:
 
 
I cannot understand something 

 
with declaring this object new Ajax.Request 
I will request the page /my/url
however, on the server side, how should 
look the files? I canno tunderstand how can I give a positive o negative 
feedback 
 
Thank you and sorry for these basic 
question 
 
On 6/28/06, Martin Ström 
<[EMAIL PROTECTED] > wrote:
Something like this should do it: 

 
new Ajax.Request("/my/url", { 

    asynchronous: 
true,
    onSuccess: function(r) 
{
    $("myDiv").innerHTML = "updated! 
new contents " + r.responseText;
    }, 
    onFailure: function(r) 
{
    
alert("failed!") 
    }
})
 
 
See the docs ( 
http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request ) for more 
info
 
Ciao
Martin
 
On 6/28/06, Il Neofita < 
[EMAIL PROTECTED]> wrote: 
Hi Andrew,
I am not so good in Java, can you send me a 
basic example. 
 
Thank you 
 
On 6/28/06, Martinez, Andrew < 
[EMAIL PROTECTED]> wrote:
Don't use Ajax.updater. Use the regular 
Ajax object and then pass in your own onSuccess function handler/function 
pointer/functor. The handler/pointer/functor will receive the response test in a 
HTTP request object and you can evaluate it there. 
 
-Andrew Martinez
 
-Original 
Message-
From: 
[EMAIL PROTECTED] [mailto: 
[EMAIL PROTECTED] On Behalf Of Il 
Neofita
Sent: Wednesday, June 28, 2006 10:49 
AM
To: 
rails-spinoffs@lists.rubyonrails.org
Subject: [Rails-spinoffs] 
Ajax.Updater
 
Hi,
someone can help me, I am ot able to find 
the way how to user Ajax.updater to test if the request give some positive or 
negat

RE: [Rails-spinoffs] Ajax.Request synchronization (onSuccess beforeonComplete?)

2006-06-30 Thread Sam
Title: Message



Not 
sure if (2) is suggesting overlapping execution, but onComplete will be called 
after your onSuccess handler exits.
 
Sam
 
 

-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Hirn, 
JosephSent: Friday, June 30, 2006 10:34 AMTo: 
rails-spinoffs@lists.rubyonrails.orgSubject: [Rails-spinoffs] 
Ajax.Request synchronization (onSuccess beforeonComplete?)

2 questions regarding the 
synchronization of these events. 
 
1)   
is onSuccess called before 
onComplete ( I assume it is)
2)   
if called after, is onComplete 
called after the onSuccess method has completed or are you at the mercy of 
synchronization issues? 
 
Hopefully someone can enlighten me. 
I tried reading the Prototype.js but couldn’t seem to determine this on my own. 

___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] javascript woes with radio button groups

2006-06-30 Thread Sam
If all else fails, setup a 100ms periodic timer event handler.  Loop thru
the radio buttons, and you can decide when to move on from there.

Sam




___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] iframe ... does it have an innerHTML ?

2006-07-01 Thread Sam
Title: Message




And here 
is the kicker:

-  
In IE 
only: if you use innerHTML there is a 1ms-100ms lag between the DOM tree/DOM 
nodes being updated with your new HTML. However it is instantly visible to the 
user.
 
 
I have been using innerHTML to insert Ajax 
retrieved content and applying observers to that content using 
EventSelectors without any problem.
 
But I'd like to be safe.  Is there a safer way to 
know when the DOM tree is ready before applying observers 
?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Firefox Progress Indicator

2006-07-03 Thread Sam
Title: Message



Firefox has a 
page-load progress indicator in the bottom right of the status 
bar.
 
Why would it 
flash briefly when I hover over my navigation links?  there is an 
onMouseOver event which changes the image, so I guess that's a page-load 
progress.
 
It seems like a new 
side-effect.  I think I would have seen it before.
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Text sizing

2006-07-05 Thread Sam
Title: Message



 
I've had to worry 
about how different browsers render different screen sizes for text for 
years.  I don't want to use "px" for font-size as IE will cripple the 
browsers "VIEW, Text Size" control.  We need to keep the text-size browser 
control fully operational for accessibility and usability.  At the same 
time, we want text-laden pages to render "approximately" the same across all 
browsers on page load, normal text-viewing-size.
 
My reference on the 
subject has been the work of Owen Briggs:
 
http://www.thenoodleincident.com/tutorials/box_lesson/font/index.html
 
This work gets 
close, but for my purposes, it could be improved.  Firefox will always 
renders text noticeably larger  than IE and these are the two most 
significant browsers in our user base.  The page layouts differ more than I 
would like.
 
Using _javascript_, it 
might be possible to get a better match in IE and Firefox text-size 
by detecting the browser type and setStyle on the body {font-size: 
value} to a browser-specific setting such that the "normal" rendering size was 
the same across all browsers.  
 
Before I go off and 
invent the wheel again; has anyone seen anything like this done 
elsewhere?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Text sizing

2006-07-05 Thread Sam
It's been a while since I've researched pts, but I had to toss them years
ago.  Something about browser differences in rendering pts.

IE will fix fonts when px are used.  It's out.

Seems like ems or % are the available choices, but no setting will give you
what you want / need.

Which is why I'm thinking there ought to be a JavaScript to do the job.
I'll look around  for one, then try to write one if nothing is out there.

Sam


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew
Kaspick
Sent: Wednesday, July 05, 2006 1:49 PM
To: rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] Text sizing


I didn't see any reference to using pt for fonts.  I use pt for most
of my fonts and sizes seem the same across browsers.  Is there some
big bad reason for not using pt for fonts that I'm unaware of?

On 7/5/06, Sam <[EMAIL PROTECTED]> wrote:
>
>
>
> I've had to worry about how different browsers render different screen
sizes
> for text for years.  I don't want to use "px" for font-size as IE will
> cripple the browsers "VIEW, Text Size" control.  We need to keep the
> text-size browser control fully operational for accessibility and
usability.
>  At the same time, we want text-laden pages to render "approximately" the
> same across all browsers on page load, normal text-viewing-size.
>
> My reference on the subject has been the work of Owen Briggs:
>
> http://www.thenoodleincident.com/tutorials/box_lesson/font/index.html
>
> This work gets close, but for my purposes, it could be improved.  Firefox
> will always renders text noticeably larger  than IE and these are the two
> most significant browsers in our user base.  The page layouts differ more
> than I would like.
>
> Using JavaScript, it might be possible to get a better match in IE and
> Firefox text-size by detecting the browser type and setStyle on the body
> {font-size: value} to a browser-specific setting such that the "normal"
> rendering size was the same across all browsers.
>
> Before I go off and invent the wheel again; has anyone seen anything like
> this done elsewhere?
>
> Sam
> ___
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs




___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Text sizing

2006-07-05 Thread Sam
I wrote a test scrip which I've included below.  I was curious how Firefox
and IE handled default text sizes and the user changing the text size.

Here's the beef:

Default font sizes: Firefox 18px, IE 16pt.  This amounts to about 2px of
difference in the defaults  No percentage, e.g., body {font-size:76%} will
ever make IE and Firefox identical only closer.

Setting the css body {font-size: 12px} or {font-size: 12pt} will cause IE to
disable the browser's "View Text Size" control.  I guess this is why
percentages are preferred over px/pt in CSS-only solutions.  (Crippling the
view text-size reduces the accessibility for persons with poor vision, or
unusual monitor resolutions.).

Some good news:

Setting body {font-size:12px} (or any fixed size) will set both IE and
Firefox identical display sizes.  To avoid diminishing the accessibility, a
user control should be provided on the page to increase or decrease the
font-size for IE.  This is the path I am planning to take since there are no
other effective solutions.

I'm trying to decide if a slider or some other UI mechanism e.g. plus (+)
and minus(-) controls might be better or more obvious.

Sam

http://www.w3.org/TR/html4/loose.dtd";>



Untitled Document

body {
font-family:Arial, Helvetica, sans-serif;
}




getStyle('body', 'font-size')= 




$('getstyle').innerHTML = Element.getStyle('body', 'font-size'); 

var sTable = '\n<table id="mytable" border="0" cellspacing="0"
cellpadding="0" style="margin-left:50px;">';
for (var i=8; i < 20; i++) {
sTable += '\n  <tr><td align="right" style="font-size:' +
i.toString() + 'px">' + i.toString() +  'px [</td><td align="left">] ' +
i.toString() + '</td>';
sTable += '<td align="right" style="font-size:' + i.toString() +
'pt">' + i.toString() +  'pt [</td><td align="left">] ' + i.toString() +
'</td></tr>';
}
$('mydiv').innerHTML = sTable + '\n</table>';









___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Re: Text sizing

2006-07-06 Thread Sam

I'm not sure I understand this rational. It seems like the correct 
method for making a font the same size across all browsers is to used a 
fixed font size (px or pt). Under these situations IE is not accessible. 
This to me seems like a fine situation and no additional user control 
should be needed. The fault is in IE not your web page.

Good point, but I develop web pages for customers who require accessibility
in the contract.  IE is part of the mix of browsers.

I have to chop stones in the pit the way I'm told.

Sam




___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Text sizing

2006-07-06 Thread Sam
> Default font sizes: Firefox 18px, IE 16pt.  This amounts to about 2px of
> difference in the defaults

> Setting body {font-size:12px} (or any fixed size) will set both IE and
> Firefox identical display sizes.  To avoid diminishing the accessibility,
a
> user control should be provided on the page to increase or decrease the
> font-size for IE.

> I don't quite get it. Why do you care about the 2px difference at all?
> Your design is scalable (I assume this from the fact that you want to
> use a  font-resize control) and will look good in both cases.

I'll try to answer as best I can, correct a mistake I made, and mention
another hack solution I came up with.

The point (of not controlling default font sizes) has been argued quite a
bit over the years. At my company, we're all about designing fluid layouts.
Most of my work is exactly that.  The 2px difference is normally not a
factor.  I have a couple of instances where the 2px becomes an annoyance.

One is a customer who *requires* a fixed 800x600 layout.  No vertical
scrolling.  We design the text to fit and if the user increases the
font-size because he wants larger text... well, he will get scrolling and
that's OK.  

We design content for this fixed layout , then test in Firefox and get a
surprise vertical scroll (in normal text view).  The Firefox 2px is just
enough to push it over the edge.

This isn't a major problem, but it does seem like one that should be
controllable.  It would eliminate surprises, and unneeded revisions if the
difference were not present.  

I may have a solution.

--

I have a type-o above--- IE default is 12pt, which is almost exactly 16px.
Interesting that IE uses pts, every other browser I've queried using
getStyle shows px...

Every other browser I tested, Opera, Netscape, default to 16px.  

Firefox default is 18px.

The hack-fix I had in mind was to continue to use percentages, but adjust
for Firefox as follows...

Body {font-size: 75%} // places browsers with 16px defaults to 12px (Opera,
IE, Netscape)

Body {font-size: 66%} // places Firefox with 18px default to 12px

It takes a couple of lines of JavaScript to set the Body Font-size
accordingly, but the results are very close.  The View Text-Size works well
too, (in all browsers) keeping the accessibility in place.





___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Re: Text sizing

2006-07-07 Thread Sam
Title: Message



-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Ryan 
GahlSent: Friday, July 07, 2006 9:58 AMTo: 
rails-spinoffs@lists.rubyonrails.orgSubject: Re: [Rails-spinoffs] Re: 
Text sizing
A hack is nothing more than a creative solution, albeit short term and 
subject to breaking under the changing terms of future environments. But, then 
you as the creative solution engineer just find the new solution, always looking 
for the possibility of a more long term fix but not afraid to resort to black 
magic, general hackery, and other types of mysterious foo. -Ryan Gahl, 
2006 

This 
is my hack, and I'm sticking to it...
 
</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#ff size=2><SPAN class=234474315-07072006>body 
{</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#ff size=2><SPAN class=234474315-07072006>  
font-size: 76%;</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#ff size=2><SPAN class=234474315-07072006>  
}</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#ff size=2><SPAN 
class=234474315-07072006>
if 
(navigator.userAgent.indexOf('Firefox') > -1) {document.body.style.fontSize = 
'66%';}
 
If 
anyone can shorten it a bit, thanks in advance.
 
Sam 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] What effect is this

2006-07-09 Thread Sam
Title: Message



Script aculo has a 
"grow" effect, but can it do the following and if not is there a prototype.js 
add-on that will?
 
I'd like to have an 
icon in the header / footer of a page which when clicked, would be the source 
point for a window to "grow" and expand until centered in the 
display.
 
Can "grow" do this 
with the right positioning?
 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Sam
Title: Message



Is it 
easy to explain the difference between a hash
 
var 
myHash = {a: 'value for a'}
 
and an 
object
 
var 
myObject = {a: 'value for a'}
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] prototype hash method

2006-07-10 Thread Sam
Sam wrote:
> Is it easy to explain the difference between a hash
>  
> var myHash = {a: 'value for a'}
>  
> and an object
>  
> var myObject = {a: 'value for a'}

There is no difference between those. They are both associative arrays
(hashes).
---

Since prototype.js has Object and Hash methods, maybe my question should
have been something like:  "What is the reasoning behind why prototype
offers different properties and methods for Hash and Object types?"

Sam





___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Making HTML display-able on a page

2006-07-10 Thread Sam
Title: Message



For error reporting 
purposes, I'd like to take the data returned from an Ajax call, which 
should contain HTML, and display that HTML in an error reporting 
page.
 
Does prototype.js 
have a method which will convert an HTML string to display 
format?
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Hiding an event to launch a debug window

2006-07-10 Thread Sam
Title: Message



I'd like to leave 
some debug code on a website, the debug window made visible with an onClick 
event on some object, but requiring CTRL-ALT or some combination to be held 
down.
 
Is it possible to 
check state of keyboard keys in an onClick handler, or can anyone suggest some 
other technique which casual visitors would not stumble 
upon?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Hiding an event to launch a debug window

2006-07-11 Thread Sam
Title: Message



I 
appreciate your help.  I'm still at a loss.  Let me ask 
again with specifics.
 
I had 
in mind adding an onClick event handler to an image.  I wasn't able to 
field keypress events on the image (if I ) and I was wondering if I could 
interrogate the CTRL and ALT keys during the onClick event?
 
Sam

Sure 
  can... inspect the event object... i forget the exact names of the properties 
  you want, but http://www.w3schools.com 
  is great for looking this stuff up...and instead of Ctrl Alt, might i 
  suggest something harder to guess, like: up, up, down, down, left, right, 
  left, right, b, a, select, start? Oops, maybe you're not making AjaxContra, 
  huh? :-O 
  On 7/10/06, Sam 
  <[EMAIL PROTECTED]> 
  wrote:
  


I'd like to leave some debug code on a 
website, the debug window made visible with an onClick event on some object, 
but requiring CTRL-ALT or some combination to be held 
down.
 
Is it possible to check state of keyboard 
keys in an onClick handler, or can anyone suggest some other technique which 
casual visitors would not stumble upon?
 
Sam___Rails-spinoffs 
mailing listRails-spinoffs@lists.rubyonrails.org 
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Hiding an event to launch a debug window

2006-07-11 Thread Sam
Title: Message



I 
appreciate the posts and regret requesting what is obvious to many, but 
I wasn't 
sure what was meant by "this stuff" below.
 
Sam
 

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Ryan 
  GahlSent: Monday, July 10, 2006 10:04 PMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: Re: [Rails-spinoffs] 
  Hiding an event to launch a debug windowSure can... 
  inspect the event object... i forget the exact names of the properties you 
  want, but http://www.w3schools.com is 
  great for looking this stuff up...and instead of Ctrl Alt, might i 
  suggest something harder to guess, like: up, up, down, down, left, right, 
  left, right, b, a, select, start? Oops, maybe you're not making AjaxContra, 
  huh? :-O 
  On 7/10/06, Sam 
  <[EMAIL PROTECTED]> 
  wrote:
  


I'd like to leave some debug code on a 
website, the debug window made visible with an onClick event on some object, 
but requiring CTRL-ALT or some combination to be held 
down.
 
Is it possible to check state of keyboard 
keys in an onClick handler, or can anyone suggest some other technique which 
casual visitors would not stumble upon?
 
Sam___Rails-spinoffs 
mailing listRails-spinoffs@lists.rubyonrails.org 
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Hiding an event to launch a debug window

2006-07-11 Thread Sam
Title: Message



Thanks.  I appreciate your response and acknowledge that this 
question was too off-topic for this forum.
 
Sam
 

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Justin McCormackSent: Tuesday, July 11, 2006 10:49 
  AMTo: rails-spinoffs@lists.rubyonrails.orgSubject: RE: 
  [Rails-spinoffs] Hiding an event to launch a debug 
  windowI recently wanted to do something similar with 
  showing a debug output DIV. Here's my code:var BugTool = 
  Class.create();BugTool.prototype = {  element: null,  
  initialize: function(element, options) {    this.element = 
  $(element);    Event.observe(document, "keyup", 
  this.onKeyUp.bindAsEventListener(this), false);  },  
  onKeyUp: function(e) {    if(ev.ctrlKey && 
  ev.shiftKey && ev.keyCode == 66) { // 
  Ctrl+Shift+B  Effect.toggle(this.element, 
  "appear");    }  }}might be of some 
  use
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Re: Documenting Prototype...

2006-07-20 Thread Sam

Before I voice my view (from the bottom), let me say I've developed an
application which uses prototype.js, script aculo, and the "windows"
extension.  I've also made use of  Event Selectors and the "debug.js" which
is offered by the "windows" group.  I have an investment beyond academic
interest.

Our choice to develop with prototype.js resulted in a clean deliverable and
a development time which exceeded (in a good way) my expectations.  That
said, I have concerns similar to others voiced in this thread.  Prototype.js
is still on a "pre" release 1.5 (unless I missed a release?), and I have
never witnessed any participation from the developer.  Instead, there is
what appears to be a closed-door stance, resulting in zero-visibility
conditions of upcoming releases.  Worse, the lack of a "full" 1.5 release
suggests prototype.js has been abandoned in some way, in the best case for
2.0 development, which has no announced beta date.

This is a regretful set of circumstances given the satisfaction, and the
investment I have in prototype.js.  The author may surprise us with
prototype.js 2.0, next week, next year, or not at all.  (Does anyone know?)
In the meantime, the persistent uncertainty in prototype.js support has led
me to reluctantly look at the alternatives.  I do not look forward to
rewriting our application because the foundation library (prototype.js) has
a lack of support.

My confidence in prototype.js would improve if there were any developer
interaction..  At a bare minimum, planned release dates would be a real
confidence boost.  Better yet, some interaction in this forum.  No feedback,
in addition to a languishing "pre" release, is unacceptable.

Sam (C)





___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Prototype.js extension libs

2006-07-24 Thread Sam
Title: Message



Hope this isn't too 
OT or obvious.  I'd like to know if there are useful prototype.js 
extensions beyond the list I've compiled.
 
This is the list of 
complimentary software extensions which are based on 
prototype.js.
 
Any 
others?
 
Rico
http://openrico.org/rico/demos.page?demo=rico_drag_and_drop_custom_draggable
 
Event 
Selectors
http://www.encytemedia.com/event-selectors/
 
Script 
Aculo
http://script.aculo.us/
 
Window 
Class
http://prototype-window.xilinus.com/
 
There's a collection 
of widgets here, but the coffee ring on the server is still a problem...  
more of a blog than a set of extensions...
http://tetlaw.id.au/view/tags/query/tag/experiments/
 
Color 
Picker
http://www.knallgrau.at/code/colorpicker/
 
Tool 
Tips
http://boygeni.us/tooltips/
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] XML Question

2006-07-24 Thread Sam
Title: Message



 
I've got an XML file 
which is pretty well structured.  I need to retrieve specific elements from 
that file to fill out empty HTML elements on a page.
 
I think what I need 
is xPath?  Or - is that overkill?  Is there some easier way to locate 
an XML element?
 
What I have 
in mind is pulling the XML file using Ajax, then xPath to get the bits I 
need.
 
Am I on the right 
path and does prototype have an xPath capability?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] XML Question

2006-07-24 Thread Sam
Title: Message



If 
this XML file isn't a DOCTYPE (not a html/body/tag document), should I expect 
Ajax responseXML to build out an xml-doctree or should I move on to 
xPath?
 
Sam
 

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Kjell BublitzSent: Monday, July 24, 2006 11:37 AMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: Re: [Rails-spinoffs] 
  XML Questionhumm.. as far as i know if your server 
  delivers an XML file as text/xml or something similar then Ajax.request will 
  fill responseXML which contains the xml-doctree. With that you can use the 
  common DOM functions to wade through all the data and then fill your elements 
  as you like. Hope this helps.
  2006/7/24, Sam <[EMAIL PROTECTED]>:
  


 
I've got an XML file which is pretty well 
structured.  I need to retrieve specific elements from that file to 
fill out empty HTML elements on a page.
 
I think what I need is xPath?  Or - 
is that overkill?  Is there some easier way to locate an XML 
element?
 
What I have in mind is pulling the 
XML file using Ajax, then xPath to get the bits I need.
 
Am I on the right path and does prototype 
have an xPath capability?
 
Sam___Rails-spinoffs 
mailing listRails-spinoffs@lists.rubyonrails.org 
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] IE 7 to be a mandatory update

2006-07-27 Thread Sam
Title: Message



http://news.com.com/Microsoft+tags+IE+7+high+priority+update/2100-7350_3-6098500.html?tag=nefd.lede
 
Is anyone testing 
rails, script and other suites on the IE 7 platform?
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] New Microsoft IDE

2006-07-27 Thread Sam
Title: Message



Has anyone here 
evaluated Microsoft Expressions as a possible development 
IDE?
 
http://www.microsoft.com/products/_expression_/en/default.mspx
 
I haven't looked at 
the JS support beyond noticing that JS code is lightly color-coded, but on the 
surface, it has some features I consider mandatory for web development (e.g., 
templates).
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] New Microsoft IDE

2006-07-27 Thread Sam
Title: Message



I'm 
not as quick to discard Expressions as an enhanced FrontPage.  
(I've nothing positive to say about FP).  My interest is in 
finding an IDE that offers specific features.  The webs we 
develop are instructional and usually have between 50 to 100 pages.  I put 
a high value on HTML page templates which both Dreamweaver and this new MS 
Expressions both support.  I am dissatisfied with Dreamweaver performance 
in a few areas and am looking for any alternative which won't sacrifice what 
have become key IDE features to our web development 
method.
 
There 
are other IDEs which have superior depth in other areas, but I'm not aware 
of any which support HTML page templating.  I wonder why HTML 
page templates aren't available in more IDEs?
 
A 
couple of other features which I place a high (but not 
mandatory) value on include:  FTP, SFTP and remote / local file 
synchronization (a feature to identify which files have been 
revised).  It's convenient to PUT or GET a file directly from the IDE, 
especially when the file must be tested from a server-side 
environment.
 
Icing 
on the cake is an integrated checkin/checkout so multiple developers can work on 
the same website.  Better would be integrated source 
control.
 
There 
are many other features are important in an IDE but there are many IDEs to 
choose from which offer these features. 
 
HTML 
page templates, not so many choices.
 
Sam

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Ryan 
  GahlSent: Thursday, July 27, 2006 10:08 AMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: Re: [Rails-spinoffs] 
  New Microsoft IDELooks like nothing more than an updated 
  FrontPage with some Dreamweaver-esque candy. MS tools are extremely good when 
  it comes to backend development (in terms of ease of use, extensibility, and 
  developer productivity)... but I doubt they will be able to make any headway 
  as a design tool provider. Then again, it's MS, anything they send to 
  market will be profitable just based on sheer numbers. 
  On 7/27/06, Sam 
  < [EMAIL PROTECTED]> 
  wrote:
  


Has anyone here evaluated Microsoft 
Expressions as a possible development IDE?
 
http://www.microsoft.com/products/_expression_/en/default.mspx
 
I haven't looked at the JS support beyond 
noticing that JS code is lightly color-coded, but on the surface, it has 
some features I consider mandatory for web development (e.g., 
templates).
 
Sam
 ___Rails-spinoffs 
mailing listRails-spinoffs@lists.rubyonrails.org 
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] XML Question

2006-07-28 Thread Sam
Title: Message



 
... is 
the responseXML below available only in Mozilla?  I get nada in 
IE.
 
Sam

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Kjell BublitzSent: Monday, July 24, 2006 4:19 PMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: Re: [Rails-spinoffs] 
  XML QuestionI don't understand your question right, but 
  in some ways this understanding seems to be correct. Have you just tried 
  to request the xml document with the ajax class and had a look into 
  responseXML ?Here is how i do it. (copied from my recent project): 
  new Ajax.Request(tplpath + 'system/workdir/blocks.xml', 
  {    
  method:'get', 
  requestHeaders:['cache-control','no-cache','pragma','no-cache'],    
  onComplete:function(xmlresult) 
  {    
  if( xmlresult.responseXML.firstChild.nodeName == 'bloxpress') { // check if 
  first child is as 
  expected    
  Bloxpress.blocksParse(xmlresult.responseXML); // pass the responseXML to a 
  function 
      
  } else { 
      
  var blockMenuDiv = Builder.node('div', {id:'contentmenu', 
  style:'display:none'},['No Blocks 
  available']);    
  $(blockMenuTarget).appendChild(blockMenuDiv);    
  Bloxpress.blocksMenu = 
  $('contentmenu');    
  }    
  }    });
  2006/7/24, Sam <[EMAIL PROTECTED] >:
  


If this XML file isn't a 
DOCTYPE (not a html/body/tag document), should I expect Ajax responseXML to 
build out an xml-doctree or should I move on to 
xPath?

 
Sam

 

  
  -Original 
  Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On 
  Behalf Of Kjell BublitzSent: Monday, July 24, 2006 11:37 
  AMTo: rails-spinoffs@lists.rubyonrails.orgSubject: 
  Re: [Rails-spinoffs] XML Questionhumm.. as far as i 
  know if your server delivers an XML file as text/xml or something similar 
  then Ajax.request will fill responseXML which contains the xml-doctree. 
  With that you can use the common DOM functions to wade through all the 
  data and then fill your elements as you like. Hope this 
  helps.
  2006/7/24, Sam <[EMAIL PROTECTED]>: 
  


 
I've got an XML file which is pretty 
well structured.  I need to retrieve specific elements from that 
file to fill out empty HTML elements on a page.
 
I think what I need is xPath?  
Or - is that overkill?  Is there some easier way to locate an XML 
element?
 
What I have in mind is pulling 
the XML file using Ajax, then xPath to get the bits I 
need.
 
Am I on the right path and does 
prototype have an xPath capability?
 
Sam___Rails-spinoffs 
mailing listRails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
___Rails-spinoffs 
mailing listRails-spinoffs@lists.rubyonrails.org 
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] XML Question

2006-07-28 Thread Sam
Title: Message



Thanks 
(a lot! ).  I've had to rule out including a 100Kb xPath.js library.  
Maybe this lib is a better solution.
 
I 
diagnosed the problem with IE responseXML - if the file isn't served "up" as 
text/xml, IE doesn't make responseXML available.  (I was testing on my 
local hard-disk / no server).  Posting to a server solves this 
problem.  I can (will) live with that.
 
Sam

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Hill, GregSent: Friday, July 28, 2006 1:37 PMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: RE: [Rails-spinoffs] 
  XML Question
  
  No, it’s 
  available.  You might have to say responseXML.documentElement (not sure, 
  but I always do and it works).  Oh, and you could try changing ‘get’ to 
  ‘post’.  I’ve always had moderate to bad success in IE with ‘GET’ 
  requests on Ajax.  Even with no arguments, sometimes 
  IE just chokes on ‘GET’.  Haven’t really researched why it does that, but 
  ‘POST’ has fixed it in every case.
   
  If you look through 
  the archives, I posted a script that takes an xml document and parses it into 
  a nested _javascript_ hash, for quick and easy access to nested tags in 
  JS.  Might be useful to you, might not.
   
  Source is 
  here:
  http://greg.kathihill.com/content/jbhv/web/default/js/xml_doc.js
   
  It doesn’t handle 
  every type of XML tag, so you might need to expand it to cover 
  more.
   
  Example of 
  usage:
     show: function (response) {    var xmlDoc = new XMLDoc(response.responseXML.documentElement);    var results = xmlDoc.asHash();    if (results.found && results.found.length > 0) {  // any  tags are included in this array, it’s always an array, even if it has just one element  // attributes and text-only nodes are included as text, so results.found[0].id could be:  //  or 1    }  }
   
  Anyhoo, if that 
  helps, use it.  If it doesn’t, then bugger off J  I find it 
  simplifies a lot of code for me.
   
  Greg
   
  
  
  
  
  
  From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of SamSent: Friday, July 28, 2006 11:17 
  AMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: RE: [Rails-spinoffs] XML 
  Question
   
  
   
  
  ... is the 
  responseXML below available only in Mozilla?  I get nada in 
  IE.
  
   
  
  Sam
  
-Original 
Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Kjell BublitzSent: Monday, July 24, 2006 4:19 
PMTo: 
rails-spinoffs@lists.rubyonrails.orgSubject: Re: [Rails-spinoffs] XML 
Question
I don't understand your question right, 
but in some ways this understanding seems to be correct. Have you just 
tried to request the xml document with the ajax class and had a look into responseXML 
?Here is how i do it. (copied from my recent project): new 
Ajax.Request(tplpath + 'system/workdir/blocks.xml', 
{    
method:'get', 
requestHeaders:['cache-control','no-cache','pragma','no-cache'],    
onComplete:function(xmlresult) 
{    
if( xmlresult.responseXML.firstChild.nodeName == 'bloxpress') { // check if 
first child is as 
expected    
Bloxpress.blocksParse(xmlresult.responseXML); // pass the responseXML to a 
function 
    
} else { 
    
var blockMenuDiv = Builder.node('div', {id:'contentmenu', 
style:'display:none'},['No Blocks 
available']);    
$(blockMenuTarget).appendChild(blockMenuDiv);    
Bloxpress.blocksMenu = 
$('contentmenu');    
}    
}    
});

2006/7/24, Sam <[EMAIL PROTECTED] 
>: 



If this XML file 
isn't a DOCTYPE (not a html/body/tag document), should I expect Ajax responseXML to 
build out an xml-doctree or should I move on to 
xPath?


 

Sam


 

  -Original 
  Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Kjell 
  BublitzSent: Monday, 
  July 24, 2006 11:37 AMTo: rails-spinoffs@lists.rubyonrails.orgSubject: Re: [Rails-spinoffs] XML 
  Question
  humm.. as far 
  as i know if your server delivers an XML file as text/xml or something 
  similar then Ajax.request will fill responseXML which contains the 
  xml-doctree. With that you can use the common DOM functions to wade 
  through all the data and then fill your elements as you like. Hope 
  this helps.
  
  2006/7/24, Sam <[EMAIL PROTECTED]>: 
  
  
  
  
   
  
  I've got an XML file which is 
  pretty well structured.  I need to retrieve specific elements fro

RE: [Rails-spinoffs] XML Question

2006-07-28 Thread Sam
Title: Message



Greg,
 
OK, 
there's objects in objects.  Nice...
 
For 
debugging purposes, what's the simplest way to convert the entire returned 
object to a string for inspection?
 
Sam

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Hill, GregSent: Friday, July 28, 2006 1:57 PMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: RE: [Rails-spinoffs] 
  XML Question
  
  Well, I’m sure xPath 
  is a lot more flexible, but holy crap is that a lot of code.  As I said, 
  mine is limited, but serves my purposes very well.  And it’s generic 
  enough for anyone to use, although it only handles node types 1 to 3.  
  Anything beyond that will be ignored (or possibly break it, I haven’t tested 
  it thoroughly against other node types).
   
  http://www.devguru.com/Technologies/xmldom/quickref/obj_node.html#types 
  (node type information)
   
  Greg
   
  
  
  
  
  
  From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of SamSent: Friday, July 28, 2006 11:43 
  AMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: RE: [Rails-spinoffs] XML 
  Question
   
  
  Thanks (a lot! 
  ).  I've had to rule out including a 100Kb xPath.js library.  Maybe 
  this lib is a better solution.
  
   
  
  I diagnosed the 
  problem with IE responseXML - if the file isn't served "up" as text/xml, IE 
  doesn't make responseXML available.  (I was testing on my local hard-disk 
  / no server).  Posting to a server solves this problem.  I can 
  (will) live with that.
  
   
  
  Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] innerText idea??

2006-08-08 Thread Sam
Any info on how good/bad/ugly is the cross-browser support for:
 
var sText = obj.innerText || obj.textContent;
 
Sam




___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] requestHeaders: ['cache-control', 'no-cache', 'pragma', 'no-cache'],

2006-08-09 Thread Sam



Ajax.Request
 
 ... 
does
 
requestHeaders: ['cache-control','no-cache','pragma','no-cache'],
apply to both GET 
and PUT operations?
 
Can I ensure a page 
I retrieve will not be cached by the browser using Ajax.Request, 
GET?
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Parsing Querystring

2006-08-11 Thread Sam



Is there a function 
somewhere which will take a string containing a URL and return an object with 
all the querystring key / value pairs?
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] requestHeaders: ['cache-control', 'no-cache', 'pragma', 'no-cache'],

2006-08-12 Thread Sam



Thanks for the suggestion. I'll give it a 
try.
 
Sam

  
  
  From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Ryan 
  GahlSent: Wednesday, August 09, 2006 2:31 PMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: Re: [Rails-spinoffs] 
  requestHeaders: ['cache-control', 'no-cache','pragma', 
  'no-cache'],
  One sure fire way to prevent caching is to include a cache buster 
  in your request URL...var cacheBuster = "?" + new Date() * 1;var 
  url = "" + cacheBuster;...do Request...
  On 8/9/06, Sam 
  <[EMAIL PROTECTED]> 
  wrote:
  


Ajax.Request
 
 ... does
 
requestHeaders: ['cache-control','no-cache','pragma','no-cache'],
apply to both GET and PUT 
operations?
 
    Can I ensure a page I retrieve will not 
be cached by the browser using Ajax.Request, GET?
 
Sam
 ___Rails-spinoffs 
mailing listRails-spinoffs@lists.rubyonrails.org 
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Parsing Querystring

2006-08-12 Thread Sam
> There is one such function exactly:
> 
> String.toQueryParams()
> 
> var url = 'http://test.com/?this=test&perfect=true';
> var params = url.toQueryParams();
> 

I don't know how I missed this.  I'm guessing I had "whole word" set in my
editor search.

Thanks,

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Prototype $$ Question

2006-08-12 Thread Sam



Take a look at this:http://img238.imageshack.us/img238/5752/prototypeselectorduplicatesld7.pngThe 
image shows that $$ returns duplicates, is it supposed to do that, or is my 
CSS/HTML wrong? I don't understand your image, but glancing at the 
HTML, I can see that ID node_3_children satisfies $$('#tree .node 
.nodeChildren') once for nodeID node_1, and again for nodeID 
node_3.
 
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Prototype $$ Question

2006-08-13 Thread Sam



Funny... I don't know if you are not understanding me, or 
if I am not understanding you...
 
I just reviewed your graphic, and I see at the bottom, the 
output of $$ which exactly describes what I posted below.  Maybe I wasn't 
clear, and I apologies in advance that I'm about to write further on the same 
thing.
 
Some nodes satisfy the criteria #tree .node .nodeChildren 
more than once, and as a result, will be output more than once by the $$ 
function.
 
The node id node_3_children satisfies the criteria $('#tree 
.node .nodeChildren') once for nodeID node_1, and once again for nodeID 
node_3.  The problem here is #tree .node .nodeChildren allows any 
number of elements to appear between these attributes:  e.g., there may be 
3 , all of class .node, between #tree .node and 
.nodeChildren.  If you want to specify direct descendents only, you could 
try $$('#tree > .node > .nodeChildren'), but I don't know if $$ supports 
direct descendents.  It probably does, but I've never had the 
opportunity to test.  In my experience, nothing works until you see 
it  work.
 
Another solution if you want the nodeChildren only once, 
you could use $$('.nodeChildren') which will match each .nodeChildren only 
once.
 
Sorry if I'm not understanding your concern.  Maybe 
someone else can clear up the confusion.
 
Sam
 
 

  
  
  From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Brian PeirisSent: Sunday, August 13, 2006 12:53 
  AMTo: rails-spinoffs@lists.rubyonrails.orgSubject: Re: 
  [Rails-spinoffs] Prototype $$ Question
  yes, I expect $$('#tree 
  .node .nodeChildren') to return exactly those two elements, but 
  if you look along the bottom of the image where I've called $$('#tree .node .nodeChildren') in the _javascript_ Console you'll see that it returns 
  node_3_children 
  twice
  On 8/13/06, Sam 
  <[EMAIL PROTECTED]> 
  wrote:
  



Take a look at this:http://img238.imageshack.us/img238/5752/prototypeselectorduplicatesld7.pngThe 
image shows that $$ returns duplicates, is it supposed to do that, or is my 
CSS/HTML wrong? 
I don't understand your 
image, but glancing at the HTML, I can see that ID node_3_children 
satisfies $$('#tree .node .nodeChildren') once for nodeID node_1, 
and again for nodeID node_3.
 
Sam___Rails-spinoffs 
mailing listRails-spinoffs@lists.rubyonrails.org 
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs-- Brian PeirisBrampton, 
  Ontario, Canada[EMAIL PROTECTED] or [EMAIL PROTECTED] 

___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Prototype $$ Question

2006-08-13 Thread Sam
> 
> Looks like a bug to me, Brian.

I gave two examples of css selectors which ensure that the same node
wouldn't be returned more than once.   Seemed more productive than declaring
the software broken.

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Shorthand for "IN"

2006-08-13 Thread Sam



 
Somewhere in a 
prototype extension library, I noticed a shorthand (can't find it now) for 
testing whether an parameter is in a set of values.
 
The set was in an 
object or an array (don't remember) and resulted in an easy 
shorthand.
 
Maybe something 
like:
 
function myFunc 
(parm1) {
if( {2:2, 
5:5, 9:9, 17:17}[parm1] ) { // Is parm1 equal to 2, 5, 9 or 
17?
 
This seems more 
verbose that what I recall.  
 
What's a 
good shorthand technique for testing whether a value is in a 
set?
 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] XML Question

2006-08-13 Thread Sam
Title: Message



I've had my Ajax XML reader working for a week now.  
Then I hit a snag late in the game (doesn't work in IE) explained by Dean 
Edwards:
 
http://dean.edwards.name/weblog/2006/04/easy-xml/
 
Since request.requestXML.documentElement isn't available in 
IE, I'm experimenting with using the requestXML and searching the tree using 
getElementsByTagName.
 
I'm confounded by not being able to read the 
element attributes.  Here's a line of the XML:
 

 

request.requestXML.getElementsByTagName('Module')[0] // 
this will locate 
 
how to I get the value of 
attr?  It seems it should be
 
request.requestXML.getElementsByTagName('Module')[0].attr 
// but it doesn't exist...
 
Any ideas?
 
Sam
 
 

  
  
  From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  SamSent: Friday, July 28, 2006 1:17 PMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: RE: [Rails-spinoffs] 
  XML Question
  
   
  ... 
  is the responseXML below available only in Mozilla?  I get nada in 
  IE.
   
  Sam
  

-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
Kjell BublitzSent: Monday, July 24, 2006 4:19 
PMTo: rails-spinoffs@lists.rubyonrails.orgSubject: Re: 
[Rails-spinoffs] XML QuestionI don't understand your 
question right, but in some ways this understanding seems to be correct. 
Have you just tried to request the xml document with the ajax class and 
had a look into responseXML ?Here is how i do it. (copied from my 
recent project): new Ajax.Request(tplpath + 
'system/workdir/blocks.xml', 
{    
method:'get', 
requestHeaders:['cache-control','no-cache','pragma','no-cache'],    
onComplete:function(xmlresult) 
{    
if( xmlresult.responseXML.firstChild.nodeName == 'bloxpress') { // check if 
first child is as 
expected    
Bloxpress.blocksParse(xmlresult.responseXML); // pass the responseXML to a 
function 
    
} else { 
    
var blockMenuDiv = Builder.node('div', {id:'contentmenu', 
style:'display:none'},['No Blocks 
available']);    
$(blockMenuTarget).appendChild(blockMenuDiv);    
Bloxpress.blocksMenu = 
$('contentmenu');    
}    
}    });
2006/7/24, Sam <[EMAIL PROTECTED] >: 

  
  
  If this XML file isn't a 
  DOCTYPE (not a html/body/tag document), should I expect Ajax responseXML 
  to build out an xml-doctree or should I move on to 
  xPath?
  
   
  Sam
  
   
  

-Original Message-From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]] On 
Behalf Of Kjell BublitzSent: Monday, July 24, 2006 11:37 
AMTo: rails-spinoffs@lists.rubyonrails.orgSubject: 
Re: [Rails-spinoffs] XML Questionhumm.. as far as i 
know if your server delivers an XML file as text/xml or something 
similar then Ajax.request will fill responseXML which contains the 
    xml-doctree. With that you can use the common DOM functions to wade 
through all the data and then fill your elements as you like. 
Hope this helps.
2006/7/24, Sam <[EMAIL PROTECTED]>: 

  
  
   
  I've got an XML file which is 
  pretty well structured.  I need to retrieve specific elements 
  from that file to fill out empty HTML elements on a 
  page.
   
  I think what I need is xPath?  
  Or - is that overkill?  Is there some easier way to locate an XML 
  element?
   
  What I have in mind is pulling 
  the XML file using Ajax, then xPath to get the bits I 
  need.
   
  Am I on the right path and does 
  prototype have an xPath capability?
   
  Sam___Rails-spinoffs 
  mailing listRails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
  ___Rails-spinoffs 
  mailing listRails-spinoffs@lists.rubyonrails.org 
  http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Inspecting an object

2006-08-14 Thread Sam



I have code and 
objects which work great in Firefox, and blow up in IE.  I don't have an 
object inspector in IE comparable to Firefox's Firebug and am contemplating 
finding a function call to layout an object in text format so I could read it 
from my own debug console.
 
I'm considering 
using a function to convert the object to JSON for display.
 
What other solutions 
might be better?
 
Sam
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] XML Question

2006-08-14 Thread Sam
Title: Message



After reading the replies to Dean's article http://dean.edwards.name/weblog/2006/04/easy-xml/
 
it turns out that IE does support requestXML.documentElement , at least, Dean 
found that it did work after a while, but he doesn't explain what 
changed.
 
To my complete amazement, it's working for me too.  I 
wish I knew why.  Nothing has changed here.
 
Sam
 
 
 
 

  
  
  From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  SamSent: Sunday, August 13, 2006 10:29 PMTo: 
  rails-spinoffs@lists.rubyonrails.orgSubject: RE: [Rails-spinoffs] 
  XML Question
  
  I've had my Ajax XML reader working for a week now.  
  Then I hit a snag late in the game (doesn't work in IE) explained by Dean 
  Edwards:
   
  http://dean.edwards.name/weblog/2006/04/easy-xml/
   
  Since request.requestXML.documentElement isn't available 
  in IE, I'm experimenting with using the requestXML and searching the tree 
  using getElementsByTagName.
   
  I'm confounded by not being able to read the 
  element attributes.  Here's a line of the XML:
   
  
   
  
  request.requestXML.getElementsByTagName('Module')[0] // 
  this will locate 
   
  how to I get the value 
  of attr?  It seems it should be
   
  request.requestXML.getElementsByTagName('Module')[0].attr 
  // but it doesn't exist...
   
  Any ideas?
   
  Sam
   
   
  


From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
SamSent: Friday, July 28, 2006 1:17 PMTo: 
rails-spinoffs@lists.rubyonrails.orgSubject: RE: [Rails-spinoffs] 
XML Question

 
... is the responseXML below available only in Mozilla?  I get 
nada in IE.
 
Sam

  
  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
  Kjell BublitzSent: Monday, July 24, 2006 4:19 
  PMTo: rails-spinoffs@lists.rubyonrails.orgSubject: 
  Re: [Rails-spinoffs] XML QuestionI don't understand 
  your question right, but in some ways this understanding seems to be 
  correct. Have you just tried to request the xml document with the ajax 
  class and had a look into responseXML ?Here is how i do it. 
  (copied from my recent project): new Ajax.Request(tplpath + 
  'system/workdir/blocks.xml', 
  {    
  method:'get', 
  requestHeaders:['cache-control','no-cache','pragma','no-cache'],    
  onComplete:function(xmlresult) 
  {    
  if( xmlresult.responseXML.firstChild.nodeName == 'bloxpress') { // check 
  if first child is as 
  expected    
  Bloxpress.blocksParse(xmlresult.responseXML); // pass the responseXML to a 
  function 
      
  } else { 
      
  var blockMenuDiv = Builder.node('div', {id:'contentmenu', 
  style:'display:none'},['No Blocks 
  available']);    
  $(blockMenuTarget).appendChild(blockMenuDiv);    
  Bloxpress.blocksMenu = 
  $('contentmenu');    
  }    
  }    });
  2006/7/24, Sam <[EMAIL PROTECTED] >: 
  


If this XML file isn't 
a DOCTYPE (not a html/body/tag document), should I expect Ajax 
responseXML to build out an xml-doctree or should I move on to 
xPath?

 
Sam

 

  
  -Original Message-From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]] On 
  Behalf Of Kjell BublitzSent: Monday, July 24, 2006 
  11:37 AMTo: rails-spinoffs@lists.rubyonrails.orgSubject: 
  Re: [Rails-spinoffs] XML Questionhumm.. as far as 
  i know if your server delivers an XML file as text/xml or something 
  similar then Ajax.request will fill responseXML which contains the 
  xml-doctree. With that you can use the common DOM functions to wade 
  through all the data and then fill your elements as you like. 
  Hope this helps.
  2006/7/24, Sam <[EMAIL PROTECTED]>: 
  


 
I've got an XML file which is 
pretty well structured.  I need to retrieve specific elements 
from that file to fill out empty HTML elements on a 
page.
 
I think what I need is 
xPath?  Or - is that overkill?  Is there some easier way 
to locate an XML element?
 
What I have in mind is 
pulling the XML file using Ajax, then xPath to get the bits I 
need.
 
Am I on the right path and does 
prototype have an xPath

[Rails-spinoffs] OK. I'm confused again.

2006-08-14 Thread Sam

Prototype.js can be humbling.  Just when I think I've got a handle on how to
read inside-out, I find something I've never seen before and can't get my
head around.

I am chasing down a bug in my code which uses Element.classNames, so I
wandered off in prototype.js to see how classNames worked.

Contest: Explain clearly, with the fewest possible words, how this function
works:


Element.Methods = {

// other methods appear here

  classNames: function(element) {
return new Element.ClassNames(element);
  },





___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Parsing Querystring

2006-08-14 Thread Sam
> Just out of curiousity Sam, I notice that you are a frequent poster to
> this list. Are you writing anything specific or just having fun with
> javascript and prototype? Anything you can show off here?
> 

I'm working on an environment to host e-learning course content.
Unfortunately I can't send a sample URL  I'm pleased with prototype.js
cross-platform support, 3rd party extensions, and speed of development.

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


[Rails-spinoffs] Completely off-topic, so flame me

2006-08-15 Thread Sam



 
There's a lot of 
old-solutions to this problem lingering on Google, so it's difficult for me to 
determine if there's a more modern solution to this problem.  A customer 
posted a complaint yesterday about how I'm coding href's when an onclick event 
is used and the href should not be used.  It seems the complaint is that 
holding the shift key and clicking the link opens a new window pointing to 
_javascript_:void(0).  
 
Reminds me:  
Doctor, it hurts when I hit my head with this hammer...  (don't hold the 
shift key and click might be a solution)
 
href="" // I never 
do this
 
href="" // this is what I do, but I read void(0) is 
deprecated over null?
 
should I use 
something else?
 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: RE: [Rails-spinoffs] Completely off-topic, so flame me

2006-08-15 Thread Sam
Thanks everyone for your suggestions.  I'm off to experiment.

If I find anything useful, I'll post back.

Sam



___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: RE: [Rails-spinoffs] OK. I'm confused again.

2006-08-15 Thread Sam
> It creates a new class/object representing the class names. The class
> is called Element.ClassNames and it is extended by Enumerable. That
> means you can iterate through the element's class names. Pretty cool.

"Extended by Enumerable".  Thanks.  Now I know where to look.

A good answer usually raises other good questions.  It seems reasonable to
post those questions back here, though I am doing so only to share my
thoughts.  I hope to dig up the answers myself.

1 - Is every object that is extended by Enumerable going to have iterable
class names?

2 - Just how much "baggage" is too much in JavaScript?  Prototype is adding
*lots* of extra stuff to everything it touches.  When does it become a
problem? Will memory consumption become an issue, will CPU consumption go
through the roof scanning hundreds of methods and properties on every
object?




___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Completely off-topic, so flame me

2006-08-15 Thread Sam
> Exactly that is also my problem. Oky not mine but also a 
> customer of mine
> wants the shift click.
> Statement: Shift click does the same as click but opens in new window"
> Problem: I have some functionality that changes a area you could name
> display-area. The customer now argues that he expects the 
> display-area in a
> new window.

My thoughts:

 - Thomas' statement: when onclick returns *false*, the href isn't taken.
That solves many problems and I think was overlooked by critics of the
href=# option.

 - href="#" won't go to the top of page if onclick returns false, however,
href="javascript:void(0)" won't go anywhere no matter what the onclick event
handler returns.

 - IE will open a window in any case if the SHIFT key is held down.  I've
found no way to suppress this, except perhaps href="javascript:window.close"
;-) (think of the downside to this)

 - Regarding the overuse of links to reach an event handler:  I am one of
those coders who overuses links for onclick items which do not need to be
"links".  I do this believing it will be better for a screen reader to
understand.  I may be off on this, but a screen reader "knows" a link is
clickable.  I'm not sure it knows an  is clickable, especially if the
onclick is assigned dynamically.

 - Regarding comments on designing links which behave well when JavaScript
isn't enabled:  Some webs (e.g., the stuff we write) are run completely
wrapped in a JavaScript portal, a.k.a. "Learning Management System".
Designing links to perform favorably if JavaScript isn't enabled don't apply
to our development work.  The entire LMS would not run if JavaScript were
not enabled.





___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


RE: [Rails-spinoffs] Completely off-topic, so flame me

2006-08-16 Thread Sam
I agree with the issues you describe below.  These are real-world problems
when designing web pages for general audiences.

I doubt the inventors of "open in tab" and "open in new window" could
foresee these issues.

Sam

 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Tom Gregory
> Sent: Wednesday, August 16, 2006 12:02 PM
> To: rails-spinoffs@lists.rubyonrails.org
> Subject: Re: [Rails-spinoffs] Completely off-topic, so flame me
> 
> I think you've misunderstood part of what I'm trying to say. (Sample  
> file below.)
> 
> On Firefox 1.5/OS X and Firefox 1.5/WinXP
> 
> 1. When middle-clicking (or right-clicking and selecting "Open link  
> in new tab"),
> a. The javascript does NOT fire, and
> b. The link opens in a new tab.
> 
> So, if href="#", it opens a duplicate page, if href="javascript:void 
> (0);" it opens a blank tab.
> 
> 2. Oddly, when -clicking (to open in a new tab)
> a. The javascript DOES execute, and
> b. The link still opens in a new tab.
> 
> In other words, as a Firefox user, I will often middle click on  
> something that looks like a link--and the web app will not behave as  
> I expect it to.  Hence my suggestion to not use an href (and thus an  
>  tag) at all if you're trapping the onclick event but not linking  
> anywhere. I'd also suggest trying to find a way to either 
> make it not  
> look like a link but still look clickable (is that a paradox?) or  
> differentiate it visually somehow.  It's not just about "unobtrusive  
> Javascript" or "HIJAX," it's about behavior violating a user's  
> expectations.
> 
> For added fun, try middle-clicking on "Link 3" in Firefox.
> 
> On Safari 2.0, both when middle-clicking and -clicking, and IE/ 
> WinXP when - or -clicking, the javascript executes, but  
> no new link/tab/window opens.  (What I believe is expected 
> behavior.)  
> For both Safari and IE, right-clicking and selecting "Open link in  
> new tab/window" does not execute the js, and opens the link in the  
> new tab/window.
> 
> 
> -- TAG
> 
> http://www.w3.org/ 
> TR/html4/strict.dtd">
> 
> 
> 
> 
> //<![CDATA[
> var Debug = {
>   print: function (str) {
>   if (!this.debug) {this.debug = 
> document.getElementById("debug");}
>   this.debug.innerHTML += str;
>   },
>   println: function (str) {this.print(str + "<br />\n");}
> }
> 
> var Event = {
>   stop: function(event) {
>  if (event.preventDefault) {
>event.preventDefault();
>event.stopPropagation();
>  } else {
>event.returnValue = false;
>event.cancelBubble = true;
>  }
>}
> }
> 
> function click2() {
>   var e = window.event;
>   if (!e) {Debug.println("No event"); return false;}
>   Event.stop (e);
>   return false;
> }
> 
> function click3(e) {
>   Debug.println('Link 3 clicked');
>   if (!e) {e = window.event};
>   if (!e) {Debug.println("No event"); return false;}
>   Event.stop (e);
>   return false;
> }
> 
> window.onload = function () {
>   var el = document.getElementById("link3");
>   el.onclick = click3;
> }
> //]]>
> 
> 
> #link3 {
>   color:blue;
>   text-decoration: underline;
> }
> 
> 
> 
> 
> Link 1
> Link 2
> Link 3
> 
> 
> 
> 
> 
> 
> On Aug 15, 2006, at 12:47 PM, Sam wrote:
> 
> >> Exactly that is also my problem. Oky not mine but also a
> >> customer of mine
> >> wants the shift click.
> >> Statement: Shift click does the same as click but opens in new  
> >> window"
> >> Problem: I have some functionality that changes a area you 
> could name
> >> display-area. The customer now argues that he expects the
> >> display-area in a
> >> new window.
> >
> > My thoughts:
> >
> >  - Thomas' statement: when onclick returns *false*, the href isn't  
> > taken.
> > That solves many problems and I think was overlooked by 
> critics of the
> > href=# option.
> >
> >  - href="#" won't go to the top of page if onclick returns false,  
> > however,
> > href="javascript:void(0)" won't go anywhere no matter what the  
> > onclick event
> > handler returns.
> >
> >  - IE will open a window in any case if the SHIFT key is held  
> > down.  I'

[Rails-spinoffs] Keeping controls in the display

2006-08-16 Thread Sam



 
I have a few 
controls (submit buttons), which would be nice to keep in the display area when 
users vertically scroll to the bottom of the page.
 
Which Script Aculo 
function would I use to do this?
 
Sam
 
 
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


  1   2   >