SystemOrganization addCategory: #'TextLint-Seaside'! WAComponent subclass: #TLSeaSideBrowser instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'TextLint-Seaside'! !TLSeaSideBrowser class methodsFor: 'as yet unclassified' stamp: 'FabrizioPerin 6/16/2010 18:16'! initiliaze WAAdmin register: self asApplicationAt: 'TextLint'.! ! !TLSeaSideBrowser methodsFor: 'as yet unclassified' stamp: 'FabrizioPerin 6/17/2010 13:26'! renderContentOn: html "html image url: ([FileDirectory default url, 'prova.png'])." html heading level3; with: 'TextLint'. html paragraph: 'TextLint is an automatic style checker following the architecture of SmallLint. Similar to a program checker TextLint can reliably point out possible problems and suggest to rewrite certain parts of a document to increase its quality. However, as with a program checker, TextLint does not replace a manual reviewing processes, it only helps to improve it.'. html paragraph: 'Please choose a text file to check'. html break. html render: [TLUploadForm new renderUploadFileOn: html].! ! WAComponent subclass: #TLUploadForm instanceVariableNames: 'file' classVariableNames: '' poolDictionaries: '' category: 'TextLint-Seaside'! !TLUploadForm methodsFor: 'as yet unclassified' stamp: 'FabrizioPerin 6/17/2010 11:53'! downloadFile: aFile self requestContext respond: [:response | response contentType: aFile contentType; document: aFile rawContents asString; attachmentWithFileName: aFile fileName.].! ! !TLUploadForm methodsFor: 'as yet unclassified' stamp: 'FabrizioPerin 6/17/2010 13:16'! receiveFile: aFile aFile isNil ifTrue: [^nil]. ( ( aFile fileName endsWith: '.txt') or: [ (aFile fileName endsWith: '.tex') or: [ aFile fileName endsWith: '.html' ] ] ) ifFalse: [^Error signal: 'The file is not a text, tex or html file']. file := ( FileDirectory default directoryNamed: 'Uploads') assureExistence; forceNewFileNamed: aFile fileName. [file binary; nextPutAll: aFile contents] ensure: [ file close ].! ! !TLUploadForm methodsFor: 'as yet unclassified' stamp: 'FabrizioPerin 6/17/2010 11:53'! renderUploadFileOn: html html form multipart; with: [ html fileUpload callback: [:value | self receiveFile: value]. html submitButton: 'Send File'.]. file notNil ifTrue: [ html anchor callback: [self downloadFile: file]; with: 'Download' ]! !