.fromHandlers(handleData: (event, sink) {
8 | if (lastTimer != null) {
9 | lastTimer!.cancel();
10 | }
11 | lastTimer = new Timer(duration, () => sink.add(event));
12 | });
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/kaif-fe/lib/view/htmls.dart:
--------------------------------------------------------------------------------
1 | part of view;
2 |
3 | const UriPolicy NULL_URI_POLICY = const _NullUriPolicy();
4 |
5 | class _NullUriPolicy implements UriPolicy {
6 | const _NullUriPolicy();
7 |
8 | bool allowsUri(String uri) {
9 | return true;
10 | }
11 | }
12 |
13 | const _ScriptLessValidator _SCRIPT_LESS_VALIDATOR =
14 | const _ScriptLessValidator();
15 |
16 | class _ScriptLessValidator implements NodeValidator {
17 | const _ScriptLessValidator();
18 |
19 | bool allowsElement(Element element) {
20 | return element is! ScriptElement;
21 | }
22 |
23 | bool allowsAttribute(Element element, String attributeName, String value) {
24 | return !attributeName.toUpperCase().startsWith("ON");
25 | }
26 | }
27 |
28 | /**
29 | * parse html to create element, should only used in code template, not user generated content.
30 | *
31 | * note all block, you can use delimited blocks,
3 | if you like:\''"\"\<<
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/in5.md:
--------------------------------------------------------------------------------
1 | Paragraphs are separated by a blank line.
2 |
3 | * this one
4 | * that one
5 | * the other one
6 |
7 | Paragraphs are separated by a blank line.
8 |
9 | + this one
10 | + that one
11 | + the other one
12 |
13 | Paragraphs are separated by a blank line.
14 |
15 | - this *one*
16 | - that _one_
17 | - the **other one**
18 |
19 | Paragraphs are separated by a blank line.
20 |
21 | 1. this one
22 | 2. that one
23 | 5. the other one
24 |
25 | * 1
26 | * 2
27 |
28 | 1. 1
29 | 2. 3333
30 |
31 | next list
32 |
33 | 1. This is a list item with two paragraphs. Lorem ipsum dolor
34 | sit amet, consectetuer adipiscing elit. Aliquam hendrerit
35 | mi posuere lectus.
36 |
37 | Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
38 | 123
39 |
40 | 2. Suspendisse id sem consectetuer libero luctus adipiscing.
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/in6.md:
--------------------------------------------------------------------------------
1 | As you probably guessed, indented 4 spaces. By the way, instead of
2 | indenting the block, you can use delimited blocks, if you like:
3 |
4 | define foobar() {
5 | print "Welcome to flavor country!";
6 | }
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/in7.md:
--------------------------------------------------------------------------------
1 | test inline link1 [an example1](http://example.com/ "Title")
2 | test inline link2 [an example2](http://example.com/)
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/in8.md:
--------------------------------------------------------------------------------
1 | Paragraphs are separated by a blank line.
2 |
3 |
4 |
5 | Paragraphs are separated by a blank line.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Paragraphs are separated by a blank line.
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/in9.md:
--------------------------------------------------------------------------------
1 | Paragraphs are separated by a blank line.
2 |
3 | > 2nd paragraph. *Italic*, **bold**, and `monospace`.
4 | > so?
5 | > okma?
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out1.out:
--------------------------------------------------------------------------------
1 | Paragraphs are separated by a blank line.
2 | 2nd paragraph. Italic, bold, and monospace
.23
3 | done 這是中文
4 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out10.out:
--------------------------------------------------------------------------------
1 | Paragraphs are 𠮟separated by a blank line.
2 | 2nd paragraph. 𠮟Italic, bold𠮟, and monospace
.23
3 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out11.out:
--------------------------------------------------------------------------------
1 | Paragraphs are separated by a blank line.
2 | done 這是中文
3 | 123
4 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out12.out:
--------------------------------------------------------------------------------
1 | Paragraphs are separated by a blank line.
2 | 2nd paragraph. delete me
3 | 這是中文~ok~
4 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out13.out:
--------------------------------------------------------------------------------
1 | Hi /u/koji !
2 | concat two user /u/lala/u/qoo
3 | This is not user /u/ab
4 | Long user name exceed max /u/abcdefghijklmnopqrst
5 | /u/中文不會是
6 | /u/abc中文
7 | /u/abc
8 | no nested link:qoo/u/abc1
9 | not work in code block /u/koji
10 | not work in code block /u/koji
11 |
12 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out14.out:
--------------------------------------------------------------------------------
1 | Hi /z/programming !
2 | concat two user /z/lala/z/qoo
3 | This is not user /z/ab
4 | Long user name exceed max /z/abcdefghijklmnopqrst
5 | /z/中文不會是
6 | /z/abc中文
7 | /z/abc
8 | /z/null
9 | /z/Null
10 | 不是只有null/z/nullba
11 | 大小寫/z/qooOO
12 | 大小寫/z/Qoo
13 | /z/pro-pro
14 | /z/pro--pro
15 | /z/-zzz-bbb
16 | /z/zzz-
17 | no nested link:qoo/z/abc1
18 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out2.out:
--------------------------------------------------------------------------------
1 | As you probably guessed, indented 4 spaces. By the way, instead of
2 | indenting the block, you can use delimited blocks, if you like:
3 | define foobar() {
4 | print "Welcome to flavor country!這是中文";
5 | 這是中文
6 | }
7 | <html>code</html>
8 | we should ignore link block
9 | [1]:http://www.yahoo.com
10 |
11 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out4.out:
--------------------------------------------------------------------------------
1 | As you probably guessed, indented 4 spaces. By the way, instead of
2 | indenting <span attr="evil">the</span> <script>no!!</script> block, you can use delimited blocks,
3 | if you like:\''"\"\<<
4 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out5.out:
--------------------------------------------------------------------------------
1 | Paragraphs are separated by a blank line.
2 |
3 | - this one
4 | - that one
5 | - the other one
6 |
7 | Paragraphs are separated by a blank line.
8 |
9 | - this one
10 | - that one
11 | - the other one
12 |
13 | Paragraphs are separated by a blank line.
14 |
15 | - this one
16 | - that one
17 | - the other one
18 |
19 | Paragraphs are separated by a blank line.
20 |
21 | this one
22 |
23 | that one
24 |
25 | the other one
26 |
27 | 1
28 |
29 | 2
30 |
31 | 1
32 |
33 | 3333
34 |
35 |
36 | next list
37 |
38 | This is a list item with two paragraphs. Lorem ipsum dolor
39 | sit amet, consectetuer adipiscing elit. Aliquam hendrerit
40 | mi posuere lectus.
41 | Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
42 | 123
43 |
44 | Suspendisse id sem consectetuer libero luctus adipiscing.
45 |
46 |
47 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out6.out:
--------------------------------------------------------------------------------
1 | As you probably guessed, indented 4 spaces. By the way, instead of
2 | indenting the block, you can use delimited blocks, if you like:
3 | define foobar() {
4 | print "Welcome to flavor country!";
5 | }
6 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out7.out:
--------------------------------------------------------------------------------
1 | test inline link1 [an example1](http://example.com/ "Title")
2 | test inline link2 [an example2](http://example.com/)
3 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out8.out:
--------------------------------------------------------------------------------
1 | Paragraphs are separated by a blank line.
2 | Paragraphs are separated by a blank line.
3 | Paragraphs are separated by a blank line.
4 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/kmark/out9.out:
--------------------------------------------------------------------------------
1 | Paragraphs are separated by a blank line.
2 | 2nd paragraph. Italic, bold, and monospace
.
3 | so?
4 | okma?
5 |
6 |
--------------------------------------------------------------------------------
/kaif-web/src/test/resources/logback-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | utf-8
7 | [%p] %c - %m%n
8 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include 'kaif-web', 'kaif-fe'
2 |
3 | gradle.allprojects {
4 | buildscript {
5 | repositories {
6 | mavenCentral()
7 | maven {
8 | url "https://plugins.gradle.org/m2/"
9 | }
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
4 |
5 | if [[ "$OSTYPE" == "linux-gnu" ]]; then
6 | jhome=$(dirname /usr/lib/jvm/*11*/bin)
7 | elif [[ "$OSTYPE" == "darwin"* ]]; then
8 | jhome=$(/usr/libexec/java_home -v 11)
9 | else
10 | echo "no java 11 found"
11 | exit 1
12 | fi
13 |
14 | JAVA_HOME=$jhome "$CUR_DIR"/gradlew clean test
15 |
--------------------------------------------------------------------------------
/tools/idea_settings.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kaif-open/kaif/20de04b6335c4ea5347e1445386732d4fd228636/tools/idea_settings.jar
--------------------------------------------------------------------------------