Wiki-Quellcode von FORMCYCLE Hilfe
Zeige letzte Bearbeiter
author | version | line-number | content |
---|---|---|---|
1 | {{velocity}} | ||
2 | #set ($mainCards = [{ | ||
3 | 'iconfc': 'square-edit-outline', | ||
4 | 'title': 'Formulardesigner', | ||
5 | 'description': 'Arbeiten mit dem Formulardesigner', | ||
6 | 'documentation': "Formcycle.FormDesigner" | ||
7 | }, { | ||
8 | 'iconfc': 'workflow-fill', | ||
9 | 'title': 'Workflow', | ||
10 | 'description': 'Formulardaten verarbeiten', | ||
11 | 'documentation': 'Formcycle.UserInterface.MyForms.WorkflowProcessing' | ||
12 | }, { | ||
13 | 'iconfc': 'wrench', | ||
14 | 'title': 'Verwaltung', | ||
15 | 'description': 'Benutzerverwaltung, LDAP, Datenbanken, Dateien, Templates und vieles mehr', | ||
16 | 'documentation': 'Formcycle.UserInterface' | ||
17 | }, { | ||
18 | 'iconfc': 'inbox', | ||
19 | 'title': 'Posteingang', | ||
20 | 'description': 'Formulardaten organisieren', | ||
21 | 'documentation': 'Formcycle.Inbox' | ||
22 | }, { | ||
23 | 'icon': 'fa fa-download', | ||
24 | 'title': 'Installation', | ||
25 | 'description': 'FORMCYCLE installieren oder aktualisieren', | ||
26 | 'documentation': 'Formcycle.Installation' | ||
27 | }, { | ||
28 | 'iconfc': 'form', | ||
29 | 'title': 'Beispiele', | ||
30 | 'description': 'Beispiele für Formulareinbindungen und Formulare', | ||
31 | 'documentation': 'doc:Examples.WebHome' | ||
32 | }]) | ||
33 | |||
34 | ## 'icon': 'fa fa-play-circle', | ||
35 | ## 'title': 'Einführungsvideos', | ||
36 | ## 'description': 'Kurze Videos zum Vorstellen einzelner FORMCYCLE-Funktionen; ggf. Titel "Schnelleinstieg"', | ||
37 | ## 'documentation': 'https://formcycle.eu/de/features' | ||
38 | ##}, { | ||
39 | ## 'iconfc': 'puzzle', | ||
40 | ## 'title': 'Anwendungsfälle', | ||
41 | ## 'description': 'Formulardaten verarbeiten', | ||
42 | ## 'documentation': 'doc:Anwendungsfälle.WebHome' | ||
43 | ##}, { | ||
44 | |||
45 | #set ($smallCards = [{ | ||
46 | 'iconfc': 'information-outline', | ||
47 | 'title': 'Workshops', | ||
48 | 'description': 'Workshops zu verschiedenen Themen rund um FORMCYCLE', | ||
49 | 'documentation': 'doc:Workshops.WebHome' | ||
50 | }, { | ||
51 | 'icon': 'fa fa-cloud', | ||
52 | 'title': 'FORM.CLOUD', | ||
53 | 'description': 'Informationen zur XIMA FORM.CLOUD', | ||
54 | 'documentation': 'doc:FORMCLOUD.WebHome' | ||
55 | }, { | ||
56 | 'iconfc': 'action-change-status', | ||
57 | 'title': 'Einbindung externer Systeme', | ||
58 | 'description': 'Einbindung von FORMCYCLE in CMS/DMS-Systeme', | ||
59 | 'documentation': 'Formcycle.CMSExtension' | ||
60 | }, { | ||
61 | 'iconfc': 'puzzle', | ||
62 | 'title': 'Plugin-Dokumentation', | ||
63 | 'description': 'Dokumentation der für FORMCYCLE verfügbaren Plugins', | ||
64 | 'documentation': 'Formcycle.PluginDocumentation' | ||
65 | }, { | ||
66 | 'icon': 'fa fa-list', | ||
67 | 'title': 'Release Notes', | ||
68 | 'description': 'Release Notes und Download der aktuellen Version', | ||
69 | 'documentation': 'doc:Blog.WebHome' | ||
70 | }, { | ||
71 | 'iconfc': 'comment-faq-outline', | ||
72 | 'title': 'Häufig gestellte Fragen', | ||
73 | 'description': 'Häufig gestellte Fragen', | ||
74 | 'documentation': "https://faq.formcycle.eu/" | ||
75 | }]) | ||
76 | |||
77 | ## 'icon': 'fa fa-share-square', | ||
78 | ## 'title': 'Daten extern weiterverarbeiten', | ||
79 | ## 'description': 'Mit FORMCYCLE erfasste Daten an andere Systeme weiterleiten', | ||
80 | ## 'documentation': 'Formcycle.UserInterface.MyForms.WorkflowProcessing' | ||
81 | ##}, { | ||
82 | |||
83 | |||
84 | |||
85 | {{html}} | ||
86 | ##$jsontool.serialize(${mainCards})<br> | ||
87 | ##$jsontool.serialize($mainCards)<br> | ||
88 | {{/html}} | ||
89 | |||
90 | {{MainMenuTiles cards='$jsontool.serialize($mainCards)' /}} | ||
91 | |||
92 | {{MainMenuTiles cards='$jsontool.serialize($smallCards)' type="small" /}} | ||
93 | |||
94 | {{/velocity}} | ||
95 | |||
96 | {{velocity}} | ||
97 | {{html wiki="false" clean="false"}} | ||
98 | |||
99 | |||
100 | |||
101 | <style> | ||
102 | .jqcloud{font:10px Helvetica,Arial,sans-serif;line-height:normal;overflow:hidden;position:relative}.jqcloud-word{margin:0;padding:0}.jqcloud-word.w1{color:#aab5f0;font-size:100%}.jqcloud-word.w2{color:#9ce;font-size:150%}.jqcloud-word.w3{color:#a0ddff;font-size:200%}.jqcloud-word.w4{color:#90c5f0;font-size:250%}.jqcloud-word.w5{color:#90a0dd;font-size:300%}.jqcloud-word.w6{color:#90c5f0;font-size:350%}.jqcloud-word.w7{color:#39d;font-size:400%}.jqcloud-word.w8{color:#0cf;font-size:450%}.jqcloud-word.w9{color:#0cf;font-size:500%}.jqcloud-word.w10{color:#0cf;font-size:550%}.jqcloud-word a{color:inherit;font-size:inherit;text-decoration:none}.jqcloud-word a:hover{color:#0cf} | ||
103 | .jqcloud span { | ||
104 | -moz-user-select: -moz-none; | ||
105 | -khtml-user-select: none; | ||
106 | -webkit-user-select: none; | ||
107 | -ms-user-select: none; | ||
108 | user-select: none; | ||
109 | background-color: #eaeaef; | ||
110 | border-radius: 10px; | ||
111 | padding: 0px 4px 0px 4px; | ||
112 | } | ||
113 | .jqcloud span.jqHighlight { | ||
114 | color: #0cf !important; | ||
115 | } | ||
116 | .jQButton { | ||
117 | color: #fff; | ||
118 | background-color: #3480AD;/*#f0f0f3*/ | ||
119 | text-align: center; | ||
120 | display: inline-block; | ||
121 | border-radius: 4px; | ||
122 | padding: 4px 10px 4px 22px; | ||
123 | font-size: 15px | ||
124 | margin: auto; | ||
125 | margin-bottom: 5px; | ||
126 | -moz-user-select: -moz-none; | ||
127 | -khtml-user-select: none; | ||
128 | -webkit-user-select: none; | ||
129 | -ms-user-select: none; | ||
130 | user-select: none; | ||
131 | } | ||
132 | .jQButton[active=false] { | ||
133 | background-color: #a7a7a7; | ||
134 | } | ||
135 | .jQButton:hover { | ||
136 | background-color: #0cf; | ||
137 | } | ||
138 | .jQButton[active=false]:hover { | ||
139 | background-color: #676767; | ||
140 | } | ||
141 | .jQButton .jQButton-icon::before { | ||
142 | font-family: "FontAwesome"; | ||
143 | font-size: 14px; | ||
144 | font-weight: 400; | ||
145 | content: "\f046"; | ||
146 | } | ||
147 | .jQButton[active=false] .jQButton-icon::before { | ||
148 | content: "\f096"; | ||
149 | } | ||
150 | .jQButton-icon { | ||
151 | position: absolute; | ||
152 | margin-left: -11px; | ||
153 | } | ||
154 | </style> | ||
155 | |||
156 | <script> | ||
157 | require(['jquery'],function(XjQ) { | ||
158 | 'use strict'; | ||
159 | |||
160 | /* | ||
161 | * Plugin class | ||
162 | */ | ||
163 | var jQCloud = function(element, word_array, options) { | ||
164 | this.Xelement = XjQ(element); | ||
165 | |||
166 | this.word_array = word_array || []; | ||
167 | this.options = options; | ||
168 | |||
169 | this.sizeGenerator = null; | ||
170 | this.colorGenerator = null; | ||
171 | |||
172 | // Data used internally | ||
173 | this.data = { | ||
174 | placed_words: [], | ||
175 | timeouts: {}, | ||
176 | namespace: null, | ||
177 | step: null, | ||
178 | angle: null, | ||
179 | aspect_ratio: null, | ||
180 | max_weight: null, | ||
181 | min_weight: null, | ||
182 | sizes: [], | ||
183 | colors: [] | ||
184 | }; | ||
185 | |||
186 | this.initialize(); | ||
187 | }; | ||
188 | |||
189 | jQCloud.DEFAULTS = { | ||
190 | width: 100, | ||
191 | height: 100, | ||
192 | center: { x: 0.5, y: 0.5 }, | ||
193 | steps: 10, | ||
194 | delay: null, | ||
195 | shape: 'elliptic', | ||
196 | classPattern: 'w{n}', | ||
197 | encodeURI: true, | ||
198 | removeOverflowing: true, | ||
199 | afterCloudRender: null, | ||
200 | autoResize: false, | ||
201 | colors: null, | ||
202 | fontSize: null, | ||
203 | template: null | ||
204 | }; | ||
205 | |||
206 | jQCloud.prototype = { | ||
207 | initialize: function() { | ||
208 | // Set/Get dimensions | ||
209 | if (this.options.width) { | ||
210 | this.Xelement.width(this.options.width); | ||
211 | } | ||
212 | else { | ||
213 | this.options.width = this.Xelement.width(); | ||
214 | } | ||
215 | if (this.options.height) { | ||
216 | this.Xelement.height(this.options.height); | ||
217 | } | ||
218 | else { | ||
219 | this.options.height = this.Xelement.height(); | ||
220 | } | ||
221 | |||
222 | // Default options value | ||
223 | this.options = XjQ.extend(true, {}, jQCloud.DEFAULTS, this.options); | ||
224 | |||
225 | // Ensure delay | ||
226 | if (this.options.delay === null) { | ||
227 | this.options.delay = this.word_array.length > 50 ? 10 : 0; | ||
228 | } | ||
229 | |||
230 | // Backward compatibility | ||
231 | if (this.options.center.x > 1) { | ||
232 | this.options.center.x = this.options.center.x / this.options.width; | ||
233 | this.options.center.y = this.options.center.y / this.options.height; | ||
234 | } | ||
235 | |||
236 | // Create colorGenerator function from options | ||
237 | // Direct function | ||
238 | if (typeof this.options.colors == 'function') { | ||
239 | this.colorGenerator = this.options.colors; | ||
240 | } | ||
241 | // Array of sizes | ||
242 | else if (XjQ.isArray(this.options.colors)) { | ||
243 | var cl = this.options.colors.length; | ||
244 | if (cl > 0) { | ||
245 | // Fill the sizes array to X items | ||
246 | if (cl < this.options.steps) { | ||
247 | for (var i = cl; i < this.options.steps; i++) { | ||
248 | this.options.colors[i] = this.options.colors[cl - 1]; | ||
249 | } | ||
250 | } | ||
251 | |||
252 | this.colorGenerator = function(weight) { | ||
253 | return this.options.colors[this.options.steps - weight]; | ||
254 | }; | ||
255 | } | ||
256 | } | ||
257 | |||
258 | // Create sizeGenerator function from options | ||
259 | // Direct function | ||
260 | if (typeof this.options.fontSize == 'function') { | ||
261 | this.sizeGenerator = this.options.fontSize; | ||
262 | } | ||
263 | // Object with 'from' and 'to' | ||
264 | else if (XjQ.isPlainObject(this.options.fontSize)) { | ||
265 | this.sizeGenerator = function(width, height, weight) { | ||
266 | var max = width * this.options.fontSize.from, | ||
267 | min = width * this.options.fontSize.to; | ||
268 | return Math.round(min + (max - min) * 1.0 / (this.options.steps - 1) * (weight - 1)) + 'px'; | ||
269 | }; | ||
270 | } | ||
271 | // Array of sizes | ||
272 | else if (XjQ.isArray(this.options.fontSize)) { | ||
273 | var sl = this.options.fontSize.length; | ||
274 | if (sl > 0) { | ||
275 | // Fill the sizes array to X items | ||
276 | if (sl < this.options.steps) { | ||
277 | for (var j = sl; j < this.options.steps; j++) { | ||
278 | this.options.fontSize[j] = this.options.fontSize[sl - 1]; | ||
279 | } | ||
280 | } | ||
281 | |||
282 | this.sizeGenerator = function(width, height, weight) { | ||
283 | return this.options.fontSize[this.options.steps - weight]; | ||
284 | }; | ||
285 | } | ||
286 | } | ||
287 | |||
288 | this.data.angle = Math.random() * 6.28; | ||
289 | this.data.step = (this.options.shape === 'rectangular') ? 18.0 : 2.0; | ||
290 | this.data.aspect_ratio = this.options.width / this.options.height; | ||
291 | this.clearTimeouts(); | ||
292 | |||
293 | // Namespace word ids to avoid collisions between multiple clouds | ||
294 | this.data.namespace = (this.Xelement.attr('id') || Math.floor((Math.random() * 1000000)).toString(36)) + '_word_'; | ||
295 | |||
296 | this.Xelement.addClass('jqcloud'); | ||
297 | |||
298 | // Container's CSS position cannot be 'static' | ||
299 | if (this.Xelement.css('position') === 'static') { | ||
300 | this.Xelement.css('position', 'relative'); | ||
301 | } | ||
302 | |||
303 | // Delay execution so that the browser can render the page before the computatively intensive word cloud drawing | ||
304 | this.createTimeout(XjQ.proxy(this.drawWordCloud, this), 10); | ||
305 | |||
306 | // Attach window resize event | ||
307 | if (this.options.autoResize) { | ||
308 | XjQ(window).on('resize.' + this.data.namespace, throttle(this.resize, 50, this)); | ||
309 | } | ||
310 | }, | ||
311 | |||
312 | // Helper function to keep track of timeouts so they can be destroyed | ||
313 | createTimeout: function(callback, time) { | ||
314 | var timeout = setTimeout(XjQ.proxy(function() { | ||
315 | delete this.data.timeouts[timeout]; | ||
316 | callback(); | ||
317 | }, this), time); | ||
318 | this.data.timeouts[timeout] = true; | ||
319 | }, | ||
320 | |||
321 | // Destroy all timeouts | ||
322 | clearTimeouts: function() { | ||
323 | XjQ.each(this.data.timeouts, function(key) { | ||
324 | clearTimeout(key); | ||
325 | }); | ||
326 | this.data.timeouts = {}; | ||
327 | }, | ||
328 | |||
329 | // Pairwise overlap detection | ||
330 | overlapping: function(a, b) { | ||
331 | if (Math.abs(2.0 * a.left + a.width - 2.0 * b.left - b.width) < a.width + b.width) { | ||
332 | if (Math.abs(2.0 * a.top + a.height - 2.0 * b.top - b.height) < a.height + b.height) { | ||
333 | return true; | ||
334 | } | ||
335 | } | ||
336 | return false; | ||
337 | }, | ||
338 | |||
339 | // Helper function to test if an element overlaps others | ||
340 | hitTest: function(elem) { | ||
341 | // Check elements for overlap one by one, stop and return false as soon as an overlap is found | ||
342 | for (var i = 0, l = this.data.placed_words.length; i < l; i++) { | ||
343 | if (this.overlapping(elem, this.data.placed_words[i])) { | ||
344 | return true; | ||
345 | } | ||
346 | } | ||
347 | return false; | ||
348 | }, | ||
349 | |||
350 | // Initialize the drawing of the whole cloud | ||
351 | drawWordCloud: function() { | ||
352 | var i, l; | ||
353 | |||
354 | this.Xelement.children('[id^="' + this.data.namespace + '"]').remove(); | ||
355 | |||
356 | if (this.word_array.length === 0) { | ||
357 | return; | ||
358 | } | ||
359 | |||
360 | // Make sure every weight is a number before sorting | ||
361 | for (i = 0, l = this.word_array.length; i < l; i++) { | ||
362 | this.word_array[i].weight = parseFloat(this.word_array[i].weight, 10); | ||
363 | } | ||
364 | |||
365 | // Sort word_array from the word with the highest weight to the one with the lowest | ||
366 | this.word_array.sort(function(a, b) { | ||
367 | return b.weight - a.weight; | ||
368 | }); | ||
369 | |||
370 | // Kepp trace of bounds | ||
371 | this.data.max_weight = this.word_array[0].weight; | ||
372 | this.data.min_weight = this.word_array[this.word_array.length - 1].weight; | ||
373 | |||
374 | // Generate colors | ||
375 | this.data.colors = []; | ||
376 | if (this.colorGenerator) { | ||
377 | for (i = 0; i < this.options.steps; i++) { | ||
378 | this.data.colors.push(this.colorGenerator(i + 1)); | ||
379 | } | ||
380 | } | ||
381 | |||
382 | // Generate font sizes | ||
383 | this.data.sizes = []; | ||
384 | if (this.sizeGenerator) { | ||
385 | for (i = 0; i < this.options.steps; i++) { | ||
386 | this.data.sizes.push(this.sizeGenerator(this.options.width, this.options.height, i + 1)); | ||
387 | } | ||
388 | } | ||
389 | |||
390 | // Iterate drawOneWord on every word, immediately or with delay | ||
391 | if (this.options.delay > 0) { | ||
392 | this.drawOneWordDelayed(); | ||
393 | } | ||
394 | else { | ||
395 | for (i = 0, l = this.word_array.length; i < l; i++) { | ||
396 | this.drawOneWord(i, this.word_array[i]); | ||
397 | } | ||
398 | |||
399 | if (typeof this.options.afterCloudRender === 'function') { | ||
400 | this.options.afterCloudRender.call(this.Xelement); | ||
401 | } | ||
402 | } | ||
403 | }, | ||
404 | |||
405 | // Function to draw a word, by moving it in spiral until it finds a suitable empty place | ||
406 | drawOneWord: function(index, word) { | ||
407 | var word_id = this.data.namespace + index, | ||
408 | word_selector = '#' + word_id, | ||
409 | |||
410 | // option.shape == 'elliptic' | ||
411 | angle = this.data.angle, | ||
412 | radius = 0.0, | ||
413 | |||
414 | // option.shape == 'rectangular' | ||
415 | steps_in_direction = 0.0, | ||
416 | quarter_turns = 0.0, | ||
417 | |||
418 | weight = Math.floor(this.options.steps / 2), | ||
419 | word_span, | ||
420 | word_size, | ||
421 | word_style; | ||
422 | |||
423 | // Create word attr object | ||
424 | //word.attr = XjQ.extend({}, word.html, { id: word_id }); | ||
425 | word.attr = XjQ.extend({}, word.html, { id: word_id, group: (word.group ? word.group : "") }); | ||
426 | |||
427 | // Linearly map the original weight to a discrete scale from 1 to 10 | ||
428 | // Only if weights are different | ||
429 | if (this.data.max_weight != this.data.min_weight) { | ||
430 | weight = Math.round((word.weight - this.data.min_weight) * 1.0 * (this.options.steps - 1) / (this.data.max_weight - this.data.min_weight)) + 1; | ||
431 | } | ||
432 | word_span = XjQ('<span>').attr(word.attr); | ||
433 | |||
434 | word_span.addClass('jqcloud-word'); | ||
435 | |||
436 | // Apply class | ||
437 | if (this.options.classPattern) { | ||
438 | word_span.addClass(this.options.classPattern.replace('{n}', weight)); | ||
439 | } | ||
440 | |||
441 | // Apply color | ||
442 | if (this.data.colors.length) { | ||
443 | word_span.css('color', this.data.colors[weight - 1]); | ||
444 | } | ||
445 | |||
446 | // Apply color from word property | ||
447 | if (word.color) { | ||
448 | word_span.css('color', word.color); | ||
449 | } | ||
450 | |||
451 | // Apply size | ||
452 | if (this.data.sizes.length) { | ||
453 | word_span.css('font-size', this.data.sizes[weight - 1]); | ||
454 | } | ||
455 | |||
456 | //Render using template function if provided. | ||
457 | if (this.options.template) { | ||
458 | word_span.html(this.options.template(word)); | ||
459 | } else if (word.link) { | ||
460 | // Append link if word.link attribute was set | ||
461 | // If link is a string, then use it as the link href | ||
462 | if (typeof word.link === 'string') { | ||
463 | word.link = { href: word.link }; | ||
464 | } | ||
465 | |||
466 | if (this.options.encodeURI) { | ||
467 | word.link.href = encodeURI(word.link.href).replace(/'/g, '%27'); | ||
468 | } | ||
469 | |||
470 | word_span.append(XjQ('<a>').attr(word.link).text(word.text)); | ||
471 | } | ||
472 | else { | ||
473 | word_span.text(word.text); | ||
474 | } | ||
475 | |||
476 | // Bind handlers to words | ||
477 | if (word.handlers) { | ||
478 | word_span.on(word.handlers); | ||
479 | } | ||
480 | |||
481 | this.Xelement.append(word_span); | ||
482 | |||
483 | word_size = { | ||
484 | width: word_span.outerWidth(), | ||
485 | height: word_span.outerHeight() | ||
486 | }; | ||
487 | word_size.left = this.options.center.x * this.options.width - word_size.width / 2.0; | ||
488 | word_size.top = this.options.center.y * this.options.height - word_size.height / 2.0; | ||
489 | |||
490 | // Save a reference to the style property, for better performance | ||
491 | word_style = word_span[0].style; | ||
492 | word_style.position = 'absolute'; | ||
493 | word_style.left = word_size.left + 'px'; | ||
494 | word_style.top = word_size.top + 'px'; | ||
495 | |||
496 | while (this.hitTest(word_size)) { | ||
497 | // option shape is 'rectangular' so move the word in a rectangular spiral | ||
498 | if (this.options.shape === 'rectangular') { | ||
499 | steps_in_direction++; | ||
500 | |||
501 | if (steps_in_direction * this.data.step > (1 + Math.floor(quarter_turns / 2.0)) * this.data.step * ((quarter_turns % 4 % 2) === 0 ? 1 : this.data.aspect_ratio)) { | ||
502 | steps_in_direction = 0.0; | ||
503 | quarter_turns++; | ||
504 | } | ||
505 | |||
506 | switch (quarter_turns % 4) { | ||
507 | case 1: | ||
508 | word_size.left += this.data.step * this.data.aspect_ratio + Math.random() * 2.0; | ||
509 | break; | ||
510 | case 2: | ||
511 | word_size.top -= this.data.step + Math.random() * 2.0; | ||
512 | break; | ||
513 | case 3: | ||
514 | word_size.left -= this.data.step * this.data.aspect_ratio + Math.random() * 2.0; | ||
515 | break; | ||
516 | case 0: | ||
517 | word_size.top += this.data.step + Math.random() * 2.0; | ||
518 | break; | ||
519 | } | ||
520 | } | ||
521 | // Default settings: elliptic spiral shape | ||
522 | else { | ||
523 | radius += this.data.step; | ||
524 | angle += (index % 2 === 0 ? 1 : -1) * this.data.step; | ||
525 | |||
526 | word_size.left = this.options.center.x * this.options.width - (word_size.width / 2.0) + (radius * Math.cos(angle)) * this.data.aspect_ratio; | ||
527 | word_size.top = this.options.center.y * this.options.height + radius * Math.sin(angle) - (word_size.height / 2.0); | ||
528 | } | ||
529 | word_style.left = word_size.left + 'px'; | ||
530 | word_style.top = word_size.top + 'px'; | ||
531 | } | ||
532 | |||
533 | // Don't render word if part of it would be outside the container | ||
534 | if (this.options.removeOverflowing && ( | ||
535 | word_size.left < 0 || word_size.top < 0 || | ||
536 | (word_size.left + word_size.width) > this.options.width || | ||
537 | (word_size.top + word_size.height) > this.options.height | ||
538 | ) | ||
539 | ) { | ||
540 | word_span.remove(); | ||
541 | return; | ||
542 | } | ||
543 | |||
544 | // Save position for further usage | ||
545 | this.data.placed_words.push(word_size); | ||
546 | |||
547 | if (typeof word.afterWordRender === 'function') { | ||
548 | word.afterWordRender.call(word_span); | ||
549 | } | ||
550 | }, | ||
551 | |||
552 | // Draw one word then recall the function after a delay | ||
553 | drawOneWordDelayed: function(index) { | ||
554 | index = index || 0; | ||
555 | |||
556 | // if not visible then do not attempt to draw | ||
557 | if (!this.Xelement.is(':visible')) { | ||
558 | this.createTimeout(XjQ.proxy(function() { | ||
559 | this.drawOneWordDelayed(index); | ||
560 | }, this), 10); | ||
561 | |||
562 | return; | ||
563 | } | ||
564 | |||
565 | if (index < this.word_array.length) { | ||
566 | this.drawOneWord(index, this.word_array[index]); | ||
567 | |||
568 | this.createTimeout(XjQ.proxy(function() { | ||
569 | this.drawOneWordDelayed(index + 1); | ||
570 | }, this), this.options.delay); | ||
571 | } | ||
572 | else { | ||
573 | if (typeof this.options.afterCloudRender == 'function') { | ||
574 | this.options.afterCloudRender.call(this.Xelement); | ||
575 | } | ||
576 | } | ||
577 | }, | ||
578 | |||
579 | // Destroy any data and objects added by the plugin | ||
580 | destroy: function() { | ||
581 | if (this.options.autoResize) { | ||
582 | XjQ(window).off('resize.' + this.data.namespace); | ||
583 | } | ||
584 | |||
585 | this.clearTimeouts(); | ||
586 | this.Xelement.removeClass('jqcloud'); | ||
587 | this.Xelement.removeData('jqcloud'); | ||
588 | this.Xelement.children('[id^="' + this.data.namespace + '"]').remove(); | ||
589 | }, | ||
590 | |||
591 | // Update the list of words | ||
592 | update: function(word_array) { | ||
593 | this.word_array = word_array; | ||
594 | this.data.placed_words = []; | ||
595 | |||
596 | this.clearTimeouts(); | ||
597 | this.drawWordCloud(); | ||
598 | }, | ||
599 | |||
600 | resize: function() { | ||
601 | var new_size = { | ||
602 | width: this.Xelement.width(), | ||
603 | height: this.Xelement.height() | ||
604 | }; | ||
605 | |||
606 | if (new_size.width != this.options.width || new_size.height != this.options.height) { | ||
607 | this.options.width = new_size.width; | ||
608 | this.options.height = new_size.height; | ||
609 | this.data.aspect_ratio = this.options.width / this.options.height; | ||
610 | |||
611 | this.update(this.word_array); | ||
612 | } | ||
613 | }, | ||
614 | }; | ||
615 | |||
616 | /* | ||
617 | * Apply throttling to a callback | ||
618 | * @param callback {function} | ||
619 | * @param delay {int} milliseconds | ||
620 | * @param context {object|null} | ||
621 | * @return {function} | ||
622 | */ | ||
623 | function throttle(callback, delay, context) { | ||
624 | var state = { | ||
625 | pid: null, | ||
626 | last: 0 | ||
627 | }; | ||
628 | |||
629 | return function() { | ||
630 | var elapsed = new Date().getTime() - state.last, | ||
631 | args = arguments, | ||
632 | that = this; | ||
633 | |||
634 | function exec() { | ||
635 | state.last = new Date().getTime(); | ||
636 | return callback.apply(context || that, Array.prototype.slice.call(args)); | ||
637 | } | ||
638 | |||
639 | if (elapsed > delay) { | ||
640 | return exec(); | ||
641 | } | ||
642 | else { | ||
643 | clearTimeout(state.pid); | ||
644 | state.pid = setTimeout(exec, delay - elapsed); | ||
645 | } | ||
646 | }; | ||
647 | } | ||
648 | |||
649 | /* | ||
650 | * jQuery plugin | ||
651 | */ | ||
652 | XjQ.fn.jQCloud = function(word_array, option) { | ||
653 | var args = arguments; | ||
654 | |||
655 | return this.each(function() { | ||
656 | var Xthis = XjQ(this), | ||
657 | data = Xthis.data('jqcloud'); | ||
658 | |||
659 | if (!data && word_array === 'destroy') { | ||
660 | // Don't even try to initialize when called with 'destroy' | ||
661 | return; | ||
662 | } | ||
663 | if (!data) { | ||
664 | var options = typeof option === 'object' ? option : {}; | ||
665 | Xthis.data('jqcloud', (data = new jQCloud(this, word_array, options))); | ||
666 | } | ||
667 | else if (typeof word_array === 'string') { | ||
668 | data[word_array].apply(data, Array.prototype.slice.call(args, 1)); | ||
669 | } | ||
670 | }); | ||
671 | }; | ||
672 | |||
673 | XjQ.fn.jQCloud.defaults = { | ||
674 | set: function(options) { | ||
675 | XjQ.extend(true, jQCloud.DEFAULTS, options); | ||
676 | }, | ||
677 | get: function(key) { | ||
678 | var options = jQCloud.DEFAULTS; | ||
679 | if (key) { | ||
680 | options = options[key]; | ||
681 | } | ||
682 | return XjQ.extend(true, {}, options); | ||
683 | } | ||
684 | }; | ||
685 | |||
686 | var jQwords = [ | ||
687 | {text: "Druckvorschau", weight: 9, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
688 | {text: "Link im Formular", weight: 6, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
689 | {text: "Kalenderwidget anpassen", weight: 8, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
690 | {text: "Optionale Daten einer Auswahl mitspeichern (col Attribute)", weight: 4, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
691 | {text: "Aktion vor Absenden ausführen", weight: 5, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
692 | {text: "Absenden ohne Speichern", weight: 9, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
693 | {text: "Eigene Formularfeld-Validatoren (Regex)", weight: 10, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
694 | {text: "Wiederholende Felder (dynamic) im JS adressieren", weight: 10, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
695 | {text: "Events an dynamic Felder anhängen", weight: 9, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
696 | {text: "[Richtext-Editor (Ticket #4227)]", weight: 3, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
697 | {text: "Vorbelegung von Daten im Formular (extern)", weight: 9, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
698 | {text: "intiale Vorbelegung von Daten in Feldern", weight: 9, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
699 | {text: "Formularfelder mit LDAP-Daten vorbelegen (Ticket 3701)", weight: 3, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
700 | {text: "Formulareingaben zurücksetzen", weight: 7, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
701 | {text: "Formulardaten lokal speichern und später wieder laden (Ticket #3964)", weight: 8, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
702 | {text: "Formular zwischenspeichern", weight: 9, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
703 | {text: "Labeltext zur Laufzeit manipulieren (Ticket #3493)", weight: 5, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
704 | {text: "Mehrfachbedingungen im Designer", weight: 7, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
705 | {text: "zusätzliches JS und CSS in allen Formularen", weight: 8, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
706 | {text: "mehrseitige Formulare", weight: 9, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
707 | {text: "responive / mobile Ansicht", weight: 10, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
708 | {text: "andere Schriftart einbinden / Design ändern", weight: 9, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
709 | {text: "Java-Script API", weight: 8, group: 'Designer', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
710 | |||
711 | {text: "Datenquellen für Auswahllisten hinterlegen", weight: 8, group: 'Datenquellen', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
712 | {text: "Datenquellen in Auswahllisten anhand von Parametern hinterlegen", weight: 6, group: 'Datenquellen', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
713 | {text: "Leerer erster Eintrag bei SQL-Datenquelle (Ticket #4068)", weight: 5, group: 'Datenquellen', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
714 | |||
715 | {text: "Mehrfachbedingungen im Workflow", weight: 8, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
716 | {text: "Automatisiertes Löschen nach bestimmten Zeitraum", weight: 9, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
717 | {text: "Exportmöglichkeiten von Daten", weight: 6, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
718 | {text: "E-Mail Aktionen abhängig von Eingaben (Bedingungen) durchführen", weight: 8, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
719 | {text: "Bedingtes Einblenden von Elementen", weight: 7, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
720 | {text: "Mehrstufigen Workflow (Beispiel)", weight: 8, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
721 | {text: "Statuswechsel", weight: 10, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
722 | {text: "Vorgangs-ID im Druck (Word-Fill) anzeigen (Ticket #3813)", weight: 5, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
723 | {text: "iCal Datei erzeugen", weight: 3, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
724 | {text: "aktuelles Datum in der Verarbeitung", weight: 6, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
725 | {text: "Laufende Nummer aus Nummernkreis erzeugen (Ticket #3249)", weight: 3, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
726 | {text: "E-Mail-Versand", weight: 10, group: 'Statusverarbeitung', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
727 | |||
728 | {text: "Migrationsmöglichkeiten in Webseite", weight: 6, group: 'Abschlusseite', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
729 | {text: "Abschlussseite in Webseite anzeigen (inline)", weight: 5, group: 'Abschlusseite', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
730 | {text: "Generierte Dateien auf Abschlussseite anzeigen", weight: 7, group: 'Abschlusseite', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
731 | {text: "Benutzerdefinierte Abschlussseite", weight: 9, group: 'Abschlusseite', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
732 | {text: "Referenznummer (Ticket #3866)", weight: 5, group: 'Abschlusseite', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
733 | |||
734 | {text: "Vorgänge löschen", weight: 9, group: 'Posteingang', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
735 | {text: "Filtermöglichkeiten", weight: 8, group: 'Posteingang', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
736 | {text: "Stauswechsel im Postfach ermöglichen (notwendige Einstellungen)", weight: 6.5, group: 'Posteingang', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
737 | {text: "Postfach exportieren", weight: 7, group: 'Posteingang', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
738 | {text: "Berechtigungen/Sichtbarkeiten für Benutzer festlegen", weight: 6, group: 'Posteingang', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
739 | |||
740 | {text: "Update FORMCYCLE", weight: 4, group: 'Anderes', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
741 | {text: "Zugriffseinschränkung - Möglichkeiten", weight: 3, group: 'Anderes', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
742 | {text: "I-Frame automatisch Höhe anpassen", weight: 5, group: 'Anderes', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
743 | {text: "Daten aus Formular werden nicht gespeichert (Disablede Felder)", weight: 6, group: 'Anderes', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
744 | {text: "Double Opt-In", weight: 7, group: 'Anderes', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/UserInterface/MyForms/DoubleOptIn/'}, | ||
745 | {text: "[Übersicht von Lösungen bei Problemen mit z.B. DB (Ticket #3714, #3057)]", weight: 6, group: 'Anderes', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
746 | {text: "[Tomcat Zugriff HTTPS - Zertifikat-Einrichtung (Ticket #3295)]", weight: 5, group: 'Anderes', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
747 | {text: "Beispiele für Print CSS / Erläuterung was das PDF Print Plugin macht", weight: 7, group: 'Anderes', link: 'https://help.formcycle.eu/xwiki/bin/view/Formcycle/'}, | ||
748 | ]; | ||
749 | ##http://mistic100.github.io/jQCloud/demo.html#handlers | ||
750 | /*XjQ('#jQArea').jQCloud(jQwords, { | ||
751 | classPattern: null, | ||
752 | colors: ["#176694", "#3480AD", "#5398c1", "#76b2d6", "#7ca2b9", "#889fad", "#8e979c", "#929596", "#babbbb"], | ||
753 | fontSize: ['16px','15px','15px','14px','14px','13px','13px','12px','12px'], | ||
754 | //width: 500, | ||
755 | height: 500 | ||
756 | });*/ | ||
757 | |||
758 | var jQButtons = XjQ('.jQButton'); | ||
759 | |||
760 | jQButtons.click(function() { | ||
761 | if (XjQ(this).attr('active') == 'true') { | ||
762 | XjQ('#jQArea').children('span[group="'+XjQ(this).attr('group')+'"]').each(jQTagInvisible); | ||
763 | XjQ(this).attr('active', 'false'); | ||
764 | } else { | ||
765 | XjQ('#jQArea').children('span[group="'+XjQ(this).attr('group')+'"]').each(jQTagVisible); | ||
766 | XjQ(this).attr('active', 'true'); | ||
767 | } | ||
768 | }); | ||
769 | function jQTagVisible() { | ||
770 | XjQ(this).css('display', 'block'); | ||
771 | } | ||
772 | function jQTagInvisible() { | ||
773 | XjQ(this).css('display', 'none'); | ||
774 | } | ||
775 | |||
776 | jQButtons.hover(function() { | ||
777 | console.log("hover",XjQ(this)); | ||
778 | XjQ('#jQArea').children('span[group="'+XjQ(this).attr('group')+'"]').each(jQTagHighlighted); | ||
779 | }, function() { | ||
780 | console.log("unhover",XjQ(this)); | ||
781 | XjQ('#jQArea').children('span[group="'+XjQ(this).attr('group')+'"]').each(jQTagNotHighlighted); | ||
782 | }); | ||
783 | function jQTagHighlighted() { | ||
784 | XjQ(this).addClass('jqHighlight'); | ||
785 | } | ||
786 | function jQTagNotHighlighted() { | ||
787 | XjQ(this).removeClass('jqHighlight'); | ||
788 | } | ||
789 | }); | ||
790 | </script> | ||
791 | <!-- | ||
792 | <div class="row"> | ||
793 | <div class="d-none d-md-block col-lg-12 card-main"> | ||
794 | <div class="well" > | ||
795 | <div id="jQButtons"> | ||
796 | <div id="jQBtn1" class="jQButton" group="Designer" active="true"><span class="jQButton-icon"></span> Designer</div> | ||
797 | <div id="jQBtn1" class="jQButton" group="Datenquellen" active="true"><span class="jQButton-icon"></span> Datenquellen</div> | ||
798 | <div id="jQBtn1" class="jQButton" group="Statusverarbeitung" active="true"><span class="jQButton-icon"></span> Statusverarbeitung</div> | ||
799 | <div id="jQBtn1" class="jQButton" group="Abschlusseite" active="true"><span class="jQButton-icon"></span> Abschlusseite</div> | ||
800 | <div id="jQBtn1" class="jQButton" group="Posteingang" active="true"><span class="jQButton-icon"></span> Posteingang</div> | ||
801 | <div id="jQBtn1" class="jQButton" group="Anderes" active="true"><span class="jQButton-icon"></span> Anderes</div> | ||
802 | </div> | ||
803 | <div id="jQArea"> | ||
804 | </div> | ||
805 | </div> | ||
806 | </div> | ||
807 | </div> | ||
808 | --> | ||
809 | {{/html}} | ||
810 | {{/velocity}} |