[squeak-dev] The Trunk: Morphic-mt.1259.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Aug 11 14:31:08 UTC 2016


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1259.mcz

==================== Summary ====================

Name: Morphic-mt.1259
Author: mt
Time: 11 August 2016, 4:30:30.244564 pm
UUID: 2c310d11-0bd2-f449-9688-efd2fb427b0a
Ancestors: Morphic-mt.1258

For for interactive release notes, support code URLs in TextURL property.

=============== Diff against Morphic-mt.1258 ===============

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"
- 		^self		"should not get here, but what the heck"
  	].
+ 	(url beginsWith: 'code://') ifTrue: [
+ 		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!

Item was added:
+ ----- Method: TextURL>>open: (in category '*Morphic') -----
+ open: anObject
+ 
+ 	anObject isBehavior ifTrue: [
+ 		^ anObject browse].
+ 	anObject isCompiledMethod ifTrue: [
+ 		^ ToolSet browse: anObject methodClass selector: anObject selector].
+ 	anObject class == MethodReference ifTrue: [
+ 		^ ToolSet browse: anObject actualClass selector: anObject selector].
+ 	anObject isSymbol ifTrue: [
+ 		SystemNavigation default browseAllImplementorsOf: anObject.
+ 		SystemNavigation default browseAllCallsOn: anObject.
+ 		^ self].
+ 	
+ 	anObject explore.!



More information about the Squeak-dev mailing list