File: symbols.inc

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (42 lines) | stat: -rw-r--r-- 1,385 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
!!hack to be able to use getopt after even if there are some = signs in the objects
!!in $(replyoption$i) commas are replaced by spaces

!set symb=!replace internal = by _equal_ in $(replyoption$i)
!set symb=!replace internal symbols_equal_ by symbols= in $symb
!set symbol$i=!getopt symbols in $symb
!set symbol$i=!declosing $(symbol$i)
!set symbol$i=!replace internal _equal_ by = in $(symbol$i)
!set symbol$i=!singlespace $(symbol$i)
!set bcnt=!wordcnt $(symbol$i)
!for b=1 to $bcnt
  !set a=!word $b of $(symbol$i)
  !if chemeq isin $(replytype$i)
    !set chemeq_option=l
    !set c=!exec chemeq $a
    !if error isin $c
      !set c=$a
    !endif
  !else
    !set c=$a
  !endif
  !set a=!replace internal ' by \' in $a
  !set symbol_out$i=!append word <span onclick="appendToInput($i,' $a ');" \
    class="wims_button wims_secondary_button">\($c\)</span> to $(symbol_out$i)
!next a

<script>
function appendToInput(n,msg){
  var field = document.getElementById("reply"+n);
  var cursorPosition=field.selectionStart;
  var front=field.value.substring(0, cursorPosition);
  var back=field.value.substring(cursorPosition, field.value.lenght);
  field.value=front+msg+back;
  cursorPosition= cursorPosition + msg.length;
  field.selectionStart = cursorPosition;
  field.selectionEnd = cursorPosition;
  field.focus();
  }
</script>
<div id="symbols_reply$i">
$(symbol_out$i)
</div>