108 |
109 |
110 | GNU GENERAL PUBLIC LICENSE
111 | Version 3, 29 June 2007
112 |
113 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
114 | Everyone is permitted to copy and distribute verbatim copies
115 | of this license document, but changing it is not allowed.
116 |
117 | Preamble
118 |
119 | The GNU General Public License is a free, copyleft license for
120 | software and other kinds of works.
121 |
122 | The licenses for most software and other practical works are designed
123 | to take away your freedom to share and change the works. By contrast,
124 | the GNU General Public License is intended to guarantee your freedom to
125 | share and change all versions of a program--to make sure it remains free
126 | software for all its users. We, the Free Software Foundation, use the
127 | GNU General Public License for most of our software; it applies also to
128 | any other work released this way by its authors. You can apply it to
129 | your programs, too.
130 |
131 | When we speak of free software, we are referring to freedom, not
132 | price. Our General Public Licenses are designed to make sure that you
133 | have the freedom to distribute copies of free software (and charge for
134 | them if you wish), that you receive source code or can get it if you
135 | want it, that you can change the software or use pieces of it in new
136 | free programs, and that you know you can do these things.
137 |
138 | To protect your rights, we need to prevent others from denying you
139 | these rights or asking you to surrender the rights. Therefore, you have
140 | certain responsibilities if you distribute copies of the software, or if
141 | you modify it: responsibilities to respect the freedom of others.
142 |
143 | For example, if you distribute copies of such a program, whether
144 | gratis or for a fee, you must pass on to the recipients the same
145 | freedoms that you received. You must make sure that they, too, receive
146 | or can get the source code. And you must show them these terms so they
147 | know their rights.
148 |
149 | Developers that use the GNU GPL protect your rights with two steps:
150 | (1) assert copyright on the software, and (2) offer you this License
151 | giving you legal permission to copy, distribute and/or modify it.
152 |
153 | For the developers' and authors' protection, the GPL clearly explains
154 | that there is no warranty for this free software. For both users' and
155 | authors' sake, the GPL requires that modified versions be marked as
156 | changed, so that their problems will not be attributed erroneously to
157 | authors of previous versions.
158 |
159 | Some devices are designed to deny users access to install or run
160 | modified versions of the software inside them, although the manufacturer
161 | can do so. This is fundamentally incompatible with the aim of
162 | protecting users' freedom to change the software. The systematic
163 | pattern of such abuse occurs in the area of products for individuals to
164 | use, which is precisely where it is most unacceptable. Therefore, we
165 | have designed this version of the GPL to prohibit the practice for those
166 | products. If such problems arise substantially in other domains, we
167 | stand ready to extend this provision to those domains in future versions
168 | of the GPL, as needed to protect the freedom of users.
169 |
170 | Finally, every program is threatened constantly by software patents.
171 | States should not allow patents to restrict development and use of
172 | software on general-purpose computers, but in those that do, we wish to
173 | avoid the special danger that patents applied to a free program could
174 | make it effectively proprietary. To prevent this, the GPL assures that
175 | patents cannot be used to render the program non-free.
176 |
177 | The precise terms and conditions for copying, distribution and
178 | modification follow.
179 |
180 | TERMS AND CONDITIONS
181 |
182 | 0. Definitions.
183 |
184 | "This License" refers to version 3 of the GNU General Public License.
185 |
186 | "Copyright" also means copyright-like laws that apply to other kinds of
187 | works, such as semiconductor masks.
188 |
189 | "The Program" refers to any copyrightable work licensed under this
190 | License. Each licensee is addressed as "you". "Licensees" and
191 | "recipients" may be individuals or organizations.
192 |
193 | To "modify" a work means to copy from or adapt all or part of the work
194 | in a fashion requiring copyright permission, other than the making of an
195 | exact copy. The resulting work is called a "modified version" of the
196 | earlier work or a work "based on" the earlier work.
197 |
198 | A "covered work" means either the unmodified Program or a work based
199 | on the Program.
200 |
201 | To "propagate" a work means to do anything with it that, without
202 | permission, would make you directly or secondarily liable for
203 | infringement under applicable copyright law, except executing it on a
204 | computer or modifying a private copy. Propagation includes copying,
205 | distribution (with or without modification), making available to the
206 | public, and in some countries other activities as well.
207 |
208 | To "convey" a work means any kind of propagation that enables other
209 | parties to make or receive copies. Mere interaction with a user through
210 | a computer network, with no transfer of a copy, is not conveying.
211 |
212 | An interactive user interface displays "Appropriate Legal Notices"
213 | to the extent that it includes a convenient and prominently visible
214 | feature that (1) displays an appropriate copyright notice, and (2)
215 | tells the user that there is no warranty for the work (except to the
216 | extent that warranties are provided), that licensees may convey the
217 | work under this License, and how to view a copy of this License. If
218 | the interface presents a list of user commands or options, such as a
219 | menu, a prominent item in the list meets this criterion.
220 |
221 | 1. Source Code.
222 |
223 | The "source code" for a work means the preferred form of the work
224 | for making modifications to it. "Object code" means any non-source
225 | form of a work.
226 |
227 | A "Standard Interface" means an interface that either is an official
228 | standard defined by a recognized standards body, or, in the case of
229 | interfaces specified for a particular programming language, one that
230 | is widely used among developers working in that language.
231 |
232 | The "System Libraries" of an executable work include anything, other
233 | than the work as a whole, that (a) is included in the normal form of
234 | packaging a Major Component, but which is not part of that Major
235 | Component, and (b) serves only to enable use of the work with that
236 | Major Component, or to implement a Standard Interface for which an
237 | implementation is available to the public in source code form. A
238 | "Major Component", in this context, means a major essential component
239 | (kernel, window system, and so on) of the specific operating system
240 | (if any) on which the executable work runs, or a compiler used to
241 | produce the work, or an object code interpreter used to run it.
242 |
243 | The "Corresponding Source" for a work in object code form means all
244 | the source code needed to generate, install, and (for an executable
245 | work) run the object code and to modify the work, including scripts to
246 | control those activities. However, it does not include the work's
247 | System Libraries, or general-purpose tools or generally available free
248 | programs which are used unmodified in performing those activities but
249 | which are not part of the work. For example, Corresponding Source
250 | includes interface definition files associated with source files for
251 | the work, and the source code for shared libraries and dynamically
252 | linked subprograms that the work is specifically designed to require,
253 | such as by intimate data communication or control flow between those
254 | subprograms and other parts of the work.
255 |
256 | The Corresponding Source need not include anything that users
257 | can regenerate automatically from other parts of the Corresponding
258 | Source.
259 |
260 | The Corresponding Source for a work in source code form is that
261 | same work.
262 |
263 |
264 |
265 |
266 |
108 |
109 |
110 | GNU GENERAL PUBLIC LICENSE
111 | Version 3, 29 June 2007
112 |
113 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
114 | Everyone is permitted to copy and distribute verbatim copies
115 | of this license document, but changing it is not allowed.
116 |
117 | Preamble
118 |
119 | The GNU General Public License is a free, copyleft license for
120 | software and other kinds of works.
121 |
122 | The licenses for most software and other practical works are designed
123 | to take away your freedom to share and change the works. By contrast,
124 | the GNU General Public License is intended to guarantee your freedom to
125 | share and change all versions of a program--to make sure it remains free
126 | software for all its users. We, the Free Software Foundation, use the
127 | GNU General Public License for most of our software; it applies also to
128 | any other work released this way by its authors. You can apply it to
129 | your programs, too.
130 |
131 | When we speak of free software, we are referring to freedom, not
132 | price. Our General Public Licenses are designed to make sure that you
133 | have the freedom to distribute copies of free software (and charge for
134 | them if you wish), that you receive source code or can get it if you
135 | want it, that you can change the software or use pieces of it in new
136 | free programs, and that you know you can do these things.
137 |
138 | To protect your rights, we need to prevent others from denying you
139 | these rights or asking you to surrender the rights. Therefore, you have
140 | certain responsibilities if you distribute copies of the software, or if
141 | you modify it: responsibilities to respect the freedom of others.
142 |
143 | For example, if you distribute copies of such a program, whether
144 | gratis or for a fee, you must pass on to the recipients the same
145 | freedoms that you received. You must make sure that they, too, receive
146 | or can get the source code. And you must show them these terms so they
147 | know their rights.
148 |
149 | Developers that use the GNU GPL protect your rights with two steps:
150 | (1) assert copyright on the software, and (2) offer you this License
151 | giving you legal permission to copy, distribute and/or modify it.
152 |
153 | For the developers' and authors' protection, the GPL clearly explains
154 | that there is no warranty for this free software. For both users' and
155 | authors' sake, the GPL requires that modified versions be marked as
156 | changed, so that their problems will not be attributed erroneously to
157 | authors of previous versions.
158 |
159 | Some devices are designed to deny users access to install or run
160 | modified versions of the software inside them, although the manufacturer
161 | can do so. This is fundamentally incompatible with the aim of
162 | protecting users' freedom to change the software. The systematic
163 | pattern of such abuse occurs in the area of products for individuals to
164 | use, which is precisely where it is most unacceptable. Therefore, we
165 | have designed this version of the GPL to prohibit the practice for those
166 | products. If such problems arise substantially in other domains, we
167 | stand ready to extend this provision to those domains in future versions
168 | of the GPL, as needed to protect the freedom of users.
169 |
170 | Finally, every program is threatened constantly by software patents.
171 | States should not allow patents to restrict development and use of
172 | software on general-purpose computers, but in those that do, we wish to
173 | avoid the special danger that patents applied to a free program could
174 | make it effectively proprietary. To prevent this, the GPL assures that
175 | patents cannot be used to render the program non-free.
176 |
177 | The precise terms and conditions for copying, distribution and
178 | modification follow.
179 |
180 | TERMS AND CONDITIONS
181 |
182 | 0. Definitions.
183 |
184 | "This License" refers to version 3 of the GNU General Public License.
185 |
186 | "Copyright" also means copyright-like laws that apply to other kinds of
187 | works, such as semiconductor masks.
188 |
189 | "The Program" refers to any copyrightable work licensed under this
190 | License. Each licensee is addressed as "you". "Licensees" and
191 | "recipients" may be individuals or organizations.
192 |
193 | To "modify" a work means to copy from or adapt all or part of the work
194 | in a fashion requiring copyright permission, other than the making of an
195 | exact copy. The resulting work is called a "modified version" of the
196 | earlier work or a work "based on" the earlier work.
197 |
198 | A "covered work" means either the unmodified Program or a work based
199 | on the Program.
200 |
201 | To "propagate" a work means to do anything with it that, without
202 | permission, would make you directly or secondarily liable for
203 | infringement under applicable copyright law, except executing it on a
204 | computer or modifying a private copy. Propagation includes copying,
205 | distribution (with or without modification), making available to the
206 | public, and in some countries other activities as well.
207 |
208 | To "convey" a work means any kind of propagation that enables other
209 | parties to make or receive copies. Mere interaction with a user through
210 | a computer network, with no transfer of a copy, is not conveying.
211 |
212 | An interactive user interface displays "Appropriate Legal Notices"
213 | to the extent that it includes a convenient and prominently visible
214 | feature that (1) displays an appropriate copyright notice, and (2)
215 | tells the user that there is no warranty for the work (except to the
216 | extent that warranties are provided), that licensees may convey the
217 | work under this License, and how to view a copy of this License. If
218 | the interface presents a list of user commands or options, such as a
219 | menu, a prominent item in the list meets this criterion.
220 |
221 | 1. Source Code.
222 |
223 | The "source code" for a work means the preferred form of the work
224 | for making modifications to it. "Object code" means any non-source
225 | form of a work.
226 |
227 | A "Standard Interface" means an interface that either is an official
228 | standard defined by a recognized standards body, or, in the case of
229 | interfaces specified for a particular programming language, one that
230 | is widely used among developers working in that language.
231 |
232 | The "System Libraries" of an executable work include anything, other
233 | than the work as a whole, that (a) is included in the normal form of
234 | packaging a Major Component, but which is not part of that Major
235 | Component, and (b) serves only to enable use of the work with that
236 | Major Component, or to implement a Standard Interface for which an
237 | implementation is available to the public in source code form. A
238 | "Major Component", in this context, means a major essential component
239 | (kernel, window system, and so on) of the specific operating system
240 | (if any) on which the executable work runs, or a compiler used to
241 | produce the work, or an object code interpreter used to run it.
242 |
243 | The "Corresponding Source" for a work in object code form means all
244 | the source code needed to generate, install, and (for an executable
245 | work) run the object code and to modify the work, including scripts to
246 | control those activities. However, it does not include the work's
247 | System Libraries, or general-purpose tools or generally available free
248 | programs which are used unmodified in performing those activities but
249 | which are not part of the work. For example, Corresponding Source
250 | includes interface definition files associated with source files for
251 | the work, and the source code for shared libraries and dynamically
252 | linked subprograms that the work is specifically designed to require,
253 | such as by intimate data communication or control flow between those
254 | subprograms and other parts of the work.
255 |
256 | The Corresponding Source need not include anything that users
257 | can regenerate automatically from other parts of the Corresponding
258 | Source.
259 |
260 | The Corresponding Source for a work in source code form is that
261 | same work.
262 |
263 |
264 |
265 |
266 |
13 |
14 |
#1
15 |
#2
16 |
#3
17 |
#4
18 |
#5
19 |
#6
20 |
#7
21 |
#8
22 |
#9
23 |
#10
24 |
#11
25 |
#12
26 |
#13
27 |
#14
28 |
#15
29 |
#16
30 |
#17
31 |
#18
32 |
#19
33 |
#20
34 |
#21
35 |
#22
36 |
#23
37 |
#24
38 |
#25
39 |
#26
40 |
#27
41 |
#28
42 |
#29
43 |
#30
44 |
#31
45 |
#32
46 |
#33
47 |
#34
48 |
#35
49 |
#36
50 |
#37
51 |
#38
52 |
#39
53 |
#40
54 |
#41
55 |
#42
56 |
#43
57 |
#44
58 |
#45
59 |
#46
60 |
#47
61 |
#48
62 |
#49
63 |
#50
64 |
#51
65 |
#52
66 |
#53
67 |
#54
68 |
#55
69 |
#56
70 |
#57
71 |
#58
72 |
#59
73 |
#60
74 |
#61
75 |
#62
76 |
#63
77 |
#64
78 |
#65
79 |
#66
80 |
#67
81 |
#68
82 |
#69
83 |
#70
84 |
#71
85 |
#72
86 |
#73
87 |
#74
88 |
#75
89 |
#76
90 |
#77
91 |
#78
92 |
#79
93 |
#80
94 |
#81
95 |
#82
96 |
#83
97 |
#84
98 |
#85
99 |
#86
100 |
#87
101 |
#88
102 |
#89
103 |
#90
104 |
#91
105 |
#92
106 |
#93
107 |
#94
108 |
#95
109 |
#96
110 |
#97
111 |
#98
112 |
#99
113 |
#100
114 |
115 |
--------------------------------------------------------------------------------
/test/unit/list.tmpl.html:
--------------------------------------------------------------------------------
1 |
6 |
7 | - #1
8 | - #2
9 | - #3
10 | - #4
11 | - #5
12 | - #6
13 | - #7
14 | - #8
15 | - #9
16 | - #10
17 | - #11
18 | - #12
19 | - #13
20 | - #14
21 | - #15
22 | - #16
23 | - #17
24 | - #18
25 | - #19
26 | - #20
27 | - #21
28 | - #22
29 | - #23
30 | - #24
31 | - #25
32 | - #26
33 | - #27
34 | - #28
35 | - #29
36 | - #30
37 | - #31
38 | - #32
39 | - #33
40 | - #34
41 | - #35
42 | - #36
43 | - #37
44 | - #38
45 | - #39
46 | - #40
47 | - #41
48 | - #42
49 | - #43
50 | - #44
51 | - #45
52 | - #46
53 | - #47
54 | - #48
55 | - #49
56 | - #50
57 | - #51
58 | - #52
59 | - #53
60 | - #54
61 | - #55
62 | - #56
63 | - #57
64 | - #58
65 | - #59
66 | - #60
67 | - #61
68 | - #62
69 | - #63
70 | - #64
71 | - #65
72 | - #66
73 | - #67
74 | - #68
75 | - #69
76 | - #70
77 | - #71
78 | - #72
79 | - #73
80 | - #74
81 | - #75
82 | - #76
83 | - #77
84 | - #78
85 | - #79
86 | - #80
87 | - #81
88 | - #82
89 | - #83
90 | - #84
91 | - #85
92 | - #86
93 | - #87
94 | - #88
95 | - #89
96 | - #90
97 | - #91
98 | - #92
99 | - #93
100 | - #94
101 | - #95
102 | - #96
103 | - #97
104 | - #98
105 | - #99
106 | - #100
107 |
--------------------------------------------------------------------------------
/test/unit/observe.tmpl.html:
--------------------------------------------------------------------------------
1 |
10 |
11 | - #1
12 | - #2
13 | - #3
14 | - #4
15 | - #5
16 | - #6
17 | - #7
18 | - #8
19 | - #9
20 | - #10
21 | - #11
22 | - #12
23 | - #13
24 | - #14
25 | - #15
26 | - #16
27 | - #17
28 | - #18
29 | - #19
30 | - #20
31 | - #21
32 | - #22
33 | - #23
34 | - #24
35 | - #25
36 | - #26
37 | - #27
38 | - #28
39 | - #29
40 | - #30
41 | - #31
42 | - #32
43 | - #33
44 | - #34
45 | - #35
46 | - #36
47 | - #37
48 | - #38
49 | - #39
50 | - #40
51 | - #41
52 | - #42
53 | - #43
54 | - #44
55 | - #45
56 | - #46
57 | - #47
58 | - #48
59 | - #49
60 | - #50
61 | - #51
62 | - #52
63 | - #53
64 | - #54
65 | - #55
66 | - #56
67 | - #57
68 | - #58
69 | - #59
70 | - #60
71 | - #61
72 | - #62
73 | - #63
74 | - #64
75 | - #65
76 | - #66
77 | - #67
78 | - #68
79 | - #69
80 | - #70
81 | - #71
82 | - #72
83 | - #73
84 | - #74
85 | - #75
86 | - #76
87 | - #77
88 | - #78
89 | - #79
90 | - #80
91 | - #81
92 | - #82
93 | - #83
94 | - #84
95 | - #85
96 | - #86
97 | - #87
98 | - #88
99 | - #89
100 | - #90
101 | - #91
102 | - #92
103 | - #93
104 | - #94
105 | - #95
106 | - #96
107 | - #97
108 | - #98
109 | - #99
110 | - #100
111 |
112 |
113 |
--------------------------------------------------------------------------------
/test/unit/pre.tmpl.html:
--------------------------------------------------------------------------------
1 |
5 |
6 | GNU GENERAL PUBLIC LICENSE
7 | Version 3, 29 June 2007
8 |
9 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
10 | Everyone is2 permitted to copy and disdtribute verbatim copies
11 | of this license document, but changing it is not allowed.
12 |
13 | Preamble
14 |
15 | The GNU General Public License is a free, copyleft license for
16 | software and other kinds of works.
17 |
18 | The licenses for most software and other practical works are designed
19 | to take away your freedom to share and change the works. By contrast,
20 | the GNU General Public License is intended to guarantee your freedom to
21 | share and change all versions of a program--to make sure it remains free
22 | software for all its users. We, the Free Software Foundation, use the
23 | GNU General Public License for most of our software; it applies also to
24 | any other work released this way by its authors. You can apply it to
25 | your programs, too.
26 |
27 | When we speak of free software, we are referring to freedom, not
28 | price. Our General Public Licenses are designed to make sure that you
29 | have the freedom to distribute copies of free software (and charge for
30 | them if you wish), that you receive source code or can get it if you
31 | want it, that you can change the software or use pieces of it in new
32 | free programs, and that you know you can do these things.
33 |
34 | To protect your rights, we need to prevent others from denying you
35 | these rights or asking you to surrender the rights. Therefore, you have
36 | certain responsibilities if you distribute copies of the software, or if
37 | you modify it: responsibilities to respect the freedom of others.
38 |
39 | For example, if you distribute copies of such a program, whether
40 | gratis or for a fee, you must pass on to the recipients the same
41 | freedoms that you received. You must make sure that they, too, receive
42 | or can get the source code. And you must show them these terms so they
43 | know their rights.
44 |
45 | Developers that use the GNU GPL protect your rights with two steps:
46 | (1) assert copyright on the software, and (2) offer you this License
47 | giving you legal permission to copy, distribute and/or modify it.
48 |
49 | For the developers' and authors' protection, the GPL clearly explains
50 | that there is no warranty for this free software. For both users' and
51 | authors' sake, the GPL requires that modified versions be marked as
52 | changed, so that their problems will not be attributed erroneously to
53 | authors of previous versions.
54 |
55 | Some devices are designed to deny users access to install or run
56 | modified versions of the software inside them, although the manufacturer
57 | can do so. This is fundamentally incompatible with the aim of
58 | protecting users' freedom to change the software. The systematic
59 | pattern of such abuse occurs in the area of products for individuals to
60 | use, which is precisely where it is most unacceptable. Therefore, we
61 | have designed this version of the GPL to prohibit the practice for those
62 | products. If such problems arise substantially in other domains, we
63 | stand ready to extend this provision to those domains in future versions
64 | of the GPL, as needed to protect the freedom of users.
65 |
66 | Finally, every program is threatened constantly by software patents.
67 | States should not allow patents to restrict development and use of
68 | software on general-purpose computers, but in those that do, we wish to
69 | avoid the special danger that patents applied to a free program could
70 | make it effectively proprietary. To prevent this, the GPL assures that
71 | patents cannot be used to render the program non-free.
72 |
73 | The precise terms and conditions for copying, distribution and
74 | modification follow.
75 |
76 | TERMS AND CONDITIONS
77 |
78 | 0. Definitions.
79 |
80 | "This License" refers to version 3 of the GNU General Public License.
81 |
82 | "Copyright" also means copyright-like laws that apply to other kinds of
83 | works, such as semiconductor masks.
84 |
85 | "The Program" refers to any copyrightable work licensed under this
86 | License. Each licensee is addressed as "you". "Licensees" and
87 | "recipients" may be individuals or organizations.
88 |
89 | To "modify" a work means to copy from or adapt all or part of the work
90 | in a fashion requiring copyright permission, other than the making of an
91 | exact copy. The resulting work is called a "modified version" of the
92 | earlier work or a work "based on" the earlier work.
93 |
94 | A "covered work" means either the unmodified Program or a work based
95 | on the Program.
96 |
97 | To "propagate" a work means to do anything with it that, without
98 | permission, would make you directly or secondarily liable for
99 | infringement under applicable copyright law, except executing it on a
100 | computer or modifying a private copy. Propagation includes copying,
101 | distribution (with or without modification), making available to the
102 | public, and in some countries other activities as well.
103 |
104 | To "convey" a work means any kind of propagation that enables other
105 | parties to make or receive copies. Mere interaction with a user through
106 | a computer network, with no transfer of a copy, is not conveying.
107 |
108 | An interactive user interface displays "Appropriate Legal Notices"
109 | to the extent that it includes a convenient and prominently visible
110 | feature that (1) displays an appropriate copyright notice, and (2)
111 | tells the user that there is no warranty for the work (except to the
112 | extent that warranties are provided), that licensees may convey the
113 | work under this License, and how to view a copy of this License. If
114 | the interface presents a list of user commands or options, such as a
115 | menu, a prominent item in the list meets this criterion.
116 |
117 | 1. Source Code.
118 |
119 | The "source code" for a work means the preferred form of the work
120 | for making modifications to it. "Object code" means any non-source
121 | form of a work.
122 |
123 | A "Standard Interface" means an interface that either is an official
124 | standard defined by a recognized standards body, or, in the case of
125 | interfaces specified for a particular programming language, one that
126 | is widely used among developers working in that language.
127 |
128 | The "System Libraries" of an executable work include anything, other
129 | than the work as a whole, that (a) is included in the normal form of
130 | packaging a Major Component, but which is not part of that Major
131 | Component, and (b) serves only to enable use of the work with that
132 | Major Component, or to implement a Standard Interface for which an
133 | implementation is available to the public in source code form. A
134 | "Major Component", in this context, means a major essential component
135 | (kernel, window system, and so on) of the specific operating system
136 | (if any) on which the executable work runs, or a compiler used to
137 | produce the work, or an object code interpreter used to run it.
138 |
139 | The "Corresponding Source" for a work in object code form means all
140 | the source code needed to generate, install, and (for an executable
141 | work) run the object code and to modify the work, including scripts to
142 | control those activities. However, it does not include the work's
143 | System Libraries, or general-purpose tools or generally available free
144 | programs which are used unmodified in performing those activities but
145 | which are not part of the work. For example, Corresponding Source
146 | includes interface definition files associated with source files for
147 | the work, and the source code for shared libraries and dynamically
148 | linked subprograms that the work is specifically designed to require,
149 | such as by intimate data communication or control flow between those
150 | subprograms and other parts of the work.
151 |
152 | The Corresponding Source need not include anything that users
153 | can regenerate automatically from other parts of the Corresponding
154 | Source.
155 |
156 | The Corresponding Source for a work in source code form is that
157 | same work.
158 |
--------------------------------------------------------------------------------
/test/unit/targetContainer.tmpl.html:
--------------------------------------------------------------------------------
1 |
10 |
11 | - #1
12 | - #2
13 | - #3
14 |
15 |
- #4
16 | - #5
17 | - #6
18 | - #7
19 | - #8
20 | - #9
21 | - #10
22 | - #11
23 | - #12
24 | - #13
25 | - #14
26 | - #15
27 | - #16
28 | - #17
29 | - #18
30 | - #19
31 | - #20
32 | - #21
33 | - #22
34 | - #23
35 | - #24
36 | - #25
37 | - #26
38 | - #27
39 | - #28
40 | - #29
41 | - #30
42 | - #31
43 | - #32
44 | - #33
45 | - #34
46 | - #35
47 | - #36
48 | - #37
49 | - #38
50 | - #39
51 | - #40
52 | - #41
53 | - #42
54 | - #43
55 | - #44
56 | - #45
57 | - #46
58 | - #47
59 | - #48
60 | - #49
61 | - #50
62 | - #51
63 | - #52
64 | - #53
65 | - #54
66 | - #55
67 | - #56
68 | - #57
69 | - #58
70 | - #59
71 | - #60
72 | - #61
73 | - #62
74 | - #63
75 | - #64
76 | - #65
77 | - #66
78 | - #67
79 | - #68
80 | - #69
81 | - #70
82 | - #71
83 | - #72
84 | - #73
85 | - #74
86 | - #75
87 | - #76
88 | - #77
89 | - #78
90 | - #79
91 | - #80
92 | - #81
93 | - #82
94 | - #83
95 | - #84
96 | - #85
97 | - #86
98 | - #87
99 | - #88
100 | - #89
101 | - #90
102 | - #91
103 | - #92
104 | - #93
105 | - #94
106 | - #95
107 | - #96
108 | - #97
109 | - #98
110 | - #99
111 | - #100
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/test/unit/utils.spec.js:
--------------------------------------------------------------------------------
1 | import {$} from "../../src/utils";
2 |
3 | describe("Util Test", function() {
4 | beforeEach(() => {
5 | this.el = sandbox();
6 | });
7 | afterEach(() => {
8 | cleanup();
9 | });
10 | it("should check `$` method", () => {
11 | // Given
12 | // When
13 | const complicatedHTML = "
";
14 | const div = complicatedHTML; // string
15 | const divs = [complicatedHTML, complicatedHTML];
16 |
17 | // Then
18 | expect($(div) instanceof HTMLElement).to.be.true;
19 | expect($(divs) instanceof HTMLElement).to.be.true;
20 | expect($(divs, true).length).to.be.equal(2);
21 | expect($("#sandbox")).to.be.equal(this.el);
22 | expect(this.el).to.be.equal(this.el);
23 | });
24 | });
25 |
--------------------------------------------------------------------------------
/test/unit/visible.spec.js:
--------------------------------------------------------------------------------
1 | import Visible from "../../src/Visible";
2 |
3 | function getWindowInnerHeight() {
4 | return window.innerHeight
5 | || document.documentElement.clientHeight
6 | || document.body.clientHeight;
7 | }
8 |
9 | describe("visible", () => {
10 | let visible,
11 | windowInnerHeight,
12 | itemOffsetHeight;
13 |
14 | beforeEach(() => {
15 | document.body.innerHTML = __html__["test/unit/list.tmpl.html"];
16 | windowInnerHeight = getWindowInnerHeight();
17 | itemOffsetHeight = document.getElementsByClassName("check_visible").item(0).offsetHeight;
18 | visible = new Visible();
19 | });
20 |
21 | afterEach(() => {
22 | visible.destroy();
23 | visible = null;
24 |
25 | document.body.innerHTML = "";
26 | });
27 |
28 | describe("#check", () => {
29 | it("should have correct number of visible item", done => {
30 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
31 |
32 | if (windowInnerHeight % itemOffsetHeight === 0) {
33 | visibleItemLength++;
34 | }
35 |
36 | visible.on("change", e => {
37 | e.visible.should.have.lengthOf(visibleItemLength);
38 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
39 | done();
40 | });
41 |
42 | visible.check();
43 | });
44 |
45 | it("should have correct number of visible item with expanded size", done => {
46 | let visibleItemLength = Math.ceil((windowInnerHeight + (2 * itemOffsetHeight)) / itemOffsetHeight);
47 |
48 | if (windowInnerHeight % itemOffsetHeight === 0) {
49 | visibleItemLength++;
50 | }
51 |
52 | visible.options.expandSize = itemOffsetHeight * 2;
53 |
54 | visible.on("change", e => {
55 | e.visible.should.have.lengthOf(visibleItemLength);
56 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
57 | done();
58 | });
59 |
60 | visible.check();
61 | });
62 |
63 | it("should have correct number of visible item when scroll", done => {
64 | let visibleItems, invisibleItems;
65 |
66 | visible.check();
67 |
68 | visible.on("change", e => {
69 | visibleItems = e.visible;
70 | invisibleItems = e.invisible;
71 | });
72 |
73 | window.scrollTo(0, 250);
74 |
75 | setTimeout(() => {
76 | visible.check();
77 | visibleItems.should.have.length.above(0);
78 | invisibleItems.should.have.length.above(0);
79 | done();
80 | }, 200);
81 | });
82 | });
83 |
84 | describe("#refresh", () => {
85 | it("should have correct number of target item when element appended", () => {
86 | var targetLength = visible._targets.length;
87 |
88 | document.getElementById("contents").insertAdjacentHTML(
89 | "beforeend",
90 | `
APPEND
91 |
APPEND
92 |
APPEND`);
93 |
94 | visible._targets.should.to.have.lengthOf(targetLength + 3);
95 | });
96 | it("should have length that is not updated when element appended with targetSelector", () => {
97 | visible.destroy();
98 | visible = new Visible(document, {
99 | targetSelector: ".check_visible",
100 | });
101 |
102 | const targetLength = visible._targets.length;
103 |
104 | document.getElementById("contents").insertAdjacentHTML(
105 | "beforeend",
106 | `
APPEND
107 |
APPEND
108 |
APPEND`);
109 |
110 | visible._targets.should.to.have.lengthOf(targetLength);
111 | });
112 | });
113 | });
114 |
115 | describe("visible observe in targetContainer", () => {
116 | let visible;
117 |
118 | beforeEach(() => {
119 | document.body.innerHTML = __html__["test/unit/targetContainer.tmpl.html"];
120 | visible = new Visible(document.querySelector("#contents"), {
121 | targetContainer: document.querySelector(".container"),
122 | });
123 | window.scrollTo(0, 0);
124 | });
125 |
126 | afterEach(() => {
127 | visible.destroy();
128 | visible = null;
129 |
130 | document.body.innerHTML = "";
131 | });
132 | it("should have correct number of visible item in targetContainer", done => {
133 | visible.on("change", e => {
134 | // total: 100, document.querySelectorAll(".wrapper").children.length: 97
135 | expect(e.visible.length + e.invisible.length).to.be.equals(97);
136 | done();
137 | });
138 |
139 | visible.observe();
140 | });
141 | });
142 | describe("visible observe", () => {
143 | let visible,
144 | windowInnerHeight,
145 | itemOffsetHeight;
146 |
147 | beforeEach(() => {
148 | document.body.innerHTML = __html__["test/unit/observe.tmpl.html"];
149 | windowInnerHeight = getWindowInnerHeight();
150 | itemOffsetHeight = document.getElementsByClassName("check_visible").item(0).offsetHeight;
151 | visible = new Visible(document.querySelector("#contents"));
152 | window.scrollTo(0, 0);
153 | });
154 |
155 | afterEach(() => {
156 | visible.destroy();
157 | visible = null;
158 |
159 | document.body.innerHTML = "";
160 | });
161 |
162 | describe("#check", () => {
163 | it("should have correct number of visible item", done => {
164 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
165 | if (windowInnerHeight % itemOffsetHeight === 0) {
166 | visibleItemLength++;
167 | }
168 |
169 | visible.on("change", e => {
170 | e.visible.should.have.lengthOf(visibleItemLength);
171 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
172 | e.isTrusted.should.to.be.true;
173 | done();
174 | });
175 |
176 | visible.observe();
177 | expect(visible._observeCallback).to.be.ok;
178 |
179 | });
180 | it("should have correct number of visible item with delay", done => {
181 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
182 | let visibles = [];
183 | let invisibles = [];
184 |
185 | if (windowInnerHeight % itemOffsetHeight === 0) {
186 | visibleItemLength++;
187 | }
188 | visible.observe({delay: 50});
189 | visibles.should.have.lengthOf(0);
190 | invisibles.should.have.lengthOf(0);
191 |
192 | visible.on("change", e => {
193 | visibles = e.visible;
194 | invisibles = e.invisible;
195 |
196 | e.visible.should.have.lengthOf(visibleItemLength);
197 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
198 | done();
199 | });
200 | setTimeout(e => {
201 | visibles.should.have.lengthOf(visibleItemLength);
202 | invisibles.should.have.lengthOf(100 - visibleItemLength);
203 | }, 200);
204 | });
205 | it("should have correct number of visible item with containment", done => {
206 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
207 | visible.on("change", e => {
208 | e.visible.should.have.lengthOf(visibleItemLength);
209 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
210 | done();
211 | });
212 | setTimeout(e => {
213 | visible.observe({containment: true});
214 | });
215 | });
216 | it("should have correct number of visible item with containment2", done => {
217 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
218 |
219 | visibleItemLength--;
220 |
221 | visible.on("change", e => {
222 | e.visible.should.have.lengthOf(visibleItemLength);
223 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
224 | done();
225 | });
226 | document.querySelector("#contents").scrollTop = 10;
227 | setTimeout(e => {
228 | visible.observe({containment: true});
229 | });
230 | });
231 | it("should have correct number of visible item with expanded size", done => {
232 | let visibleItemLength = Math.ceil((windowInnerHeight + (2 * itemOffsetHeight)) / itemOffsetHeight);
233 |
234 | if (windowInnerHeight % itemOffsetHeight === 0) {
235 | visibleItemLength++;
236 | }
237 |
238 | visible.options.expandSize = itemOffsetHeight * 2;
239 |
240 | visible.on("change", e => {
241 | e.visible.should.have.lengthOf(visibleItemLength);
242 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
243 | done();
244 | });
245 |
246 | visible.observe();
247 | });
248 |
249 | it("should have correct number of visible item when scroll", done => {
250 | let visibleItems, invisibleItems;
251 |
252 | visible.observe();
253 | expect(visible._observer).to.be.ok;
254 |
255 | visible.on("change", e => {
256 | e.visible.should.have.length.above(0);
257 | e.invisible.should.have.length.above(0);
258 | e.isTrusted.should.to.be.true;
259 | done();
260 | });
261 |
262 | visible._wrapper.scrollTop = 250;
263 | });
264 | });
265 | });
266 |
267 |
268 | describe("visible observe#event", () => {
269 | let visible,
270 | windowInnerHeight,
271 | itemOffsetHeight;
272 |
273 | beforeEach(() => {
274 | document.body.innerHTML = __html__["test/unit/observe.tmpl.html"];
275 | windowInnerHeight = getWindowInnerHeight();
276 | itemOffsetHeight = document.getElementsByClassName("check_visible").item(0).offsetHeight;
277 | visible = new Visible(document.querySelector("#contents"));
278 | window.scrollTo(0, 0);
279 | });
280 |
281 | afterEach(() => {
282 | visible.destroy();
283 | visible = null;
284 |
285 | document.body.innerHTML = "";
286 | });
287 |
288 | describe("#check", () => {
289 | it("should have correct number of visible item", done => {
290 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
291 | if (windowInnerHeight % itemOffsetHeight === 0) {
292 | visibleItemLength++;
293 | }
294 |
295 | visible.on("change", e => {
296 | e.visible.should.have.lengthOf(visibleItemLength);
297 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
298 | done();
299 | });
300 | setTimeout(e => {
301 | visible._addObserveEvent();
302 | })
303 | });
304 | it("should have correct number of visible item with delay", done => {
305 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
306 | let visibles = [];
307 | let invisibles = [];
308 |
309 | if (windowInnerHeight % itemOffsetHeight === 0) {
310 | visibleItemLength++;
311 | }
312 | visible._addObserveEvent({delay: 50});
313 | visibles.should.have.lengthOf(0);
314 | invisibles.should.have.lengthOf(0);
315 |
316 | visible.on("change", e => {
317 | visibles = e.visible;
318 | invisibles = e.invisible;
319 |
320 | e.visible.should.have.lengthOf(visibleItemLength);
321 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
322 | done();
323 | });
324 | setTimeout(e => {
325 | visibles.should.have.lengthOf(visibleItemLength);
326 | invisibles.should.have.lengthOf(100 - visibleItemLength);
327 | }, 200);
328 | });
329 | it("should have correct number of visible item with containment", done => {
330 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
331 |
332 |
333 | visible.on("change", e => {
334 | e.visible.should.have.lengthOf(visibleItemLength);
335 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
336 | done();
337 | });
338 | setTimeout(e => {
339 | visible._addObserveEvent({containment: true});
340 | });
341 | });
342 | it("should have correct number of visible item with containment2", done => {
343 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
344 |
345 | visibleItemLength--;
346 |
347 | visible.on("change", e => {
348 | e.visible.should.have.lengthOf(visibleItemLength);
349 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
350 | done();
351 | });
352 | document.querySelector("#contents").scrollTop = 10;
353 | setTimeout(e => {
354 | visible._addObserveEvent({ containment: true });
355 | });
356 | });
357 | it("should have correct number of visible item with expanded size", done => {
358 | let visibleItemLength = Math.ceil((windowInnerHeight + (2 * itemOffsetHeight)) / itemOffsetHeight);
359 |
360 | if (windowInnerHeight % itemOffsetHeight === 0) {
361 | visibleItemLength++;
362 | }
363 |
364 | visible.options.expandSize = itemOffsetHeight * 2;
365 |
366 | visible.on("change", e => {
367 | e.visible.should.have.lengthOf(visibleItemLength);
368 | e.invisible.should.have.lengthOf(100 - visibleItemLength);
369 | done();
370 | });
371 |
372 | visible._addObserveEvent();
373 | });
374 |
375 | it("should have correct number of visible item when scroll", done => {
376 | let visibleItems, invisibleItems;
377 |
378 | visible._addObserveEvent();
379 |
380 | visible.on("change", e => {
381 | e.visible.should.have.length.above(0);
382 | e.invisible.should.have.length.above(0);
383 | e.isTrusted.should.to.be.true;
384 | done();
385 | });
386 |
387 | visible._wrapper.scrollTop = 250;
388 |
389 | });
390 | });
391 | });
392 |
393 | describe("iScroll", () => {
394 | let visible,
395 | iScroll;
396 |
397 | beforeEach(() => {
398 | document.body.innerHTML = __html__["test/unit/fixed.tmpl.html"];
399 | visible = new Visible();
400 | iScroll = new IScroll("#contents");
401 | });
402 |
403 | afterEach(() => {
404 | visible.destroy();
405 | visible = null;
406 |
407 | iScroll.destroy();
408 | iScroll = null;
409 |
410 | document.body.innerHTML = "";
411 | });
412 | it("should have correct number of visible item after iscroll", done => {
413 | window.scrollTo(0, 0);
414 | iScroll.scrollTo(0, 0);
415 | visible.check();
416 | visible.on("change", e => {
417 | e.visible.should.to.have.lengthOf(5);
418 | e.invisible.should.to.have.lengthOf(5);
419 | e.isTrusted.should.to.be.true;
420 | done();
421 | });
422 | iScroll.scrollTo(0, -501);
423 |
424 | setTimeout(() => {
425 | visible.check();
426 | }, 200);
427 | });
428 | });
429 |
430 | describe("contaiment visible", () => {
431 | let visible,
432 | contentsEl;
433 |
434 | beforeEach(() => {
435 | document.body.innerHTML = __html__["test/unit/list.tmpl.html"];
436 | contentsEl = document.getElementById("contents");
437 | contentsEl.classList.add("scrollable");
438 |
439 | visible = new Visible(contentsEl);
440 | });
441 |
442 | afterEach(() => {
443 | contentsEl = null;
444 |
445 | visible.destroy();
446 | visible = null;
447 |
448 | document.body.innerHTML = "";
449 | });
450 |
451 | it("should have correct number of visible item", done => {
452 | visible.on("change", e => {
453 | e.visible.should.to.have.lengthOf(5);
454 | e.visible[4].innerText.should.to.equal("#5");
455 | done();
456 | });
457 |
458 | visible.check(true);
459 | });
460 |
461 | it("should have correct number of visible item when scroll", done => {
462 | visible.check(true);
463 |
464 | visible.on("change", e => {
465 | e.visible.should.to.have.lengthOf(2);
466 | e.invisible.should.to.have.lengthOf(2);
467 | done();
468 | });
469 |
470 | contentsEl.scrollTop = 40;
471 |
472 | setTimeout(() => {
473 | visible.check(true);
474 | }, 200);
475 | });
476 | });
477 |
478 | describe("getVisibleElements", () => {
479 | let visible,
480 | windowInnerHeight,
481 | itemOffsetHeight;
482 |
483 | beforeEach(() => {
484 | document.body.innerHTML = __html__["test/unit/list.tmpl.html"];
485 | windowInnerHeight = getWindowInnerHeight();
486 | itemOffsetHeight = document.getElementsByClassName("check_visible").item(0).offsetHeight;
487 |
488 | visible = new Visible();
489 | });
490 |
491 | afterEach(() => {
492 | visible.destroy();
493 | visible = null;
494 |
495 | document.body.innerHTML = "";
496 | });
497 |
498 | it("should have 0 visible elements on init", () => {
499 | expect(visible.getVisibleElements()).to.be.empty;
500 | });
501 |
502 | it("should have same amount of visible elements as 'visible' from the change event", done => {
503 | let visibleItemLength = Math.ceil(windowInnerHeight / itemOffsetHeight);
504 |
505 | if (windowInnerHeight % itemOffsetHeight === 0) {
506 | visibleItemLength++;
507 | }
508 |
509 | visible.on("change", e => {
510 | expect(visible.getVisibleElements().length).to.equal(visibleItemLength);
511 | expect(visible.getVisibleElements().length).to.equal(e.visible.length);
512 | done();
513 | });
514 |
515 | visible.check();
516 | });
517 | });
518 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | var webpack = require("webpack");
2 | var pkg = require("./package.json");
3 | var path = require("path");
4 | var StringReplacePlugin = require("string-replace-webpack-plugin");
5 |
6 | var config = {
7 | entry: {
8 | "visible": "./src/index.js"
9 | },
10 | output: {
11 | path: path.resolve(__dirname, "dist"),
12 | filename: "[name].js",
13 | library: [pkg.namespace.eg, "Visible"],
14 | libraryTarget: "umd"
15 | },
16 | externals: {
17 | "@egjs/component" : {
18 | commonjs: "@egjs/component",
19 | commonjs2: "@egjs/component",
20 | amd: "@egjs/component",
21 | root: [pkg.namespace.eg, "Component"]
22 | }
23 | },
24 | module: {
25 | rules: [{
26 | test: /\.js$/,
27 | exclude: /node_modules/,
28 | loader: "babel-loader"
29 | },
30 | {
31 | test: /(\.js)$/,
32 | loader: StringReplacePlugin.replace({
33 | replacements: [{
34 | pattern: /#__VERSION__#/ig,
35 | replacement: function (match, p1, offset, string) {
36 | return pkg.version;
37 | }
38 | }]
39 | })
40 | }]
41 | },
42 | plugins: [
43 | new webpack.optimize.ModuleConcatenationPlugin(),
44 | new StringReplacePlugin()
45 | ]
46 | };
47 |
48 | module.exports = function (env) {
49 | env = env || "development";
50 | return require("./config/webpack.config." + env + ".js")(config);
51 | };
52 |
--------------------------------------------------------------------------------
/webpack.parts.js:
--------------------------------------------------------------------------------
1 | exports.development = function(options) {
2 | return {
3 | devServer: {
4 | publicPath: "/dist/"
5 | },
6 | devtool: "inline-source-map"
7 | }
8 | };
9 |
10 | exports.production = function(options) {
11 | return {
12 | entry: {
13 | // it will merged config.entry
14 | "visible.min": "./src/index.js"
15 | },
16 | devtool: "cheap-module-source-map"
17 | }
18 | };
19 |
20 | exports.productionPackaged = function(options) {
21 | return {
22 | entry: {
23 | "visible.pkgd": "./src/index.js",
24 | "visible.pkgd.min": "./src/index.js"
25 | },
26 | externals: {
27 | // it will overwrite config.externals
28 | }
29 | }
30 | };
31 |
--------------------------------------------------------------------------------