Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1277.mcz==================== Summary ====================
Name: Morphic-mt.1277
Author: mt
Time: 14 August 2016, 11:43:36.427355 am
UUID: f0eee6b3-a9ec-6643-8fd1-8cbd7f566a8b
Ancestors: Morphic-mt.1276
Fixes a bug regarding text actions and code evaluation. Do it deferred so that the rest of event handling does not intervene.
=============== Diff against Morphic-mt.1276 ===============
Item was changed:
----- Method: TextURL>>actOnClickFor: (in category '*Morphic') -----
actOnClickFor: anObject
"Do what you can with this URL. Later a web browser."
| response m |
(url beginsWith: 'sqPr://') ifTrue: [
ProjectLoading thumbnailFromUrl: (url copyFrom: 8 to: url size).
^ true "should not get here, but what the heck"
].
(url beginsWith: 'code://') ifTrue: [
+ Project current addDeferredUIMessage: [self open: (Compiler evaluate: (url allButFirst: 7))].
- self open: (Compiler evaluate: (url allButFirst: 7)).
^ true "should not get here, but what the heck"
].
"if it's a web browser, tell it to jump"
anObject isWebBrowser
ifTrue: [anObject jumpToUrl: url. ^ true]
ifFalse: [((anObject respondsTo: #model) and: [anObject model isWebBrowser])
ifTrue: [anObject model jumpToUrl: url. ^ true]].
"if it's a morph, see if it is contained in a web browser"
(anObject isKindOf: Morph) ifTrue: [
m := anObject.
[ m ~= nil ] whileTrue: [
(m isWebBrowser) ifTrue: [
m jumpToUrl: url.
^true ].
(m hasProperty: #webBrowserView) ifTrue: [
m model jumpToUrl: url.
^true ].
m := m owner. ]
].
"no browser in sight. ask if we should start a new browser"
((self confirm: 'open a browser to view this URL?' translated) and: [WebBrowser default notNil]) ifTrue: [
WebBrowser default openOnUrl: url.
^ true ].
"couldn't display in a browser. Offer to put up just the source"
response := (UIManager default
chooseFrom: (Array with: 'View web page as source' translated
with: 'Cancel' translated)
title: 'Couldn''t find a web browser. View\page as source?' withCRs translated).
response = 1 ifTrue: [HTTPSocket httpShowPage: url].
^ true!