SystemOrganization addCategory: #'TextLint-Seaside'! !TLWhitespace methodsFor: '*textlint-seaside' stamp: 'lr 10/25/2010 19:50'! render: aCollection on: html html span class: 'whitespace'; with: self text! ! !TLWord methodsFor: '*textlint-seaside' stamp: 'lr 10/25/2010 19:51'! render: aCollection on: html html span class: 'word'; with: self text! ! !TLMarkup methodsFor: '*textlint-seaside' stamp: 'lr 10/25/2010 19:50'! render: aCollection on: html html span class: 'markup'; with: self text! ! !TLElement methodsFor: '*textlint-seaside' stamp: 'lr 10/25/2010 19:46'! render: results on: html self children do: [ :each | each render: results on: html ]! ! WAComponent subclass: #TLRootComponent instanceVariableNames: 'checker results' classVariableNames: '' poolDictionaries: '' category: 'TextLint-Seaside'! !TLRootComponent class methodsFor: 'initialization' stamp: 'lr 10/25/2010 20:24'! initialize WAAdmin register: self asApplicationAt: 'textlint'. WAAdmin applicationDefaults removeParent: WADevelopmentConfiguration instance! ! !TLRootComponent methodsFor: 'actions' stamp: 'lr 10/25/2010 19:42'! analyze: aString checker := TLTextLintChecker new. checker addStyle: TLWritingStyle scientificPaperStyle. results := checker check: aString! ! !TLRootComponent methodsFor: 'rendering' stamp: 'lr 10/25/2010 20:32'! renderBodyOn: html html form: [ results isNil ifTrue: [ self renderTextOn: html ] ifFalse: [ self renderResultOn: html ] ]! ! !TLRootComponent methodsFor: 'rendering' stamp: 'lr 10/25/2010 19:25'! renderContentOn: html html div class: 'head'; with: [ self renderHeadOn: html ]. html div class: 'body'; with: [ self renderBodyOn: html ]. html div class: 'foot'; with: [ self renderFootOn: html ]! ! !TLRootComponent methodsFor: 'rendering' stamp: 'lr 10/25/2010 19:25'! renderFootOn: html html paragraph: [ html anchor url: 'http://scg.unibe.ch/staff/fabrizioperin/'; with: 'Fabrizio Perin'. html text: ', '. html anchor url: 'http://www.lukas-renggli.ch/'; with: 'Lukas Renggli'. html text: ', and '. html anchor url: 'http://www.jorgeressia.com/'; with: 'Jorge Ressia'. html text: '.' ]! ! !TLRootComponent methodsFor: 'rendering' stamp: 'lr 10/25/2010 20:37'! renderHeadOn: html html heading level: 1; with: [ html span: self title ]. html paragraph: 'TextLint is a tool to check your texts for common style errors. Just paste your text, HTML or LaTeX source into the text field below to give it a try.'! ! !TLRootComponent methodsFor: 'rendering' stamp: 'lr 10/25/2010 20:32'! renderResultOn: html html paragraph class: 'result'; with: [ checker document render: results on: html ]. html submitButton callback: [ results := nil ]; with: 'Close'! ! !TLRootComponent methodsFor: 'rendering' stamp: 'lr 10/25/2010 20:32'! renderTextOn: html html textArea value: (checker isNil ifFalse: [ checker document text ]); callback: [ :value | self analyze: value ]. html submitButton: 'Analyze'! ! !TLRootComponent methodsFor: 'accessing' stamp: 'lr 10/25/2010 20:36'! style ^ '.head, .foot, .body { width: 800px; margin: 0 auto; } .head h1 { width: 263px; height: 100px; background-image: url("http://textlint.lukas-renggli.ch/images/logo.png"); } .head h1 span { display: none; } textarea, p.result { resize: none; width: 100%; height: 500px; padding: 5px; line-height: 1.5; margin:0 0 1.5em; border: 1px solid #bbb; font: 1em "andale mono", "lucida console", monospace; } p.result { overflow: auto; white-space: pre-wrap; white-space: -moz-pre-wrap !!important; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; } p.result .markup { color: gray; }'! ! !TLRootComponent methodsFor: 'accessing' stamp: 'lr 10/25/2010 19:23'! title ^ 'TextLint'! ! !TLRootComponent methodsFor: 'updating' stamp: 'lr 10/25/2010 20:00'! updateRoot: aHtmlRoot super updateRoot: aHtmlRoot. aHtmlRoot title: self title. aHtmlRoot stylesheet url: 'http://textlint.lukas-renggli.ch/blueprint/screen.css'! ! !TLPunctuationMark methodsFor: '*textlint-seaside' stamp: 'lr 10/25/2010 19:50'! render: aCollection on: html html span class: 'punctuation'; with: self text! ! TLRootComponent initialize!