'From etoys4.0 of 9 October 2008 [latest update: #2291] on 11 September 2009 at 4:38:56 pm'! "Change Set: ProjectDAV4-yo Date: 11 September 2009 Author: Yoshiki Ohshima Hook up with primOpenURL:. Add #translated a few more places."! AlignmentMorphBob1 subclass: #EtoyDAVLoginMorph instanceVariableNames: 'theName theNameMorph thePassword thePasswordMorph actionBlock cancelBlock panel ' classVariableNames: '' poolDictionaries: '' category: 'Morphic-Experimental'! !EtoyDAVLoginMorph methodsFor: 'actions' stamp: 'yo 9/11/2009 16:25'! launchBrowser ActiveWorld addMorph: self buildPanel centeredNear: Sensor cursorPoint. ScratchPlugin primOpenURL: self url. ! ! !EtoyDAVLoginMorph methodsFor: 'building' stamp: 'yo 9/11/2009 16:37'! cancelButton ^self buttonNamed: 'Cancel' translated action: #doCancel color: self buttonColor help: 'Cancel this login operation.' translated! ! !EtoyDAVLoginMorph methodsFor: 'building' stamp: 'yo 9/11/2009 16:37'! okButton ^self buttonNamed: 'OK' translated action: #doOK color: self buttonColor help: 'Login to Squeakland' translated! ! !EtoyDAVLoginMorph methodsFor: 'building' stamp: 'yo 9/11/2009 16:36'! okButton2 ^self buttonNamed: 'OK' translated action: #deletePanel color: self buttonColor help: 'Close this dialog' translated! ! !EtoyDAVLoginMorph methodsFor: 'initialize' stamp: 'yo 9/11/2009 16:14'! delete self deletePanel. super delete. ! ! !EtoyDAVLoginMorph methodsFor: 'initialize' stamp: 'yo 9/11/2009 16:24'! rebuild | title link | self removeAllMorphs. title := StringMorph contents: 'Login to Squeakland' translated font: self myFont. title lock. link := StringMorph contents: '(create account)' translated font: Preferences standardListFont emphasis: 4. link color: Color blue. link beSticky. link on: #click send: #launchBrowser to: self. self addARow: { title. self newSpacer: Color transparent. link}. self addARow: { (StringMorph contents:'') lock }. (self addARow: { (StringMorph contents: 'Username:' translated font: self myFont) lock. Morph new extent: 15@0; color: Color transparent. self newSpacer: Color transparent. (theNameMorph _ TextMorph new beAllFont: self myFont; crAction: (MessageSend receiver: self selector: #doOK); extent: 250@20; borderStyle: (InsetBorder new color: Color black; width: 2); contentsWrapped: 'the old name' ). }) color: self defaultColor; borderWidth: 0. self addARow: { (StringMorph contents:'') lock }. (self addARow: { (StringMorph contents: 'Password:' translated font: self myFont) lock. Morph new extent: 15@0; color: Color transparent. self newSpacer: Color transparent. (thePasswordMorph _ TextMorph new beAllFont: (FixedFaceFont new passwordFont baseFont: self myFont copy); crAction: (MessageSend receiver: self selector: #doOK); extent: 250@20; borderStyle: (InsetBorder new color: Color black; width: 2); contentsWrapped: '' ). }) color: self defaultColor. self addARow: { (StringMorph contents:'') lock }. self addARow: { self newSpacer: Color transparent. self okButton hResizing: #rigid. Morph new extent: 30@0; color: Color transparent. self cancelButton hResizing: #rigid. }. ! ! !EtoyDAVLoginMorph methodsFor: 'private' stamp: 'yo 9/11/2009 16:24'! buildPanel | title | self deletePanel. panel := AlignmentMorphBob1 new. panel vResizing: #shrinkWrap; hResizing: #shrinkWrap; layoutInset: 4; color: self defaultColor; beSticky; borderWidth: self defaultBorderWidth; borderColor: self defaultBorderColor. title := TextMorph new contents: 'Launching a web browser and opening the signup page.\If it does not work,\please visit the following page with your browser:\\' translated withCRs, self url; beAllFont: self myFont. title beSticky. title centered. panel addARow: {title}. panel addARow: { (StringMorph contents:'') lock }. panel addARow: { self newSpacer: Color transparent. self okButton2 hResizing: #rigid. self newSpacer: Color transparent. }. panel setProperty: #morphicLayerNumber toValue: 9. ^ panel. ! ! !EtoyDAVLoginMorph methodsFor: 'private' stamp: 'yo 9/11/2009 15:39'! deletePanel panel ifNotNil: [panel delete. panel := nil].! ! !EtoyDAVLoginMorph methodsFor: 'private' stamp: 'yo 9/11/2009 15:38'! newSpacer: aColor "Answer a space-filling instance of me of the given color." ^ AlignmentMorph newSpacer: aColor ! ! !EtoyDAVLoginMorph methodsFor: 'private' stamp: 'yo 9/11/2009 15:21'! url ^ 'http://squeakland.org/action/signup'.! ! EtoyDAVLoginMorph removeSelector: #rebuild2! AlignmentMorphBob1 subclass: #EtoyDAVLoginMorph instanceVariableNames: 'theName theNameMorph thePassword thePasswordMorph actionBlock cancelBlock panel' classVariableNames: '' poolDictionaries: '' category: 'Morphic-Experimental'!