sleepyhead111 commited on
Commit
892ff1b
·
verified ·
1 Parent(s): e9f8719

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. mosesdecoder/jam-files/boost-build/tools/clang-darwin.jam +170 -0
  2. mosesdecoder/jam-files/boost-build/tools/clang-linux.jam +196 -0
  3. mosesdecoder/jam-files/boost-build/tools/cw-config.jam +34 -0
  4. mosesdecoder/jam-files/boost-build/tools/intel.jam +34 -0
  5. mosesdecoder/jam-files/boost-build/tools/midl.jam +142 -0
  6. mosesdecoder/jam-files/boost-build/tools/xsltproc-config.jam +37 -0
  7. mosesdecoder/jam-files/boost-build/tools/zlib.jam +92 -0
  8. mosesdecoder/scripts/ems/support/substitute-filtered-tables.perl +55 -0
  9. mosesdecoder/scripts/ems/web/analysis_diff.php +1072 -0
  10. mosesdecoder/scripts/ems/web/bilingual-concordance.css +98 -0
  11. mosesdecoder/scripts/ems/web/comment.php +5 -0
  12. mosesdecoder/scripts/ems/web/diff.php +58 -0
  13. mosesdecoder/scripts/ems/web/favicon.ico +0 -0
  14. mosesdecoder/scripts/ems/web/general.css +5 -0
  15. mosesdecoder/scripts/ems/web/hierarchical-segmentation.js +107 -0
  16. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/MIT-LICENSE +20 -0
  17. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/README.rdoc +59 -0
  18. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/lib/prototype.js +0 -0
  19. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/_ajax_inplaceeditor_result.html +1 -0
  20. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/_ajax_inplaceeditor_text.html +1 -0
  21. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/_autocomplete_result.html +9 -0
  22. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/_autocomplete_result_single.html +3 -0
  23. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/ajax_autocompleter2_test.html +86 -0
  24. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/ajax_autocompleter_test.html +71 -0
  25. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/ajax_inplacecollectioneditor_test.html +60 -0
  26. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/ajax_inplaceeditor_test.html +116 -0
  27. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop2_test.html +85 -0
  28. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop3_test.html +90 -0
  29. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop4_test.html +41 -0
  30. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop5_test.html +42 -0
  31. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop6_test.html +76 -0
  32. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop7_test.html +211 -0
  33. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop8_test.html +142 -0
  34. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop9_test.html +47 -0
  35. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop_delay_test.html +84 -0
  36. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dropmarker.png +0 -0
  37. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effect_direct_test.html +35 -0
  38. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effect_puff_test.html +65 -0
  39. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effect_scale_test.html +29 -0
  40. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects2_test.html +63 -0
  41. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects3_test.html +36 -0
  42. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects4_test.html +31 -0
  43. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects5_test.html +483 -0
  44. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects5b_test.html +39 -0
  45. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects6_test.html +61 -0
  46. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_blind_test.html +65 -0
  47. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_float_appear_test.html +46 -0
  48. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_grow_strink_test.html +38 -0
  49. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_highlight_bg_image.html +57 -0
  50. mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_queue_limit_test.html +30 -0
mosesdecoder/jam-files/boost-build/tools/clang-darwin.jam ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright Vladimir Prus 2004.
2
+ # Copyright Noel Belcourt 2007.
3
+ # Distributed under the Boost Software License, Version 1.0.
4
+ # (See accompanying file LICENSE_1_0.txt
5
+ # or copy at http://www.boost.org/LICENSE_1_0.txt)
6
+
7
+ import clang ;
8
+ import feature : feature ;
9
+ import os ;
10
+ import toolset ;
11
+ import toolset : flags ;
12
+ import gcc ;
13
+ import common ;
14
+ import errors ;
15
+ import generators ;
16
+
17
+ feature.extend-subfeature toolset clang : platform : darwin ;
18
+
19
+ toolset.inherit-generators clang-darwin
20
+ <toolset>clang <toolset-clang:platform>darwin
21
+ : gcc
22
+ # Don't inherit PCH generators. They were not tested, and probably
23
+ # don't work for this compiler.
24
+ : gcc.mingw.link gcc.mingw.link.dll gcc.compile.c.pch gcc.compile.c++.pch
25
+ ;
26
+
27
+ generators.override clang-darwin.prebuilt : builtin.lib-generator ;
28
+ generators.override clang-darwin.prebuilt : builtin.prebuilt ;
29
+ generators.override clang-darwin.searched-lib-generator : searched-lib-generator ;
30
+
31
+ toolset.inherit-rules clang-darwin : gcc ;
32
+ toolset.inherit-flags clang-darwin : gcc
33
+ : <inlining>off <inlining>on <inlining>full <optimization>space
34
+ <warnings>off <warnings>all <warnings>on
35
+ <architecture>x86/<address-model>32
36
+ <architecture>x86/<address-model>64
37
+ ;
38
+
39
+ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
40
+ {
41
+ .debug-configuration = true ;
42
+ }
43
+
44
+ # vectorization diagnostics
45
+ feature vectorize : off on full ;
46
+
47
+ # Initializes the clang-darwin toolset
48
+ # version in optional
49
+ # name (default clang++) is used to invoke the specified clang complier
50
+ # compile and link options allow you to specify addition command line options for each version
51
+ rule init ( version ? : command * : options * )
52
+ {
53
+ command = [ common.get-invocation-command clang-darwin : clang++
54
+ : $(command) ] ;
55
+
56
+ # Determine the version
57
+ local command-string = $(command:J=" ") ;
58
+ if $(command)
59
+ {
60
+ version ?= [ MATCH "^([0-9.]+)"
61
+ : [ SHELL "$(command-string) -dumpversion" ] ] ;
62
+ }
63
+
64
+ local condition = [ common.check-init-parameters clang-darwin
65
+ : version $(version) ] ;
66
+
67
+ common.handle-options clang-darwin : $(condition) : $(command) : $(options) ;
68
+
69
+ gcc.init-link-flags clang-darwin darwin $(condition) ;
70
+
71
+ }
72
+
73
+ SPACE = " " ;
74
+
75
+ flags clang-darwin.compile OPTIONS <cflags> ;
76
+ flags clang-darwin.compile OPTIONS <cxxflags> ;
77
+ # flags clang-darwin.compile INCLUDES <include> ;
78
+
79
+ # Declare flags and action for compilation.
80
+ toolset.flags clang-darwin.compile OPTIONS <optimization>off : -O0 ;
81
+ toolset.flags clang-darwin.compile OPTIONS <optimization>speed : -O3 ;
82
+ toolset.flags clang-darwin.compile OPTIONS <optimization>space : -Os ;
83
+
84
+ toolset.flags clang-darwin.compile OPTIONS <inlining>off : -fno-inline ;
85
+ toolset.flags clang-darwin.compile OPTIONS <inlining>on : -Wno-inline ;
86
+ toolset.flags clang-darwin.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ;
87
+
88
+ toolset.flags clang-darwin.compile OPTIONS <warnings>off : -w ;
89
+ toolset.flags clang-darwin.compile OPTIONS <warnings>on : -Wall ;
90
+ toolset.flags clang-darwin.compile OPTIONS <warnings>all : -Wall -pedantic ;
91
+ toolset.flags clang-darwin.compile OPTIONS <warnings-as-errors>on : -Werror ;
92
+
93
+ toolset.flags clang-darwin.compile OPTIONS <debug-symbols>on : -g ;
94
+ toolset.flags clang-darwin.compile OPTIONS <profiling>on : -pg ;
95
+ toolset.flags clang-darwin.compile OPTIONS <rtti>off : -fno-rtti ;
96
+
97
+ actions compile.c
98
+ {
99
+ "$(CONFIG_COMMAND)" -x c $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
100
+ }
101
+
102
+ actions compile.c++
103
+ {
104
+ "$(CONFIG_COMMAND)" -x c++ $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
105
+ }
106
+
107
+ flags clang-darwin ARFLAGS <archiveflags> ;
108
+
109
+ # Default value. Mostly for the sake of clang-linux
110
+ # that inherits from gcc, but does not has the same
111
+ # logic to set the .AR variable. We can put the same
112
+ # logic in clang-linux, but that's hardly worth the trouble
113
+ # as on Linux, 'ar' is always available.
114
+ .AR = ar ;
115
+
116
+ rule archive ( targets * : sources * : properties * )
117
+ {
118
+ # Always remove archive and start again. Here's rationale from
119
+ # Andre Hentz:
120
+ #
121
+ # I had a file, say a1.c, that was included into liba.a.
122
+ # I moved a1.c to a2.c, updated my Jamfiles and rebuilt.
123
+ # My program was crashing with absurd errors.
124
+ # After some debugging I traced it back to the fact that a1.o was *still*
125
+ # in liba.a
126
+ #
127
+ # Rene Rivera:
128
+ #
129
+ # Originally removing the archive was done by splicing an RM
130
+ # onto the archive action. That makes archives fail to build on NT
131
+ # when they have many files because it will no longer execute the
132
+ # action directly and blow the line length limit. Instead we
133
+ # remove the file in a different action, just before the building
134
+ # of the archive.
135
+ #
136
+ local clean.a = $(targets[1])(clean) ;
137
+ TEMPORARY $(clean.a) ;
138
+ NOCARE $(clean.a) ;
139
+ LOCATE on $(clean.a) = [ on $(targets[1]) return $(LOCATE) ] ;
140
+ DEPENDS $(clean.a) : $(sources) ;
141
+ DEPENDS $(targets) : $(clean.a) ;
142
+ common.RmTemps $(clean.a) : $(targets) ;
143
+ }
144
+
145
+ actions piecemeal archive
146
+ {
147
+ "$(.AR)" $(AROPTIONS) rc "$(<)" "$(>)"
148
+ "ranlib" -cs "$(<)"
149
+ }
150
+
151
+ flags clang-darwin.link USER_OPTIONS <linkflags> ;
152
+
153
+ # Declare actions for linking
154
+ rule link ( targets * : sources * : properties * )
155
+ {
156
+ SPACE on $(targets) = " " ;
157
+ # Serialize execution of the 'link' action, since
158
+ # running N links in parallel is just slower.
159
+ JAM_SEMAPHORE on $(targets) = <s>clang-darwin-link-semaphore ;
160
+ }
161
+
162
+ actions link bind LIBRARIES
163
+ {
164
+ "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
165
+ }
166
+
167
+ actions link.dll bind LIBRARIES
168
+ {
169
+ "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -install_name "$(<[1]:D=)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS)
170
+ }
mosesdecoder/jam-files/boost-build/tools/clang-linux.jam ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) 2003 Michael Stevens
2
+ # Copyright (c) 2010-2011 Bryce Lelbach (blelbach@cct.lsu.edu, maintainer)
3
+ #
4
+ # Use, modification and distribution is subject to the Boost Software
5
+ # License Version 1.0. (See accompanying file LICENSE_1_0.txt or
6
+ # http://www.boost.org/LICENSE_1_0.txt)
7
+
8
+ import toolset ;
9
+ import feature ;
10
+ import toolset : flags ;
11
+
12
+ import clang ;
13
+ import gcc ;
14
+ import common ;
15
+ import errors ;
16
+ import generators ;
17
+ import type ;
18
+ import numbers ;
19
+
20
+ feature.extend-subfeature toolset clang : platform : linux ;
21
+
22
+ toolset.inherit-generators clang-linux
23
+ <toolset>clang <toolset-clang:platform>linux : gcc
24
+ : gcc.mingw.link gcc.mingw.link.dll gcc.cygwin.link gcc.cygwin.link.dll ;
25
+ generators.override clang-linux.prebuilt : builtin.lib-generator ;
26
+ generators.override clang-linux.prebuilt : builtin.prebuilt ;
27
+ generators.override clang-linux.searched-lib-generator : searched-lib-generator ;
28
+
29
+ # Override default do-nothing generators.
30
+ generators.override clang-linux.compile.c.pch : pch.default-c-pch-generator ;
31
+ generators.override clang-linux.compile.c++.pch : pch.default-cpp-pch-generator ;
32
+
33
+ type.set-generated-target-suffix PCH
34
+ : <toolset>clang <toolset-clang:platform>linux : pth ;
35
+
36
+ toolset.inherit-rules clang-linux : gcc ;
37
+ toolset.inherit-flags clang-linux : gcc
38
+ : <inlining>off <inlining>on <inlining>full
39
+ <optimization>space <optimization>speed
40
+ <warnings>off <warnings>all <warnings>on ;
41
+
42
+ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] {
43
+ .debug-configuration = true ;
44
+ }
45
+
46
+ rule init ( version ? : command * : options * ) {
47
+ command = [ common.get-invocation-command clang-linux : clang++
48
+ : $(command) ] ;
49
+
50
+ # Determine the version
51
+ local command-string = $(command:J=" ") ;
52
+
53
+ if $(command) {
54
+ version ?= [ MATCH "version ([0-9.]+)"
55
+ : [ SHELL "$(command-string) --version" ] ] ;
56
+ }
57
+
58
+ local condition = [ common.check-init-parameters clang-linux
59
+ : version $(version) ] ;
60
+
61
+ common.handle-options clang-linux : $(condition) : $(command) : $(options) ;
62
+
63
+ gcc.init-link-flags clang-linux gnu $(condition) ;
64
+ }
65
+
66
+ ###############################################################################
67
+ # Flags
68
+
69
+ toolset.flags clang-linux.compile OPTIONS <cflags> ;
70
+ toolset.flags clang-linux.compile OPTIONS <cxxflags> ;
71
+
72
+ toolset.flags clang-linux.compile OPTIONS <optimization>off : ;
73
+ toolset.flags clang-linux.compile OPTIONS <optimization>speed : -O3 ;
74
+ toolset.flags clang-linux.compile OPTIONS <optimization>space : -Os ;
75
+
76
+ # note: clang silently ignores some of these inlining options
77
+ toolset.flags clang-linux.compile OPTIONS <inlining>off : -fno-inline ;
78
+ toolset.flags clang-linux.compile OPTIONS <inlining>on : -Wno-inline ;
79
+ toolset.flags clang-linux.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ;
80
+
81
+ toolset.flags clang-linux.compile OPTIONS <warnings>off : -w ;
82
+ toolset.flags clang-linux.compile OPTIONS <warnings>on : -Wall ;
83
+ toolset.flags clang-linux.compile OPTIONS <warnings>all : -Wall -pedantic ;
84
+ toolset.flags clang-linux.compile OPTIONS <warnings-as-errors>on : -Werror ;
85
+
86
+ toolset.flags clang-linux.compile OPTIONS <debug-symbols>on : -g ;
87
+ toolset.flags clang-linux.compile OPTIONS <profiling>on : -pg ;
88
+ toolset.flags clang-linux.compile OPTIONS <rtti>off : -fno-rtti ;
89
+
90
+ ###############################################################################
91
+ # C and C++ compilation
92
+
93
+ rule compile.c++ ( targets * : sources * : properties * ) {
94
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
95
+ gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
96
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
97
+
98
+ local pth-file = [ on $(<) return $(PCH_FILE) ] ;
99
+
100
+ if $(pth-file) {
101
+ DEPENDS $(<) : $(pth-file) ;
102
+ compile.c++.with-pch $(targets) : $(sources) ;
103
+ }
104
+ else {
105
+ compile.c++.without-pth $(targets) : $(sources) ;
106
+ }
107
+ }
108
+
109
+ actions compile.c++.without-pth {
110
+ "$(CONFIG_COMMAND)" -c -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
111
+ }
112
+
113
+ actions compile.c++.with-pch bind PCH_FILE
114
+ {
115
+ "$(CONFIG_COMMAND)" -c -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -include-pth -Xclang "$(PCH_FILE)" -o "$(<)" "$(>)"
116
+ }
117
+
118
+ rule compile.c ( targets * : sources * : properties * )
119
+ {
120
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
121
+ gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
122
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
123
+
124
+ local pth-file = [ on $(<) return $(PCH_FILE) ] ;
125
+
126
+ if $(pth-file) {
127
+ DEPENDS $(<) : $(pth-file) ;
128
+ compile.c.with-pch $(targets) : $(sources) ;
129
+ }
130
+ else {
131
+ compile.c.without-pth $(targets) : $(sources) ;
132
+ }
133
+ }
134
+
135
+ actions compile.c.without-pth
136
+ {
137
+ "$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
138
+ }
139
+
140
+ actions compile.c.with-pch bind PCH_FILE
141
+ {
142
+ "$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -include-pth -Xclang "$(PCH_FILE)" -c -o "$(<)" "$(>)"
143
+ }
144
+
145
+ ###############################################################################
146
+ # PCH emission
147
+
148
+ rule compile.c++.pch ( targets * : sources * : properties * ) {
149
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
150
+ gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
151
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
152
+ }
153
+
154
+ actions compile.c++.pch {
155
+ rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)"
156
+ }
157
+
158
+ rule compile.c.pch ( targets * : sources * : properties * ) {
159
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
160
+ gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
161
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
162
+ }
163
+
164
+ actions compile.c.pch
165
+ {
166
+ rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)"
167
+ }
168
+
169
+ ###############################################################################
170
+ # Linking
171
+
172
+ SPACE = " " ;
173
+
174
+ rule link ( targets * : sources * : properties * ) {
175
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
176
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
177
+ SPACE on $(targets) = " " ;
178
+ JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ;
179
+ }
180
+
181
+ actions link bind LIBRARIES {
182
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS)
183
+ }
184
+
185
+ rule link.dll ( targets * : sources * : properties * ) {
186
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
187
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
188
+ SPACE on $(targets) = " " ;
189
+ JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ;
190
+ }
191
+
192
+ # Differ from 'link' above only by -shared.
193
+ actions link.dll bind LIBRARIES {
194
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS)
195
+ }
196
+
mosesdecoder/jam-files/boost-build/tools/cw-config.jam ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #~ Copyright 2005 Rene Rivera.
2
+ #~ Distributed under the Boost Software License, Version 1.0.
3
+ #~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
4
+
5
+ # Automatic configuration for CodeWarrior toolset. To use, just import this module.
6
+
7
+ import os ;
8
+ import toolset : using ;
9
+
10
+ if [ os.name ] = NT
11
+ {
12
+ for local R in 9 8 7
13
+ {
14
+ local cw-path = [ W32_GETREG
15
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Metrowerks\\CodeWarrior\\Product Versions\\CodeWarrior for Windows R$(R)"
16
+ : "PATH" ] ;
17
+ local cw-version = [ W32_GETREG
18
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Metrowerks\\CodeWarrior\\Product Versions\\CodeWarrior for Windows R$(R)"
19
+ : "VERSION" ] ;
20
+ cw-path ?= [ W32_GETREG
21
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Metrowerks\\CodeWarrior for Windows\\$(R).0"
22
+ : "PATH" ] ;
23
+ cw-version ?= $(R).0 ;
24
+
25
+ if $(cw-path)
26
+ {
27
+ if --debug-configuration in [ modules.peek : ARGV ]
28
+ {
29
+ ECHO "notice:" using cw ":" $(cw-version) ":" "$(cw-path)\\Other Metrowerks Tools\\Command Line Tools\\mwcc.exe" ;
30
+ }
31
+ using cw : $(cw-version) : "$(cw-path)\\Other Metrowerks Tools\\Command Line Tools\\mwcc.exe" ;
32
+ }
33
+ }
34
+ }
mosesdecoder/jam-files/boost-build/tools/intel.jam ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright Vladimir Prus 2004.
2
+ # Distributed under the Boost Software License, Version 1.0.
3
+ # (See accompanying file LICENSE_1_0.txt
4
+ # or copy at http://www.boost.org/LICENSE_1_0.txt)
5
+
6
+ # This is a generic 'intel' toolset. Depending on the current
7
+ # system, it forwards either to 'intel-linux' or 'intel-win'
8
+ # modules.
9
+
10
+ import feature ;
11
+ import os ;
12
+ import toolset ;
13
+
14
+ feature.extend toolset : intel ;
15
+ feature.subfeature toolset intel : platform : : propagated link-incompatible ;
16
+
17
+ rule init ( * : * )
18
+ {
19
+ if [ os.name ] = LINUX
20
+ {
21
+ toolset.using intel-linux :
22
+ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
23
+ }
24
+ else if [ os.name ] = MACOSX
25
+ {
26
+ toolset.using intel-darwin :
27
+ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
28
+ }
29
+ else
30
+ {
31
+ toolset.using intel-win :
32
+ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
33
+ }
34
+ }
mosesdecoder/jam-files/boost-build/tools/midl.jam ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) 2005 Alexey Pakhunov.
2
+ #
3
+ # Use, modification and distribution is subject to the Boost Software
4
+ # License Version 1.0. (See accompanying file LICENSE_1_0.txt or
5
+ # http://www.boost.org/LICENSE_1_0.txt)
6
+
7
+ # Microsoft Interface Definition Language (MIDL) related routines
8
+
9
+ import common ;
10
+ import generators ;
11
+ import feature : feature get-values ;
12
+ import os ;
13
+ import scanner ;
14
+ import toolset : flags ;
15
+ import type ;
16
+
17
+ rule init ( )
18
+ {
19
+ }
20
+
21
+ type.register IDL : idl ;
22
+
23
+ # A type library (.tlb) is generated by MIDL compiler and can be included
24
+ # to resources of an application (.rc). In order to be found by a resource
25
+ # compiler its target type should be derived from 'H' - otherwise
26
+ # the property '<implicit-dependency>' will be ignored.
27
+ type.register MSTYPELIB : tlb : H ;
28
+
29
+
30
+ # Register scanner for MIDL files
31
+ class midl-scanner : scanner
32
+ {
33
+ import path property-set regex scanner type virtual-target ;
34
+
35
+ rule __init__ ( includes * )
36
+ {
37
+ scanner.__init__ ;
38
+
39
+ self.includes = $(includes) ;
40
+
41
+ # List of quoted strings
42
+ self.re-strings = "[ \t]*\"([^\"]*)\"([ \t]*,[ \t]*\"([^\"]*)\")*[ \t]*" ;
43
+
44
+ # 'import' and 'importlib' directives
45
+ self.re-import = "import"$(self.re-strings)"[ \t]*;" ;
46
+ self.re-importlib = "importlib[ \t]*[(]"$(self.re-strings)"[)][ \t]*;" ;
47
+
48
+ # C preprocessor 'include' directive
49
+ self.re-include-angle = "#[ \t]*include[ \t]*<(.*)>" ;
50
+ self.re-include-quoted = "#[ \t]*include[ \t]*\"(.*)\"" ;
51
+ }
52
+
53
+ rule pattern ( )
54
+ {
55
+ # Match '#include', 'import' and 'importlib' directives
56
+ return "((#[ \t]*include|import(lib)?).+(<(.*)>|\"(.*)\").+)" ;
57
+ }
58
+
59
+ rule process ( target : matches * : binding )
60
+ {
61
+ local included-angle = [ regex.transform $(matches) : $(self.re-include-angle) : 1 ] ;
62
+ local included-quoted = [ regex.transform $(matches) : $(self.re-include-quoted) : 1 ] ;
63
+ local imported = [ regex.transform $(matches) : $(self.re-import) : 1 3 ] ;
64
+ local imported_tlbs = [ regex.transform $(matches) : $(self.re-importlib) : 1 3 ] ;
65
+
66
+ # CONSIDER: the new scoping rule seem to defeat "on target" variables.
67
+ local g = [ on $(target) return $(HDRGRIST) ] ;
68
+ local b = [ NORMALIZE_PATH $(binding:D) ] ;
69
+
70
+ # Attach binding of including file to included targets.
71
+ # When target is directly created from virtual target
72
+ # this extra information is unnecessary. But in other
73
+ # cases, it allows to distinguish between two headers of the
74
+ # same name included from different places.
75
+ local g2 = $(g)"#"$(b) ;
76
+
77
+ included-angle = $(included-angle:G=$(g)) ;
78
+ included-quoted = $(included-quoted:G=$(g2)) ;
79
+ imported = $(imported:G=$(g2)) ;
80
+ imported_tlbs = $(imported_tlbs:G=$(g2)) ;
81
+
82
+ local all = $(included-angle) $(included-quoted) $(imported) ;
83
+
84
+ INCLUDES $(target) : $(all) ;
85
+ DEPENDS $(target) : $(imported_tlbs) ;
86
+ NOCARE $(all) $(imported_tlbs) ;
87
+ SEARCH on $(included-angle) = $(self.includes:G=) ;
88
+ SEARCH on $(included-quoted) = $(b) $(self.includes:G=) ;
89
+ SEARCH on $(imported) = $(b) $(self.includes:G=) ;
90
+ SEARCH on $(imported_tlbs) = $(b) $(self.includes:G=) ;
91
+
92
+ scanner.propagate
93
+ [ type.get-scanner CPP : [ property-set.create $(self.includes) ] ] :
94
+ $(included-angle) $(included-quoted) : $(target) ;
95
+
96
+ scanner.propagate $(__name__) : $(imported) : $(target) ;
97
+ }
98
+ }
99
+
100
+ scanner.register midl-scanner : include ;
101
+ type.set-scanner IDL : midl-scanner ;
102
+
103
+
104
+ # Command line options
105
+ feature midl-stubless-proxy : yes no : propagated ;
106
+ feature midl-robust : yes no : propagated ;
107
+
108
+ flags midl.compile.idl MIDLFLAGS <midl-stubless-proxy>yes : /Oicf ;
109
+ flags midl.compile.idl MIDLFLAGS <midl-stubless-proxy>no : /Oic ;
110
+ flags midl.compile.idl MIDLFLAGS <midl-robust>yes : /robust ;
111
+ flags midl.compile.idl MIDLFLAGS <midl-robust>no : /no_robust ;
112
+
113
+ # Architecture-specific options
114
+ architecture-x86 = <architecture> <architecture>x86 ;
115
+ address-model-32 = <address-model> <address-model>32 ;
116
+ address-model-64 = <address-model> <address-model>64 ;
117
+
118
+ flags midl.compile.idl MIDLFLAGS $(architecture-x86)/$(address-model-32) : /win32 ;
119
+ flags midl.compile.idl MIDLFLAGS $(architecture-x86)/<address-model>64 : /x64 ;
120
+ flags midl.compile.idl MIDLFLAGS <architecture>ia64/$(address-model-64) : /ia64 ;
121
+
122
+
123
+ flags midl.compile.idl DEFINES <define> ;
124
+ flags midl.compile.idl UNDEFS <undef> ;
125
+ flags midl.compile.idl INCLUDES <include> ;
126
+
127
+
128
+ generators.register-c-compiler midl.compile.idl : IDL : MSTYPELIB H C(%_i) C(%_proxy) C(%_dlldata) ;
129
+
130
+
131
+ # MIDL does not always generate '%_proxy.c' and '%_dlldata.c'. This behavior
132
+ # depends on contents of the source IDL file. Calling TOUCH_FILE below ensures
133
+ # that both files will be created so bjam will not try to recreate them
134
+ # constantly.
135
+ TOUCH_FILE = [ common.file-touch-command ] ;
136
+
137
+ actions compile.idl
138
+ {
139
+ midl /nologo @"@($(<[1]:W).rsp:E=$(nl)"$(>:W)" $(nl)-D$(DEFINES) $(nl)"-I$(INCLUDES)" $(nl)-U$(UNDEFS) $(nl)$(MIDLFLAGS) $(nl)/tlb "$(<[1]:W)" $(nl)/h "$(<[2]:W)" $(nl)/iid "$(<[3]:W)" $(nl)/proxy "$(<[4]:W)" $(nl)/dlldata "$(<[5]:W)")"
140
+ $(TOUCH_FILE) "$(<[4]:W)"
141
+ $(TOUCH_FILE) "$(<[5]:W)"
142
+ }
mosesdecoder/jam-files/boost-build/tools/xsltproc-config.jam ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #~ Copyright 2005 Rene Rivera.
2
+ #~ Distributed under the Boost Software License, Version 1.0.
3
+ #~ (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
4
+
5
+ # Automatic configuration for Python tools and librries. To use, just import this module.
6
+
7
+ import os ;
8
+ import toolset : using ;
9
+
10
+ if [ os.name ] = NT
11
+ {
12
+ local xsltproc-path = [ GLOB [ modules.peek : PATH ] "C:\\Boost\\bin" : xsltproc\.exe ] ;
13
+ xsltproc-path = $(xsltproc-path[1]) ;
14
+
15
+ if $(xsltproc-path)
16
+ {
17
+ if --debug-configuration in [ modules.peek : ARGV ]
18
+ {
19
+ ECHO "notice:" using xsltproc ":" $(xsltproc-path) ;
20
+ }
21
+ using xsltproc : $(xsltproc-path) ;
22
+ }
23
+ }
24
+ else
25
+ {
26
+ local xsltproc-path = [ GLOB [ modules.peek : PATH ] : xsltproc ] ;
27
+ xsltproc-path = $(xsltproc-path[1]) ;
28
+
29
+ if $(xsltproc-path)
30
+ {
31
+ if --debug-configuration in [ modules.peek : ARGV ]
32
+ {
33
+ ECHO "notice:" using xsltproc ":" $(xsltproc-path) ;
34
+ }
35
+ using xsltproc : $(xsltproc-path) ;
36
+ }
37
+ }
mosesdecoder/jam-files/boost-build/tools/zlib.jam ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) 2010 Vladimir Prus.
2
+ #
3
+ # Use, modification and distribution is subject to the Boost Software
4
+ # License Version 1.0. (See accompanying file LICENSE_1_0.txt or
5
+ # http://www.boost.org/LICENSE_1_0.txt)
6
+
7
+ # Supports the zlib library
8
+ #
9
+ # After 'using zlib', the following targets are available:
10
+ #
11
+ # /zlib//zlib -- The zlib library
12
+
13
+
14
+ # In addition to direct purpose of supporting zlib, this module also
15
+ # serves as canonical example of how third-party condiguration works
16
+ # in Boost.Build. The operation is as follows
17
+ #
18
+ # - For each 'using zlib : condition ... : ...' we create a target alternative
19
+ # for zlib, with the specified condition.
20
+ # - There's one target alternative for 'zlib' with no specific condition
21
+ # properties.
22
+ #
23
+ # Two invocations of 'using zlib' with the same condition but different
24
+ # properties are not permitted, e.g.:
25
+ #
26
+ # using zlib : condition <target-os>windows : include foo ;
27
+ # using zlib : condition <target-os>windows : include bar ;
28
+ #
29
+ # is in error. One exception is for empty condition, 'using' without any
30
+ # parameters is overridable. That is:
31
+ #
32
+ # using zlib ;
33
+ # using zlib : include foo ;
34
+ #
35
+ # Is OK then the first 'using' is ignored. Likewise if the order of the statements
36
+ # is reversed.
37
+ #
38
+ # When 'zlib' target is built, a target alternative is selected as usual for
39
+ # Boost.Build. The selected alternative is a custom target class, which:
40
+ #
41
+ # - calls ac.find-include-path to find header path. If explicit path is provided
42
+ # in 'using', only that path is checked, and if no header is found there, error
43
+ # is emitted. Otherwise, we check a directory specified using ZLIB_INCLUDE
44
+ # environment variable, and failing that, in standard directories.
45
+ # [TODO: document sysroot handling]
46
+ # - calls ac.find-library to find the library, in an identical fashion.
47
+ #
48
+
49
+ import project ;
50
+ import ac ;
51
+ import errors ;
52
+ import "class" : new ;
53
+ import targets ;
54
+
55
+ project.initialize $(__name__) ;
56
+ project = [ project.current ] ;
57
+ project zlib ;
58
+
59
+ header = zlib.h ;
60
+ names = z zlib zll zdll ;
61
+
62
+ .default-alternative = [ new ac-library zlib : $(project) ] ;
63
+ $(.default-alternative).set-header $(header) ;
64
+ $(.default-alternative).set-default-names $(names) ;
65
+ targets.main-target-alternative $(.default-alternative) ;
66
+
67
+ rule init ( * : * )
68
+ {
69
+ if ! $(condition)
70
+ {
71
+ # Special case the no-condition case so that 'using' without parameters
72
+ # can mix with more specific 'using'.
73
+ $(.default-alternative).reconfigure $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
74
+ }
75
+ else
76
+ {
77
+ # FIXME: consider if we should allow overriding definitions for a given
78
+ # condition -- e.g. project-config.jam might want to override whatever is
79
+ # in user-config.jam.
80
+ local mt = [ new ac-library zlib : $(project)
81
+ : $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ] ;
82
+ $(mt).set-header $(header) ;
83
+ $(mt).set-default-names $(names) ;
84
+ targets.main-target-alternative $(mt) ;
85
+ }
86
+ }
87
+
88
+
89
+
90
+
91
+
92
+
mosesdecoder/scripts/ems/support/substitute-filtered-tables.perl ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env perl
2
+ #
3
+ # This file is part of moses. Its use is licensed under the GNU Lesser General
4
+ # Public License version 2.1 or, at your option, any later version.
5
+
6
+ use warnings;
7
+
8
+ # experiment.perl support script
9
+ # get filtered rule and reordering tables and place them into a configuration file
10
+
11
+ if (scalar @ARGV < 1 || ! -e $ARGV[0]) {
12
+ die("ERROR: could not find pseudo-config with filtered tables");
13
+ }
14
+
15
+ # read config sections about filtered tables
16
+ my @arr;
17
+ open(FILTERED, $ARGV[0]) or die "Cannot open: $!";
18
+ my $feature_section = 0;
19
+ while(my $line = <FILTERED>) {
20
+ chomp($line);
21
+ if ($line =~ /^\[(.+)\]/) {
22
+ $feature_section = ($1 eq "feature");
23
+ }
24
+ next unless $feature_section;
25
+ if ($line =~ /PhraseDictionary/ || $line =~ /RuleTable/ || $line =~ /ProbingPT/ ) {
26
+ print STDERR "pt:$line \n";
27
+ push(@arr, $line);
28
+ }
29
+ elsif ($line =~ /LexicalReordering/) {
30
+ print STDERR "ro:$line \n";
31
+ push(@arr, $line);
32
+ }
33
+ }
34
+ close(FILTERED);
35
+
36
+ # pass through master config file and replace table sections
37
+ my $ind = 0;
38
+ $feature_section = 0;
39
+ while(my $line = <STDIN>) {
40
+ chomp($line);
41
+ if ($line =~ /^\[(.+)\]/) {
42
+ $feature_section = ($1 eq "feature");
43
+ }
44
+ if ($feature_section && ($line =~ /PhraseDictionary/ || $line =~ /RuleTable/ || $line =~ /ProbingPT/ )) {
45
+ print $arr[$ind]."\n";
46
+ ++$ind;
47
+ }
48
+ elsif ($feature_section && $line =~ /LexicalReordering/) {
49
+ print $arr[$ind]."\n";
50
+ ++$ind;
51
+ }
52
+ else {
53
+ print "$line\n";
54
+ }
55
+ }
mosesdecoder/scripts/ems/web/analysis_diff.php ADDED
@@ -0,0 +1,1072 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ This file is part of moses. Its use is licensed under the GNU Lesser General
5
+ Public License version 2.1 or, at your option, any later version.
6
+ */
7
+ function diff_analysis() {
8
+ global $task,$user,$setup,$id,$id2,$set;
9
+ global $comment,$dir;
10
+
11
+ head("Comparative Analysis: $task ($user), Set $set");
12
+
13
+ $c = $comment["$setup-$id"]->name;
14
+ $c2 = $comment["$setup-$id2"]->name;
15
+ if (substr($c2,0,strlen($id)+1) == $id."+") {
16
+ print "Run $id2 vs $id (".substr($c2,strlen($id)).")";
17
+ }
18
+ else {
19
+ print "Run $id2 ($c2) vs $id ($c)";
20
+ }
21
+ print "</h4>";
22
+
23
+ ?><script language="javascript" src="javascripts/prototype.js"></script>
24
+ <script language="javascript" src="javascripts/scriptaculous.js"></script>
25
+ <script>
26
+ function diff(field,sort,count) {
27
+ var url = '?analysis_diff=' + field + '_diff'
28
+ + '&setup=<?php print $setup ?>'
29
+ + '&id=<?php print $id ?>'
30
+ + '&id2=<?php print $id2 ?>'
31
+ + '&set=<?php print $set ?>'
32
+ + '&sort=' + sort
33
+ + '&count=' + count;
34
+ new Ajax.Updater(field, url, { method: 'get' });
35
+ }
36
+ function ngram_diff(type,order,count,sort,smooth) {
37
+ var url = '?analysis_diff=ngram_' + type + '_diff'
38
+ + '&setup=<?php print $setup ?>'
39
+ + '&id=<?php print $id ?>'
40
+ + '&id2=<?php print $id2 ?>'
41
+ + '&set=<?php print $set ?>'
42
+ + '&order=' + order
43
+ + '&smooth=' + smooth
44
+ + '&sort=' + sort
45
+ + '&count=' + count;
46
+ var field = (type == "precision" ? "nGramPrecision" : "nGramRecall") + order;
47
+ new Ajax.Updater(field, url, { method: 'get' });
48
+ }
49
+ function generic_show_diff(field,parameters) {
50
+ var url = '?analysis=' + field + '_show'
51
+ + '&setup=<?php print $setup ?>'
52
+ + '&id=<?php print $id ?>'
53
+ + '&id2=<?php print $id2 ?>'
54
+ + '&set=<?php print $set ?>'
55
+ + '&' + parameters;
56
+ new Ajax.Updater(field, url, { method: 'get', evalScripts: true });
57
+ }
58
+ </script>
59
+ </head>
60
+ <body>
61
+ <div id="nGramSummary"><?php ngram_summary_diff() ?></div>
62
+ <div id="PrecisionByCoverageDiff"></div>
63
+ <div id="PrecisionRecallDetailsDiff"></div>
64
+ <div id="bleu">(loading...)</div>
65
+ <script>
66
+ diff('bleu','',5);
67
+ </script>
68
+ </body></html>
69
+ <?php
70
+ }
71
+
72
+ function precision_by_coverage_diff() {
73
+ global $experiment,$evalset,$dir,$set,$id,$id2;
74
+ $img_width = 1000;
75
+
76
+ print "<h3>Precision by Coverage</h3>";
77
+ print "The graphs display what ratio of words of a specific type are translated correctly (yellow), and what ratio is deleted (blue).";
78
+ print " The extend of the boxes is scaled on the x-axis by the number of tokens of the displayed type.";
79
+ // load data
80
+ $data = file(get_current_analysis_filename2("precision","precision-by-corpus-coverage"));
81
+ $total = 0;
82
+ $log_info = array();
83
+ for($i=0;$i<count($data);$i++) {
84
+ $item = split("\t",$data[$i]);
85
+ $info[$item[0]]["precision"] = $item[1];
86
+ $info[$item[0]]["delete"] = $item[2];
87
+ $info[$item[0]]["length"] = $item[3];
88
+ $info[$item[0]]["total"] = $item[4];
89
+ $total += $item[4];
90
+ $log_count = -1;
91
+ if ($item[0]>0) {
92
+ $log_count = (int) (log($item[0])/log(2));
93
+ }
94
+ if (!array_key_exists($log_count,$log_info)) {
95
+ $log_info[$log_count]["precision"] = 0;
96
+ $log_info[$log_count]["delete"] = 0;
97
+ $log_info[$log_count]["length"] = 0;
98
+ $log_info[$log_count]["total"] = 0;
99
+ }
100
+ $log_info[$log_count]["precision"] += $item[1];
101
+ $log_info[$log_count]["delete"] += $item[2];
102
+ $log_info[$log_count]["length"] += $item[3];
103
+ $log_info[$log_count]["total"] += $item[4];
104
+ }
105
+ $log_info_new = $log_info;
106
+
107
+ // load base data
108
+ $data = file(get_current_analysis_filename("precision","precision-by-corpus-coverage"));
109
+ for($i=0;$i<count($data);$i++) {
110
+ $item = split("\t",$data[$i]);
111
+ $info[$item[0]]["precision"] -= $item[1];
112
+ $info[$item[0]]["delete"] -= $item[2];
113
+ $info[$item[0]]["length"] -= $item[3];
114
+ $log_count = -1;
115
+ if ($item[0]>0) {
116
+ $log_count = (int) (log($item[0])/log(2));
117
+ }
118
+ $log_info[$log_count]["precision"] -= $item[1];
119
+ $log_info[$log_count]["delete"] -= $item[2];
120
+ $log_info[$log_count]["length"] -= $item[3];
121
+ }
122
+
123
+
124
+ print "<h4>By log<sub>2</sub>-count in the training corpus</h4>";
125
+ precision_by_coverage_diff_graph("byCoverage",$log_info,$log_info_new,$total,$img_width,SORT_NUMERIC);
126
+ precision_by_coverage_diff_matrix();
127
+
128
+ // load factored data
129
+ $d = dir("$dir/evaluation/$set.analysis.".get_precision_analysis_version($dir,$set,$id));
130
+ while (false !== ($file = $d->read())) {
131
+ if (preg_match('/precision-by-corpus-coverage.(.+)$/',$file, $match) &&
132
+ file_exists(get_current_analysis_filename2("precision","precision-by-corpus-coverage.$match[1]"))) {
133
+ precision_by_coverage_diff_factored($img_width,$total,$file,$match[1]);
134
+ }
135
+ }
136
+ }
137
+
138
+ function precision_by_coverage_diff_factored($img_width,$total,$file,$factor_id) {
139
+ global $dir,$set,$id,$id2;
140
+ $data = file(get_current_analysis_filename2("precision",$file));
141
+ for($i=0;$i<count($data);$i++) {
142
+ $item = split("\t",$data[$i]);
143
+ $factor = $item[0];
144
+ $count = $item[1];
145
+ $info_factored[$factor][$count]["precision"] = $item[2];
146
+ $info_factored[$factor][$count]["delete"] = $item[3];
147
+ $info_factored[$factor][$count]["length"] = $item[4];
148
+ $info_factored[$factor][$count]["total"] = $item[5];
149
+ $info_factored_sum[$factor]["precision"] += $item[2];
150
+ $info_factored_sum[$factor]["delete"] += $item[3];
151
+ $info_factored_sum[$factor]["length"] += $item[4];
152
+ $info_factored_sum[$factor]["total"] += $item[5];
153
+ $total_factored[$factor] += $item[5];
154
+ $log_count = -1;
155
+ if ($count>0) {
156
+ $log_count = (int) (log($count)/log(2));
157
+ }
158
+ $log_info_factored[$factor][$log_count]["precision"] += $item[2];
159
+ $log_info_factored[$factor][$log_count]["delete"] += $item[3];
160
+ $log_info_factored[$factor][$log_count]["length"] += $item[4];
161
+ $log_info_factored[$factor][$log_count]["total"] += $item[5];
162
+ }
163
+ $info_factored_new = $info_factored;
164
+ $info_factored_sum_new = $info_factored_sum;
165
+ $log_info_factored_new = $log_info_factored;
166
+
167
+ // baseline data
168
+ $data = file(get_current_analysis_filename("precision",$file));
169
+ for($i=0;$i<count($data);$i++) {
170
+ $item = split("\t",$data[$i]);
171
+ $factor = $item[0];
172
+ $count = $item[1];
173
+ $info_factored[$factor][$count]["precision"] -= $item[2];
174
+ $info_factored[$factor][$count]["delete"] -= $item[3];
175
+ $info_factored[$factor][$count]["length"] -= $item[4];
176
+ $info_factored_sum[$factor]["precision"] -= $item[2];
177
+ $info_factored_sum[$factor]["delete"] -= $item[3];
178
+ $info_factored_sum[$factor]["length"] -= $item[4];
179
+ $log_count = -1;
180
+ if ($count>0) {
181
+ $log_count = (int) (log($count)/log(2));
182
+ }
183
+ $log_info_factored[$factor][$log_count]["precision"] -= $item[2];
184
+ $log_info_factored[$factor][$log_count]["delete"] -= $item[3];
185
+ $log_info_factored[$factor][$log_count]["length"] -= $item[4];
186
+ }
187
+ print "<h4>By factor ".factor_name("input",$factor_id)."</h4>";
188
+ precision_by_coverage_diff_graph("byFactor",$info_factored_sum,$info_factored_sum_new,$total,$img_width,SORT_STRING);
189
+
190
+ print "<h4>For each factor, by log<sub>2</sub>-count in the corpus</h4>";
191
+ foreach ($log_info_factored as $factor => $info) {
192
+ if ($total_factored[$factor]/$total > 0.01) {
193
+ print "<table style=\"display:inline;\"><tr><td align=center><font size=-2><b>$factor</b></font>";
194
+ precision_by_coverage_diff_graph("byCoverageFactor$factor",$info,$log_info_factored_new[$factor],$total,10+2*$img_width*$total_factored[$factor]/$total,SORT_NUMERIC);
195
+ print "</td></tr></table>";
196
+ }
197
+ }
198
+ }
199
+
200
+ function precision_by_word_diff($type) {
201
+ global $dir,$set,$id,$id2;
202
+ $byCoverage = -2;
203
+ $byFactor = "false";
204
+ if ($type == "byCoverage") {
205
+ $byCoverage = (int) $_GET["type"];
206
+ }
207
+ else if ($type == "byFactor") {
208
+ $byFactor = $_GET["type"];
209
+ }
210
+ else if (preg_match("/byCoverageFactor(.+)/",$type,$match)) {
211
+ $byCoverage = (int) $_GET["type"];
212
+ $byFactor = $match[1];
213
+ }
214
+
215
+ $data = file(get_current_analysis_filename2("precision","precision-by-input-word"));
216
+ $total = 0;
217
+ $info = array();
218
+ for($i=0;$i<count($data);$i++) {
219
+ $line = rtrim($data[$i]);
220
+ $item = split("\t",$line);
221
+ $total += $item[3];
222
+
223
+ //# filter for count
224
+ $count = $item[4];
225
+ $log_count = -1;
226
+ if ($count>0) {
227
+ $log_count = (int) (log($count)/log(2));
228
+ }
229
+ if ($byCoverage != -2 && $byCoverage != $log_count) {
230
+ continue;
231
+ }
232
+
233
+ //# filter for factor
234
+ $word = $item[5];
235
+ if ($byFactor != "false" && $byFactor != $item[6]) {
236
+ continue;
237
+ }
238
+ if (!array_key_exists($word,$info)) {
239
+ $info[$word]["precision"] = 0;
240
+ $info[$word]["delete"] = 0;
241
+ $info[$word]["length"] = 0;
242
+ $info[$word]["total"] = 0;
243
+ }
244
+ $info[$word]["precision"] += $item[0];
245
+ $info[$word]["delete"] += $item[1];
246
+ $info[$word]["length"] += $item[2];
247
+ $info[$word]["total"] += $item[3];
248
+ }
249
+ $info_new = $info;
250
+
251
+ $data = file(get_current_analysis_filename("precision","precision-by-input-word"));
252
+ for($i=0;$i<count($data);$i++) {
253
+ $line = rtrim($data[$i]);
254
+ $item = split("\t",$line);
255
+
256
+ //# filter for count
257
+ $count = $item[4];
258
+ $log_count = -1;
259
+ if ($count>0) {
260
+ $log_count = (int) (log($count)/log(2));
261
+ }
262
+ if ($byCoverage != -2 && $byCoverage != $log_count) {
263
+ continue;
264
+ }
265
+
266
+ //# filter for factor
267
+ $word = $item[5];
268
+ if ($byFactor != "false" && $byFactor != $item[6]) {
269
+ continue;
270
+ }
271
+ if (!array_key_exists($word,$info)) {
272
+ $info[$word]["precision"] = 0;
273
+ $info[$word]["delete"] = 0;
274
+ $info[$word]["length"] = 0;
275
+ $info_new[$word]["length"] = 0;
276
+ $info_new[$word]["delete"] = 0;
277
+ $info_new[$word]["precision"] = 0;
278
+ $info_new[$word]["total"] = 0;
279
+ $info[$word]["total"] = -$item[3];
280
+ }
281
+ $info[$word]["precision"] -= $item[0];
282
+ $info[$word]["delete"] -= $item[1];
283
+ $info[$word]["length"] -= $item[2];
284
+ }
285
+
286
+ print "<table border=1><tr><td align=center>&nbsp;</td><td align=center colspan=3>Precision</td><td align=center colspan=2>Precision Impact</td><td align=center colspan=3>Delete</td><td align=center colspan=2>Delete Impact</td><td align=center>Length</td></tr>\n";
287
+ foreach ($info as $word => $wordinfo) {
288
+ print "<tr><td align=center>$word</td>";
289
+ printf("<td align=right>%.1f%s</td><td align=right>%+.1f%s</td><td align=right><font size=-1>%+.1f/%d</font></td>",$info_new[$word]["precision"]/$wordinfo["total"]*100,"%",$wordinfo["precision"]/$wordinfo["total"]*100,"%",$wordinfo["precision"],$wordinfo["total"]);
290
+ printf("<td align=right>%+.2f%s</td><td align=right><font size=-1>%+.1f/%d</font></td>",$wordinfo["precision"]/$total*100,"%",$wordinfo["precision"],$total);
291
+ printf("<td align=right>%.1f%s</td><td align=right>%+.1f%s</td><td align=right><font size=-1>%+d/%d</font></td>",$info_new[$word]["delete"]/$wordinfo["total"]*100,"%",$wordinfo["delete"]/$wordinfo["total"]*100,"%",$wordinfo["delete"],$wordinfo["total"]);
292
+ printf("<td align=right>%+.2f%s</td><td align=right><font size=-1>%+d/%d</font></td>",$wordinfo["delete"]/$total*100,"%",$wordinfo["delete"],$total);
293
+ printf("<td align=right>%+.3f</td>",$wordinfo["length"]/$wordinfo["total"]);
294
+ print "</tr>";
295
+ }
296
+ print "</table>\n";
297
+ }
298
+
299
+ function precision_by_coverage_diff_matrix() {
300
+ global $id,$id2;
301
+ print "<h4>Impact of Change in Coverage</h4>";
302
+ print "Coverage in run $id is the x-axis, change in coverage in run $id2 is the y-axis. Size of box reflects how many output words are produced, yellow is the number of correct translations, green indicates increase, green decrease. The bleu rectangle below each box indicates number of words dropped, and increase (cyan) or decrease (purple).<p>(";
303
+ $scale = 30;
304
+ for($i=1; $i<=5; $i++) {
305
+ $size = (int)(sqrt($i*$scale));
306
+ $name = "size-$i";
307
+ print "<canvas id=\"$name\" width=\"$size\" height=\"$size\"></canvas><script language=\"javascript\">
308
+ var canvas = document.getElementById(\"$name\");
309
+ var ctx = canvas.getContext(\"2d\");
310
+ ctx.fillStyle = \"rgb(0,0,0)\";
311
+ ctx.fillRect (0, 0, $size, $size);
312
+ </script> = $i word";
313
+ if ($i>1) { print "s"; }
314
+ if ($i<5) { print ", "; }
315
+ }
316
+ print ")<p>";
317
+ # get base data
318
+ $data = file(get_current_analysis_filename("precision","precision-by-input-word"));
319
+ $word = array(); $class = array();
320
+ for($i=0;$i<count($data);$i++) {
321
+ $line = rtrim($data[$i]);
322
+ $item = split("\t",$line);
323
+ $surface = $item[5];
324
+ $word[$surface] = array();
325
+ $word[$surface]["precision"] = $item[0]; # number of precise translations
326
+ $word[$surface]["delete"] = $item[1]; # number of deleted
327
+ $word[$surface]["total"] = $item[2]; # number of all translations
328
+ $word[$surface]["coverage"] = $item[4]; # count in training corpus
329
+ if ($item[4] == 0) { $log_count = -1; }
330
+ else { $log_count = (int) (log($item[4])/log(2)); }
331
+ $word[$surface]["log_count"] = $log_count;
332
+ if (!array_key_exists($log_count,$class)) { $class[$log_count] = array(); }
333
+ $class[$log_count][] = $surface;
334
+ }
335
+
336
+ # init matrix
337
+ $matrix = array();
338
+ $max_base_log_count = -1;
339
+ $min_alt_log_count = 99;
340
+ $max_alt_log_count = -1;
341
+ foreach(array_keys($class) as $log_count) {
342
+ $matrix[$log_count] = array();
343
+ if ($log_count > $max_base_log_count) { $max_base_log_count = $log_count; }
344
+ }
345
+
346
+ # get alternative data
347
+ $data = file(get_current_analysis_filename2("precision","precision-by-input-word"));
348
+ for($i=0;$i<count($data);$i++) {
349
+ $line = rtrim($data[$i]);
350
+ $item = split("\t",$line);
351
+ $surface = $item[5];
352
+ if ($item[4] == 0) { $alt = -1; }
353
+ else { $alt = (int) (log($item[4])/log(2)); }
354
+
355
+ $base = -1;
356
+ if (array_key_exists($surface,$word)) {
357
+ $base = $word[$surface]["log_count"];
358
+ }
359
+
360
+ $alt -= $base;
361
+ if ($alt > $max_alt_log_count) { $max_alt_log_count = $alt; }
362
+ if ($alt < $min_alt_log_count) { $min_alt_log_count = $alt; }
363
+
364
+ if (!array_key_exists($alt,$matrix[$base])) {
365
+ $matrix[$base][$alt] = array();
366
+ $matrix[$base][$alt]["precision1"] = 0;
367
+ $matrix[$base][$alt]["delete1"] = 0;
368
+ $matrix[$base][$alt]["total1"] = 0;
369
+ $matrix[$base][$alt]["coverage1"] = 0;
370
+ $matrix[$base][$alt]["precision2"] = 0;
371
+ $matrix[$base][$alt]["delete2"] = 0;
372
+ $matrix[$base][$alt]["total2"] = 0;
373
+ $matrix[$base][$alt]["coverage2"] = 0;
374
+ }
375
+ # ignore mismatches in source words due to tokenization / casing
376
+ if (array_key_exists($surface,$word)) {
377
+ $matrix[$base][$alt]["precision1"] += $word[$surface]["precision"];
378
+ $matrix[$base][$alt]["delete1"] += $word[$surface]["delete"];
379
+ $matrix[$base][$alt]["total1"] += $word[$surface]["total"];
380
+ $matrix[$base][$alt]["coverage1"] += $word[$surface]["count"];
381
+ $matrix[$base][$alt]["precision2"] += $item[0];
382
+ $matrix[$base][$alt]["delete2"] += $item[1];
383
+ $matrix[$base][$alt]["total2"] += $item[2];
384
+ $matrix[$base][$alt]["coverage2"] += $item[4];
385
+ }
386
+ }
387
+
388
+ # make table
389
+ print "<table border=1 cellspacing=0 cellpadding=0><tr><td>&nbsp;</td>";
390
+ for($base=-1;$base<=$max_base_log_count;$base++) {
391
+ print "<td align=center>$base</td>";
392
+ }
393
+ print "<td></td></tr>";
394
+ for($alt=$max_alt_log_count;$alt>=$min_alt_log_count;$alt--) {
395
+ print "<tr><td>$alt</td>";
396
+ for($base=-1;$base<=$max_base_log_count;$base++) {
397
+ print "<td align=center valign=center>";
398
+ if (array_key_exists($base,$matrix) &&
399
+ array_key_exists($alt,$matrix[$base])) {
400
+ #print $matrix[$base][$alt]["precision1"]."->".
401
+ # $matrix[$base][$alt]["precision2"]."<br>";
402
+ #print $matrix[$base][$alt]["delete1"]."->".
403
+ # $matrix[$base][$alt]["delete2"]."<br>";
404
+ #print $matrix[$base][$alt]["total1"]."->".
405
+ # $matrix[$base][$alt]["total2"]."<br>";
406
+ $scale = 30;
407
+ $total = $matrix[$base][$alt]["total1"];
408
+ if ($matrix[$base][$alt]["total2"] > $total) {
409
+ $total = $matrix[$base][$alt]["total2"];
410
+ }
411
+ $total = (int)(sqrt($total*$scale));
412
+ if ($total>0) {
413
+ $prec1 = $matrix[$base][$alt]["precision1"]*$scale;
414
+ $prec2 = $matrix[$base][$alt]["precision2"]*$scale;
415
+ if ($prec1 > $prec2) {
416
+ $prec_base = (int)(sqrt($prec1));
417
+ $prec_imp = (int)(sqrt($prec1-$prec2));
418
+ $prec_color = "255,100,100";
419
+ }
420
+ else {
421
+ $prec_base = (int)(sqrt($prec2));
422
+ $prec_imp = (int)(sqrt($prec2-$prec1));
423
+ $prec_color = "100,255,100";
424
+ }
425
+ $prec_base_top = (int)(($total-$prec_base)/2);
426
+ $prec_imp_top = (int)(($total-$prec_imp)/2);
427
+
428
+ $del1 = $matrix[$base][$alt]["delete1"]*$scale;
429
+ $del2 = $matrix[$base][$alt]["delete2"]*$scale;
430
+ if ($del1 > $del2) {
431
+ $del_base = $del1;
432
+ $del_imp = $del1-$del2;
433
+ $del_color = "150,100,255";
434
+ }
435
+ else {
436
+ $del_base = $del2;
437
+ $del_imp = $del2-$del1;
438
+ $del_color = "100,200,200";
439
+ }
440
+ $del_base_height = (int)($del_base/$total);
441
+ $del_imp_height = (int)($del_imp/$total);
442
+
443
+ $name = "matrix-$base-$alt";
444
+ #print "$total/$prec1/$prec2 -> $prec_base/$prec_imp<br>";
445
+ print "<a href=\"javascript:generic_show_diff('CoverageMatrixDetails','base=$base&alt=$alt')\">";
446
+ print "<canvas id=\"$name\" width=\"$total\" height=\"".($total+$del_base_height+$del_imp_height)."\"></canvas></a>";
447
+ print "<script language=\"javascript\">
448
+ var canvas = document.getElementById(\"$name\");
449
+ var ctx = canvas.getContext(\"2d\");
450
+ ctx.fillStyle = \"rgb(200,200,200)\";
451
+ ctx.fillRect (0, 0, $total, $total);
452
+ ctx.fillStyle = \"rgb(200,200,0)\";
453
+ ctx.fillRect ($prec_base_top, $prec_base_top, $prec_base, $prec_base);
454
+ ctx.fillStyle = \"rgb($prec_color)\";
455
+ ctx.fillRect ($prec_imp_top, $prec_imp_top, $prec_imp, $prec_imp);
456
+ ctx.fillStyle = \"rgb(100,100,255)\";
457
+ ctx.fillRect (0, $total, $total, $del_base_height);
458
+ ctx.fillStyle = \"rgb($del_color)\";
459
+ ctx.fillRect (0, ".($total+$del_base_height).", $total, $del_imp_height);
460
+ </script>";
461
+ }
462
+ }
463
+ print "</td>";
464
+ }
465
+ print "<td>$alt</td></tr>";
466
+ }
467
+ print "<tr><td></td>";
468
+ for($base=-1;$base<=$max_base_log_count;$base++) {
469
+ print "<td align=center>$base</td>";
470
+ }
471
+ print "<td></td></tr></table><div id=\"CoverageMatrixDetails\"></div>";
472
+ }
473
+
474
+ function precision_by_coverage_diff_matrix_details() {
475
+ $alt = $_GET["alt"];
476
+ $base = $_GET["base"];
477
+
478
+ $impact_total = 0;
479
+ $data = file(get_current_analysis_filename("precision","precision-by-input-word"));
480
+ $word = array(); $class = array();
481
+ for($i=0;$i<count($data);$i++) {
482
+ $line = rtrim($data[$i]);
483
+ $item = split("\t",$line);
484
+ if ($item[4] == 0) { $log_count = -1; }
485
+ else { $log_count = (int) (log($item[4])/log(2)); }
486
+ if ($log_count == $base) {
487
+ $surface = $item[5];
488
+ $word[$surface] = array();
489
+ $word[$surface]["precision"] = $item[0]; # number of precise translations
490
+ $word[$surface]["delete"] = $item[1]; # number of deleted
491
+ $word[$surface]["total"] = $item[2]; # number of all translations
492
+ $word[$surface]["coverage"] = $item[4]; # count in training corpus
493
+ }
494
+ $impact_total += $item[2];
495
+ }
496
+
497
+ print "<table border=1><tr><td align=center>&nbsp;</td><td align=center colspan=3>Precision</td><td align=center colspan=2>Precision Impact</td><td align=center colspan=3>Delete</td><td align=center colspan=2>Delete Impact</td></tr>\n";
498
+
499
+ # get alternative data
500
+ $data = file(get_current_analysis_filename2("precision","precision-by-input-word"));
501
+ for($i=0;$i<count($data);$i++) {
502
+ $line = rtrim($data[$i]);
503
+ $item = split("\t",$line);
504
+ if ($item[4] == 0) { $log_count = -1; }
505
+ else { $log_count = (int) (log($item[4])/log(2)); }
506
+ $surface = $item[5];
507
+ if ($log_count-$base == $alt && array_key_exists($surface,$word)) {
508
+ $precision = $item[0]; # number of precise translations
509
+ $delete = $item[1]; # number of deleted
510
+ $total = $item[3]; # number of all translations + deletions
511
+ $coverage = $item[4]; # count in training corpus
512
+ $surface = $item[5];
513
+ $out = sprintf("%07d", (1-($precision-$word[$surface]["precision"])/$impact_total)*1000000);
514
+ $out .= "\t<tr><td align=cente>$surface</td>";
515
+ $out .= sprintf("<td align=right>%.1f%s</td><td align=right>%+.1f%s</td><td align=right><font size=-1>%+.1f/%d</font></td>",
516
+ $precision/$total*100,"%",
517
+ ($precision-$word[$surface]["precision"])/$total*100,"%",
518
+ $precision-$word[$surface]["precision"],$total);
519
+ $out .= sprintf("<td align=right>%+.2f%s</td><td align=right><font size=-1>%+.1f/%d</font></td>",
520
+ ($precision-$word[$surface]["precision"])/$impact_total*100,"%",
521
+ $precision-$word[$surface]["precision"],$impact_total);
522
+ $out .= sprintf("<td align=right>%.1f%s</td><td align=right>%+.1f%s</td><td align=right><font size=-1>%+.1f/%d</font></td>",
523
+ $delete/$total*100,"%",
524
+ ($delete-$word[$surface]["delete"])/$total*100,"%",
525
+ $delete-$word[$surface]["delete"],$total);
526
+ $out .= sprintf("<td align=right>%+.2f%s</td><td align=right><font size=-1>%+.1f/%d</font></td>",
527
+ ($delete-$word[$surface]["delete"])/$impact_total*100,"%",
528
+ $delete-$word[$surface]["delete"],$impact_total);
529
+ $out .= "</tr>";
530
+ $all_out[] = $out;
531
+ }
532
+ }
533
+ sort($all_out);
534
+ foreach($all_out as $out) { $o = explode("\t",$out); print $o[1]; }
535
+ print "</table>";
536
+ }
537
+
538
+ function precision_by_coverage_diff_graph($name,$log_info,$log_info_new,$total,$img_width,$sort_type) {
539
+ $keys = array_keys($log_info);
540
+ sort($keys,$sort_type);
541
+
542
+ print "<div id=\"Toggle$name\" onClick=\"document.getElementById('Table$name').style.display = 'none'; this.style.display = 'none';\" style=\"display:none;\"><font size=-2>(hide table)</font></div>\n";
543
+ print "<div id=\"Table$name\" style=\"display:none;\">\n";
544
+ print "<table border=1><tr><td align=center>&nbsp;</td><td align=center colspan=3>Precision</td><td align=center colspan=2>Precision Impact</td><td align=center colspan=3>Delete</td><td align=center colspan=2>Delete Impact</td><td align=center>Length</td></tr>\n";
545
+ foreach ($keys as $i) {
546
+ if (array_key_exists($i,$log_info)) {
547
+ print "<tr><td align=center>$i</td>";
548
+ printf("<td align=right>%.1f%s</td><td align=right>%.1f%s</td><td align=right><font size=-1>%+.1f/%d</font></td>",$log_info_new[$i]["precision"]/$log_info[$i]["total"]*100,"%",$log_info[$i]["precision"]/$log_info[$i]["total"]*100,"%",$log_info[$i]["precision"],$log_info[$i]["total"]);
549
+ printf("<td align=right>%+.2f%s</td><td align=right><font size=-1>%+.1f/%d</font></td>",$log_info[$i]["precision"]/$total*100,"%",$log_info[$i]["precision"],$total);
550
+ printf("<td align=right>%.1f%s</td><td align=right>%+.1f%s</td><td align=right><font size=-1>%+d/%d</font></td>",$log_info_new[$i]["delete"]/$log_info[$i]["total"]*100,"%",$log_info[$i]["delete"]/$log_info[$i]["total"]*100,"%",$log_info[$i]["delete"],$log_info[$i]["total"]);
551
+ printf("<td align=right>%+.2f%s</td><td align=right><font size=-1>%+d/%d</font></td>",$log_info[$i]["delete"]/$total*100,"%",$log_info[$i]["delete"],$total);
552
+ printf("<td align=right>%+.3f</td>",$log_info[$i]["length"]/$log_info[$i]["total"]);
553
+ print "<td><A HREF=\"javascript:generic_show_diff('PrecisionByWordDiff$name','type=$i')\">&#x24BE;</A></td>";
554
+ print "</tr>";
555
+ }
556
+ }
557
+ print "</table><div id=\"PrecisionByWordDiff$name\"></div></div>";
558
+
559
+ print "<div id=\"Graph$name\" onClick=\"document.getElementById('Table$name').style.display = 'block'; document.getElementById('Toggle$name').style.display = 'block';\"><canvas id=\"$name\" width=$img_width height=300></canvas></div>";
560
+ print "<script language=\"javascript\">
561
+ var canvas = document.getElementById(\"$name\");
562
+ var ctx = canvas.getContext(\"2d\");
563
+ ctx.lineWidth = 0.5;
564
+ ctx.font = '9px serif';
565
+ ";
566
+ for($line=-1;$line<=0.8;$line+=.2) {
567
+ $height = 90-$line/2*180;
568
+ print "ctx.moveTo(20, $height);\n";
569
+ print "ctx.lineTo($img_width, $height);\n";
570
+ print "ctx.fillText(\"".sprintf("%d",10 * $line * 1.001)."\%\", 0, $height+4);";
571
+ }
572
+ for($line=-0.4;$line<=0.4;$line+=.2) {
573
+ $height = 250+$line/2*180;
574
+ print "ctx.moveTo(20, $height);\n";
575
+ print "ctx.lineTo($img_width, $height);\n";
576
+ if ($line != 0) {
577
+ print "ctx.fillText(\"".sprintf("%d",10 * $line * 1.001)."\%\", 0, $height+4);";
578
+ }
579
+ }
580
+ print "ctx.strokeStyle = \"rgb(100,100,100)\"; ctx.stroke();\n";
581
+
582
+ $total = 0;
583
+ foreach ($keys as $i) {
584
+ $total += $log_info[$i]["total"];
585
+ }
586
+ $total_so_far = 0;
587
+ foreach ($keys as $i) {
588
+ $prec_ratio = $log_info[$i]["precision"]/$log_info[$i]["total"];
589
+ $x = (int)(20+($img_width-20) * $total_so_far / $total);
590
+ $y = (int)(90-($prec_ratio*180*5));
591
+ $width = (int)($img_width * $log_info[$i]["total"]/$total);
592
+ $height = (int)($prec_ratio*180*5);
593
+ print "ctx.fillStyle = \"rgb(200,200,0)\";";
594
+ print "ctx.fillRect ($x, $y, $width, $height);";
595
+
596
+ $del_ratio = $log_info[$i]["delete"]/$log_info[$i]["total"];
597
+ $height = (int)($del_ratio*180*5);
598
+ print "ctx.fillStyle = \"rgb(100,100,255)\";";
599
+ print "ctx.fillRect ($x, 250, $width, $height);";
600
+
601
+ $total_so_far += $log_info[$i]["total"];
602
+
603
+ if ($width>3) {
604
+ print "ctx.fillStyle = \"rgb(0,0,0)\";";
605
+ // print "ctx.rotate(-1.5707);";
606
+ print "ctx.fillText(\"$i\", $x+$width/2-3, 190);";
607
+ //print "ctx.rotate(1.5707);";
608
+ }
609
+ }
610
+ print "</script>";
611
+ }
612
+
613
+
614
+ // stats on precision and recall
615
+ function precision_recall_details_diff() {
616
+ ?>
617
+ <table width=100%>
618
+ <tr>
619
+ <td width=25% valign=top><div id="nGramPrecision1">(loading...)</div></td>
620
+ <td width=25% valign=top><div id="nGramPrecision2">(loading...)</div></td>
621
+ <td width=25% valign=top><div id="nGramPrecision3">(loading...)</div></td>
622
+ <td width=25% valign=top><div id="nGramPrecision4">(loading...)</div></td>
623
+ </tr><tr>
624
+ <td width=25% valign=top><div id="nGramRecall1">(loading...)</div></td>
625
+ <td width=25% valign=top><div id="nGramRecall2">(loading...)</div></td>
626
+ <td width=25% valign=top><div id="nGramRecall3">(loading...)</div></td>
627
+ <td width=25% valign=top><div id="nGramRecall4">(loading...)</div></td>
628
+ </tr></table>
629
+ <script language="javascript">
630
+ ngram_diff('precision',1,5,'',0);
631
+ ngram_diff('precision',2,5,'',0);
632
+ ngram_diff('precision',3,5,'',0);
633
+ ngram_diff('precision',4,5,'',0);
634
+ ngram_diff('recall',1,5,'',0);
635
+ ngram_diff('recall',2,5,'',0);
636
+ ngram_diff('recall',3,5,'',0);
637
+ ngram_diff('recall',4,5,'',0);
638
+ </script>
639
+ <?php
640
+ }
641
+
642
+ function ngram_summary_diff() {
643
+ global $experiment,$evalset,$dir,$set,$id,$id2;
644
+
645
+ // load data
646
+ for($idx=0;$idx<2;$idx++) {
647
+ $data = file(get_analysis_filename($dir,$set,$idx?$id2:$id,"basic","summary"));
648
+ for($i=0;$i<count($data);$i++) {
649
+ $item = split(": ",$data[$i]);
650
+ $info[$idx][$item[0]] = $item[1];
651
+ }
652
+ }
653
+
654
+ print "<table cellspacing=5 width=100%><tr><td valign=top align=center bgcolor=#eeeeee>";
655
+ print "<b>Precision of Output</b><br>";
656
+ //foreach (array("precision","recall") as $type) {
657
+ $type = "precision";
658
+ print "<table><tr><td>$type</td><td>1-gram</td><td>2-gram</td><td>3-gram</td><td>4-gram</td></tr>\n";
659
+ printf("<tr><td>correct</td><td>%d (%+d)</td><td>%d (%+d)</td><td>%d (%+d)</td><td>%d (%+d)</td></tr>\n",
660
+ $info[1]["$type-1-correct"],$info[1]["$type-1-correct"]-$info[0]["$type-1-correct"],
661
+ $info[1]["$type-2-correct"],$info[1]["$type-2-correct"]-$info[0]["$type-2-correct"],
662
+ $info[1]["$type-3-correct"],$info[1]["$type-3-correct"]-$info[0]["$type-3-correct"],
663
+ $info[1]["$type-4-correct"],$info[1]["$type-4-correct"]-$info[0]["$type-4-correct"]);
664
+ printf("<tr><td>&nbsp;</td><td>%.1f%s (%+.1f%s)</td><td>%.1f%s (%+.1f%s)</td><td>%.1f%s (%+.1f%s)</td><td>%.1f%s (%+.1f%s)</td></tr>\n",
665
+ $info[1]["$type-1-correct"]/$info[1]["$type-1-total"]*100,'%',$info[1]["$type-1-correct"]/$info[1]["$type-1-total"]*100-$info[0]["$type-1-correct"]/$info[0]["$type-1-total"]*100,'%',
666
+ $info[1]["$type-2-correct"]/$info[1]["$type-2-total"]*100,'%',$info[1]["$type-2-correct"]/$info[1]["$type-2-total"]*100-$info[0]["$type-2-correct"]/$info[0]["$type-2-total"]*100,'%',
667
+ $info[1]["$type-3-correct"]/$info[1]["$type-3-total"]*100,'%',$info[1]["$type-3-correct"]/$info[1]["$type-3-total"]*100-$info[0]["$type-3-correct"]/$info[0]["$type-3-total"]*100,'%',
668
+ $info[1]["$type-4-correct"]/$info[1]["$type-4-total"]*100,'%',$info[1]["$type-4-correct"]/$info[1]["$type-4-total"]*100-$info[0]["$type-4-correct"]/$info[0]["$type-4-total"]*100,'%');
669
+ printf("<tr><td>wrong</td><td>%d (%+d)</td><td>%d (%+d)</td><td>%d (%+d)</td><td>%d (%+d)</td></tr>\n",
670
+ $info[1]["$type-1-total"]-$info[1]["$type-1-correct"],($info[1]["$type-1-total"]-$info[1]["$type-1-correct"])-($info[0]["$type-1-total"]-$info[0]["$type-1-correct"]),
671
+ $info[1]["$type-2-total"]-$info[1]["$type-2-correct"],($info[1]["$type-2-total"]-$info[1]["$type-2-correct"])-($info[0]["$type-2-total"]-$info[0]["$type-2-correct"]),
672
+ $info[1]["$type-3-total"]-$info[1]["$type-3-correct"],($info[1]["$type-3-total"]-$info[1]["$type-3-correct"])-($info[0]["$type-3-total"]-$info[0]["$type-3-correct"]),
673
+ $info[1]["$type-4-total"]-$info[1]["$type-4-correct"],($info[1]["$type-4-total"]-$info[1]["$type-4-correct"])-($info[0]["$type-4-total"]-$info[0]["$type-4-correct"]));
674
+ print "</table>";
675
+ //}
676
+
677
+ print "<A HREF=\"javascript:generic_show_diff('PrecisionRecallDetailsDiff','')\">details</A> ";
678
+ if (file_exists(get_current_analysis_filename("precision","precision-by-corpus-coverage")) &&
679
+ file_exists(get_current_analysis_filename2("precision","precision-by-corpus-coverage"))) {
680
+ print "| <A HREF=\"javascript:generic_show_diff('PrecisionByCoverageDiff','')\">precision of input by coverage</A> ";
681
+ }
682
+
683
+ print "</td><td valign=top align=center bgcolor=#eeeeee>";
684
+ print "<b>Metrics</b><br>\n";
685
+
686
+ for($idx=0;$idx<2;$idx++) {
687
+ $each_score = explode(" ; ",$experiment[$idx?$id2:$id]->result[$set]);
688
+ for($i=0;$i<count($each_score);$i++) {
689
+ if (preg_match('/([\d\(\)\.\s]+) (BLEU[\-c]*)/',$each_score[$i],$match) ||
690
+ preg_match('/([\d\(\)\.\s]+) (IBM[\-c]*)/',$each_score[$i],$match) ||
691
+ preg_match('/([\d\(\)\.\s]+) (METEOR[\-c]*)/',$each_score[$i],$match)) {
692
+ $score[$match[2]][$idx] = $match[1];
693
+ }
694
+ }
695
+ }
696
+ $header = ""; $score_line = ""; $diff_line = "";
697
+ foreach ($score as $name => $value) {
698
+ $header .= "<td>$name</td>";
699
+ $score_line .= "<td>".$score[$name][1]."</td>";
700
+ $diff_line .= sprintf("<td>%+.2f</td>",$score[$name][1]-$score[$name][0]);
701
+ }
702
+ print "<table border=1><tr>".$header."</tr><tr>".$score_line."</tr><tr>".$diff_line."</tr></table>";
703
+ printf("length-diff<br>%d (%+d)",$info[1]["precision-1-total"]-$info[1]["recall-1-total"],$info[1]["precision-1-total"]-$info[0]["precision-1-total"]);
704
+
705
+ print "</td><tr><table>";
706
+ }
707
+
708
+ function bleu_diff() {
709
+ $count = $_GET['count'];
710
+ if ($count == 0) { $count = 5; }
711
+
712
+ print "<b>annotated sentences</b><br>";
713
+ print "<font size=-1>sorted by ";
714
+
715
+ if ($_GET['sort'] == "order" || $_GET['sort'] == "") {
716
+ print "order ";
717
+ }
718
+ else {
719
+ print "<A HREF=\"javascript:diff('bleu','order',$count)\">order</A> ";
720
+ }
721
+
722
+ if ($_GET['sort'] == "better") {
723
+ print "order ";
724
+ }
725
+ else {
726
+ print "<A HREF=\"javascript:diff('bleu','better',$count)\">better</A> ";
727
+ }
728
+
729
+ if ($_GET['sort'] == "worse") {
730
+ print "order ";
731
+ }
732
+ else {
733
+ print "<A HREF=\"javascript:diff('bleu','worse',$count)\">worse</A> ";
734
+ }
735
+
736
+ print "display <A HREF=\"\">fullscreen</A> ";
737
+
738
+ $count = $_GET['count'];
739
+ if ($count == 0) { $count = 5; }
740
+ print "showing $count ";
741
+ print "<A HREF=\"javascript:diff('bleu','" . $_GET['sort'] . "',5+$count)\">more</A> ";
742
+ if ($count > 5) {
743
+ print "<A HREF=\"javascript:diff('bleu','" . $_GET['sort'] . "',$count-5)\">less</A> ";
744
+ }
745
+ print "<A HREF=\"javascript:diff('bleu','" . $_GET['sort'] . "',9999)\">all</A> ";
746
+
747
+ print "</font><BR>\n";
748
+
749
+ bleu_diff_annotation();
750
+ print "<font size=-1>";
751
+ print "<A HREF=\"javascript:diff('bleu','" . $_GET['sort'] . "',5+$count)\">more</A> ";
752
+ print "</font><BR>\n";
753
+ }
754
+
755
+ function bleu_diff_annotation() {
756
+ global $set,$id,$id2,$dir;
757
+
758
+ // load input
759
+ $input_annotation = file(get_analysis_filename($dir,$set,$id,"coverage","input-annotation"));
760
+ for($i=0;$i<count($input_annotation);$i++) {
761
+ $item = split("\t",$input_annotation[$i]);
762
+ $input[$i] = $item[0];
763
+ }
764
+
765
+ // load translations
766
+ for($idx=0;$idx<2;$idx++) {
767
+ $data = file(get_analysis_filename($dir,$set,$idx?$id2:$id,"basic","bleu-annotation"));
768
+ for($i=0;$i<count($data);$i++) {
769
+ $item = split("\t",$data[$i]);
770
+ $annotation[$item[1]]["bleu$idx"] = $item[0];
771
+ $annotation[$item[1]]["system$idx"] = $item[2];
772
+ $annotation[$item[1]]["reference"] = $item[3];
773
+ $annotation[$item[1]]["id"] = $item[1];
774
+ }
775
+ }
776
+ $data = array();
777
+
778
+ $identical=0; $same=0; $better=0; $worse=0;
779
+ for($i=0;$i<count($annotation);$i++) {
780
+ if ($annotation[$i]["system1"] == $annotation[$i]["system0"]) {
781
+ $identical++;
782
+ }
783
+ else if ($annotation[$i]["bleu1"] == $annotation[$i]["bleu0"]) {
784
+ $same++;
785
+ }
786
+ else if ($annotation[$i]["bleu1"] > $annotation[$i]["bleu0"]) {
787
+ $better++;
788
+ }
789
+ else {
790
+ $worse++;
791
+ }
792
+ }
793
+
794
+ print "<table><tr><td>identical</td><td>same</td><td>better</td><td>worse</td></tr>\n";
795
+ printf("<tr><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr>\n", $identical, $same, $better, $worse);
796
+ printf("<tr><td>%d%s</td><td>%d%s</td><td>%d%s</td><td>%d%s</td></tr></table>\n", $identical*100/count($annotation)+.5, '%', $same*100/count($annotation)+.5, '%', $better*100/count($annotation)+.5, '%', $worse*100/count($annotation)+.5, '%');
797
+
798
+ // print "identical: $identical (%d), same: $same, better: $better, worse: $worse<br>\n";
799
+
800
+ // sort
801
+ global $sort;
802
+ $sort = $_GET['sort'];
803
+ if ($sort == '') {
804
+ $sort = "order";
805
+ }
806
+ function cmp($a, $b) {
807
+ global $sort;
808
+ if ($sort == "worse") {
809
+ $a_idx = $a["bleu1"]-$a["bleu0"];
810
+ $b_idx = $b["bleu1"]-$b["bleu0"];
811
+ }
812
+ else if ($sort == "better") {
813
+ $a_idx = -$a["bleu1"]+$a["bleu0"];
814
+ $b_idx = -$b["bleu1"]+$b["bleu0"];
815
+ }
816
+
817
+ if ($a_idx == $b_idx) {
818
+ return 0;
819
+ }
820
+ return ($a_idx < $b_idx) ? -1 : 1;
821
+ }
822
+
823
+ if ($sort != 'order') {
824
+ usort($annotation, 'cmp');
825
+ }
826
+
827
+ $count = $_GET['count'];
828
+ if ($count == 0) { $count = 5; }
829
+
830
+ // display
831
+ for($i=0;$i<$count && $i<count($annotation);$i++) {
832
+ $line = $annotation[$i];
833
+ print "<font size=-2>[src]</font> ".$input[$line["id"]]."<br>";
834
+
835
+ $word_with_score1 = split(" ",$line["system1"]);
836
+ $word_with_score0 = split(" ",$line["system0"]);
837
+ $word1 = split(" ",preg_replace("/\|\d/","",$line["system1"]));
838
+ $word0 = split(" ",preg_replace("/\|\d/","",$line["system0"]));
839
+ $matched_with_score = string_edit_distance($word_with_score0,$word_with_score1);
840
+ $matched = string_edit_distance($word0,$word1);
841
+
842
+ print "<font size=-2>[".$id2."-".$line["id"].":".$line["bleu1"]."]</font> ";
843
+ $matched1 = preg_replace('/D/',"",$matched);
844
+ $matched_with_score1 = preg_replace('/D/',"",$matched_with_score);
845
+ bleu_line_diff( $word_with_score1, $matched1, $matched_with_score1 );
846
+
847
+ print "<font size=-2>[".$id."-".$line["id"].":".$line["bleu0"]."]</font> ";
848
+ $matched0 = preg_replace('/I/',"",$matched);
849
+ $matched_with_score0 = preg_replace('/I/',"",$matched_with_score);
850
+ bleu_line_diff( $word_with_score0, $matched0, $matched_with_score0 );
851
+
852
+ print "<font size=-2>[ref]</font> ".$line["reference"]."<hr>";
853
+ }
854
+ }
855
+
856
+ function bleu_line_diff( $word,$matched,$matched_with_score ) {
857
+ $color = array("#FFC0C0","#FFC0FF","#C0C0FF","#C0FFFF","#C0FFC0");
858
+ $lcolor = array("#FFF0F0","#FFF0FF","#F0F0FF","#F0FFFF","#F0FFF0");
859
+ for($j=0;$j<count($word);$j++) {
860
+ list($surface,$correct) = split("\|", $word[$j]);
861
+ if (substr($matched_with_score,$j,1) == "M") {
862
+ $style = "background-color: $lcolor[$correct];";
863
+ }
864
+ else {
865
+ $style = "background-color: $color[$correct];";
866
+ }
867
+ if (substr($matched,$j,1) == "M") {
868
+ $style .= "color: #808080;";
869
+ }
870
+ print "<span style=\"$style\">$surface</span> ";
871
+ }
872
+ print "<br>";
873
+ }
874
+
875
+ function ngram_diff($type) {
876
+ global $set,$id,$id2,$dir;
877
+
878
+ ini_set('memory_limit',1e9); // 1G for big files
879
+
880
+ // load data
881
+ $order = $_GET['order'];
882
+
883
+ for($idx=0;$idx<2;$idx++) {
884
+ $data = file(get_analysis_filename($dir,$set,$idx?$id2:$id,"basic","n-gram-$type.$order"));
885
+ for($i=0;$i<count($data);$i++) {
886
+ $item = split("\t",$data[$i]);
887
+ $ngram_hash[$item[2]]["total$idx"] = $item[0];
888
+ $ngram_hash[$item[2]]["correct$idx"] = $item[1];
889
+ }
890
+ unset($data);
891
+ }
892
+
893
+ // sort option
894
+ $sort = $_GET['sort'];
895
+ $smooth = $_GET['smooth'];
896
+ if ($sort == '') {
897
+ $sort = 'ratio_worse';
898
+ $smooth = 1;
899
+ }
900
+
901
+ error_reporting(E_ERROR); // otherwise undefined counts trigger notices
902
+
903
+ // sort index
904
+ foreach ($ngram_hash as $n => $value) {
905
+ $item = $value;
906
+ // $item["correct0"] += 0;
907
+ // $item["correct1"] += 0;
908
+ // $item["total0"] += 0;
909
+ // $item["total1"] += 0;
910
+ $item["ngram"] = $n;
911
+
912
+ if ($sort == "abs_worse") {
913
+ $item["index"] = (2*$item["correct1"] - $item["total1"])
914
+ - (2*$item["correct0"] - $item["total0"]);
915
+ }
916
+ else if ($sort == "abs_better") {
917
+ $item["index"] = - (2*$item["correct1"] - $item["total1"])
918
+ + (2*$item["correct0"] - $item["total0"]);
919
+ }
920
+ else if ($sort == "ratio_worse") {
921
+ $item["index"] =
922
+ ($item["correct1"] + $smooth) / ($item["total1"] + $smooth)
923
+ - ($item["correct0"] + $smooth) / ($item["total0"] + $smooth);
924
+ }
925
+ else if ($sort == "ratio_better") {
926
+ $item["index"] =
927
+ - ($item["correct1"] + $smooth) / ($item["total1"] + $smooth)
928
+ + ($item["correct0"] + $smooth) / ($item["total0"] + $smooth);
929
+ }
930
+ $ngram[] = $item;
931
+ unset($ngram_hash[$n]);
932
+ }
933
+ unset($ngram_hash);
934
+
935
+ // sort
936
+ function cmp($a, $b) {
937
+ if ($a["index"] == $b["index"]) {
938
+ return 0;
939
+ }
940
+ return ($a["index"] < $b["index"]) ? -1 : 1;
941
+ }
942
+
943
+ usort($ngram, 'cmp');
944
+
945
+ // display
946
+ $count = $_GET['count'];
947
+ if ($count == 0) { $count = 5; }
948
+
949
+ print "<B>$order-gram $type</B><br><font size=-1>sorted by<br>";
950
+ if ($sort == "ratio_worse") {
951
+ print "ratio worse ";
952
+ print "smooth-$smooth ";
953
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count,'ratio_worse',$smooth+1)\">+</A> ";
954
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count,'ratio_worse',$smooth-1)\">-</A>,";
955
+ }
956
+ else {
957
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count,'ratio_worse',1)\">ratio worse</A>, ";
958
+ }
959
+ if ($sort == "abs_worse") {
960
+ print "absolute worse, ";
961
+ }
962
+ else {
963
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count,'abs_worse',0)\">absolute worse</A>, ";
964
+ }
965
+
966
+ print "<br>";
967
+ if ($sort == "ratio_better") {
968
+ print "ratio better ";
969
+ print "smooth-$smooth ";
970
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count,'ratio_better',$smooth+1)\">+</A> ";
971
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count,'ratio_better',$smooth-1)\">-</A>,";
972
+ }
973
+ else {
974
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count,'ratio_better',1)\">ratio better</A>, ";
975
+ }
976
+ if ($sort == "abs_better") {
977
+ print "absolute better, ";
978
+ }
979
+ else {
980
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count,'abs_better',0)\">absolute better</A>, ";
981
+ }
982
+
983
+ print "<br>showing $count ";
984
+ if ($count < 9999) {
985
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count+5,'$sort',$smooth)\">more</A> ";
986
+ if ($count > 5) {
987
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,$count-5,'$sort',$smooth)\">less</A> ";
988
+ }
989
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,9999,'$sort',$smooth)\">all</A> ";
990
+ }
991
+ else {
992
+ print "<A HREF=\"javascript:ngram_diff('$type',$order,5,'$sort',$smooth)\">top5</A> ";
993
+ }
994
+
995
+ print "<br>\n";
996
+
997
+ print "<table width=100%>\n";
998
+ print "<tr><td>$order-gram</td>";
999
+ if ($type == 'recall') {
1000
+ print "<td>&Delta;</td><td>ok</td><td>x</td></tr>\n";
1001
+ }
1002
+ else {
1003
+ print "<td align=right>&Delta;</td><td>ok</td><td align=right>&Delta;</td><td>x</td></tr>\n";
1004
+ }
1005
+ for($i=0;$i<$count && $i<count($ngram);$i++) {
1006
+ $line = $ngram[$i];
1007
+ print "<tr><td>".$line["ngram"]."</td>";
1008
+ $ok = $line["correct1"];
1009
+ $ok_diff = $ok - $line["correct0"];
1010
+ $wrong = $line["total1"] - $line["correct1"];
1011
+ $wrong_diff = $wrong - ($line["total0"]-$line["correct0"]);
1012
+ if ($type == 'recall') {
1013
+ printf("<td>%+d</td><td>%d</td><td>%d</td></tr>", $ok_diff,$ok,$wrong);
1014
+ }
1015
+ else {
1016
+ printf("<td align=right>%+d</td><td>(%d)</td><td align=right>%+d</td><td>(%d)</td></tr>", $ok_diff,$ok,$wrong_diff,$wrong);
1017
+ }
1018
+ }
1019
+ print "</table>\n";
1020
+ }
1021
+
1022
+ function string_edit_distance($a,$b) {
1023
+ $cost = array( array( 0 ) );
1024
+ $back = array( array( "" ) );
1025
+
1026
+ // init boundaries
1027
+ for($i=0;$i<count($a);$i++) {
1028
+ $cost[$i+1][0] = $i+1;
1029
+ }
1030
+ for($j=0;$j<count($b);$j++) {
1031
+ $cost[0][$j+1] = $j+1;
1032
+ }
1033
+
1034
+ // exhaustive sed
1035
+ for($i=1;$i<=count($a);$i++) {
1036
+ for($j=1;$j<=count($b);$j++) {
1037
+ $match_cost = ($a[$i-1] == $b[$j-1]) ? 0 : 1;
1038
+ $c = $match_cost + $cost[$i-1][$j-1];
1039
+ $p = $match_cost ? "S" : "M";
1040
+ if ($cost[$i-1][$j]+1 < $c) {
1041
+ $c = $cost[$i-1][$j]+1;
1042
+ $p = "D";
1043
+ }
1044
+ if ($cost[$i][$j-1]+1 < $c) {
1045
+ $c = $cost[$i][$j-1]+1;
1046
+ $p = "I";
1047
+ }
1048
+ $cost[$i][$j] = $c;
1049
+ $back[$i][$j] = $p;
1050
+ }
1051
+ }
1052
+
1053
+ // retrieve path
1054
+ $i=count($a);
1055
+ $j=count($b);
1056
+ $path = "";
1057
+ while($i>0 || $j>0) {
1058
+ if ($back[$i][$j] == "M" || $back[$i][$j] == "S") {
1059
+ $path = $back[$i][$j] . $path;
1060
+ $i--; $j--;
1061
+ }
1062
+ else if($i==0 || $back[$i][$j] == "I") {
1063
+ $path = "I".$path;
1064
+ $j--;
1065
+ }
1066
+ else {
1067
+ $path = "D".$path;
1068
+ $i--;
1069
+ }
1070
+ }
1071
+ return $path;
1072
+ }
mosesdecoder/scripts/ems/web/bilingual-concordance.css ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .pp_head {
2
+ font-size: 90%;
3
+ font-weight: bold;
4
+ text-align: center;
5
+ }
6
+
7
+ .pp_target_header {
8
+ font-size: 80%;
9
+ font-weight: bold;
10
+ text-align: center;
11
+ }
12
+
13
+ .pp_singleton_header {
14
+ font-size: 80%;
15
+ font-variant: small-caps;
16
+ font-weight: bold;
17
+ text-align: center;
18
+ }
19
+
20
+ table.biconcor {
21
+ table-layout: fixed;
22
+ padding: 0px;
23
+ margin: 0px;
24
+ }
25
+
26
+ tr.biconcor {
27
+ padding: 0px;
28
+ margin: 0px;
29
+ }
30
+
31
+ td.biconcor {
32
+ white-space: nowrap;
33
+ overflow: hidden;
34
+ padding: 0px;
35
+ margin: 0px;
36
+ }
37
+
38
+ td.pp_source_left {
39
+ font-size: 70%;
40
+ text-align: right;
41
+ }
42
+
43
+ td.pp_target_left {
44
+ font-size: 70%;
45
+ text-align: right;
46
+ }
47
+
48
+ td.pp_source {
49
+ font-size: 70%;
50
+ font-weight: bold;
51
+ }
52
+
53
+ td.pp_target {
54
+ font-size: 70%;
55
+ font-weight: bold;
56
+ }
57
+
58
+ td.mismatch_target {
59
+ font-size: 70%;
60
+ text-align: center;
61
+ }
62
+
63
+ td.pp_source_right {
64
+ font-size: 70%;
65
+ border-style:solid;
66
+ border-width:0px 2px 0px 0px ;
67
+ border-color: black;
68
+ }
69
+
70
+ td.pp_target_right {
71
+ font-size: 70%;
72
+ }
73
+
74
+ span.null_aligned {
75
+ color: blue;
76
+ }
77
+
78
+ span.mismatch_pre_aligned {
79
+ color: purple;
80
+ }
81
+
82
+ span.mismatch_post_aligned {
83
+ color: olive;
84
+ }
85
+
86
+ span.mismatch_misaligned {
87
+ color: red;
88
+ }
89
+
90
+ span.mismatch_aligned {
91
+ font-weight: bold;
92
+ }
93
+
94
+ td.pp_more {
95
+ font-size: 70%;
96
+ color: navy;
97
+ text-align: center;
98
+ }
mosesdecoder/scripts/ems/web/comment.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ <?php
2
+ $fp = fopen("comment","a");
3
+ fwrite($fp,$_GET{'run'} . ";" . $_GET{'text'} . "\n");
4
+ fclose($fp);
5
+ ?>
mosesdecoder/scripts/ems/web/diff.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ This file is part of moses. Its use is licensed under the GNU Lesser General
5
+ Public License version 2.1 or, at your option, any later version.
6
+ */
7
+
8
+ function diff() {
9
+ global $experiment;
10
+ $display = $_GET["run"];
11
+ sort($display);
12
+ while (list($i,$run) = each($display)) {
13
+ if ($i==0) {
14
+ print "<H3>Experiment $run</H3>\n";
15
+ }
16
+ else {
17
+ $diff = compute_diff($display[0],$run);
18
+ }
19
+ print "<table border=1 cellpadding=1 cellspacing=0><tr>";
20
+ output_score($run,$experiment[$run]);
21
+ print "</tr></table>";
22
+ }
23
+ }
24
+
25
+ function compute_diff($base,$change) {
26
+ print "<H3>Experiment $change</H3><TABLE>";
27
+
28
+ // get parameter values for the two runs
29
+ $parameter_base = load_parameter($base);
30
+ $parameter_change = load_parameter($change);
31
+
32
+ // get parameters and sort them
33
+ $all_parameters = array_keys($parameter_base);
34
+ foreach (array_keys($parameter_change) as $parameter) {
35
+ if (!array_key_exists($parameter,$parameter_base)) {
36
+ $all_parameters[] = $parameter;
37
+ }
38
+ }
39
+ sort($all_parameters);
40
+
41
+ // display differences
42
+ foreach ($all_parameters as $parameter) {
43
+ if (!array_key_exists($parameter,$parameter_base)) {
44
+ $parameter_base[$parameter] = "";
45
+ }
46
+ if (!array_key_exists($parameter,$parameter_change)) {
47
+ $parameter_change[$parameter] = "";
48
+ }
49
+ if ($parameter_base[$parameter] != $parameter_change[$parameter]) {
50
+ output_diff_line($parameter,$parameter_base[$parameter],$parameter_change[$parameter]);
51
+ }
52
+ }
53
+ print "</TABLE>\n";
54
+ }
55
+
56
+ function output_diff_line($parameter,$base_value,$change_value) {
57
+ print "<TR><TD BGCOLOR=yellow>$parameter</TD><TD BGCOLOR=lightgreen>$change_value</TD></TR><TR><TD>&nbsp;</TD><TD BGCOLOR=#cccccc>$base_value</TD></TR>\n";
58
+ }
mosesdecoder/scripts/ems/web/favicon.ico ADDED
mosesdecoder/scripts/ems/web/general.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ h2 {
2
+ font:italic x-large/1.75 'Essays 1743','Times New Roman',serif;
3
+ text-shadow:0 0 1px #667
4
+ }
5
+
mosesdecoder/scripts/ems/web/hierarchical-segmentation.js ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ This file is part of moses. Its use is licensed under the GNU Lesser General
3
+ Public License version 2.1 or, at your option, any later version.
4
+ */
5
+ var nodeIn = [];
6
+ var nodeOut = [];
7
+ var nodeChildren = [];
8
+ var max_depth = [];
9
+ var span_count_in = [];
10
+ var span_count_out = [];
11
+ var current_depth = -1;
12
+
13
+ function highlightSingleNode( sentence, id, color ) {
14
+ var i, j, item;
15
+ for(i=nodeIn[sentence][id].start;i<=nodeIn[sentence][id].end;i++) {
16
+ for(j=nodeIn[sentence][id].depth;j<=max_depth[sentence];j++) {
17
+ item = "in-" + sentence + "-" + i + "-" + j;
18
+ if ($(item) !== null) {
19
+ $(item).setStyle({ backgroundColor: color, borderColor: 'red' });
20
+ }
21
+ }
22
+ }
23
+ //$("debug").innerHTML = "highlight: "+id+", of "+nodeOut[sentence].size()+"<br>";
24
+ for(i=nodeOut[sentence][id].start;i<=nodeOut[sentence][id].end;i++) {
25
+ for(j=nodeOut[sentence][id].depth;j<=max_depth[sentence];j++) {
26
+ item = "out-" + sentence + "-" + i + "-" + j;
27
+ //$("debug").innerHTML += item;
28
+ if ($(item) !== null) {
29
+ $(item).setStyle({ backgroundColor: color, borderColor: 'red' });
30
+ }
31
+ }
32
+ }
33
+ }
34
+
35
+ function lowlightAllNodes( sentence ) {
36
+ var i, j, item;
37
+ for(i=0;i<span_count_in[sentence];i++) {
38
+ for(j=0;j<=max_depth[sentence];j++) {
39
+ item = "in-" + sentence + "-" + i + "-" + j;
40
+ if ($(item) !== null) {
41
+ $(item).setStyle({ backgroundColor: 'white', borderColor: 'black' });
42
+ }
43
+ }
44
+ }
45
+ for(i=0;i<span_count_out[sentence];i++) {
46
+ for(j=0;j<=max_depth[sentence];j++) {
47
+ item = "out-" + sentence + "-" + i + "-" + j;
48
+ if ($(item) !== null) {
49
+ $(item).setStyle({ backgroundColor: 'white', borderColor: 'black' });
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ function highlightNode( sentence, id ) {
56
+ var i;
57
+ lowlightAllNodes( sentence );
58
+ highlightSingleNode( sentence, id, 'yellow' );
59
+ for(i=0; i<nodeChildren[sentence][id].size(); i++) {
60
+ var childId = nodeChildren[sentence][id][i];
61
+ var j;
62
+ highlightSingleNode( sentence, childId, '#ffffa0');
63
+ for(j=0; j<nodeChildren[sentence][childId].size(); j++) {
64
+ highlightSingleNode(
65
+ sentence, nodeChildren[sentence][childId][j], '#ffffe0');
66
+ }
67
+ }
68
+ }
69
+
70
+ function alignIn( sentence, word, depth ) {
71
+ var id, i;
72
+ if (current_depth < depth) {
73
+ current_depth = depth;
74
+ }
75
+ else { return; }
76
+
77
+ id = 0;
78
+ for(i=1;i<nodeIn[sentence].size();i++ ) {
79
+ if (nodeIn[sentence][i].start <= word && word <= nodeIn[sentence][i].end && nodeIn[sentence][i].depth <= depth) {
80
+ id = i;
81
+ }
82
+ }
83
+
84
+ highlightNode( sentence, id );
85
+ }
86
+
87
+ function alignOut( sentence, word, depth ) {
88
+ var id, i;
89
+ if (current_depth < depth) {
90
+ current_depth = depth;
91
+ }
92
+ else { return; }
93
+ id = 0;
94
+ for(i=1;i<nodeOut[sentence].size();i++ ) {
95
+ if (nodeOut[sentence][i].start <= word && word <= nodeOut[sentence][i].end && nodeOut[sentence][i].depth <= depth) {
96
+ id = i;
97
+ }
98
+ }
99
+
100
+ highlightNode( sentence, id );
101
+ }
102
+
103
+ function unAlign( sentence ) {
104
+ if (current_depth === -1) { return; }
105
+ current_depth = -1;
106
+ lowlightAllNodes( sentence );
107
+ }
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/README.rdoc ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ == script.aculo.us web 2.0 javascript
2
+
3
+ The Web is changing. The 30-year-old terminal-like technology it was originally
4
+ is gradually giving way to new ways of doing things. The power of AJAX allows
5
+ for rich user interaction without the trouble that has bugged traditional
6
+ web applications.
7
+
8
+ Building upon the wonderful Prototype JavaScript library, script.aculo.us
9
+ provides you with some great additional ingredients to mix in.
10
+
11
+ For more information, see http://script.aculo.us/
12
+
13
+ == What's new in this release?
14
+
15
+ See the CHANGELOG file for information on what's new.
16
+
17
+ You can follow http://twitter.com/scriptaculous if you want
18
+ to be updated as we fix bugs and add new features.
19
+
20
+ == Installation/Usage
21
+
22
+ script.aculo.us includes the Prototype JavaScript Framework
23
+ V1.6.0. You can use later versions, as they become available
24
+ (see http://prototypejs.org/).
25
+
26
+ Put prototype.js, and the six files scriptaculous.js,
27
+ builder.js, effects.js, dragdrop.js, controls.js and slider.js
28
+ in a directory of your website, e.g. /javascripts.
29
+
30
+ (The sound.js and unittest.js files are optional)
31
+
32
+ Now, you can include the scripts by adding the following
33
+ tags to the HEAD section of your HTML pages:
34
+
35
+ <script src="javascripts/prototype.js" type="text/javascript"></script>
36
+ <script src="javascripts/scriptaculous.js" type="text/javascript"></script>
37
+
38
+ scriptaculous.js will automatically load the other files of the
39
+ script.aculo.us distribution in, provided they are accessible
40
+ via the same path.
41
+
42
+ See http://wiki.script.aculo.us/scriptaculous/show/Usage for detailed
43
+ usage instructions.
44
+
45
+ == The distribution
46
+
47
+ Besides the script.aculo.us files in src, there's a complete
48
+ test tree included which holds functional and unit tests for
49
+ script.aculo.us.
50
+
51
+ If you need examples on how to implement things, the best place to
52
+ start is by opening test/run_functional_tests.html or
53
+ test/run_unit_tests.html in your browser, and looking at
54
+ the sources of the examples provided.
55
+
56
+ == License
57
+
58
+ script.aculo.us is licensed under the terms of the MIT License,
59
+ see the included MIT-LICENSE file.
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/lib/prototype.js ADDED
The diff for this file is too large to render. See raw diff
 
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/_ajax_inplaceeditor_result.html ADDED
@@ -0,0 +1 @@
 
 
1
+ Server received: To be edited
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/_ajax_inplaceeditor_text.html ADDED
@@ -0,0 +1 @@
 
 
1
+ Text from server
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/_autocomplete_result.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ <ul>
2
+ <li>test1<span class="selectme">selectme1</span></li><li><span class="selectme">selectme2</span>test2</li>
3
+ <li>test3<span class="selectme">selectme3</span></li>
4
+ <li><b>BOLD</b><span class="selectme">selectme4<b>boldinselectme</b></span></li>
5
+
6
+ <li><span class="informal">(GET ME NOT)</span>(GET &lt;ME&gt; INSTEAD)<span class="selectme">(forselectme!)</span></li>
7
+
8
+ <li><span class="selectme">Here we have <a href="_autocomplete_result.html">a link</a> which should work</span></li>
9
+ </ul>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/_autocomplete_result_single.html ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ <ul>
2
+ <li>test1<span class="selectme">selectme1</span></li>
3
+ </ul>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/ajax_autocompleter2_test.html ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Autocompleter functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ .selected { background-color: #888; }
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <h1>script.aculo.us Autocompleter functional test file</h1>
16
+
17
+
18
+
19
+ This is an incremental Ajax autocompleter. Type something, then type a comma, than type more. This autocompleter features an indicator.<br/>
20
+ <div id="ac1_indicator" style="display:none">NOW FETCHING RESULTS</div>
21
+ Autocompleter ac1: <input type="text" id="ac1" autocomplete="off"/>
22
+ <div id="ac1update" style="display:none;border:1px solid black;background-color:white;position:relative;"></div>
23
+
24
+
25
+ <script type="text/javascript" language="javascript" charset="utf-8">
26
+ // <![CDATA[
27
+ new Ajax.Autocompleter('ac1','ac1update','_autocomplete_result.html', {
28
+ tokens: ',', indicator: 'ac1_indicator'
29
+ } );
30
+ // ]]>
31
+ </script>
32
+
33
+ <br/><br/>
34
+ Non-incremental Ajax autocompleter.<br/>
35
+ Autocompleter ac2: <input id="ac2" type="text" autocomplete="off"/>
36
+ <div id="ac2update" style="display:none;border:1px solid black;background-color:white;"></div>
37
+
38
+
39
+ <script type="text/javascript" language="javascript" charset="utf-8">
40
+ // <![CDATA[
41
+ new Ajax.Autocompleter('ac2','ac2update','_autocomplete_result.html');
42
+ // ]]>
43
+ </script>
44
+
45
+ <br/><br/>
46
+ Non-incremental Ajax autocompleter.<br/>
47
+ Autocompleter ac3: <input id="ac3" type="text" autocomplete="off"/>
48
+ <div id="ac3update" style="display:none;border:1px solid black;background-color:white;"></div>
49
+
50
+
51
+ <script type="text/javascript" language="javascript" charset="utf-8">
52
+ // <![CDATA[
53
+ new Ajax.Autocompleter('ac3','ac3update','_autocomplete_result.html');
54
+ // ]]>
55
+ </script>
56
+
57
+ <br/><br/>
58
+
59
+ Local incremental array autocompleter ac4<br/> with full-search. Type 'Jac', hit enter a few <br/>times, type 'gne'.<br/> <textarea rows=5 cols=40 id="ac4" autocomplete="off"></textarea>
60
+ <div id="ac4update" style="display:none;border:1px solid black;background-color:white;"></div>
61
+
62
+ <script type="text/javascript" language="javascript" charset="utf-8">
63
+ // <![CDATA[
64
+ new Autocompleter.Local('ac4','ac4update',
65
+ new Array("John Jackson", "", "Jack Johnson", "", "Jane Agnews"), { tokens: new Array(',','\n'), fullSearch: true, partialSearch: true });
66
+ // ]]>
67
+ </script>
68
+ <br/><br/>
69
+
70
+ Local incremental array autocompleter ac5<br/> with fixed height and scrollbar. Type 'Jac', hit enter a few <br/>times, type 'gne'.<br/> <input id="ac5" type="text" autocomplete="off"/>
71
+ <div id="ac5update" style="display:none;border:1px solid black;background-color:white;height:50px;overflow:auto;"></div>
72
+
73
+ <script type="text/javascript" language="javascript" charset="utf-8">
74
+ // <![CDATA[
75
+ new Autocompleter.Local('ac5','ac5update',
76
+ new Array("John Jackson", "Jack Johnson", "Jane Agnews", "Jack Johnson", "Jane Agnews", "Jack Johnson", "Jane Agnews"), { tokens: new Array(',','\n'), fullSearch: true, partialSearch: true });
77
+ // ]]>
78
+ </script>
79
+
80
+
81
+ <br /><br /><br />
82
+ <br /><br /><br />
83
+ <div id="debug" style="font-size:11px;"></div>
84
+
85
+ </body>
86
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/ajax_autocompleter_test.html ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Autocompleter functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ .selected { background-color: #888; }
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <h1>script.aculo.us Autocompleter functional test file</h1>
16
+
17
+
18
+ Autocompleter ac1 (updated panel is relative, so no overlapping should occur): <input id="ac1" name="ac1" type="text"/>
19
+ <div id="ac1update" style="display:none;border:1px solid black;background-color:white;position:relative;"></div>
20
+
21
+ <script type="text/javascript" language="javascript" charset="utf-8">
22
+ // <![CDATA[
23
+ new Ajax.Autocompleter('ac1','ac1update','_autocomplete_result.html');
24
+ // ]]>
25
+ </script>
26
+
27
+ <br/>
28
+
29
+ Autocompleter ac2 w/ parameters: <input id="ac2" type="text" name="ac2"/>
30
+ <div id="ac2update" style="display:none;border:1px solid black;background-color:white;"></div>
31
+
32
+
33
+ <script type="text/javascript" language="javascript" charset="utf-8">
34
+ // <![CDATA[
35
+ new Ajax.Autocompleter('ac2','ac2update','_autocomplete_result.html',{parameters:'a=b&b=c'});
36
+ // ]]>
37
+ </script>
38
+
39
+ <br/>
40
+
41
+ Autocompleter ac3 (nested in postion:relative div, selects "selectme" class):
42
+ <br/>
43
+ <div style="position:relative">
44
+ <input id="ac3" type="text"/>
45
+ <div id="ac3update" style="display:none;border:1px solid black;background-color:white;"></div>
46
+ </div>
47
+
48
+ <script type="text/javascript" language="javascript" charset="utf-8">
49
+ // <![CDATA[
50
+ new Ajax.Autocompleter('ac3','ac3update','_autocomplete_result.html',{select:'selectme'});
51
+ // ]]>
52
+ </script>
53
+
54
+ <br/><select><option>First Item</option><option>Second Item</option><option>Third Item</option></select>
55
+
56
+ <br/><br/>
57
+ Autocompleter ac4 (autoselects option if single single option is returned):
58
+ <br/>
59
+ <input id="ac4" type="text"/>
60
+ <div id="ac4update" style="display:none;border:1px solid black;background-color:white;"></div>
61
+
62
+ <script type="text/javascript" language="javascript" charset="utf-8">
63
+ // <![CDATA[
64
+ new Ajax.Autocompleter('ac4','ac4update','_autocomplete_result_single.html',{select:'selectme',autoSelect:true});
65
+ // ]]>
66
+ </script>
67
+
68
+ <div id="debug" style="font-size:11px;"></div>
69
+
70
+ </body>
71
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/ajax_inplacecollectioneditor_test.html ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Demo</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ .inplaceeditor-saving { background: url(wait.gif) bottom right no-repeat; }
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <h1>script.aculo.us Demo</h1>
16
+ <p>
17
+ Demo of the Ajax.InPlaceCollectionEditor.
18
+ </p>
19
+
20
+ <p id="tobeedited">three</p> (should autoselect "three")
21
+ <script>
22
+ new Ajax.InPlaceCollectionEditor(
23
+ 'tobeedited', '_ajax_inplaceeditor_result.html', {
24
+ collection: ['one','two','three'],
25
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
26
+ });
27
+ </script>
28
+
29
+
30
+ <p id="tobeedited2">two</p> (should autoselect "two")
31
+ <script>
32
+ new Ajax.InPlaceCollectionEditor(
33
+ 'tobeedited2', '_ajax_inplaceeditor_result.html', {
34
+ collection: [[0,'one'],[1,'two'],[2,'three']],
35
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
36
+ });
37
+ </script>
38
+
39
+ <p id="tobeedited3">three</p> (should manually select "one")
40
+ <script>
41
+ new Ajax.InPlaceCollectionEditor(
42
+ 'tobeedited3', '_ajax_inplaceeditor_result.html', {
43
+ collection: [[0,'one'],[1,'two'],[2,'three']],
44
+ value: 0,
45
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
46
+ });
47
+ </script>
48
+
49
+ <p id="tobeedited4">one</p> (should manually select "two")
50
+ <script>
51
+ new Ajax.InPlaceCollectionEditor(
52
+ 'tobeedited4', '_ajax_inplaceeditor_result.html', {
53
+ collection: ['one','two','three'],
54
+ value: 'two',
55
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
56
+ });
57
+ </script>
58
+
59
+ </body>
60
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/ajax_inplaceeditor_test.html ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Demo</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ .inplaceeditor-saving { background: url(wait.gif) bottom right no-repeat; }
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <h1>script.aculo.us Demo</h1>
16
+ <p>
17
+ Demo of the Ajax.InPlaceEditor.
18
+ </p>
19
+
20
+ <h1 id="tobeedited">To be edited</h1>
21
+ <script>
22
+ new Ajax.InPlaceEditor($('tobeedited'), '_ajax_inplaceeditor_result.html', {
23
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
24
+ });
25
+ </script>
26
+
27
+ <h1 id="tobeeditedblur">To be edited w/ blur</h1>
28
+ <script>
29
+ new Ajax.InPlaceEditor($('tobeeditedblur'), '_ajax_inplaceeditor_result.html', {
30
+ submitOnBlur: true, okButton: false, cancelLink: true,
31
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
32
+ });
33
+ </script>
34
+
35
+ <h1 id="tobeeditedoklink">To be edited w/ okLink and cancelButton</h1>
36
+ <script>
37
+ new Ajax.InPlaceEditor($('tobeeditedoklink'),
38
+ '_ajax_inplaceeditor_result.html', {
39
+ okButton: false,
40
+ okLink: true,
41
+ cancelButton: true,
42
+ cancelLink: false,
43
+ textBeforeControls: ' ---> ',
44
+ textBetweenControls: ' | ',
45
+ textAfterControls: ' <--- ',
46
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
47
+ });
48
+ </script>
49
+
50
+ <h1 id="tobeeditedoklinkonly">To be edited w/ okLink only </h1>
51
+ <script>
52
+ new Ajax.InPlaceEditor($('tobeeditedoklinkonly'),
53
+ '_ajax_inplaceeditor_result.html', {
54
+ okButton: false,
55
+ okLink: true,
56
+ cancelButton: false,
57
+ cancelLink: false,
58
+ textBeforeControls: ' ---> ',
59
+ textBetweenControls: ' | ', // will not be used, as one control only
60
+ textAfterControls: ' <--- ',
61
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
62
+ });
63
+ </script>
64
+
65
+
66
+ <span id="tobeedited2">With external edit control and custom parameter name</span> &nbsp; <a id="tobeedited2EditControl" href="#">edit</a>
67
+ <script>
68
+ new Ajax.InPlaceEditor($('tobeedited2'), '_ajax_inplaceeditor_result.html', {
69
+ externalControl: 'tobeedited2EditControl',
70
+ paramName: 'foobar',
71
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
72
+ });
73
+ </script>
74
+
75
+ <table>
76
+ <tbody>
77
+ <tr>
78
+ <td><span id="tobeeditedTD">test</span></td>
79
+ <td><a id="tobeeditedTDEditControl" href="#">edit</a></td>
80
+ </tr>
81
+ </tbody>
82
+ </table>
83
+
84
+ <script>
85
+ new Ajax.InPlaceEditor($('tobeeditedTD'), '_ajax_inplaceeditor_result.html', {
86
+ externalControl: 'tobeeditedTDEditControl'
87
+ });
88
+ </script>
89
+
90
+ <p id="tobeedited3">Multi row editor: Lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum</p>
91
+ <script>
92
+ new Ajax.InPlaceEditor($('tobeedited3'), '_ajax_inplaceeditor_result.html', {
93
+ rows:5,
94
+ ajaxOptions: {method: 'get'} //override so we can use a static for the result
95
+ });
96
+ </script>
97
+
98
+ <p id="tobeedited4">Loads text from server</p>
99
+ <script>
100
+ new Ajax.InPlaceEditor($('tobeedited4'), '_ajax_inplaceeditor_result.html',
101
+ {ajaxOptions: {method: 'get'}, //override so we can use a static for the result and to load the text
102
+ loadTextURL: '_ajax_inplaceeditor_text.html'
103
+ });
104
+ </script>
105
+
106
+ <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
107
+ <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
108
+ <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
109
+
110
+ <h1 id="tobeeditedFarDown">Editor very far down to test scrolling bug</h1>
111
+ <script>
112
+ new Ajax.InPlaceEditor($('tobeeditedFarDown'), '../unit/_ajax_inplaceeditor_result.html');
113
+ </script>
114
+
115
+ </body>
116
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop2_test.html ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Drag and drop functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ #thelist li { background: green; margin:5px; padding: 30px; }
12
+ #thelist2 li { background: #ffb; margin:2px; padding: 2px; }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <h1>script.aculo.us Drag and drop functional test file</h1>
17
+
18
+ <h2>Draggables/Droppables</h2>
19
+
20
+ <div id="revertbox1" class="box1" style="z-index:1000;width:150px;height:150px;background:#bbf;">
21
+ <span id="handle1">drag here</span><br/>
22
+ <input type="checkbox" id="shouldrevert1"/> Revert?
23
+ </div>
24
+
25
+ <div id="revertbox2" class="box" style="z-index:1000;width:150px;height:150px;background:#bbf;">
26
+ <span id="handle2">drag here</span><br/>
27
+ <input type="checkbox" id="shouldrevert2"/> Revert?
28
+ I've onStart, onDrag and onEnd events!<br/>
29
+ <span id="event-info"></span>
30
+ </div>
31
+
32
+ <div id="specialbox" class="box" style="z-index:1000;width:150px;height:150px;background:#fbb;">
33
+ This box overrides the default endeffect
34
+ </div>
35
+
36
+ <div id="specialbox2" class="box" style="z-index:1000;width:150px;height:150px;background:#fbb;">
37
+ This box overrides the default starteffect
38
+ </div>
39
+
40
+ <div id="specialbox3" class="box" style="z-index:1000;width:150px;height:150px;background:#fbb;">
41
+ This box overrides the default end- and starteffects
42
+ </div>
43
+
44
+ <div id="droptarget1" style="width:200px;height:200px;background-color:#eee;">accepts first box</div>
45
+ <div id="droptarget2" style="width:200px;height:200px;background-color:#eee;">accepts second box</div>
46
+
47
+ <script type="text/javascript" language="javascript" charset="utf-8">
48
+ // <![CDATA[
49
+ new Draggable('revertbox1',{scroll:window,handle:'handle1',revert:function(element){return ($('shouldrevert1').checked)}});
50
+ new Draggable('revertbox2',{
51
+ handle:'handle2',
52
+ revert:function(element){return ($('shouldrevert2').checked)},
53
+ onStart:function(){$('revertbox2').setStyle({backgroundColor:'#bfb'})},
54
+ onDrag:function(){$('event-info').update('drag!')},
55
+ onEnd:function(){alert('end!')}
56
+ });
57
+
58
+ Droppables.add('droptarget1',{accept:['box1','otherstuff'],onDrop:function(){alert('drop!')}});
59
+ Droppables.add('droptarget2',{accept:'box',onDrop:function(){alert('drop!')}});
60
+
61
+
62
+ new Draggable('specialbox',{
63
+ endeffect:function(){
64
+ new Effect.Highlight('specialbox',{queue:'end'});
65
+ }
66
+ });
67
+ new Draggable('specialbox2',{
68
+ starteffect:function(){
69
+ new Effect.Highlight('specialbox2',{queue:'end'});
70
+ }
71
+ });
72
+ new Draggable('specialbox3',{
73
+ starteffect:function(){
74
+ new Effect.Highlight('specialbox3',{queue:'end'});
75
+ },
76
+ endeffect:function(){
77
+ new Effect.Highlight('specialbox3',{queue:'end'});
78
+ }
79
+ });
80
+ // ]]>
81
+ </script>
82
+
83
+
84
+ </body>
85
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop3_test.html ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Drag and drop functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ #thelist li { background: green; margin:5px; padding: 30px; }
12
+ #thelist2 li { background: #ffb; margin:2px; padding: 2px; }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <h1>script.aculo.us Drag and drop functional test file</h1>
17
+
18
+ <h2>Draggables/Droppables</h2>
19
+
20
+ <div style="width:400px;height:400px;overflow:scroll;position:relative;" id="scroll-container">
21
+
22
+ <ul id="thelist2" style="padding: 2px; background:red;">
23
+ <li>Relatively here!</li>
24
+ <li><input onclick="this.checked = !this.checked" name="x" id="x" type="checkbox"/>one</li>
25
+ <li>one</li>
26
+ <li>one</li>
27
+ <li>one</li>
28
+ <li>one</li>
29
+ <li>one</li>
30
+ <li>one</li>
31
+ <li>one</li>
32
+ <li>one</li>
33
+ <li>one</li>
34
+ <li>one</li>
35
+ <li>one</li>
36
+ <li>one</li>
37
+ <li>one</li>
38
+ <li>one</li>
39
+ <li>one</li>
40
+ <li>one</li>
41
+ <li>one</li>
42
+ <li>one</li>
43
+ <li>one</li>
44
+ <li>one</li>
45
+ <li>one</li>
46
+ <li>one</li>
47
+ <li>one</li>
48
+ <li>one</li>
49
+ <li>one</li>
50
+ <li>one</li>
51
+ <li>one</li>
52
+ <li>one</li>
53
+ <li>one</li>
54
+ <li>one</li>
55
+ <li>one</li>
56
+ <li>one</li>
57
+ <li>one</li>
58
+ <li>one</li>
59
+ <li>one</li>
60
+ <li>one</li>
61
+ <li>one</li>
62
+ <li>one</li>
63
+ <li>one</li>
64
+ <li>one</li>
65
+ <li>one</li>
66
+ <li>one</li>
67
+ <li>one</li>
68
+ <li>one</li>
69
+ <li>one</li>
70
+ <li>one</li>
71
+ <li>one</li>
72
+ <li>one</li>
73
+ <li>one</li>
74
+ </ul>
75
+
76
+ </div>
77
+
78
+ <pre id="debug"></pre>
79
+
80
+ <script type="text/javascript" language="javascript" charset="utf-8">
81
+ // <![CDATA[
82
+ // Sortable.create('thelist', {overlap: 'horizontal', constraint: false});
83
+ Position.includeScrollOffsets = true;
84
+ Sortable.create('thelist2',{scroll:'scroll-container'});
85
+
86
+ // ]]>
87
+ </script>
88
+
89
+ </body>
90
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop4_test.html ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Drag and drop functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ </head>
11
+ <body style="background-color:#eee;">
12
+ <div style="position:relative;margin-left:100px;top:40px;background-color:white;">
13
+ (inside position:relative container)
14
+ <h1>script.aculo.us Drag and drop functional test file</h1>
15
+
16
+ <h2>Draggables/Droppables</h2>
17
+
18
+ <div id="absolute_positioned_element" class="box1" style="width:150px;height:150px;background:#bbf;">
19
+ <b>Ghosting effect</b>
20
+ <input type="text" value="blah"/>
21
+ <div id="hurradiegams">test!</div>
22
+ <br/>
23
+ </div>
24
+
25
+ <a href="#" onclick="alert($('hurradiegams').innerHTML); return false;">alert contents of test div</a>
26
+
27
+ <div id="absolute_positioned_element2" class="box1" style="width:150px;height:150px;background:#bbf;">
28
+ <span id="handle1">Ghost effect</span><br/>
29
+ </div>
30
+
31
+ <script type="text/javascript" language="javascript" charset="utf-8">
32
+ // <![CDATA[
33
+ Position.includeScrollOffsets = true;
34
+
35
+ new Draggable('absolute_positioned_element',{ghosting: true});
36
+ new Draggable('absolute_positioned_element2',{ghosting: true, revert:true});
37
+ // ]]>
38
+ </script>
39
+ </div>
40
+ </body>
41
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop5_test.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <title>script.aculo.us Drag and drop functional test file</title>
4
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
5
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
6
+ <script src="../../src/unittest.js" type="text/javascript"></script>
7
+ </head>
8
+ <style>
9
+ div.hoverclass123 {
10
+ border:1px solid red;
11
+ }
12
+ </style>
13
+ <body>
14
+
15
+ <h1>script.aculo.us Drag and drop functional test file</h1>
16
+
17
+ <h2>w/o hoverclass</h2>
18
+
19
+ <div id="cart" class="cart" style="text-align:center;height:50px;padding:10px;background-color:#fba">
20
+ ### DROP HERE ###
21
+ </div>
22
+
23
+ <script type="text/javascript">Droppables.add('cart', {onDrop:function(element,dropon){alert('w/o hoverclass, should be \'product_id\':' + encodeURIComponent(element.id) + ', dropon should be \'cart\':' + dropon.id)}})</script>
24
+
25
+ <br/>
26
+
27
+ <img alt="Product2" id="product_id" src="icon.png" /> &lt;-- drag this!
28
+
29
+ <script type="text/javascript">new Draggable('product_id', {revert:true})</script>
30
+
31
+ <h2>w/ hoverclass</h2>
32
+
33
+
34
+ <div id="carth" class="cart" style="text-align:center;height:50px;padding:10px;background-color:#fba">
35
+ ### DROP HERE ###
36
+ </div>
37
+
38
+ <script type="text/javascript">Droppables.add('carth', {hoverclass:'hoverclass123',onDrop:function(element, dropon, event){alert('w/ hoverclass: should be \'product_id\':' + encodeURIComponent(element.id) + ', dropon should be \'carth\':' + dropon.id)}})</script>
39
+
40
+
41
+ </body>
42
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop6_test.html ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Drag and drop functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ div.box { background: green; width:100px; height:100px }
12
+ div.box-container { background: yellow; width:200px; height:200px }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <h1>script.aculo.us Drag and drop functional test file</h1>
17
+
18
+ <h2>Draggables/Droppables</h2>
19
+
20
+ <div id="box-normal" class="box">
21
+ Normal box
22
+ </div>
23
+
24
+ <div id="box-grid-numeric" class="box">
25
+ snap: 25
26
+ </div>
27
+
28
+ <div id="box-grid-array" class="box">
29
+ snap: [5,25]
30
+ </div>
31
+
32
+ <div id="box-grid-procedural" class="box">
33
+ snap: procedural (e.g. constrain to box)
34
+ </div>
35
+
36
+ <div class="box-container">
37
+ <div id="box-grid-procedural-gets-draggable" class="box">
38
+ snap: procedural (e.g. constrain to parent element)
39
+ </div>
40
+ </div>
41
+
42
+ <script type="text/javascript" language="javascript" charset="utf-8">
43
+ // <![CDATA[
44
+ new Draggable('box-normal',{snap:false,revert:true});
45
+ new Draggable('box-grid-numeric',{snap:25,revert:true});
46
+ new Draggable('box-grid-array',{snap:[5,25],revert:true});
47
+ new Draggable('box-grid-procedural',{
48
+ snap: function(x,y) {
49
+ return[
50
+ x<100 ? (x > 0 ? x : 0 ) : 100,
51
+ y<50 ? (y > 0 ? y : 0) : 50];
52
+ },
53
+ revert:true
54
+ });
55
+ new Draggable('box-grid-procedural-gets-draggable',{
56
+ snap: function(x,y,draggable) {
57
+ function constrain(n, lower, upper) {
58
+ if (n > upper) return upper;
59
+ else if (n < lower) return lower;
60
+ else return n;
61
+ }
62
+
63
+ element_dimensions = Element.getDimensions(draggable.element);
64
+ parent_dimensions = Element.getDimensions(draggable.element.parentNode);
65
+ return[
66
+ constrain(x, 0, parent_dimensions.width - element_dimensions.width),
67
+ constrain(y, 0, parent_dimensions.height - element_dimensions.height)];
68
+ },
69
+ revert:true
70
+ });
71
+ // ]]>
72
+ </script>
73
+
74
+
75
+ </body>
76
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop7_test.html ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title></title>
6
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
7
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
8
+ <script type="text/javascript">
9
+ //<![CDATA[
10
+
11
+ Position.includeScrollOffsets = true;
12
+
13
+ Draggables.clear = function (event) {
14
+ while (Draggables.drags.length) {
15
+ var d = Draggables.drags.pop();
16
+ var e = d.element;
17
+ d.stopScrolling();
18
+ d.destroy();
19
+ d.element = null;
20
+ if (e.parentNode) {e.parentNode.removeChild(e)};
21
+ }
22
+ }
23
+
24
+ function cleanup() { //try to remove circular references
25
+ lis = document.getElementsByTagName("li");
26
+ for (i = 0; i < lis.length; i++) {
27
+ if (lis[i].longListItem) {lis[i].longListItem.destroy();}
28
+ else if (lis[i].container) {lis[i].container.destroy();}
29
+ }
30
+ Draggables.clear();
31
+ }
32
+
33
+ window.onload = function() {
34
+ var li = $("masterList").getElementsByTagName('LI');
35
+ for (var i = 0; i < li.length; i++) {
36
+ //var d = new LongListItem(li[i]);
37
+ //li[i].onmousedown = d.onMouseDown.bindAsEventListener(d);
38
+ var d = new Draggable(li[i],
39
+ {revert: true,
40
+ ghosting: false,
41
+ scroll: "rightContainers"
42
+ });
43
+
44
+ }
45
+
46
+ var divs = $("rightContainers").getElementsByTagName("div");
47
+ for (i = 0; i < divs.length; i++) {
48
+ if (divs[i].className && Element.hasClassName(divs[i], "container")) {
49
+ Droppables.add(divs[i].id, {hoverclass: "hover", scrollingParent: "rightContainers"});
50
+ }
51
+ }
52
+ Event.observe(window, 'unload', cleanup, false);
53
+ }
54
+ //]]>
55
+ </script>
56
+ <style type="text/css">
57
+ html, body {
58
+ margin:0; padding: 0;
59
+ height: 100% !important;
60
+ }
61
+ body {
62
+ position:relative;
63
+ color: black;
64
+ background-color: white;
65
+ font-family: Verdana, Arial, Helvetica, sans-serif;
66
+ font-size: small;
67
+ }
68
+ h1 {font-size:115%;}
69
+ h2 {font-size: 110%;}
70
+ h3 {font-size: 105%;}
71
+ div, p, li, td {
72
+ font-family: Verdana, Arial, Helvetica, sans-serif;
73
+ font-size: small;
74
+ }
75
+ p {margin: 0 0 .7em 0; padding:0;}
76
+ ul {
77
+ position:relative;
78
+ list-style: none;
79
+ margin:0; padding:0;
80
+ overflow: visible;
81
+ }
82
+ li {position:relative;}
83
+
84
+ .instructions {font-style:italic;}
85
+ #leftDiv {
86
+ position: absolute;
87
+ top: 0; left: 0; bottom: 0;
88
+ width: 30%;
89
+ margin: 0; padding: 7px;
90
+ border-right: 2px solid #bb9;
91
+ background-color: #eed;
92
+ }
93
+
94
+ #leftDiv li, #rightContainers div.container li {
95
+ margin: 3px 0; padding: 3px 3em 3px 10px;
96
+ border: 2px solid #456;
97
+ background-color: #cde;
98
+ cursor: move;
99
+ }
100
+
101
+ #rightContainers {
102
+ padding: .5em;
103
+ position: absolute;
104
+ top: 0; bottom: 0; right: 0; left: 35%;
105
+ overflow:auto;
106
+ }
107
+
108
+ #rightContainers div.container{
109
+ background-color: #bb9;
110
+ margin: 0 0 40px 0; padding: 0 0 1px 0;
111
+ border: 2px solid #775;
112
+ }
113
+
114
+ #rightContainers div.container h2{
115
+ margin:0; padding: 2px 1em 0 1em;
116
+ text-align:center;
117
+ }
118
+
119
+ #rightContainers div.container ul {
120
+ margin: 5px; padding: 0 3px;
121
+ background-color: white;
122
+ border: 1px solid black;
123
+ }
124
+
125
+ #rightContainers div.container ul.empty {
126
+ padding: 3px 0;
127
+ }
128
+
129
+ #rightContainers div.hover {
130
+ background-color: #eed;
131
+ }
132
+ </style>
133
+ <!--[if IE]><style type="text/css">
134
+ #leftDiv {
135
+ height: expression((document.body.clientHeight - 44) + "px");
136
+ }
137
+ #leftDiv ul{width:93%;}
138
+ #leftDiv li div.count {
139
+ right:4px;
140
+ top:4px;
141
+ }
142
+ #rightContainers li a.remove {
143
+ display:block;
144
+ float:none;
145
+ position:absolute;
146
+ top: 4px;
147
+ right: 1.6em;
148
+ margin:0; padding:0 .2em;
149
+ }
150
+ </style><![endif]-->
151
+ </head>
152
+ <body>
153
+ <div id="leftDiv" class="">
154
+ <form id="frmContinue" action="#" method="post">
155
+ <p class="instructions">Shrink your window until the right-hand pane is scrollable.</p>
156
+ <p class="instructions">Drag from the list on left to groups on the right, force the right-hand pane to scroll.</p>
157
+ <input name="data" type="hidden" value=" ">
158
+ </form>
159
+ <ul id="masterList">
160
+ <li id="drag1">One</li>
161
+ <li id="drag2">Two</li>
162
+ <li id="drag3">Three</li>
163
+ <li id="drag4">Four</li>
164
+ <li id="drag5">Five</li>
165
+ <li id="drag6">Six</li>
166
+ <li id="drag7">Seven</li>
167
+ <li id="drag8">Eight</li>
168
+ </ul>
169
+ </div>
170
+
171
+ <div id="rightContainers" class="">
172
+ </form>
173
+ <div id="grp1" class="container">
174
+ <h2><span id="grp1_name">Group 1</span></h2>
175
+ <ul id="grp1ul" class="empty"></ul>
176
+ </div>
177
+ <div id="grp2" class="container">
178
+ <h2><span id="grp2_name">Group 2</span></h2>
179
+ <ul id="grp2ul" class="empty"></ul>
180
+ </div>
181
+ <div id="grp3" class="container">
182
+ <h2><span id="grp3_name">Group 3</span></h2>
183
+ <ul id="grp3ul" class="empty"></ul>
184
+ </div>
185
+ <div id="grp4" class="container">
186
+ <h2><span id="grp4_name">Group 4</span></h2>
187
+ <ul id="grp4ul" class="empty"></ul>
188
+ </div>
189
+ <div id="grp5" class="container">
190
+ <h2><span id="grp5_name">Group 5</span></h2>
191
+ <ul id="grp5ul" class="empty"></ul>
192
+ </div>
193
+ <div id="grp6" class="container">
194
+ <h2><span id="grp6_name">Group 6</span></h2>
195
+ <ul id="grp6ul" class="empty"></ul>
196
+ </div>
197
+ <div id="grp7" class="container">
198
+ <h2><span id="grp7_name">Group 7</span></h2>
199
+ <ul id="grp7ul" class="empty"></ul>
200
+ </div>
201
+ <div id="grp8" class="container">
202
+ <h2><span id="grp8_name">Group 8</span></h2>
203
+ <ul id="grp8ul" class="empty"></ul>
204
+ </div>
205
+ <div id="grp9" class="container">
206
+ <h2><span id="grp9_name">Group 9</span></h2>
207
+ <ul id="grp9ul" class="empty"></ul>
208
+ </div>
209
+ </div>
210
+ </body>
211
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop8_test.html ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <title>Drag &amp; Drop</title>
4
+
5
+ <style type="text/css">
6
+
7
+ td
8
+ {
9
+ width: 10em;
10
+ text-align: center;
11
+ }
12
+
13
+ table.mytable {
14
+ list-style-type: none;
15
+ padding: 4px 4px 0 4px;
16
+ margin: 0px;
17
+ font-size: 13px;
18
+ font-family: Arial, sans-serif;
19
+ }
20
+
21
+ table.mytable tr {
22
+ margin-bottom: 4px;
23
+ padding: 2px 2px;
24
+ border: 1px solid #c00;
25
+ background-color: #eee;
26
+ }
27
+
28
+ div.draggable {
29
+ cursor:move;
30
+ padding:2px;
31
+ background-color: #BBCCDD;
32
+ }
33
+
34
+ div.dropsite {
35
+ padding:2px;
36
+ background-color: #DDBB99;
37
+ }
38
+
39
+ div.hoverclass123
40
+ {
41
+ border:1px solid red;
42
+ }
43
+
44
+ </style>
45
+
46
+ <script language="JavaScript" type="text/javascript" src="../../lib/prototype.js"></script>
47
+ <script language="JavaScript" type="text/javascript" src="../../src/scriptaculous.js"></script>
48
+ <script language="JavaScript" type="text/javascript">
49
+
50
+ Position.includeScrollOffsets = true;
51
+
52
+ window.onload = function()
53
+ {
54
+ var t1 = document.getElementById("t1");
55
+ add_divs(t1, 'td', 'draggable');
56
+ var trs = t1.getElementsByTagName("tr");
57
+ for (var i = 0; i < trs.length; i++)
58
+ {
59
+ var divs = document.getElementsByClassName("draggable", trs[i]);
60
+ var drag_text = divs[2].innerHTML;
61
+ for (var j = 0; j < divs.length; ++j)
62
+ {
63
+ new Draggable(divs[j], {ghosting:true, revert:true});
64
+ }
65
+ }
66
+
67
+ var t2 = document.getElementById("t2");
68
+ add_divs(t2, 'td', 'dropsite');
69
+ var divs = document.getElementsByClassName("dropsite", t2);
70
+ for (var j = 0; j < divs.length; ++j)
71
+ {
72
+ Droppables.add(divs[j], {accept:'draggable',
73
+ hoverclass:'hoverclass123',
74
+ onDrop:function(element, dropon, event)
75
+ { debug("dropped " + element.innerHTML + " on "
76
+ + dropon.innerHTML + "\n")}});
77
+ }
78
+ };
79
+
80
+ function debug(text)
81
+ {
82
+ document.getElementById('debug').innerHTML
83
+ = "<pre>" + text + "</pre>";
84
+ }
85
+
86
+ function add_divs(table, tag, classname)
87
+ {
88
+ var items = table.getElementsByTagName(tag);
89
+ for (var i = 0; i < items.length; i++)
90
+ items[i].innerHTML =
91
+ "<div class='" + classname + "'>" + items[i].innerHTML + "</div>";
92
+ }
93
+
94
+
95
+ </script>
96
+ </head>
97
+ <body>
98
+
99
+ <p>Drag from this table:</p>
100
+ <DIV STYLE="padding-left: 50pt;">
101
+ <DIV STYLE="overflow: auto; width: 250; height: 100;
102
+ border: 1px gray solid;
103
+ padding:0px; margin: 0px;">
104
+ <table id="t1" class="sortable mytable">
105
+ <tr><td>one</td><td>1</td><td>uno</td></tr>
106
+ <tr><td>two</td><td>2</td><td>dos</td></tr>
107
+ <tr><td>three</td><td>3</td><td>tres</td></tr>
108
+ <tr><td>four</td><td>4</td><td>quatro</td></tr>
109
+ <tr><td>five</td><td>5</td><td>cinco</td></tr>
110
+ <tr><td>six</td><td>6</td><td>seis</td></tr>
111
+ <tr><td>seven</td><td>7</td><td>siete</td></tr>
112
+ <tr><td>eight</td><td>8</td><td>ocho</td></tr>
113
+ <tr><td>nine</td><td>9</td><td>nueve</td></tr>
114
+ <tr><td>ten</td><td>10</td><td>diez</td></tr>
115
+ </table>
116
+ </DIV>
117
+ </DIV>
118
+ <p>
119
+ <p>Drop on this table:</p>
120
+ <DIV STYLE="padding-left: 50pt;">
121
+ <DIV STYLE="overflow: auto; width: 250; height: 100;
122
+ border: 1px gray solid;
123
+ padding:0px; margin: 0px;">
124
+ <table id="t2" class="sortable mytable">
125
+ <tr><td>eleven</td><td>11</td><td>once</td></tr>
126
+ <tr><td>twelve</td><td>12</td><td>doce</td></tr>
127
+ <tr><td>thirteen</td><td>13</td><td>trece</td></tr>
128
+ <tr><td>fourteen</td><td>14</td><td>catorce</td></tr>
129
+ <tr><td>fifteen</td><td>15</td><td>quince</td></tr>
130
+ <tr><td>sixteen</td><td>16</td><td>dieciseis</td></tr>
131
+ <tr><td>seventeen</td><td>17</td><td>diecisiete</td></tr>
132
+ <tr><td>eightteen</td><td>18</td><td>dieciocho</td></tr>
133
+ <tr><td>nineteen</td><td>19</td><td>diecinueve</td></tr>
134
+ <tr><td>twenty</td><td>20</td><td>veinte</td></tr>
135
+ </table>
136
+ </DIV>
137
+ </DIV>
138
+ <p>
139
+ <div id="debug"></div>
140
+ </p>
141
+ </body>
142
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop9_test.html ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title></title>
6
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
7
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
8
+ </head>
9
+ <body>
10
+ <div id="source" style="height: 100px; width: 100px; background-color: gray;">
11
+ Draggable
12
+ </div>
13
+ <script type="text/javascript">
14
+ //<![CDATA[
15
+ new Draggable("source", {
16
+ revert:"failure",
17
+ onDropped: function(element){ $(element).update('I WAS DROPPED!') },
18
+ reverteffect: function(element, top_offset, left_offset) {
19
+ var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;
20
+ new Effect.Move(element, {
21
+ x: -left_offset, y: -top_offset, duration: dur,
22
+ transition: Effect.Transitions.spring,
23
+ queue: {scope:'_draggable', position:'end'}
24
+ });
25
+ }
26
+ });
27
+ //]]>
28
+ </script>
29
+
30
+ <br/>
31
+
32
+ <div id="target" style="height: 100px; width: 100px; background-color: green;">
33
+ Good Target
34
+ </div>
35
+
36
+ <script type="text/javascript">
37
+ //<![CDATA[
38
+ Droppables.add("target", {
39
+ onDrop:function(element){ Effect.Puff($('source')); }
40
+ });
41
+ //]]>
42
+ </script>
43
+
44
+ <br/>
45
+
46
+ </body>
47
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dragdrop_delay_test.html ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml">
5
+ <head>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <title>script.aculo.us functional test</title>
8
+ <script type="text/javascript" src="../../lib/prototype.js"></script>
9
+ <script type="text/javascript" src="../../src/effects.js"></script>
10
+ <script type="text/javascript" src="../../src/dragdrop.js"></script>
11
+ <script type="text/javascript">
12
+ //<![CDATA[
13
+ var myStartEffect = function(element) {
14
+ element._opacity = Element.getOpacity(element);
15
+ new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
16
+ new Effect.Highlight(element, {});
17
+ }
18
+ //]]>
19
+ </script>
20
+ <style type="text/css">
21
+ /*<![CDATA[*/
22
+ h1 {font-size: 1.2em; text-align:center;}
23
+ li {
24
+ margin: 5px auto;
25
+ padding: 2px;
26
+ width: 200px;
27
+ text-align:center;
28
+ list-style-type:none;
29
+ border: 2px solid #779;
30
+ background-color: #dde
31
+ }
32
+ div {
33
+ margin: 5px auto;
34
+ padding: 2px;
35
+ width: 300px;
36
+ text-align:center;
37
+ border: 2px solid #797;
38
+ background-color: #ded
39
+ }
40
+ /*]]>*/
41
+ </style>
42
+ </head>
43
+
44
+ <body>
45
+ <h1>No delay sortable</h1>
46
+
47
+ <ul id="sort1">
48
+ <li id="s1_1">one</li>
49
+
50
+ <li id="s1_2">two</li>
51
+
52
+ <li id="s1_3">three</li>
53
+ </ul>
54
+
55
+ <h1>Delayed sortable (500 ms)</h1>
56
+
57
+ <ul id="sort2">
58
+ <li id="s2_1">one</li>
59
+
60
+ <li id="s2_2">two</li>
61
+
62
+ <li id="s2_3">three</li>
63
+ </ul>
64
+
65
+ <h1>No delay draggable</h1>
66
+
67
+ <div id="drag1">
68
+ Lorem ipsum
69
+ </div>
70
+
71
+ <h1>Delayed draggable (1000 ms)</h1>
72
+
73
+ <div id="drag2">
74
+ Lorem ipsum
75
+ </div>
76
+
77
+ <script type="text/javascript" charset="utf-8">
78
+ Sortable.create('sort1', {starteffect: myStartEffect});
79
+ Sortable.create('sort2', {starteffect:myStartEffect, delay:500});
80
+ new Draggable('drag1', {starteffect:myStartEffect});
81
+ new Draggable('drag2', {starteffect:myStartEffect, delay:1000});
82
+ </script>
83
+ </body>
84
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/dropmarker.png ADDED
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effect_direct_test.html ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ /* <![CDATA[ */
12
+ #d1 { background-color: #888; }
13
+ /* ]]> */
14
+ </style>
15
+
16
+ </head>
17
+ <body>
18
+ <h1>script.aculo.us Effects functional test file</h1>
19
+
20
+ <a href="#" onclick="$$('div.d').each( function(e) { e.visualEffect('highlight',{duration:1.5}) }); return false;">Highlight</a> |
21
+ <a href="#" onclick="$$('div.d').each( function(e) { e.visualEffect('blind_up','d1',{duration:1.5}) }); return false;">BlindUp</a> |
22
+ <a href="#" onclick="$$('div.d').each( function(e) { e.visualEffect('blind_down',{duration:1.5}) }); return false;">BlindDown</a> |
23
+ <a href="#" onclick="$$('div.d').each( function(e) { e.visualEffect('slide_up',{duration:1.5}) }); return false;">SlideUp</a> |
24
+ <a href="#" onclick="$$('div.d').each( function(e) { e.visualEffect('slide_down',{duration:1.5}) }); return false;">SlideDown</a>
25
+
26
+ <div class="d"><div style="overflow:hidden">
27
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas enim. Nulla facilisi. Vestibulum accumsan augue vulputate justo. Fusce faucibus. Sed blandit, neque sed lacinia nonummy, diam quam imperdiet justo, at dictum augue nunc a neque. Sed urna lacus, tincidunt at, aliquam id, fringilla id, felis. Vivamus feugiat molestie quam. Sed id dolor. Sed ac purus id sapien sollicitudin ultricies. Aliquam hendrerit orci et odio. Suspendisse volutpat wisi at sem. Integer eget nulla. Duis eu diam a nunc condimentum tempus. Praesent gravida metus vitae massa. Aliquam neque magna, fringilla eu, porta id, interdum sit amet, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin lorem est, ultrices sit amet, condimentum vitae, vehicula a, massa.
28
+ </div></div>
29
+
30
+ <div class="d"><div style="overflow:hidden">
31
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas enim. Nulla facilisi. Vestibulum accumsan augue vulputate justo. Fusce faucibus. Sed blandit, neque sed lacinia nonummy, diam quam imperdiet justo, at dictum augue nunc a neque. Sed urna lacus, tincidunt at, aliquam id, fringilla id, felis. Vivamus feugiat molestie quam. Sed id dolor. Sed ac purus id sapien sollicitudin ultricies. Aliquam hendrerit orci et odio. Suspendisse volutpat wisi at sem. Integer eget nulla. Duis eu diam a nunc condimentum tempus. Praesent gravida metus vitae massa. Aliquam neque magna, fringilla eu, porta id, interdum sit amet, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin lorem est, ultrices sit amet, condimentum vitae, vehicula a, massa.
32
+ </div></div>
33
+
34
+ </body>
35
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effect_puff_test.html ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <script type="text/javascript" charset="utf-8">
11
+ Position.includeScrollOffsets = true;
12
+ </script>
13
+ <body>
14
+ <h1>script.aculo.us Effects functional test file</h1>
15
+
16
+ <h2>Effect.Puff</h2>
17
+
18
+ <div id="p1" style="width:100px;height:100px;background-color:#dde;" onclick="Effect.Puff(this)">
19
+ click to test puff, no position set
20
+ </div>
21
+
22
+ <div id="p2" style="float:right;width:100px;height:100px;background-color:#dde;" onclick="Effect.Puff(this)">
23
+ click to test puff, floats
24
+ </div>
25
+
26
+ <div id="p3" style="position:absolute;left:200px;top:100px;width:100px;height:100px;background-color:#dde;" onclick="Effect.Puff(this)">
27
+ click to test puff, absolute position set
28
+ </div>
29
+
30
+ <h3>Floating inside a container</h3>
31
+
32
+ <div style="width:300px;height:300px;border:1px solid red">
33
+ <div style="float:left;width:100px;height:100px;background-color:#888;" onclick="Effect.Puff(this)">
34
+ click to puff
35
+ </div>
36
+ <div style="float:left;width:100px;height:100px;background-color:#999;" onclick="Effect.Puff(this)">
37
+ click to puff
38
+ </div>
39
+ <div style="float:left;width:100px;height:100px;background-color:#aaa;" onclick="Effect.Puff(this)">
40
+ click to puff
41
+ </div>
42
+ <div style="float:left;width:100px;height:100px;background-color:#bbb;" onclick="Effect.Puff(this)">
43
+ click to puff
44
+ </div>
45
+ <div style="float:left;width:100px;height:100px;background-color:#ccc;" onclick="Effect.Puff(this)">
46
+ click to puff
47
+ </div>
48
+ <div style="float:left;width:100px;height:100px;background-color:#ddd;" onclick="Effect.Puff(this)">
49
+ click to puff
50
+ </div>
51
+ <div style="float:left;width:100px;height:100px;background-color:#eee;" onclick="Effect.Puff(this)">
52
+ click to puff
53
+ </div>
54
+ <div style="float:left;width:100px;height:100px;background-color:#777;" onclick="Effect.Puff(this)">
55
+ click to puff
56
+ </div>
57
+ <div style="float:left;width:100px;height:100px;background-color:#666;" onclick="Effect.Puff(this)">
58
+ click to puff
59
+ </div>
60
+ </div>
61
+
62
+ </div>
63
+
64
+ </body>
65
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effect_scale_test.html ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ /* <![CDATA[ */
12
+ #scaleable { background-color: #888; }
13
+ /* ]]> */
14
+ </style>
15
+
16
+ </head>
17
+ <body>
18
+ <h1>script.aculo.us Effects functional test file</h1>
19
+
20
+ <a href="#" onclick="new Effect.Scale( 'scaleable', 20,{ scaleX: true, scaleY: false }); return false;">Scale X only</a> |
21
+ <a href="#" onclick="new Effect.Scale( 'scaleable', 20,{ scaleX: false, scaleY: true }); return false;">Scale Y only</a> |
22
+ <a href="#" onclick="new Effect.Scale( 'scaleable', 20,{ scaleX: true, scaleY: true }); return false;">Scale X and Y</a>
23
+
24
+ <div id="scaleable">
25
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas enim. Nulla facilisi. Vestibulum accumsan augue vulputate justo. Fusce faucibus. Sed blandit, neque sed lacinia nonummy, diam quam imperdiet justo, at dictum augue nunc a neque. Sed urna lacus, tincidunt at, aliquam id, fringilla id, felis. Vivamus feugiat molestie quam. Sed id dolor. Sed ac purus id sapien sollicitudin ultricies. Aliquam hendrerit orci et odio. Suspendisse volutpat wisi at sem. Integer eget nulla. Duis eu diam a nunc condimentum tempus. Praesent gravida metus vitae massa. Aliquam neque magna, fringilla eu, porta id, interdum sit amet, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin lorem est, ultrices sit amet, condimentum vitae, vehicula a, massa.
26
+ </div>
27
+
28
+ </body>
29
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects2_test.html ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
+ <title>Untitled Document</title>
6
+ <style type="text/css">
7
+ #menu {
8
+ width: 300px;
9
+ border: 1px #000 solid;
10
+ }
11
+ .menu_header {
12
+ background-color: #00CC99;
13
+ color: #FFFFFF;
14
+ }
15
+ .menu_block {
16
+ background-color: #006699;
17
+ color: #FFFFFF;
18
+ overflow:hidden;
19
+ }
20
+ .menu_block div {
21
+ }
22
+ .close_block {
23
+ position: relative;
24
+ width: 100%;
25
+ bottom: 0px;
26
+ height: 15px;
27
+ text-align: center;
28
+ display: block;
29
+ }
30
+ </style>
31
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
32
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
33
+ <script src="../../src/unittest.js" type="text/javascript"></script>
34
+ </head>
35
+ <body>
36
+ <div id="menu">
37
+ <div class="menu_header" id="menu_header1"><a href="#" onClick="new Effect.SlideDown('menu_block1'); return false;">HEADER 1</a></div>
38
+ <div class="menu_block_container" id="menu_block_container1">
39
+ <div class="menu_block" id="menu_block1"><div>
40
+ text<br>
41
+ text<br>
42
+ text<br>
43
+ text<br>
44
+ text<br>
45
+ text<br>
46
+ text<br>
47
+ <a href="#" class="close_block" onClick="new Effect.SlideUp('menu_block1'); return false;">close</a></div></div>
48
+ </div>
49
+ <div class="menu_header" id="menu_header2"><a href="#" onClick="new Effect.SlideDown('menu_block2'); return false;">HEADER 2</a></div>
50
+ <div class="menu_block_container" id="menu_block_container2">
51
+ <div class="menu_block" id="menu_block2"><div>
52
+ text<br>
53
+ text<br>
54
+ text<br>
55
+ text<br>
56
+ text<br>
57
+ text<br>
58
+ text<br>
59
+ <a href="#" class="close_block" onClick="new Effect.SlideUp('menu_block2'); return false;">close</a></div></div>
60
+ </div>
61
+ </div>
62
+ </body>
63
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects3_test.html ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ </head>
11
+ <body>
12
+ <h1>script.aculo.us Effects functional test file</h1>
13
+
14
+ <h2>Effect.SlideDown/Effect.SlideUp</h2>
15
+
16
+ <script type="text/javascript" language="javascript" charset="utf-8">
17
+ // <![CDATA[
18
+ var effect_1 = null;
19
+ // ]]>
20
+ </script>
21
+
22
+ <a href="#" onclick="effect_1 = Effect.SlideDown('d1',{duration:1.0}); return false;">Start slide down</a> |
23
+ <a href="#" onclick="effect_1 = Effect.SlideUp('d1',{duration:1.0}); return false;">Start slide up</a> |
24
+ <a href="#" onclick="effect_1.cancel(); return false;">cancel()</a> |
25
+ <a href="#" onclick="alert(Object.inspect($('d1').firstChild.style)); return false;">inspect()</a> |
26
+ <a href="#" onclick="$('d1').firstChild.innerHTML += $('d1').firstChild.innerHTML; return false;">add content</a>
27
+
28
+ <div id="d1" style="display:none;"><div style="background-color:#ff8080;width:300px;border:2px solid red;padding:10px;">
29
+ <p>
30
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas enim. Nulla facilisi. Vestibulum accumsan augue vulputate justo. Fusce faucibus. Sed blandit, neque sed lacinia nonummy, diam quam imperdiet justo, at dictum augue nunc a neque. Sed urna lacus, tincidunt at, aliquam id, fringilla id, felis. Vivamus feugiat molestie quam. Sed id dolor. Sed ac purus id sapien sollicitudin ultricies. Aliquam hendrerit orci et odio. Suspendisse volutpat wisi at sem. Integer eget nulla. Duis eu diam a nunc condimentum tempus. Praesent gravida metus vitae massa. Aliquam neque magna, fringilla eu, porta id, interdum sit amet, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin lorem est, ultrices sit amet, condimentum vitae, vehicula a, massa.
31
+ </p>
32
+ </div></div>
33
+
34
+
35
+ </body>
36
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects4_test.html ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ /* <![CDATA[ */
12
+ #d1 { background-color: #888; }
13
+ /* ]]> */
14
+ </style>
15
+
16
+ </head>
17
+ <body>
18
+ <h1>script.aculo.us Effects functional test file</h1>
19
+
20
+ <a href="#" onclick="new Effect.Highlight('d1',{duration:1.5}); return false;">Highlight</a> |
21
+ <a href="#" onclick="new Effect.BlindUp('d1',{duration:1.5}); return false;">BlindUp</a> |
22
+ <a href="#" onclick="new Effect.BlindDown('d1',{duration:1.5}); return false;">BlindDown</a> |
23
+ <a href="#" onclick="new Effect.SlideUp('d1',{duration:1.5}); return false;">SlideUp</a> |
24
+ <a href="#" onclick="new Effect.SlideDown('d1',{duration:1.5}); return false;">SlideDown</a>
25
+
26
+ <div id="d1"><div style="overflow:hidden">
27
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas enim. Nulla facilisi. Vestibulum accumsan augue vulputate justo. Fusce faucibus. Sed blandit, neque sed lacinia nonummy, diam quam imperdiet justo, at dictum augue nunc a neque. Sed urna lacus, tincidunt at, aliquam id, fringilla id, felis. Vivamus feugiat molestie quam. Sed id dolor. Sed ac purus id sapien sollicitudin ultricies. Aliquam hendrerit orci et odio. Suspendisse volutpat wisi at sem. Integer eget nulla. Duis eu diam a nunc condimentum tempus. Praesent gravida metus vitae massa. Aliquam neque magna, fringilla eu, porta id, interdum sit amet, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin lorem est, ultrices sit amet, condimentum vitae, vehicula a, massa.
28
+ </div></div>
29
+
30
+ </body>
31
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects5_test.html ADDED
@@ -0,0 +1,483 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ </head>
11
+ <body>
12
+ <h1>script.aculo.us ScrollTo effect functional test</h1>
13
+
14
+ <a href="#" onclick="new Effect.ScrollTo('down-below',{duration:5.0}); return false;">scroll (slow-mo) down-below...</a>,
15
+ <a href="#" onclick="new Effect.ScrollTo('last-heading'); return false;">scroll last-heading</a>
16
+
17
+ <h2 id="first-heading"><b>first-heading</b>Heading 2</h2>
18
+ <ul>
19
+ <li>item</li>
20
+ <li>item</li>
21
+ <li>item</li>
22
+ <li>item</li>
23
+ <li>item</li>
24
+ <li>item</li>
25
+ <li>item</li>
26
+ <li>item</li>
27
+ <li>item</li>
28
+ <li>item</li>
29
+ </ul>
30
+
31
+ <h2>Heading 2</h2>
32
+ <ul>
33
+ <li>item</li>
34
+ <li>item</li>
35
+ <li>item</li>
36
+ <li>item</li>
37
+ <li>item</li>
38
+ <li>item</li>
39
+ <li>item</li>
40
+ <li>item</li>
41
+ <li>item</li>
42
+ <li>item</li>
43
+ </ul>
44
+
45
+ <h2>Heading 2</h2>
46
+ <ul>
47
+ <li>item</li>
48
+ <li>item</li>
49
+ <li>item</li>
50
+ <li>item</li>
51
+ <li>item</li>
52
+ <li>item</li>
53
+ <li>item</li>
54
+ <li>item</li>
55
+ <li>item</li>
56
+ <li>item</li>
57
+ </ul>
58
+
59
+ <h2>Heading 2</h2>
60
+ <ul>
61
+ <li>item</li>
62
+ <li>item</li>
63
+ <li>item</li>
64
+ <li>item</li>
65
+ <li>item</li>
66
+ <li>item</li>
67
+ <li>item</li>
68
+ <li>item</li>
69
+ <li>item</li>
70
+ <li>item</li>
71
+ </ul>
72
+
73
+ <h2>Heading 2</h2>
74
+ <ul>
75
+ <li>item</li>
76
+ <li>item</li>
77
+ <li>item</li>
78
+ <li>item</li>
79
+ <li>item</li>
80
+ <li>item</li>
81
+ <li>item</li>
82
+ <li>item</li>
83
+ <li>item</li>
84
+ <li>item</li>
85
+ </ul>
86
+
87
+ <h2>Heading 2</h2>
88
+ <ul>
89
+ <li>item</li>
90
+ <li>item</li>
91
+ <li>item</li>
92
+ <li>item</li>
93
+ <li>item</li>
94
+ <li>item</li>
95
+ <li>item</li>
96
+ <li>item</li>
97
+ <li>item</li>
98
+ <li>item</li>
99
+ </ul>
100
+
101
+ <h2>Heading 2</h2>
102
+ <ul>
103
+ <li>item</li>
104
+ <li>item</li>
105
+ <li>item</li>
106
+ <li>item</li>
107
+ <li>item</li>
108
+ <li>item</li>
109
+ <li>item</li>
110
+ <li>item</li>
111
+ <li>item</li>
112
+ <li>item</li>
113
+ </ul>
114
+
115
+ <h2>Heading 2</h2>
116
+ <ul>
117
+ <li>item</li>
118
+ <li>item</li>
119
+ <li>item</li>
120
+ <li>item</li>
121
+ <li>item</li>
122
+ <li>item</li>
123
+ <li>item</li>
124
+ <li>item</li>
125
+ <li>item</li>
126
+ <li>item</li>
127
+ </ul>
128
+
129
+ <h2>Heading 2</h2>
130
+ <ul>
131
+ <li>item</li>
132
+ <li>item</li>
133
+ <li>item</li>
134
+ <li>item</li>
135
+ <li>item</li>
136
+ <li>item</li>
137
+ <li>item</li>
138
+ <li>item</li>
139
+ <li>item</li>
140
+ <li>item</li>
141
+ </ul>
142
+
143
+ <h2>Heading 2</h2>
144
+ <ul>
145
+ <li>item</li>
146
+ <li>item</li>
147
+ <li>item</li>
148
+ <li>item</li>
149
+ <li>item</li>
150
+ <li>item</li>
151
+ <li>item</li>
152
+ <li>item</li>
153
+ <li>item</li>
154
+ <li>item</li>
155
+ </ul>
156
+
157
+ <h2>Heading 2</h2>
158
+ <ul>
159
+ <li>item</li>
160
+ <li>item</li>
161
+ <li>item</li>
162
+ <li>item</li>
163
+ <li>item</li>
164
+ <li>item</li>
165
+ <li>item</li>
166
+ <li>item</li>
167
+ <li>item</li>
168
+ <li>item</li>
169
+ </ul>
170
+
171
+ <h2>Heading 2</h2>
172
+ <ul>
173
+ <li>item</li>
174
+ <li>item</li>
175
+ <li>item</li>
176
+ <li>item</li>
177
+ <li>item</li>
178
+ <li>item</li>
179
+ <li>item</li>
180
+ <li>item</li>
181
+ <li>item</li>
182
+ <li>item</li>
183
+ </ul>
184
+
185
+ <h2 id="down-below"><b>DOWN BELOW</b>Heading 2</h2>
186
+ <ul>
187
+ <li>item</li>
188
+ <li>item</li>
189
+ <li>item</li>
190
+ <li>item</li>
191
+ <li>item</li>
192
+ <li>item</li>
193
+ <li>item</li>
194
+ <li>item</li>
195
+ <li>item</li>
196
+ <li>item</li>
197
+ </ul>
198
+
199
+ <a href="#" onclick="new Effect.ScrollTo('first-heading'); return false;">scroll...</a>
200
+
201
+ <h2>Heading 2</h2>
202
+ <ul>
203
+ <li>item</li>
204
+ <li>item</li>
205
+ <li>item</li>
206
+ <li>item</li>
207
+ <li>item</li>
208
+ <li>item</li>
209
+ <li>item</li>
210
+ <li>item</li>
211
+ <li>item</li>
212
+ <li>item</li>
213
+ </ul>
214
+
215
+ <h2>Heading 2</h2>
216
+ <ul>
217
+ <li>item</li>
218
+ <li>item</li>
219
+ <li>item</li>
220
+ <li>item</li>
221
+ <li>item</li>
222
+ <li>item</li>
223
+ <li>item</li>
224
+ <li>item</li>
225
+ <li>item</li>
226
+ <li>item</li>
227
+ </ul>
228
+
229
+ <h2>Heading 2</h2>
230
+ <ul>
231
+ <li>item</li>
232
+ <li>item</li>
233
+ <li>item</li>
234
+ <li>item</li>
235
+ <li>item</li>
236
+ <li>item</li>
237
+ <li>item</li>
238
+ <li>item</li>
239
+ <li>item</li>
240
+ <li>item</li>
241
+ </ul>
242
+
243
+ <h2>Heading 2</h2>
244
+ <ul>
245
+ <li>item</li>
246
+ <li>item</li>
247
+ <li>item</li>
248
+ <li>item</li>
249
+ <li>item</li>
250
+ <li>item</li>
251
+ <li>item</li>
252
+ <li>item</li>
253
+ <li>item</li>
254
+ <li>item</li>
255
+ </ul>
256
+
257
+ <h2>Heading 2</h2>
258
+ <ul>
259
+ <li>item</li>
260
+ <li>item</li>
261
+ <li>item</li>
262
+ <li>item</li>
263
+ <li>item</li>
264
+ <li>item</li>
265
+ <li>item</li>
266
+ <li>item</li>
267
+ <li>item</li>
268
+ <li>item</li>
269
+ </ul>
270
+
271
+ <h2>Heading 2</h2>
272
+ <ul>
273
+ <li>item</li>
274
+ <li>item</li>
275
+ <li>item</li>
276
+ <li>item</li>
277
+ <li>item</li>
278
+ <li>item</li>
279
+ <li>item</li>
280
+ <li>item</li>
281
+ <li>item</li>
282
+ <li>item</li>
283
+ </ul>
284
+
285
+ <h2>Heading 2</h2>
286
+ <ul>
287
+ <li>item</li>
288
+ <li>item</li>
289
+ <li>item</li>
290
+ <li>item</li>
291
+ <li>item</li>
292
+ <li>item</li>
293
+ <li>item</li>
294
+ <li>item</li>
295
+ <li>item</li>
296
+ <li>item</li>
297
+ </ul>
298
+
299
+ <h2>Heading 2</h2>
300
+ <ul>
301
+ <li>item</li>
302
+ <li>item</li>
303
+ <li>item</li>
304
+ <li>item</li>
305
+ <li>item</li>
306
+ <li>item</li>
307
+ <li>item</li>
308
+ <li>item</li>
309
+ <li>item</li>
310
+ <li>item</li>
311
+ </ul>
312
+
313
+ <h2>Heading 2</h2>
314
+ <ul>
315
+ <li>item</li>
316
+ <li>item</li>
317
+ <li>item</li>
318
+ <li>item</li>
319
+ <li>item</li>
320
+ <li>item</li>
321
+ <li>item</li>
322
+ <li>item</li>
323
+ <li>item</li>
324
+ <li>item</li>
325
+ </ul>
326
+
327
+ <h2>Heading 2</h2>
328
+ <ul>
329
+ <li>item</li>
330
+ <li>item</li>
331
+ <li>item</li>
332
+ <li>item</li>
333
+ <li>item</li>
334
+ <li>item</li>
335
+ <li>item</li>
336
+ <li>item</li>
337
+ <li>item</li>
338
+ <li>item</li>
339
+ </ul>
340
+
341
+ <h2>Heading 2</h2>
342
+ <ul>
343
+ <li>item</li>
344
+ <li>item</li>
345
+ <li>item</li>
346
+ <li>item</li>
347
+ <li>item</li>
348
+ <li>item</li>
349
+ <li>item</li>
350
+ <li>item</li>
351
+ <li>item</li>
352
+ <li>item</li>
353
+ </ul>
354
+
355
+ <h2>Heading 2</h2>
356
+ <ul>
357
+ <li>item</li>
358
+ <li>item</li>
359
+ <li>item</li>
360
+ <li>item</li>
361
+ <li>item</li>
362
+ <li>item</li>
363
+ <li>item</li>
364
+ <li>item</li>
365
+ <li>item</li>
366
+ <li>item</li>
367
+ </ul>
368
+
369
+ <h2>Heading 2</h2>
370
+ <ul>
371
+ <li>item</li>
372
+ <li>item</li>
373
+ <li>item</li>
374
+ <li>item</li>
375
+ <li>item</li>
376
+ <li>item</li>
377
+ <li>item</li>
378
+ <li>item</li>
379
+ <li>item</li>
380
+ <li>item</li>
381
+ </ul>
382
+
383
+ <h2>Heading 2</h2>
384
+ <ul>
385
+ <li>item</li>
386
+ <li>item</li>
387
+ <li>item</li>
388
+ <li>item</li>
389
+ <li>item</li>
390
+ <li>item</li>
391
+ <li>item</li>
392
+ <li>item</li>
393
+ <li>item</li>
394
+ <li>item</li>
395
+ </ul>
396
+
397
+ <h2>Heading 2</h2>
398
+ <ul>
399
+ <li>item</li>
400
+ <li>item</li>
401
+ <li>item</li>
402
+ <li>item</li>
403
+ <li>item</li>
404
+ <li>item</li>
405
+ <li>item</li>
406
+ <li>item</li>
407
+ <li>item</li>
408
+ <li>item</li>
409
+ </ul>
410
+
411
+ <h2>Heading 2</h2>
412
+ <ul>
413
+ <li>item</li>
414
+ <li>item</li>
415
+ <li>item</li>
416
+ <li>item</li>
417
+ <li>item</li>
418
+ <li>item</li>
419
+ <li>item</li>
420
+ <li>item</li>
421
+ <li>item</li>
422
+ <li>item</li>
423
+ </ul>
424
+
425
+ <h2>Heading 2</h2>
426
+ <ul>
427
+ <li>item</li>
428
+ <li>item</li>
429
+ <li>item</li>
430
+ <li>item</li>
431
+ <li>item</li>
432
+ <li>item</li>
433
+ <li>item</li>
434
+ <li>item</li>
435
+ <li>item</li>
436
+ <li>item</li>
437
+ </ul>
438
+
439
+ <h2>Heading 2</h2>
440
+ <ul>
441
+ <li>item</li>
442
+ <li>item</li>
443
+ <li>item</li>
444
+ <li>item</li>
445
+ <li>item</li>
446
+ <li>item</li>
447
+ <li>item</li>
448
+ <li>item</li>
449
+ <li>item</li>
450
+ <li>item</li>
451
+ </ul>
452
+
453
+ <h2>Heading 2</h2>
454
+ <ul>
455
+ <li>item</li>
456
+ <li>item</li>
457
+ <li>item</li>
458
+ <li>item</li>
459
+ <li>item</li>
460
+ <li>item</li>
461
+ <li>item</li>
462
+ <li>item</li>
463
+ <li>item</li>
464
+ <li>item</li>
465
+ </ul>
466
+
467
+ <h2 id="last-heading">Heading 2</h2>
468
+ <ul>
469
+ <li>item</li>
470
+ <li>item</li>
471
+ <li>item</li>
472
+ <li>item</li>
473
+ <li>item</li>
474
+ <li>item</li>
475
+ <li>item</li>
476
+ <li>item</li>
477
+ <li>item</li>
478
+ <li>item</li>
479
+ </ul>
480
+
481
+
482
+ </body>
483
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects5b_test.html ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ </head>
11
+ <body>
12
+
13
+ <div style="height: 200px;">&nbsp;</div>
14
+
15
+ <h1>script.aculo.us ScrollTo effect (with floats) functional test</h1>
16
+
17
+ (this test only applies to Firefox)
18
+
19
+ <div style="float: right; padding: 10px; background: #ccc; height: 1900px;">
20
+
21
+ <h2>top of float</h2>
22
+
23
+ <a href="#" onclick="new Effect.ScrollTo('bottom-of-float');return false;">scroll to bottom!</a>
24
+
25
+ <div style="height: 1500px;">&nbsp;</div>
26
+
27
+ <h2 id="bottom-of-float">Bottom of Float</h2>
28
+
29
+ w00t
30
+
31
+ </div>
32
+
33
+ <script>
34
+ window.scrollBy(0, 200);
35
+ </script>
36
+
37
+
38
+ </body>
39
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects6_test.html ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ </head>
11
+ <body>
12
+ <h1>script.aculo.us Fade/Appear effect functional test</h1>
13
+ <p>Note: these tests use the browser default CSS style rules.</p>
14
+
15
+ <h2>DIV</h2>
16
+ <div id="test_div">TEST</div>
17
+ <a href="#" onclick="Effect.Fade('test_div'); return false;">Effect.Fade</a> |
18
+ <a href="#" onclick="Effect.Appear('test_div'); return false;">Effect.Appear</a>
19
+
20
+ <h2>SPAN</h2>
21
+ <span id="test_span">TEST</span><br/>
22
+ <a href="#" onclick="Effect.Fade('test_span'); return false;">Effect.Fade</a> |
23
+ <a href="#" onclick="Effect.Appear('test_span'); return false;">Effect.Appear</a>
24
+
25
+ <h2>P</h2>
26
+ <p id="test_p">TEST</p><br/>
27
+ <a href="#" onclick="Effect.Fade('test_p'); return false;">Effect.Fade</a> |
28
+ <a href="#" onclick="Effect.Appear('test_p'); return false;">Effect.Appear</a>
29
+
30
+ <h2>IMG</h2>
31
+ <img id="test_img" src="icon.png" alt="test image" /><br/>
32
+ <a href="#" onclick="Effect.Fade('test_img'); return false;">Effect.Fade</a> |
33
+ <a href="#" onclick="Effect.Appear('test_img'); return false;">Effect.Appear</a>
34
+
35
+
36
+ <hr/>
37
+
38
+ <p style="color:red;">The following elements are not supported with Fade/Appear on all browsers!</p>
39
+
40
+ <h2>TABLE</h2>
41
+ <table id="test_table"><tbody><tr><td>TEST</td></tr></tbody></table>
42
+ <a href="#" onclick="Effect.Fade('test_table'); return false;">Effect.Fade</a> |
43
+ <a href="#" onclick="Effect.Appear('test_table'); return false;">Effect.Appear</a>
44
+
45
+ <h2>TBODY</h2>
46
+ <table><tbody id="test_tbody"><tr><td>TEST</td></tr></tbody></table>
47
+ <a href="#" onclick="Effect.Fade('test_tbody'); return false;">Effect.Fade</a> |
48
+ <a href="#" onclick="Effect.Appear('test_tbody'); return false;">Effect.Appear</a>
49
+
50
+ <h2>TR</h2>
51
+ <table><tbody><tr id="test_tr"><td>TEST</td></tr></tbody></table>
52
+ <a href="#" onclick="Effect.Fade('test_tr'); return false;">Effect.Fade</a> |
53
+ <a href="#" onclick="Effect.Appear('test_tr'); return false;">Effect.Appear</a>
54
+
55
+ <h2>TD</h2>
56
+ <table><tbody><tr><td id="test_td">TEST</td></tr></tbody></table>
57
+ <a href="#" onclick="Effect.Fade('test_td'); return false;">Effect.Fade</a> |
58
+ <a href="#" onclick="Effect.Appear('test_td'); return false;">Effect.Appear</a>
59
+
60
+ </body>
61
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_blind_test.html ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ /* <![CDATA[ */
12
+ #d1 { background-color: #fcb; width: 200px; }
13
+ /* ]]> */
14
+ </style>
15
+
16
+ </head>
17
+ <body>
18
+ <h1>script.aculo.us Effects functional test file</h1>
19
+
20
+ <h2>Effect.BlindUp/Effect.BlindDown</h2>
21
+
22
+ <div id="d1">
23
+ Lorem ipsum dolor sit amet
24
+ <ul>
25
+ <li>test!</li>
26
+ <li>test!</li>
27
+ </ul>
28
+ <img src="icon.png" alt="test!"/>
29
+ <img src="icon.png" alt="test!"/>
30
+ <img src="icon.png" alt="test!"/>
31
+ <img src="icon.png" alt="test!"/>
32
+ <img src="icon.png" alt="test!"/>
33
+ <img src="icon.png" alt="test!"/>
34
+ <img src="icon.png" alt="test!"/>
35
+ <img src="icon.png" alt="test!"/>
36
+ <img src="icon.png" alt="test!"/>
37
+ <img src="icon.png" alt="test!"/>
38
+ Lorem ipsum dolor sit amet
39
+ <ul>
40
+ <li>test!</li>
41
+ <li>test!</li>
42
+ </ul>
43
+ Lorem ipsum dolor sit amet
44
+ <ul>
45
+ <li>test!</li>
46
+ <li>test!</li>
47
+ </ul>
48
+ Lorem ipsum dolor sit amet
49
+ <ul>
50
+ <li>test!</li>
51
+ <li>test!</li>
52
+ </ul>
53
+ </div>
54
+
55
+ <p>
56
+ <a href="#" onclick="Effect.BlindDown('d1');; return false;">BlindDown()</a>
57
+ </p>
58
+
59
+ <p>
60
+ <a href="#" onclick="Effect.BlindUp('d1');; return false;">BlindUp()</a>
61
+ </p>
62
+
63
+
64
+ </body>
65
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_float_appear_test.html ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ </head>
11
+ <body>
12
+ <h1>script.aculo.us functional test file</h1>
13
+ <p>
14
+ See if workaround for Safari and floating elements with Effect.Appear works.
15
+ </p>
16
+
17
+ <a href="#" onclick="Effect.Appear('float_div_left'); return false;">float:left</a> |
18
+ <a href="#" onclick="Effect.Appear('float_div_right'); return false;">float:right</a> |
19
+ <a href="#" onclick="$('float_div_right').setOpacity(1)">float:right (setOpacity 1)</a> |
20
+ <a href="#" onclick="Effect.Appear('icon'); return false;">image (non-floating)</a> |
21
+ <a href="#" onclick="Effect.Appear('float_icon'); return false;">image (floating)</a> |
22
+ <a href="#" onclick="$('float_icon').setOpacity(1);">image (setOpacity 1)</a>
23
+
24
+ <hr/>
25
+
26
+ <div id="float_div_left" style="float:left;display:none">
27
+ Lorem ipsum dolor sit amet,<br/>
28
+ consectetur adipisicing elit,<br/>
29
+ sed do eiusmod tempor incididunt<br/>
30
+ ut labore et dolore magna aliqua.
31
+ </div>
32
+
33
+ <div id="float_div_right" style="float:right;opacity:0.4">
34
+ Lorem ipsum dolor sit amet,<br/>
35
+ consectetur adipisicing elit,<br/>
36
+ sed do eiusmod tempor incididunt<br/>
37
+ ut labore et dolore magna aliqua.
38
+ </div>
39
+
40
+ <img id="icon" src="icon.png" style="display:none" alt="" />
41
+
42
+ <img id="float_icon" src="icon.png" style="float:left;opacity:0.4" alt="" />
43
+
44
+
45
+ </body>
46
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_grow_strink_test.html ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>script.aculo.us Effects functional test file</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
8
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
9
+ <script src="../../src/unittest.js" type="text/javascript"></script>
10
+ <style type="text/css" media="screen">
11
+ /* <![CDATA[ */
12
+ #d1 { background-color: #fcb; width: 200px; height: 200px; }
13
+ /* ]]> */
14
+ </style>
15
+
16
+ </head>
17
+ <body>
18
+ <h1>script.aculo.us Effects functional test file</h1>
19
+
20
+ <h2>Effect.Grow/Effect.Shrink</h2>
21
+
22
+ <div id="d1" style="font-size: 2em;">
23
+ <p style="font-size:1em;">Lorem ipsum dolor sit amet</p>
24
+ </div>
25
+
26
+ <p>
27
+ Grow:
28
+ <a href="#" onclick="Effect.Grow('d1');; return false;">Grow()</a>
29
+ </p>
30
+
31
+ <p>
32
+ Shrink:
33
+ <a href="#" onclick="Effect.Shrink('d1');; return false;">Shrink()</a>
34
+ </p>
35
+
36
+
37
+ </body>
38
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_highlight_bg_image.html ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title></title>
6
+ <script type="text/javascript" src="../../lib/prototype.js"></script>
7
+ <script type="text/javascript">
8
+ //<![CDATA[
9
+
10
+ Li = {
11
+ onMouseDown_image: function(event) {
12
+ new Effect.Highlight(this, {keepBackgroundImage:true});
13
+ },
14
+ onMouseDown_without: function(event) {
15
+ new Effect.Highlight(this);
16
+ }
17
+ }
18
+
19
+ window.onload = function() {
20
+ var li = $("with").getElementsByTagName('LI');
21
+ for (var i = 0; i < li.length; i++) {
22
+ li[i].onmousedown = Li.onMouseDown_image.bindAsEventListener(li[i]);
23
+ }
24
+ var li = $("without").getElementsByTagName('LI');
25
+ for (i = 0; i < li.length; i++) {
26
+ li[i].onmousedown = Li.onMouseDown_without.bindAsEventListener(li[i]);
27
+ }
28
+ }
29
+
30
+ //]]>
31
+ </script>
32
+ <style type="text/css">
33
+ body {
34
+ font-family: Verdana, Arial, Helvetica, sans-serif;
35
+ li {
36
+ margin: 3px 0; padding: 3px 3em 3px 24px;
37
+ }
38
+ #with li {background-color: #cde;}
39
+ #without li {background-color: #ced;}
40
+ </head>
41
+ <body>
42
+ <p>Test of <code>keepBackgroundImage</code> parameter for <code>Effect.Highlight</code>. Click items to show effect.</p>
43
+ <p>With the <code>keepBackgroundImage</code> parameter.</p>
44
+ <ul id="with">
45
+ <li>One</li>
46
+ <li>Two</li>
47
+ <li>Three</li>
48
+ </ul>
49
+
50
+ <p>Without the parameter.</p>
51
+ <ul id="without">
52
+ <li>One</li>
53
+ <li>Two</li>
54
+ <li>Three</li>
55
+ </ul>
56
+ </body>
57
+ </html>
mosesdecoder/scripts/ems/web/javascripts/scriptaculous-js-1.8.3/test/functional/effects_queue_limit_test.html ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>script.aculo.us Effects functional test file</title>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+ <script src="../../lib/prototype.js" type="text/javascript"></script>
7
+ <script src="../../src/scriptaculous.js" type="text/javascript"></script>
8
+ <script src="../../src/unittest.js" type="text/javascript"></script>
9
+ <style type="text/css" media="screen">
10
+ /* <![CDATA[ */
11
+ #d1 { background-color: #fcb; width: 200px; height: 200px; float:left; }
12
+ #d2 { background-color: #cfb; font-size: 2em; width: 200px; height: 200px; float:left; }
13
+ #d3 { background-color: #bcf; font-size: 2em; width: 200px; height: 200px; float:left; }
14
+ /* ]]> */
15
+ </style>
16
+
17
+ </head>
18
+ <body>
19
+ <h1>script.aculo.us Effects functional test file</h1>
20
+
21
+ <h2>Effect.Queue limit</h2>
22
+
23
+ <a href="#" onclick="Effect.SlideUp('slidingtwice',{queue:{scope:'myscope', position:'end', limit: 1}});">up</a>
24
+ <a href="#" onclick="Effect.SlideDown('slidingtwice',{queue:{scope:'myscope', position:'end', limit: 1}});">down</a>
25
+ <div id="slidingtwice"><div style="background-color:#000;color:white;font-size:20px;height:300px;width:150px;">
26
+ Do a bit sliding in parallel, with a scoped queue, but I am limited to one : ) so don't try over and over again...
27
+ </div></div>
28
+
29
+ </body>
30
+ </html>