'From Squeak3.2alpha of 3 October 2001 [latest update: #4518] on 16 November 2001 at 12:20:42 am'! "Change Set: ScamperContentType Date: 15 November 2001 Author: Felix Franz fixes Scamper to ignore additional characters after a semicolon in the content type. Example: 'text/html; charset=us-ascii' is now treated as 'text/html'. w3.org uses the above content-type. "! !Scamper methodsFor: 'document handling' stamp: 'ff 11/15/2001 23:57'! displayDocument: mimeDocument "switch to viewing the given MIMEDocument" | handled urlString | handled _ false. "add it to the history" " recentDocuments removeAllSuchThat: [ :d | d url = mimeDocument url ]." currentUrlIndex > recentDocuments size ifTrue: [recentDocuments addLast: mimeDocument]. " ifFalse: [recentDocuments removeAt: currentUrlIndex]." recentDocuments size > 20 ifTrue: [ recentDocuments removeFirst ]. mimeDocument mainType = 'image' ifTrue: [handled _ self displayImagePage: mimeDocument]. (mimeDocument contentType beginsWith: 'text/html') ifTrue: [handled _ self displayTextHtmlPage: mimeDocument]. mimeDocument contentType = 'x-application/shockwave-flash' ifTrue:[handled _ self displayFlashPage: mimeDocument]. (#('audio/midi' 'audio/x-midi') includes: mimeDocument contentType) ifTrue: [handled _ self processMidiPage: mimeDocument]. "Before we display plain text files we should look at the extension of the URL" (handled not and:[ mimeDocument mainType = 'text']) ifTrue:[ urlString _ mimeDocument url toText. (urlString endsWithAnyOf: #('.gif' '.jpg' '.pcx')) ifTrue:[handled _ self displayImagePage: mimeDocument]. (handled not and:[urlString endsWithAnyOf: #('.mid' '.midi')]) ifTrue:[handled _ self processMidiPage: mimeDocument]. (handled not and:[urlString endsWith: '.swf']) ifTrue:[handled _ self displayFlashPage: mimeDocument]. ]. (handled not and: [ mimeDocument mainType = 'text']) ifTrue: [ self displayPlainTextPage: mimeDocument. handled _ true]. handled ifFalse: [self processUnhandledPage: mimeDocument].! !