cewebs-didaktiki 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b85b88f5da1053776ab9e95e80ee850351b300bd48fb3933551802b5ab0fdf6
4
- data.tar.gz: 18237a6bc9a90db29a583bb00d23fbe5e5ac0a8dd524b90bce2de9a554035fdf
3
+ metadata.gz: 0d8eed94401a6504a4d8c57ede4e5c8a371d3ec6fb54ccffb01ba78ef31d19de
4
+ data.tar.gz: a98174ee560c187b2caf52fd9eecfa030f5fcf1d7140b44603925659e02849bc
5
5
  SHA512:
6
- metadata.gz: 9cfb3cc7a8f724b1050627197853eab1a047d13fd2fb6460621c6a07f621d8d17c748146558e057fa9ea272d1e55aad021beb2f126d089803b6c051ab6e65d88
7
- data.tar.gz: 4a13ced0cf3301cd6c58a3c3bfbc2d560bc53a8733b141e118cbbf2a86327d2a1e0f4b2474d1aba2ab1fc76892747bd4c76850ef1d858aebd0de6864f3ce3fd5
6
+ metadata.gz: 93f75655d30565a28f029e9c3657724fc764abf375a71bd2e029f284a041923cbffd6b66e41d83fe6e565e542dc7cd6d7c5b25099ad579d3b0c2917f0419e5d6
7
+ data.tar.gz: fc89c10a96cb5b8a8cc3159cf64a6f7f1c6eacb4ee53f87d0b402c74c7cd9d7a9d2f222e050771c34408261a5e55d45a82401598055bebfd8e49baffcc7f1380
data/README.md CHANGED
@@ -10,6 +10,413 @@ cewebs-aman service aman didaktiki # the AMan in the directory aman offers the
10
10
 
11
11
  See the README of `cewebs-transformationengine` for how all parts of CEWebS work together.
12
12
 
13
+ Every new wiki starts with two pages, copied from `server/data/Default/Data`: **Help**, the markup reference below, and **Formulas**, which shows the supported formula commands.
14
+
15
+ ## Markup
16
+
17
+ Διδακτικη implements a WIKI as a CEWebS (Cooperative Environment Web Service). The markup of **Διδακτικη** is similar to [MediaWiki](http://de.wikipedia.org), but differs in some nuances from MediaWiki.
18
+
19
+ ### Paragraphs
20
+
21
+ Every new line (CR/LF) starts a new paragraph. So to write a paragraph, start a new line, write the whole content, and let the browser wrap the lines.
22
+ For more space between two paragraphs, insert an empty line. It must not contain a space, otherwise an empty box is created.
23
+
24
+ ### Boxes
25
+
26
+ ```
27
+ This box is created simply by starting the line with a blank (space).
28
+ ```
29
+
30
+ ### Links
31
+
32
+ Making links to other locations on the web works by inserting
33
+
34
+ ```
35
+ [http://www.ruby-lang.org|description]
36
+ ```
37
+
38
+ mailto: links work by inserting
39
+
40
+ ```
41
+ [mailto:et@cewebs.org|description]
42
+ ```
43
+
44
+ Creating new WIKI-keywords (new documents in the WIKI) is as simple as writing
45
+
46
+ ```
47
+ [[keyword]]
48
+ ```
49
+
50
+ The resulting link is red when the linked document does not already exists. It turns to blue when content is added.
51
+
52
+ Making internal links (referencing WIKI-keywords) works similar to creating
53
+
54
+ ```
55
+ [[keyword|description]]
56
+ [[keyword#section_1|description]]
57
+ ```
58
+
59
+ The keyword is the name of the existing WIKI-site. The section_? (anchor) is optional and the digit ? to refer a certain caption is the number of the heading within this document.
60
+
61
+ Example: on the Help page, heading "Links" has the number 3, because we start counting from 0. An internal link to it looks like:
62
+
63
+ ```
64
+ [[Help#section_3|Links]]
65
+ ```
66
+
67
+ ### Headings
68
+
69
+ Headings work as expected:
70
+
71
+ ```
72
+ == heading
73
+ === sub-heading
74
+ ==== sub-sub-heading
75
+ ```
76
+
77
+ ### Other basics
78
+
79
+ | Markup | Meaning |
80
+ |---|---|
81
+ | `/*WIKI syntax expression*/` | A comment. The expression inside is not processed by the WIKI markup parser. |
82
+ | `/**Invisible Comment**/` | A comment. This comment can only be seen by screen readers or when editing the page. |
83
+ | `// invisible comment which needs no white space` | |
84
+ | `''emphasis''` | Two single quotes. Tells the parser to print the content in *italic letters*. |
85
+ | `'''strong'''` | Three single quotes. Tells the parser to print the content in **bold letters**. |
86
+ | `___underline___` | Three underscores. Tells the parser to print the content in <u>underline letters</u>. |
87
+ | `---strike through---` | Three dashes. Tells the parser to print the content in ~~strike through~~. |
88
+ | `%%monospaced%%` | to print text `monospaced` (typewriter). |
89
+ | `!!annotation!!` | This element is excluded from export. With this element the users can put comments in the text, to further ease collaboration. This should not be used as versioning instrument. |
90
+
91
+ A difference to MediaWiki markup is introduced by making it possible to create indented text blocks. This is especially useful when one has to add long quotes to his documents. An indented paragraph is denoted by two leading **>** characters (`>>`).
92
+
93
+ Newlines are handled differently like they are handled in MediaWiki. Every newline has an impact on the result. To create a paragraph one can enter two newlines. More than two lines create a bigger space (although this space is not growing with more then three newlines).
94
+
95
+ ### Lists
96
+
97
+ Lists basically work like in MediaWiki with the exception that a newline is possible. A list is terminated when two newlines (a paragraph) occur.
98
+
99
+ | Markup | Meaning |
100
+ |---|---|
101
+ | `* a star` | A star at the beginning of a line starts a normal bullet-list. The list continues until a paragraph or a heading is found. |
102
+ | `** two stars` | Two stars at the beginning of a line start a sub-list. It can only exist inside a bullet-list or numbered list. |
103
+ | `*** three stars` | Three stars at the beginning of a line start a sub-sub-list. It can only exist inside a bullet-sub-list or numbered sub-list. |
104
+ | `# a hash` | A hash symbol at the beginning of a line starts a numbered list. The list continues until a paragraph or a heading is found. |
105
+ | `## two hashes` | Two hash symbols at the beginning of a line start a numbered sub-list. It can only exist inside a bullet-list or numbered list. |
106
+ | `### three hashes` | Three hash symbols at the beginning of a line start a numbered sub-sub-list. It can only exist inside a bullet-sub-list or numbered sub-list. |
107
+
108
+ As already obvious these two list types can also be interspersed. The last list type is a definition-list. It is used by writing
109
+
110
+ ```
111
+ ;definition: description
112
+ ```
113
+
114
+ starting at the beginning of a line. This type comes in very handy when defining concepts or terms.
115
+
116
+ Example for a bullet-list:
117
+
118
+ ```
119
+ * A: Something sub-bullets have to be added:
120
+ ** Sub 1
121
+ More stuff in Sub one
122
+ ** Sub 1
123
+ ~ A: continued
124
+ More A: stuff
125
+ * B: More stuff
126
+ ```
127
+
128
+ To realize the *A: continued* which is obviously not possible with only the star syntax, we added **~** as a way to terminate sub-bullet-lists.
129
+
130
+ #### Continuing a numbered list
131
+
132
+ To continue a numbered list write a hash symbol at the beginning of a line followed by the keyword "counter:" and the number of the next bullet point.
133
+
134
+ ```
135
+ #counter: 3 /* causes starting the numbered list with bullet point number three */
136
+ ```
137
+
138
+ This is useful if you would like to insert a picture within a bullet point - what terminates the list automatically, because it indicates a paragraph.
139
+
140
+ Examples:
141
+
142
+ ```
143
+ Starting a new list, because a paragraph follows point two...
144
+ # point one
145
+ # point two
146
+
147
+ # point next
148
+ # point after the next
149
+
150
+ Continuing the previous list by using the defined syntax...
151
+ # point one
152
+ # point two
153
+
154
+ #counter: 3
155
+ # point next
156
+ # point after the next
157
+ ```
158
+
159
+ ### Literature references
160
+
161
+ A custom addition that to my best of knowledge only exist in Διδακτικη are the literature references. They are inspired by the way LaTeX handles them. A reference can be placed on an arbitrary page in the WIKI, by using the
162
+
163
+ ```
164
+ [ref:identifier] reference text
165
+ ```
166
+
167
+ syntax (starting in a new line). This reference can than be cited everywhere in the WIKI by using
168
+
169
+ ```
170
+ [cite:identifier]
171
+ ```
172
+
173
+ The export-system also assists this system by collecting the references from the whole WIKI and appending it to the exported document. So its wise to put all references to a central document that is not included in the export.
174
+
175
+ ### Images
176
+
177
+ Inserting images is modelled after adding attachments to an email. Images can be added to a document and then be used. Images from other documents are not (!) usable- Adding the images to the document is as easy as uploading them. When uploading a size restriction can also be applied. If an image exceeds this size, it is resized to meet the restriction. This is also useful for vector graphic images, as they often do not contain size information. By using [ImageMagick](http://www.imagemagick.org) it is possible to throw over 90 major formats at the system. Images can be used inside the page by writing
178
+
179
+ ```
180
+ [image:name|description]
181
+ ```
182
+
183
+ #### Referencing
184
+
185
+ Every image on the page can then be referenced inside the text by using
186
+
187
+ ```
188
+ [fig:name]
189
+ ```
190
+
191
+ Both, cites and references to images are clickable. For images the page scrolls to the image, for references one jumps to the page with the reference.
192
+
193
+ #### Alignment
194
+
195
+ By default images are displayed centred. To change the position you have the following possibilities:
196
+
197
+ ```
198
+ [image-left:picture.png|description] // image = left, text = below the image
199
+ [image-float-left:picture.png|description] // image = left, text = right next to the image
200
+ [image-float-right:picture.png|description] // image = right, text = left next to the image
201
+ ```
202
+
203
+ ### Tables
204
+
205
+ Tables also differ from MediaWiki. A table is created by starting a line with **"|| "**. At the end of each row the user has to put also a **"||"**. Each row can span multiple lines in the input box. Each cell has to be separated by another **" || "**. By default the text is aligned left. This can be changed by using **"c"**, **"l"** or **"r"** directly after **"||"**. With the modifier **"h"** you can define a header line.
206
+ For example:
207
+
208
+ ```
209
+ ||h Name ||hc Age ||h Sex ||
210
+ || Jürgen ||c 29 || male ||
211
+ || Axel ||c 27 || male ||
212
+ || Monika ||c 22 || female ||
213
+ ```
214
+
215
+ Furthermore the following vertical alignements inside cells are possible:
216
+
217
+ ```
218
+ VT vertical top
219
+ VB vertical bottom
220
+ VC vertical center
221
+ V_ vertical baseline
222
+ ```
223
+
224
+ If you write
225
+
226
+ ```
227
+ NW no whitespace wrapping
228
+ ```
229
+
230
+ lines are not wrapped when spaces are in a cell. This is an advantage when setting math formulas within cells.
231
+
232
+ For normal cells you can also use the modifiers **"G"** (Good), **"B"** (Bad) and **"N"** (Neutral). A table that contains a list (and a description that can be referenced with `[tab:table1]`) can be created like this:
233
+
234
+ ```
235
+ ||-
236
+ * Test 1
237
+ * Test 2
238
+ ||B Hello ||
239
+ [border][table1:Table Description]
240
+ ```
241
+
242
+ #### Color
243
+
244
+ | Modifier | Comment |
245
+ |---|---|
246
+ | `G` | Good |
247
+ | `B` | Bad |
248
+ | `N` | Neutral |
249
+ | `CA` | Color A |
250
+ | `CB` | Color B |
251
+ | `CC` | Color C |
252
+ | `CD` | Color D |
253
+ | `CE` | Color E |
254
+ | `CF` | Color F |
255
+
256
+ #### Dark Borders
257
+
258
+ | Dark Border | Comment |
259
+ |---|---|
260
+ | `BO` | All sides |
261
+ | `BL` | Left |
262
+ | `BR` | Right |
263
+ | `BT` | Top |
264
+ | `BB` | Bottom |
265
+
266
+ #### Column width
267
+
268
+ ```
269
+ ||hS Small ||hM Medium ||hL Large ||hXL X-Large ||hXXL XX-Large||
270
+ ```
271
+
272
+ #### Multi-Column
273
+
274
+ ```
275
+ ||c2 two columns || second column? ||
276
+ || 1 || 2 || 3 ||
277
+ [border]
278
+ ```
279
+
280
+ #### Multi-Row
281
+
282
+ ```
283
+ ||r2 two rows || 2 || 3 ||
284
+ || 1 || 2 || 3 ||
285
+ [border]
286
+ ```
287
+
288
+ ```
289
+ || 1 ||r2 X || 3 ||
290
+ || 1 || 2 || 3 ||
291
+ [border]
292
+ ```
293
+
294
+ ```
295
+ || 1 ||r4 X || 3 ||
296
+ || 1 || 2 || 3 ||
297
+ || 1 || 2 || 3 ||
298
+ || 1 || 2 || 3 ||
299
+ || 1 || 2 || 3 ||
300
+ [border]
301
+ ```
302
+
303
+ #### Alignment
304
+
305
+ Tables are displayed centred by default, when they have a description. Otherwise you can use the markup `[center]` (combined with the markup `[border]` or alone) to change the position from left hand side to the middle.
306
+
307
+ ```
308
+ || content ||
309
+ [table1:Table Description]
310
+
311
+ || content ||
312
+ [border][center]
313
+ ```
314
+
315
+ ### Monospaced Text
316
+
317
+ There is also the ability to add text that is printed in monospaced letters. This is especially useful when one wants to add source code to a document. Every line with a space as the first letter is printed monospaced, multiple successive lines following this rule are interpreted as block. Example:
318
+
319
+ ```
320
+ people.each do |person|
321
+ puts person + ' has an IQ of ' + rand(200)
322
+ end
323
+ ```
324
+
325
+ ### Mathematical Formulas
326
+
327
+ Διδακτικη has support for mathematical formulas through LaTeX syntax. They are turned into MathML by [Temml](https://temml.org) in the browser, all current browsers display MathML. The page Formulas, in every new wiki, shows the supported commands. There is support for both, inline (denoted by `$`)
328
+
329
+ ```
330
+ Use a formula ($R_{2}=(\left\lbrace A,B,C,D,E,F,G \right\rbrace, F_{2})$) inside a sentence.
331
+ ```
332
+
333
+ and block formulas (denoted by `\[` and `\]`) put on a single line
334
+
335
+ ```
336
+ \[\sum_{n=1}^\infty \frac{1}{n} = \infty\]
337
+ ```
338
+
339
+ It is also possible to reference block formulas by giving them a label, like in the following example:
340
+
341
+ ```
342
+ \[my sum:\sum_{n=1}^\infty \frac{1}{n} = \infty\]
343
+ ```
344
+
345
+ You can now reference it in the text by writing
346
+
347
+ ```
348
+ Yada yada [formula:my sum] yada shebang.
349
+ ```
350
+
351
+ Without JavaScript the formulas are shown as their LaTeX code.
352
+
353
+ [Temml](https://temml.org) is written by Ron Kok and published under the MIT license ([source code](https://github.com/ronkok/Temml)). It started as a fork of [KaTeX](https://katex.org). The engine ships an unchanged copy (version 0.14.0) in `static/js/temml/`, together with its license.
354
+
355
+ How it works: redel puts every formula, with its delimiters, into a `<span class="formula">`. The engine (`static/js/engine.js`) loads Temml only for pages that contain one, and replaces the TeX with MathML. Browsers without MathML keep the TeX.
356
+
357
+ ### Table of Contents
358
+
359
+ On every Page you can insert a table of contents for inter-page navigation. You can jump to all headings.
360
+
361
+ ```
362
+ [toc]
363
+ ```
364
+
365
+ or
366
+
367
+ ```
368
+ [table of contents]
369
+ ```
370
+
371
+ ### Compartments
372
+
373
+ First of all the corresponding Διδακτικη wiki-service on the *admin* page has to be configured (only *managers* may do this) to allow *group*, *team* or *person* oriented wikis.
374
+ There are three values for each type: **no**, **public** and **private**.
375
+
376
+ * **no**: no wikis for either groups, teams or persons.
377
+ * **public**: wikis are public readable, only the owner(s) (*group*, *team* or *person*) are able to edit the corresponding pages.
378
+ * **private**: only the owner(s) are able to read and edit the corresponding wiki.
379
+
380
+ Afterwards you may insert the following compartment commands on every page of your Διδακτικη:
381
+
382
+ ```
383
+ [user-compartments] all persons
384
+ [user-compartments:g1] all persons in group 1
385
+ [team-compartments] every group and every team
386
+ [team-compartments:g1] every team of group 1
387
+ [group-compartments]
388
+ ```
389
+
390
+ A must: if there is more than one possible group, the group has to be specified in team compartments.
391
+ Exception: admins are not included.
392
+
393
+ ### Print/Export
394
+
395
+ You can establish an HTML version of particular CEWebS pages. List all pages you want to include in the HTML version and add
396
+
397
+ ```
398
+ [export-html-index:/CEWebS/static/styles/content.css]
399
+ ```
400
+
401
+ Example:
402
+
403
+ ```
404
+ [export-html-index:/CEWebS/static/styles/content.css]
405
+ [[Course Goals]]
406
+ [[Course Schedule]]
407
+ ```
408
+
409
+ The parameter has to be a link to a css that will be included in the resulting page. To export the current page you can write:
410
+
411
+ ```
412
+ [export-html:/CEWebS/static/styles/content.css]
413
+ ```
414
+
415
+ A second export format is LaTeX. The result is a ZIP File with all included pages as individual .tex documents plus an Image directory. The syntax is consistent with the HTML export:
416
+
417
+ * `[export-latex-index]` for exporting all sub-pages.
418
+ * `[export-latex]` for exporting the current page.
419
+
13
420
  ## License
14
421
 
15
422
  GPL-3.0-or-later, see LICENSE.GPL.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cewebs-didaktiki"
3
- s.version = "3.0.2"
3
+ s.version = "3.0.3"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "GPL-3.0-or-later"
6
6
  s.summary = "Wiki for CEWebS"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.email = 'juergen.mangler@gmail.com'
21
21
  s.homepage = 'http://www.cewebs.org'
22
22
 
23
- s.add_runtime_dependency 'cewebs-servicesbase', '~> 3.0'
23
+ s.add_runtime_dependency 'cewebs-servicesbase', '~> 3.0', '>= 3.0.2'
24
24
  s.add_runtime_dependency 'diff-lcs', '~> 1.6'
25
25
  s.add_runtime_dependency 'mimemagic', '~> 0.4'
26
26
  end
@@ -58,7 +58,8 @@ module Didaktiki
58
58
  when 'versions'
59
59
  CEWebS::Prepare.new(:cachekey => key.call(c.what,r.user), :authenticate => true)
60
60
  when 'pages'
61
- CEWebS::Prepare.new(:cachekey => key.call(r.user), :authenticate => true)
61
+ # the page it was opened from, for [back]
62
+ CEWebS::Prepare.new(:cachekey => key.call(r.user,c.name('what')), :authenticate => true)
62
63
  when 'latex', 'html', 'edit', 'save', 'versionshow', 'diff', 'ascurrent', 'image', 'file', 'delete', 'discuss', 'exportwiki'
63
64
  CEWebS::Prepare.new(:cachekey => '', :authenticate => true)
64
65
  when 'aresource'
@@ -85,7 +86,7 @@ module Didaktiki
85
86
  CEWebS::Document.new(:content => view.render(:backlinks), :modified => modified)
86
87
  when 'pages'
87
88
  modified = r.newer(*c.files(File.join(c.path,'linking.xml'))) or return nil
88
- CEWebS::Document.new(:content => view.render(:pages), :modified => modified)
89
+ CEWebS::Document.new(:content => view.render(:pages), :modified => modified, :access => c.name('what') == '' ? [] : [back(c)])
89
90
  when 'versions'
90
91
  return message(c,'accessdenied') unless c.access.edit?
91
92
  modified = r.newer(*c.files(c.storage.cpath + 'revisions.xml')) or return nil
@@ -158,7 +159,7 @@ module Didaktiki
158
159
  meta = page.meta
159
160
  end
160
161
  content = c.xhtml(text,s,s.current,meta['discussion'])[0]
161
- access = [{ :href => c.link('pages',nil), :text => c.strings.sfind('pages') }]
162
+ access = [{ :href => c.link('pages'), :text => c.strings.sfind('pages') }]
162
163
  access << { :href => c.link('versions'), :text => c.strings.sfind('versions') } unless s.new?
163
164
  access << { :href => c.link('edit'), :text => c.strings.sfind('edit') }
164
165
  CEWebS::Document.new(
@@ -237,10 +238,13 @@ module Didaktiki
237
238
  file = upload(c) or return
238
239
  factor = 10 - c.r.raw('max').to_i.clamp(0,7)
239
240
  width, height = %w{maxwidth maxheight}.map { |m| c.custom.find("number(/custom/object/@#{m})").to_i }
240
- png = ReDel::Image::shrink(file.data,width * factor / 10,height) or return
241
- width, height = ReDel::Image::size(png)
241
+ width = width * factor / 10
242
+ # twice the pixels of the size it is shown at, so it is sharp on high resolution screens
243
+ png = ReDel::Image::shrink(file.data,width * 2,height * 2) or return
244
+ pw, ph = ReDel::Image::size(png)
245
+ scale = [1.0, width.to_f / pw, height.to_f / ph].min
242
246
  c.storage.add_object(file.value,file.data,nil,:images_orig)
243
- c.storage.add_object(file.value,png,{ 'width' => width, 'height' => height },:images)
247
+ c.storage.add_object(file.value,png,{ 'width' => (pw * scale).round, 'height' => (ph * scale).round },:images)
244
248
  end #}}}
245
249
 
246
250
  def save(c,text,eid,comment,meta,base,name) #{{{
@@ -317,7 +317,8 @@ module Wiki
317
317
  ti
318
318
  end
319
319
  def mP_CODE(ts,ti,te)
320
- temp = ti.gsub(/^ /,'')
320
+ # the space of the first line is already consumed by the pattern (ts)
321
+ temp = ti.gsub(/\n /,"\n")
321
322
  @tree.last.data = { :language => "", :label => "", :caption => "", :data => "" }
322
323
  temp.gsub!(/^\[language:([^\]]+)\][ \t]*\n/) do |m|
323
324
  @tree.last.data[:language] = $1
@@ -51,7 +51,7 @@ module Didaktiki
51
51
  form_ :id => 'CEWebS_discuss', :action => @c.link('discuss'), :method => 'post' do
52
52
  input_ :type => 'hidden', :name => 'CEWebS_id', :value => ''
53
53
  div_ { input_ :class => 'size-max border', :type => 'text', :name => 'CEWebS_comment', :value => '' }
54
- div_ { input_ :type => 'submit', :value => h(s('submit')) }
54
+ div_ { input_ :type => 'submit', :value => h_!(s('submit')) }
55
55
  nil
56
56
  end
57
57
  nil
@@ -82,7 +82,7 @@ module Didaktiki
82
82
  end #}}}
83
83
 
84
84
  def backlinks #{{{
85
- h1_ { h(s('backlinks')) % capture { a_(:href => @c.link('show')) { @c.what } } }
85
+ h1_ { h_!(s('backlinks')) % capture_! { a_(:href => @c.link('show')) { @c.what } } }
86
86
  links = backlink_names
87
87
  return div_(s('backlinksempty')) if links.empty?
88
88
  ul_ do
@@ -97,8 +97,10 @@ module Didaktiki
97
97
  linked = doc.find('/main/page/link/@name').map(&:to_s)
98
98
  cell = { :class => 'margin-left-big margin-right-big' }
99
99
 
100
- div_(:class => 'margin-top-huge') { @strings.sffind('pagesintro') }
101
- div_ { a_ s('exportwiki'), :href => @c.link('exportwiki',nil,'file'); nil }
100
+ div_(:class => 'margin-top-huge') do
101
+ text_ h_!(s('pagesintro')) + ' '
102
+ a_peg_ s('exportwiki'), :href => @c.link('exportwiki',nil,'file')
103
+ end
102
104
  table_ :id => 'pages', :class => 'margin-top-huge' do
103
105
  thead_ do
104
106
  tr_ do
@@ -124,7 +126,7 @@ module Didaktiki
124
126
  unless linked.include?(ele.attributes['name']) || exceptions.include?(ele.attributes['name'])
125
127
  span_ s('orphan'), :class => 'urgent'
126
128
  space_
127
- a_peg_ s('delete'), :onclick => "return confirm('#{h(s('deletewarn'))}');", :href => @c.link('delete',name), :'data-post' => 'true'
129
+ a_peg_ s('delete'), :onclick => "return confirm('#{h_!(s('deletewarn'))}');", :href => @c.link('delete',name), :'data-post' => 'true'
128
130
  end
129
131
  nil
130
132
  end
@@ -158,14 +160,14 @@ module Didaktiki
158
160
  @c.storage.get_history(@c.custom.find('number(/custom/revisions)').to_i).reverse_each do |ele|
159
161
  tr_ do
160
162
  td_(:class => 'margin-left-huge nowrap') do
161
- text_ h(s('revision')) + ' '
163
+ text_ h_!(s('revision')) + ' '
162
164
  a_ ele.rev, :href => @c.link('versionshow') + "&amp;CEWebS_rev=#{ele.rev}"
163
165
  end
164
166
  td_(cell) { input_ :type => 'radio', :name => 'CEWebS_from', :value => ele.rev, :checked => (ele.rev == current ? 'checked' : nil) }
165
167
  td_(cell) { input_ :type => 'radio', :name => 'CEWebS_to', :value => ele.rev, :checked => (ele.rev == current-1 || current == 1 ? 'checked' : nil) }
166
168
  td_ Time.parse(ele.modified).strftime(s('statusdate')), cell
167
169
  td_(cell) do
168
- text_ h("#{ele.user} - #{ele.comment} ")
170
+ text_ h_!("#{ele.user} - #{ele.comment} ")
169
171
  span_ "(#{ele.action})", :class => 'urgent' if ele.action
170
172
  nil
171
173
  end
@@ -204,13 +206,13 @@ module Didaktiki
204
206
  { 'plock' => 'plock', 'alock' => 'alock', 'notexport' => 'exportnotpossible', 'discussion' => 'discussion' }.each do |name,string|
205
207
  div_ do
206
208
  input_ :type => 'checkbox', :name => "CEWebS_#{name}", :value => 'true', :checked => (meta[name] ? 'checked' : nil)
207
- text_ ' ' + h(s(string))
209
+ text_ ' ' + h_!(s(string))
208
210
  end
209
211
  end
210
212
  div_ :class => 'border-top' do
211
- text_ h(s('name')) + ': '
213
+ text_ h_!(s('name')) + ': '
212
214
  input_ :type => 'text', :name => 'CEWebS_name', :value => @c.what
213
- text_ ' ' + h(s('name_exp'))
215
+ text_ ' ' + h_!(s('name_exp'))
214
216
  end
215
217
  end
216
218
  end
@@ -232,9 +234,23 @@ module Didaktiki
232
234
  div_(:id => 'help', :class => 'border') { @strings.sffind('helptext') }
233
235
  end
234
236
 
237
+ # the text fills the page, the panels are at its bottom. All panels share one grid cell, the hidden
238
+ # ones still take up space, so the cell is as high as the highest of help and configuration.
239
+ # Images and files do not count (contain), they fill the cell and their lists scroll.
240
+ style_ <<~end
241
+ #content { box-sizing: border-box; height: 100%; display: flex; flex-direction: column; }
242
+ #icontent { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 100%; grid-template-rows: minmax(10em,1fr) auto auto auto; }
243
+ #CEWebSEdit { display: contents; }
244
+ #CEWebS_text { box-sizing: border-box; height: 100%; resize: none; }
245
+ #configuration, #images, #files, #help { grid-row: 4; grid-column: 1; box-sizing: border-box; }
246
+ #help > ul { margin-bottom: 0; }
247
+ #images, #files { contain: size; display: flex; flex-direction: column; }
248
+ #images table, #files table { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
249
+ end
250
+
235
251
  javascript_ <<~end
236
252
  function activate(on) {
237
- ['images','files','help','configuration'].forEach(function(id) { document.getElementById(id).style.display = (id == on ? 'block' : 'none'); });
253
+ ['images','files','help','configuration'].forEach(function(id) { document.getElementById(id).style.visibility = (id == on ? '' : 'hidden'); });
238
254
  }
239
255
  function submitObject(form) {
240
256
  document.forms[form].CEWebS_text.value = document.forms['CEWebSEdit'].CEWebS_text.value;
@@ -282,7 +298,7 @@ module Didaktiki
282
298
  td_(cell) { name }
283
299
  td_ "#{ele.meta['width']}x#{ele.meta['height']}", cell if type == 'images'
284
300
  td_(cell) { a_peg_ s('delete'), :href => "javascript:delObject('#{id}','#{form}')" }
285
- td_(:class => 'align-bottom important') { "[#{command}:#{name}|#{h(s("#{type}description"))}]" }
301
+ td_(:class => 'align-bottom important') { "[#{command}:#{name}|#{h_!(s("#{type}description"))}]" }
286
302
  end
287
303
  end
288
304
  nil