[ANN] Seaside 2.9.0-alpha3

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] Seaside 2.9.0-alpha3

Lukas Renggli
It has been some time since we released Seaside 2.9a2 and we figured
it was high time for another. We've been pretty busy over the past two
months and you will notice some significant changes since the last
release. The two most notable changes involve returning responses and
using continuations with #call:.

The RequestContext is now initialized with a Response object and
Request Handlers *must* configure that Response. It is no longer
possible to create and return a new Response object. This makes
streaming easier, cleans up a bunch of code, and means that you can
now easily add cookies during the action phase ("self requestContext
response addCookie: myCookie").

This release moves all uses of first-class continuations within the
main framework and moves them to an optional Seaside-Flow package.
Loading this package will enable the #call: method on Component as
well as a few other odds and ends. If you don't have support for
continuations or don't need to use #call:, you can now omit loading
them. We've also begun using partial or delimited continuations. This
should be more semantically correct, uses less memory, and removes the
need for the new process that was previously created when entering a
Session. If you'd like more information on partial continuations, you
can check out this blog post:
<http://blog.fitzell.ca/2009/01/seaside-partial-continuations.html>.


1. The Seaside Builder
======================

As with the previous release, the easiest way to load it is to use the
Seaside Builder to load the Seaside 2.9 packages you want into any
recent Pharo, Pharo-dev or Squeak image. Do not try to load into an
image that already contains Seaside 2.8, such as the Pharo-web images.
The Seaside Builder comes with an improved UI: a simple view that
makes the decision process of what packages to load much simpler, and
an advanced view that gives you the full control over all packages.

      http://builder.seaside.st

While it is theoretically possible to upgrade a 2.9a2 image to this
release using Monticello, we don't recommend it. Figuring what order
to load all the packages can be tricky and you can quickly find
yourself in a mess. Once we shift to a beta phase we will be sure to
facilitate upgrading; for now, you'll be better off loading this
release into a new image.

Please note, that the package Seaside-OmniBrowserTools requires a
recent installation of OmniBrowser. The Seaside Builder does not
currently load one for you.


2. Things to be aware of
========================

Please remember that this is an Alpha release and things are still
changing rapidly. It is probably not suited for production use; at
very least, you'll need to follow the development mailing list
closely.

You'll find a list of current migration issues at
<http://seaside.st/documentation/migration/28to29>.


3. When things go wrong
=======================

If you run into problems, please let us know using the issue tracker
at <http://code.google.com/p/seaside/issues/list> or through the
mailing list.


4. Closed Issues
================

Issue 17:  Halos leak memory on Squeak
Issue 19:  Behaviour of #initialRequest:/#updateUrl differs when using
session cookies.
Issue 22:  Decorations are rendered outside Halo of component.
Issue 31:  WAStaticHtmlCanvas and form elements
Issue 38:  WAExternalID reinitialzes PRNG on image startup
Issue 48:  cookies can not be added in callback phase
Issue 105: Remove url generation methods from WASession
Issue 109: Get rid of IDs for Styling
Issue 142: Make sure that collection attributes do not return their
actual collection object
Issue 151: WAProcessMonitorTest>>testTerminate
Issue 164: remove #testGarbageCollect?
Issue 169: Document response factory
Issue 177: figure out configuration for WACache
Issue 179: review mutexes in WACache
Issue 183: WAApplication>>description dependencies
Issue 198: WAResponse should not depend on WAApplication
Issue 199: review WAStandardFiles
Issue 203: add ""advanced"" flag to configuration attributes
Issue 207: WAUserConfiguration>>at:
Issue 210: Pad error responses
Issue 212: WASessionContinuation>>url method name
Issue 220: move WADispatcherViewer and so on into Environment
Issue 221: consider providing abstract implementation of
platform-specific classes
Issue 230: WAAdmin>>applicationDefaults keeps overwriting settings
every time it is called
Issue 231: cleaup configuration editor extensions to Configuration
Issue 236: look at returning responses
Issue 239: WAConfiguration>>addAncestorsTo:forAttributeAt:
Issue 245: WAHalo Source View is broken
Issue 247: WAValidationDecoration>>#validate does not work on all platforms
Issue 253: WAPackage is partly under-defined
Issue 255: Listing of files does not work (for me)
Issue 260: Load order problem with tests
Issue 264: Help Button in ""Seaside Control Panel""
Issue 265: WAControlPanel should display the Seaside Logo
Issue 266: remove uses of generic Error
Issue 268: Introduce WAMessageSend
Issue 269: Add server with same port in ""Seaside Control Panel""
Issue 270: WAExternalID raises an error when cryptography package is loaded
Issue 271: WAAttributeNotFound initialization method bypass standard
initialization
Issue 273: Seaside-Tests-Color package
Issue 274: Seaside Control Panel looks broken on Pharo
Issue 275: Comet is missing in builder.seaside.st
Issue 276: New Session link is broken
Issue 277: Add a seaside tab to /seaside/status
Issue 278: omnibrowser tools should be registered in the Open menu
Issue 280: no command to add a new server adaptor in OB control panel
Issue 281: Simplify builder UI
Issue 282: ReadStream>>#'next' might give an error when at end
Issue 283: rename #possibleCauses to #seasidePossibleCauses ?
Issue 284: WAResponse sends #application
Issue 285: respondAndContinue: does not use a SessionCallback
Issue 286: WAActionCallback>>isEnabled calls #requestContext
Issue 288: Create new root dispatchers from Seaside-OmniBrowserTools
Issue 289: Changes to Seaside-Tests-Core to address issues discovered
in GemStone port
Issue 290: WARenderCanvas referenced from Seaside-Tests-Core but not yet defined
Issue 291: WABufferedResponseTest fails because WriteStream does not
understand #'crlf'
Issue 292: Remove WAGemStoneMock* classes from Seaside-Tests-Core
Issue 293: Refactor WAResponse and subclasses to encapsulate stream
and use WriteStream instead of ReadWriteStream
Issue 294: Loading Seaside-Squeak-Platform gives walkback because
'WAPlatform current' is nil
Issue 296: WAFileHandler default is nil when running tests
Issue 297: WAEncoderTest has three failures
Issue 298: #upToAndSkipThroughAll: needs a test
Issue 299: closeThisPopup* should use builder
Issue 300: #passenger: produces invalid IDs
Issue 302: create tests for RSS-Examples and Comet-Core platform methods
Issue 304: caching session cookie state
Issue 305: move #nativeRequest to WARequestContext?
Issue 308: scriptaculous uses WAContinuation
Issue 310: #inNewRenderLoopCall: broken with partial continuations
Issue 311: Undefined globals and methods referenced in Seaside-Canvas
and Seaside-Canvas-Tests
Issue 312: WALeastRecentlyUsedExpiryPolicy uses non-portable approach
to increasing counter
Issue 313: Allow platforms to use an instance variable to cache
objects in WAFileLibrary
Issue 314: WAHtmlBuilder>>#'renderResponse:' calls WAResponse
class>>#'defaultValueForMimeType' that is not defined
Issue 315: WAResourceBaseUrlTest>>#'createHandlers' references
WAApplication that is not defined
Issue 316: WAInteractionTest>>#'testContentType' fails
Issue 317: WAApplicationTest>>#'testNotImplemented' fails
Issue 318: WAComponentPlatformTest>>#'testHaloClass' failure
Issue 320: WAMutex portability
Issue 326: Seaside-Tests-Flow depends on WAFunctionalTests
Issue 329: character set can not be specified for RSS
Issue 330: Not possible to add a new adapter if no adapters are defined
Issue 331: WAProcessStatus>>renderProcess:on: depends on WAInspector
Issue 332: JQuery-Core depends on Seaside-Tests-Functional
Issue 334: JSConversionTest>>#'testPoint' fails
Issue 335: Seaside BrowserEnvironment
Issue 337: Deprecate #register*Callback: methods
Issue 339: functional tests and webtools depend on Flow
Issue 342: Canonical URLs
Issue 343: update seaside adaptor for Swazoo 2.3
Issue 344: Swazoo adapor broken
Issue 345: unit tests needed for WAFileHandlerListing and its subclasses
Issue 346: platform test for #new:withAll:
Issue 347: canceling addition of a server adaptor doesn't work
Issue 348: bring back utf-8 fast path
Issue 350: Several WAMutexTests and one WAPlatformTest fail on VA Smalltalk
Issue 351: Add #size: to WAFileUploadTag
Issue 353: Manually calculate memory in WAMemory
Issue 358: Slime should not depend on Seaside classes
Issue 362: Comet is broken after response and encoding refactorings
Issue 365: Hide toolbar and halos when opening a tool
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Seaside 2.9.0-alpha3

Lukas Renggli
For the impatient I also uploaded a ready-made image that I created
while testing the Seaside Builder.

    http://builder.seaside.st/distributions/002-Seaside2.9.0-a3/Seaside2.9.0-alpha3.zip

The image contains all officially supported packages and is based on
the latest Pharo-dev by Damien Cassou. It is not a one-click image
yet, but that will certainly come with one of the next releases.

Lukas
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: [ANN] Seaside 2.9.0-alpha3

cedreek
Cool :)

Thanks all for the huge work you're doing ;)

Bye

2009/3/14 Lukas Renggli <[hidden email]>:

> For the impatient I also uploaded a ready-made image that I created
> while testing the Seaside Builder.
>
>    http://builder.seaside.st/distributions/002-Seaside2.9.0-a3/Seaside2.9.0-alpha3.zip
>
> The image contains all officially supported packages and is based on
> the latest Pharo-dev by Damien Cassou. It is not a one-click image
> yet, but that will certainly come with one of the next releases.
>
> Lukas
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



--
Cédrick
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: [ANN] Seaside 2.9.0-alpha3

Sebastian Sastre-2
In reply to this post by Lukas Renggli
I'm so happy. Thank you so much for that, this came in great time for me so I
feel this feeds seaside
momentum I hope others feel it too
best!
sebastian

> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre
> de Lukas Renggli
> Enviado el: Saturday, March 14, 2009 07:12
> Para: Seaside; Seaside - developer list
> Asunto: [Seaside] [ANN] Seaside 2.9.0-alpha3
>
> It has been some time since we released Seaside 2.9a2 and we figured
> it was high time for another. We've been pretty busy over the past two
> months and you will notice some significant changes since the last
> release. The two most notable changes involve returning responses and
> using continuations with #call:.
>
> The RequestContext is now initialized with a Response object and
> Request Handlers *must* configure that Response. It is no longer
> possible to create and return a new Response object. This makes
> streaming easier, cleans up a bunch of code, and means that you can
> now easily add cookies during the action phase ("self requestContext
> response addCookie: myCookie").
>
> This release moves all uses of first-class continuations within the
> main framework and moves them to an optional Seaside-Flow package.
> Loading this package will enable the #call: method on Component as
> well as a few other odds and ends. If you don't have support for
> continuations or don't need to use #call:, you can now omit loading
> them. We've also begun using partial or delimited continuations. This
> should be more semantically correct, uses less memory, and removes the
> need for the new process that was previously created when entering a
> Session. If you'd like more information on partial continuations, you
> can check out this blog post:
> <http://blog.fitzell.ca/2009/01/seaside-partial-continuations.html>.
>
>
> 1. The Seaside Builder
> ======================
>
> As with the previous release, the easiest way to load it is to use the
> Seaside Builder to load the Seaside 2.9 packages you want into any
> recent Pharo, Pharo-dev or Squeak image. Do not try to load into an
> image that already contains Seaside 2.8, such as the Pharo-web images.
> The Seaside Builder comes with an improved UI: a simple view that
> makes the decision process of what packages to load much simpler, and
> an advanced view that gives you the full control over all packages.
>
>       http://builder.seaside.st
>
> While it is theoretically possible to upgrade a 2.9a2 image to this
> release using Monticello, we don't recommend it. Figuring what order
> to load all the packages can be tricky and you can quickly find
> yourself in a mess. Once we shift to a beta phase we will be sure to
> facilitate upgrading; for now, you'll be better off loading this
> release into a new image.
>
> Please note, that the package Seaside-OmniBrowserTools requires a
> recent installation of OmniBrowser. The Seaside Builder does not
> currently load one for you.
>
>
> 2. Things to be aware of
> ========================
>
> Please remember that this is an Alpha release and things are still
> changing rapidly. It is probably not suited for production use; at
> very least, you'll need to follow the development mailing list
> closely.
>
> You'll find a list of current migration issues at
> <http://seaside.st/documentation/migration/28to29>.
>
>
> 3. When things go wrong
> =======================
>
> If you run into problems, please let us know using the issue tracker
> at <http://code.google.com/p/seaside/issues/list> or through the
> mailing list.
>
>
> 4. Closed Issues
> ================
>
> Issue 17:  Halos leak memory on Squeak
> Issue 19:  Behaviour of #initialRequest:/#updateUrl differs when using
> session cookies.
> Issue 22:  Decorations are rendered outside Halo of component.
> Issue 31:  WAStaticHtmlCanvas and form elements
> Issue 38:  WAExternalID reinitialzes PRNG on image startup
> Issue 48:  cookies can not be added in callback phase
> Issue 105: Remove url generation methods from WASession
> Issue 109: Get rid of IDs for Styling
> Issue 142: Make sure that collection attributes do not return their
> actual collection object
> Issue 151: WAProcessMonitorTest>>testTerminate
> Issue 164: remove #testGarbageCollect?
> Issue 169: Document response factory
> Issue 177: figure out configuration for WACache
> Issue 179: review mutexes in WACache
> Issue 183: WAApplication>>description dependencies
> Issue 198: WAResponse should not depend on WAApplication
> Issue 199: review WAStandardFiles
> Issue 203: add ""advanced"" flag to configuration attributes
> Issue 207: WAUserConfiguration>>at:
> Issue 210: Pad error responses
> Issue 212: WASessionContinuation>>url method name
> Issue 220: move WADispatcherViewer and so on into Environment
> Issue 221: consider providing abstract implementation of
> platform-specific classes
> Issue 230: WAAdmin>>applicationDefaults keeps overwriting settings
> every time it is called
> Issue 231: cleaup configuration editor extensions to Configuration
> Issue 236: look at returning responses
> Issue 239: WAConfiguration>>addAncestorsTo:forAttributeAt:
> Issue 245: WAHalo Source View is broken
> Issue 247: WAValidationDecoration>>#validate does not work on
> all platforms
> Issue 253: WAPackage is partly under-defined
> Issue 255: Listing of files does not work (for me)
> Issue 260: Load order problem with tests
> Issue 264: Help Button in ""Seaside Control Panel""
> Issue 265: WAControlPanel should display the Seaside Logo
> Issue 266: remove uses of generic Error
> Issue 268: Introduce WAMessageSend
> Issue 269: Add server with same port in ""Seaside Control Panel""
> Issue 270: WAExternalID raises an error when cryptography
> package is loaded
> Issue 271: WAAttributeNotFound initialization method bypass standard
> initialization
> Issue 273: Seaside-Tests-Color package
> Issue 274: Seaside Control Panel looks broken on Pharo
> Issue 275: Comet is missing in builder.seaside.st
> Issue 276: New Session link is broken
> Issue 277: Add a seaside tab to /seaside/status
> Issue 278: omnibrowser tools should be registered in the Open menu
> Issue 280: no command to add a new server adaptor in OB control panel
> Issue 281: Simplify builder UI
> Issue 282: ReadStream>>#'next' might give an error when at end
> Issue 283: rename #possibleCauses to #seasidePossibleCauses ?
> Issue 284: WAResponse sends #application
> Issue 285: respondAndContinue: does not use a SessionCallback
> Issue 286: WAActionCallback>>isEnabled calls #requestContext
> Issue 288: Create new root dispatchers from Seaside-OmniBrowserTools
> Issue 289: Changes to Seaside-Tests-Core to address issues discovered
> in GemStone port
> Issue 290: WARenderCanvas referenced from Seaside-Tests-Core
> but not yet defined
> Issue 291: WABufferedResponseTest fails because WriteStream does not
> understand #'crlf'
> Issue 292: Remove WAGemStoneMock* classes from Seaside-Tests-Core
> Issue 293: Refactor WAResponse and subclasses to encapsulate stream
> and use WriteStream instead of ReadWriteStream
> Issue 294: Loading Seaside-Squeak-Platform gives walkback because
> 'WAPlatform current' is nil
> Issue 296: WAFileHandler default is nil when running tests
> Issue 297: WAEncoderTest has three failures
> Issue 298: #upToAndSkipThroughAll: needs a test
> Issue 299: closeThisPopup* should use builder
> Issue 300: #passenger: produces invalid IDs
> Issue 302: create tests for RSS-Examples and Comet-Core
> platform methods
> Issue 304: caching session cookie state
> Issue 305: move #nativeRequest to WARequestContext?
> Issue 308: scriptaculous uses WAContinuation
> Issue 310: #inNewRenderLoopCall: broken with partial continuations
> Issue 311: Undefined globals and methods referenced in Seaside-Canvas
> and Seaside-Canvas-Tests
> Issue 312: WALeastRecentlyUsedExpiryPolicy uses non-portable approach
> to increasing counter
> Issue 313: Allow platforms to use an instance variable to cache
> objects in WAFileLibrary
> Issue 314: WAHtmlBuilder>>#'renderResponse:' calls WAResponse
> class>>#'defaultValueForMimeType' that is not defined
> Issue 315: WAResourceBaseUrlTest>>#'createHandlers' references
> WAApplication that is not defined
> Issue 316: WAInteractionTest>>#'testContentType' fails
> Issue 317: WAApplicationTest>>#'testNotImplemented' fails
> Issue 318: WAComponentPlatformTest>>#'testHaloClass' failure
> Issue 320: WAMutex portability
> Issue 326: Seaside-Tests-Flow depends on WAFunctionalTests
> Issue 329: character set can not be specified for RSS
> Issue 330: Not possible to add a new adapter if no adapters
> are defined
> Issue 331: WAProcessStatus>>renderProcess:on: depends on WAInspector
> Issue 332: JQuery-Core depends on Seaside-Tests-Functional
> Issue 334: JSConversionTest>>#'testPoint' fails
> Issue 335: Seaside BrowserEnvironment
> Issue 337: Deprecate #register*Callback: methods
> Issue 339: functional tests and webtools depend on Flow
> Issue 342: Canonical URLs
> Issue 343: update seaside adaptor for Swazoo 2.3
> Issue 344: Swazoo adapor broken
> Issue 345: unit tests needed for WAFileHandlerListing and its
> subclasses
> Issue 346: platform test for #new:withAll:
> Issue 347: canceling addition of a server adaptor doesn't work
> Issue 348: bring back utf-8 fast path
> Issue 350: Several WAMutexTests and one WAPlatformTest fail
> on VA Smalltalk
> Issue 351: Add #size: to WAFileUploadTag
> Issue 353: Manually calculate memory in WAMemory
> Issue 358: Slime should not depend on Seaside classes
> Issue 362: Comet is broken after response and encoding refactorings
> Issue 365: Hide toolbar and halos when opening a tool
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Textarea and setSelectionRange()

Carl Gundel
Has anyone here managed to call the setSelectionRange() method against  
a textarea in Seaside?  I cannot seem to get this working.

Thanks,

-Carl Gundel
http://www.runbasic.com
http://www.libertybasic.com
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Textarea and setSelectionRange()

Lukas Renggli
> Has anyone here managed to call the setSelectionRange() method against a
> textarea in Seaside?  I cannot seem to get this working.

Text selection is handled different in IE.

There is JavaScript code in the Pier-EditorEnh plugin at
<http://source.lukas-renggli.ch/pieraddons> that retrieves and sets
the text selection. As far as I know this code works in all web
browsers:

function getSelection(element) {
        if (document.selection && document.selection.createRange) {
                var range = document.selection.createRange();
                var stored = range.duplicate();
                stored.moveToElementText(element);
                stored.setEndPoint("EndToEnd", range);
                element.selectionStart = stored.text.length - range.text.length;
                element.selectionEnd = element.selectionStart + range.text.length;
        }
        return [element.selectionStart, element.selectionEnd];
}

function setSelection(element, range) {
        element.focus();
        element.selectionStart = range[0];
        element.selectionEnd = range[1];
        if (document.selection && document.selection.createRange) {
                var range = document.selection.createRange();
          range.moveStart("character", element.selectionStart);
            range.moveEnd("character", element.selectionEnd - element.selectionStart);
                range.select();
        }
}

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Textarea and setSelectionRange()

Bany, Michel
Support for this is available in Seaside 2.8.

See #setSelectionFrom:to: and WAStandardFiles>>miscJs.
See also #renderTextArea: for an example.

HTH,
Michel




> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf
> Of Lukas Renggli
> Sent: samedi, 14. mars 2009 17:25
> To: Seaside - general discussion
> Subject: Re: [Seaside] Textarea and setSelectionRange()
>
> > Has anyone here managed to call the setSelectionRange()
> method against
> > a textarea in Seaside?  I cannot seem to get this working.
>
> Text selection is handled different in IE.
>
> There is JavaScript code in the Pier-EditorEnh plugin at
> <http://source.lukas-renggli.ch/pieraddons> that retrieves
> and sets the text selection. As far as I know this code works
> in all web
> browsers:
>
> function getSelection(element) {
> if (document.selection && document.selection.createRange) {
> var range = document.selection.createRange();
> var stored = range.duplicate();
> stored.moveToElementText(element);
> stored.setEndPoint("EndToEnd", range);
> element.selectionStart = stored.text.length -
> range.text.length;
> element.selectionEnd = element.selectionStart +
> range.text.length;
> }
> return [element.selectionStart, element.selectionEnd]; }
>
> function setSelection(element, range) {
> element.focus();
> element.selectionStart = range[0];
> element.selectionEnd = range[1];
> if (document.selection && document.selection.createRange) {
> var range = document.selection.createRange();
> range.moveStart("character", element.selectionStart);
>     range.moveEnd("character", element.selectionEnd
> - element.selectionStart);
> range.select();
> }
> }
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Textarea and setSelectionRange()

Sebastian Sastre-2
yes, the hard part is when you want the caret position in pixels as I need now.
Looks like there is no cross browser solution for that yet :/
sebastian

> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre
> de Bany, Michel
> Enviado el: Monday, March 16, 2009 04:26
> Para: Seaside - general discussion
> Asunto: RE: [Seaside] Textarea and setSelectionRange()
>
> Support for this is available in Seaside 2.8.
>
> See #setSelectionFrom:to: and WAStandardFiles>>miscJs.
> See also #renderTextArea: for an example.
>
> HTH,
> Michel
>
>
>
>
> > -----Original Message-----
> > From: [hidden email]
> > [mailto:[hidden email]] On Behalf
> > Of Lukas Renggli
> > Sent: samedi, 14. mars 2009 17:25
> > To: Seaside - general discussion
> > Subject: Re: [Seaside] Textarea and setSelectionRange()
> >
> > > Has anyone here managed to call the setSelectionRange()
> > method against
> > > a textarea in Seaside?  I cannot seem to get this working.
> >
> > Text selection is handled different in IE.
> >
> > There is JavaScript code in the Pier-EditorEnh plugin at
> > <http://source.lukas-renggli.ch/pieraddons> that retrieves
> > and sets the text selection. As far as I know this code works
> > in all web
> > browsers:
> >
> > function getSelection(element) {
> > if (document.selection && document.selection.createRange) {
> > var range = document.selection.createRange();
> > var stored = range.duplicate();
> > stored.moveToElementText(element);
> > stored.setEndPoint("EndToEnd", range);
> > element.selectionStart = stored.text.length -
> > range.text.length;
> > element.selectionEnd = element.selectionStart +
> > range.text.length;
> > }
> > return [element.selectionStart, element.selectionEnd]; }
> >
> > function setSelection(element, range) {
> > element.focus();
> > element.selectionStart = range[0];
> > element.selectionEnd = range[1];
> > if (document.selection && document.selection.createRange) {
> > var range = document.selection.createRange();
> > range.moveStart("character", element.selectionStart);
> >     range.moveEnd("character", element.selectionEnd
> > - element.selectionStart);
> > range.select();
> > }
> > }
> >
> > Cheers,
> > Lukas
> >
> > --
> > Lukas Renggli
> > http://www.lukas-renggli.ch
> > _______________________________________________
> > seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Javascript questions Re: Textarea and setSelectionRange()

Carl Gundel
In reply to this post by Bany, Michel
Thanks guys.  I used Michel's suggestion by backporting the Seaside  
2.8 code back to 2.6.  I managed to make something work, but it is  
slightly different depending on the browser.  I also tried Lukas'  
suggestion but with less luck.

I do have an issue with the order of execution of Javascript.  For  
example I am using Editarea which is an open source code editor in  
Javascript.  It comes with it's own set selection function which I was  
unable to make work.  It does work, mind you in their examples and I  
think this is because they tie it to a button which is clicked after  
the page is all loaded up.  I need to make the selection happen  
automatically, but I couldn't figure out how to make the call to the  
selection method happen as the last thing on the page load.  I can  
actually see the selection happen really fast and then it gets wiped  
out by the actions of other scripts.

How is this done in Seaside?  What can I do to specify Javascript that  
will be guaranteed to run after some other Javascript code?  I am a  
beginner in the Javascript realm and I have been spending a lot of  
energy trying to figure this out, but the going has been slow.  Has  
somebody written some details on the use of Javascript with Seaside?

Thanks,

-Carl Gundel
http://www.runbasic.com
http://www.libertybasic.com

On Mar 16, 2009, at 3:26 AM, Bany, Michel wrote:

> Support for this is available in Seaside 2.8.
>
> See #setSelectionFrom:to: and WAStandardFiles>>miscJs.
> See also #renderTextArea: for an example.
>
> HTH,
> Michel
>
>
>
>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf
>> Of Lukas Renggli
>> Sent: samedi, 14. mars 2009 17:25
>> To: Seaside - general discussion
>> Subject: Re: [Seaside] Textarea and setSelectionRange()
>>
>>> Has anyone here managed to call the setSelectionRange()
>> method against
>>> a textarea in Seaside?  I cannot seem to get this working.
>>
>> Text selection is handled different in IE.
>>
>> There is JavaScript code in the Pier-EditorEnh plugin at
>> <http://source.lukas-renggli.ch/pieraddons> that retrieves
>> and sets the text selection. As far as I know this code works
>> in all web
>> browsers:
>>
>> function getSelection(element) {
>> if (document.selection && document.selection.createRange) {
>> var range = document.selection.createRange();
>> var stored = range.duplicate();
>> stored.moveToElementText(element);
>> stored.setEndPoint("EndToEnd", range);
>> element.selectionStart = stored.text.length -
>> range.text.length;
>> element.selectionEnd = element.selectionStart +
>> range.text.length;
>> }
>> return [element.selectionStart, element.selectionEnd]; }
>>
>> function setSelection(element, range) {
>> element.focus();
>> element.selectionStart = range[0];
>> element.selectionEnd = range[1];
>> if (document.selection && document.selection.createRange) {
>> var range = document.selection.createRange();
>> range.moveStart("character", element.selectionStart);
>>     range.moveEnd("character", element.selectionEnd
>> - element.selectionStart);
>> range.select();
>> }
>> }
>>
>> Cheers,
>> Lukas
>>
>> --
>> Lukas Renggli
>> http://www.lukas-renggli.ch
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Javascript questions Re: Textarea and setSelectionRange()

Lukas Renggli
> How is this done in Seaside?

Almost certainly this is not specific to Seaside.

Maybe your editor library has an special API or methods that get
called in case of a special event.

> What can I do to specify Javascript that will
> be guaranteed to run after some other Javascript code?

If this is your own code, then call you code at the end of the other
code. Especially when it comes to DOM event, there is no guarantee in
what order events are processed.

> figure this out, but the going has been slow.  Has somebody written some
> details on the use of Javascript with Seaside?

Again, there is nothing Seaside specific in the way Javascript
processes events. This is certainly one of the best documentations on
events: <http://www.quirksmode.org/js/introevents.html>.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Javascript questions Re: Textarea and setSelectionRange()

Carl Gundel
Okay.  Thanks, but isn't it fair to ask what should be Seaside idioms  
or best practices for using Javascript?

-Carl Gundel
Liberty BASIC for Windows - http://www.libertybasic.com
Run BASIC, easy web programming - http://www.runbasic.com

On Mar 17, 2009, at 1:44 PM, Lukas Renggli <[hidden email]> wrote:

>> How is this done in Seaside?
>
> Almost certainly this is not specific to Seaside.
>
> Maybe your editor library has an special API or methods that get
> called in case of a special event.
>
>> What can I do to specify Javascript that will
>> be guaranteed to run after some other Javascript code?
>
> If this is your own code, then call you code at the end of the other
> code. Especially when it comes to DOM event, there is no guarantee in
> what order events are processed.
>
>> figure this out, but the going has been slow.  Has somebody written  
>> some
>> details on the use of Javascript with Seaside?
>
> Again, there is nothing Seaside specific in the way Javascript
> processes events. This is certainly one of the best documentations on
> events: <http://www.quirksmode.org/js/introevents.html>.
>
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Javascript questions Re: Textarea and setSelectionRange()

Lukas Renggli
> Okay.  Thanks, but isn't it fair to ask what should be Seaside idioms or
> best practices for using Javascript?

Sure, but as I said it mostly depends on the Javascript libraries you are using.

With Scriptaculous (http://www.prototypejs.org/api/event/observe) and
JQuery (http://docs.jquery.com/Events/bind) you have totally different
idioms on how to register for events. In these two cases Seaside does
not try to run its own thing, but instead it just provides a nice
Smalltalk API to the Javascript interface.

In any case you can register for Javascript events directly while
rendering the HTML source using the event selectors defined in
WATagBrush, but that doesn't give much flexibility and certainly no
control over order (see
http://www.quirksmode.org/js/introevents.html).

One thing Seaside provides out of the box is the addition of onLoad
scripts. This can be done by evaluating "html document addLoadScript:"
in Seaside 2.9 and "self session addLoadScript:" in earlier versions.
The code added through these calls is evaluated in order when the page
has completely loaded, but there is no control over other Javascript
code that might be present on your site and that might define other
load handlers.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside