Re: [Proto-Scripty] this and setTimeout in Prototype-based class
On 02 Dec 2009, at 15:25, fma wrote: But it does not work. In the _show() method, the call to this._flashNavButtons() leads to an error (this._flashNavButtons() is not a function). I think I understand why: when called from the timeout mecanism, 'this' no longer exists, or does not point anymore on my object... Is there a way to pass 'this' in the timeout callback? I also use such timeout callback to make the navgation buttons blink 3 times when the photo is opened in full size... Instead of relying on setTimeout, you would be better off just rewriting the whole thing in a more Prototype way and using Ajax to fetch the image, then use the callback to display the fullscreen version. Now if you still just want to get the setTimeout working, you probably could just use: setTimeout(function() {this._show}.bind(this),300); Best regards Peter De Berdt -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] InPlace[Collection]Editor deprecation layer
i came across this block of text in Scriptaculous controls.js 1.8.2 . 3: // DEPRECATION LAYER FOR InPlace[Collection]Editor! // This only exists for a while, in order to let // users adapt to the new API. Read up on the new // API and convert your code to it ASAP! As i use both of those Classes, i want to make sure i'm using the newer API, but there's no indication where i can read up on the new API, and the documentation on script.aculo.us is fairly vague about what's new and deprecated. Anyone have some kind of timeline for this deprecation? Where can i read up to make sure i'm current? Thanks. joe t. -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: this and setTimeout in Prototype-based class
On 3 déc, 17:34, Peter De Berdt peter.de.be...@pandora.be wrote: Instead of relying on setTimeout, you would be better off just rewriting the whole thing in a more Prototype way and using Ajax to fetch the image, then use the callback to display the fullscreen version. Thanks for you answer. I'm re-writing my code, using more Prototype features as I discover them ;o) Now if you still just want to get the setTimeout working, you probably could just use: setTimeout(function() {this._show}.bind(this),300); This works fine, but I'll have a look at Ajax.Request to fetch the image... Thanks for your answer! -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Using Ajax.Request to fetch an image
Hello, Could someone explain me how to fetch an image using Ajax.Request? I can only find how to retreive text/xml datas, but not binary datas... Thanks, -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] document.write() vs Element/appendChild()
I'm writing a javascript object to build a widget (which is reused in several pages). I first used document.write to create a few div. Then, I switched to Element to directly create the DOM. But in this last case, things don't work find under IE (but all is OK with Firefox). The problem is when I try to set the propertied of that divs from my javascript controller: it seems that using DOM, the position (fixed/absolute) is not well understood under IE. Here is my code: var ImageFullSimpleView = Class.create(AbstractView, { // View for full size image with only navigation buttons // initialize: function($super) { $super(fullSimple); }, createWidgets: function($super) { // Create widgets document.write(div id=\ + this._name + _mask\ class= \fullMask\/div\n); document.write(div id=\ + this._name + _content\ class= \fullContent\\n); document.write(img id=\ + this._name + _image\ class= \fullImage\ /\n); document.write(div id=\ + this._name + _prevButton\ class=\fullPrevButton\/div\n); document.write(div id=\ + this._name + _nextButton\ class=\fullNextButton\/div\n); document.write(div id=\ + this._name + _hideButton\ class=\fullHideButton\/div\n); document.write(/div\n); // Create bindings for widgets this.mask = $(this._name + _mask); this.content = $(this._name + _content); this.image = $(this._name + _image); this.prevButton = $(this._name + _prevButton); this.nextButton = $(this._name + _nextButton); this.hideButton = $(this._name + _hideButton); // // Create widgets using DOM (doesn't work well with IE) // this.mask = new Element('div', {'id': this._name + _mask, 'class': fullMask}); // document.body.appendChild(this.mask); // this.content = new Element('div', {'id': this._name + _content, 'class': fullContent}); // document.body.appendChild(this.content); // this.image = new Element('img', {'id': this._name + _image, 'class': fullImage}); // this.content.appendChild(this.image); // this.prevButton = new Element('div', {'id': this._name + _prevButton, 'class': fullPrevButton}); // this.content.appendChild(this.prevButton); // this.nextButton = new Element('div', {'id': this._name + _nextButton, 'class': fullNextButton}); // this.content.appendChild(this.nextButton); // this.hideButton = new Element('div', {'id': this._name + _hideButton, 'class': fullHideButton}); // this.content.appendChild(this.hideButton); this.mask.hide(); this.content.hide(); }, }); The CSS is: .fullMask { position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; background-color: black; opacity: 0.75; filter: alpha(opacity=75); z-index: 2; } .fullContent { position: fixed; left: 50%; top: 50%; z-index: 3; } .fullImage { border: 10px solid white; z-index: 4; } /* Common settings for navigation buttons */ .fullPrevButton, .fullNextButton, .fullHideButton { position: absolute; height: 100px; width: 100px; z-index: 5; cursor: default; opacity: 0; filter: alpha(opacity=0); background-repeat: no-repeat; background-position: center center; } .fullPrevButton { top: 50%; margin-top: -50px; right: 50%; margin-right: 50px; background-image: url(/icons/default/button-left.png); } .fullNextButton { top: 50%; margin-top: -50px; left: 50%; margin-left: 50px; background-image: url(/icons/default/button-right.png); } .fullHideButton { top: 50%; margin-top: 25px; left: 50%; margin-left: -50px; background-image: url(/icons/default/button-hide.png); } -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
[Proto-Scripty] Re: document.write() vs Element/appendChild()
BTW, what is the tag to format code on this group? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.