新規リンクボタンが画面を崩さないようにする
refs → templates (page) → newLink
<form action="<?toNew?>"><input type="hidden" name="name" value="<?newSendName?>"><b><?newShowName?>:</b> <input type="submit" value="create"><?createType?></form>
↓
<b><?newShowNameWithAlias?></b><input type="button" value="新規" onclick="location.href='<?toNew?>?name=<?newSendName?>'"><?createType?>
refs → actions (book) → newShowNameWithAlias "これから作成されるページ名と、もしあればエイリアス名を表示するアクション作成"
| alias show |
show _ PageFormatter toSafeAlias: (request settingsAt: 'pageEntry').
alias _ PageFormatter toSafeAlias: ((request settingsAt: 'alias' ifAbsent: [''])).
alias = ''
ifTrue: [show]
ifFalse: [alias, '<font size=-1>(', show, ')</font>']
refs → actions (page) → createType "スキームを使うときに"
| mySchemeName myScheme return |
mySchemeName _ page settingsAt: 'scheme' ifAbsent: ['default'].
(book formatPrivAddress: 'allSchemes' request: request response: response shelf: shelf) do: [:scheme |
((scheme at: 1) = mySchemeName) ifTrue: [
myScheme _ scheme]].
return _ WriteStream on: String new.
(((myScheme at: 2) size + (myScheme at: 3) size) < 2)
ifTrue: [
(myScheme at: 2) do: [:str | return
nextPutAll: '<input type="hidden" name="type" value="text-';
nextPutAll: (TextFormatter encodeToStrictXmlCrlf: str);
nextPutAll: '">'].
(myScheme at: 3) do: [:str | return
nextPutAll: '<input type="hidden" name="type" value="project-';
nextPutAll: (TextFormatter encodeToStrictXmlCrlf: str);
nextPutAll: '">']]
ifFalse: [
return
nextPutAll: ' <select name="type">'.
(myScheme at: 2) do: [:str | return
nextPutAll: '<option value="text-';
nextPutAll: (TextFormatter encodeToStrictXmlCrlf: str);
nextPutAll: '">';
nextPutAll: ((str = 'default')
ifTrue: ['blank TEXT']
ifFalse: [TextFormatter encodeToXmlCrlf: str]);
nextPutAll: String crlf].
(myScheme at: 3) do: [:str | return
nextPutAll: '<option value="project-';
nextPutAll: (TextFormatter encodeToStrictXmlCrlf: str);
nextPutAll: '">';
nextPutAll: ((str = 'default')
ifTrue: ['blank PROJECT']
ifFalse: [TextFormatter encodeToXmlCrlf: str]);
nextPutAll: String crlf].
return
nextPutAll: '</select>'].
return contents
このページを編集 (3449 bytes)
|
以下の 1 ページから参照されています。 |
This page has been visited 2416 times.