Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63224e8ce6 | ||
|
|
ff7f9568db | ||
|
|
3635dd8faf | ||
|
|
d5fda056ff | ||
|
|
d8e8d1d597 | ||
|
|
59290534bc | ||
|
|
8fb0b71be6 | ||
|
|
ddc0fc9949 | ||
|
|
5428fdbd04 | ||
|
|
98f2bfbfb6 | ||
|
|
d780d26cc9 | ||
|
|
a5711bd933 | ||
|
|
b96cde2f77 | ||
|
|
a3f3ed1298 | ||
|
|
5f34193ac7 | ||
|
|
6fe6852a0c | ||
|
|
961d143f7d | ||
|
|
0e98544a79 | ||
|
|
86d8b8dece | ||
|
|
46e2a663e9 | ||
|
|
e7fbd0095f | ||
|
|
add6fa526e | ||
|
|
47e77e9a9c | ||
|
|
81036ac997 | ||
|
|
77df883566 | ||
|
|
bfc7e3b4e9 | ||
|
|
e05fe15470 | ||
|
|
2a062a2ff5 | ||
|
|
44e7b70dbc | ||
|
|
88abefb896 | ||
|
|
06ca5e6857 | ||
|
|
c1f8d34892 | ||
|
|
5679661914 | ||
|
|
cd957cf52b | ||
|
|
fff798c1cc | ||
|
|
b464d3185e | ||
|
|
cfb68ff90f | ||
|
|
8418fca2f6 | ||
|
|
68c0baeb22 | ||
|
|
700fd846a8 | ||
|
|
72a7643cde | ||
|
|
6b0177979f | ||
|
|
7eb67fe6fa | ||
|
|
5be65e8bd4 | ||
|
|
46903a3732 | ||
|
|
c5b9b4d723 | ||
|
|
302a985aa7 | ||
|
|
21a11ec47a | ||
|
|
814f4f4b4c | ||
|
|
87eeaaf028 | ||
|
|
b44aefc384 | ||
|
|
e2c940532d | ||
|
|
66d6b3b511 | ||
|
|
f0010f320e | ||
|
|
f092530a8c | ||
|
|
11a9fa345d | ||
|
|
a1c2019960 | ||
|
|
96e17ff1db | ||
|
|
4292cf38d9 | ||
|
|
fcba1650a0 | ||
|
|
ddf1998d49 | ||
|
|
633acffd28 | ||
|
|
09ba525f2e | ||
|
|
a8cbb1590d | ||
|
|
89971d1cb5 | ||
|
|
35180d61fa | ||
|
|
8954d90ada | ||
|
|
c0d399680e | ||
|
|
528dd912d8 | ||
|
|
cb6ae0516c | ||
|
|
4e1ad9bfa8 | ||
|
|
6bea258722 | ||
|
|
554a52d548 | ||
|
|
1a17655ef1 | ||
|
|
5af2db1ff8 | ||
|
|
a8567ae9ed | ||
|
|
40925165e6 | ||
|
|
eb4942a38d | ||
|
|
5f9d8a9cc2 | ||
|
|
b67141b1ef | ||
|
|
9f69b9aa42 | ||
|
|
18cdade705 | ||
|
|
7eb8a604bd | ||
|
|
d55470f753 | ||
|
|
c4042dc475 | ||
|
|
0688c86dee | ||
|
|
d111f331ca | ||
|
|
f622f2936a | ||
|
|
4e017d3ffa | ||
|
|
2ebf0d12ed | ||
|
|
d547a9d6ea | ||
|
|
afdb028070 | ||
|
|
80d4615f32 | ||
|
|
cb7753af2a | ||
|
|
5a12a7fb31 | ||
|
|
d4bceef5b4 | ||
|
|
931082f426 | ||
|
|
333fb4ebd8 | ||
|
|
27b6319f2e | ||
|
|
70d8b2d755 | ||
|
|
17c10b8a45 | ||
|
|
f8e2c8e319 | ||
|
|
9ea82fdaaf | ||
|
|
3d01a83c85 | ||
|
|
13f8b1a10c | ||
|
|
f78e172eda | ||
|
|
bd452f90b2 | ||
|
|
2b1f150f02 | ||
|
|
e7a9457249 | ||
|
|
d3ab2e73d5 | ||
|
|
860f40ca63 | ||
|
|
59a7db56a4 | ||
|
|
01e5107a96 | ||
|
|
8765dbbe0f | ||
|
|
d125b0b95b | ||
|
|
1d2fc4b8f5 | ||
|
|
146ea115bf | ||
|
|
4f44188997 | ||
|
|
ac5fb303eb | ||
|
|
31a14997f8 | ||
|
|
4cd4ff2c5e | ||
|
|
26ef508966 | ||
|
|
28b4badb9a | ||
|
|
8e2e2420b0 | ||
|
|
67349627f4 | ||
|
|
cfe825f94a | ||
|
|
53e79915fa | ||
|
|
9fb5f688ed | ||
|
|
c2cdae0615 | ||
|
|
2516bb59a1 | ||
|
|
13c78fae58 | ||
|
|
91c0a31800 | ||
|
|
277137c8e6 | ||
|
|
4556a355a2 | ||
|
|
7dafb07438 | ||
|
|
3c8e7a1364 | ||
|
|
921cd46c10 | ||
|
|
b0f6dc4e16 | ||
|
|
1499b19575 | ||
|
|
877b867cef | ||
|
|
837808bd77 | ||
|
|
10a69f4338 | ||
|
|
7bc603f380 | ||
|
|
6c1cc6fc96 | ||
|
|
ed9def985e | ||
|
|
be57c3ab5b | ||
|
|
809a004a60 | ||
|
|
6129805194 | ||
|
|
06475f2050 | ||
|
|
b6f8f9be75 | ||
|
|
cc524592c4 | ||
|
|
53bca4e178 | ||
|
|
e060b2936f | ||
|
|
deb0e89240 | ||
|
|
5951ce2aef | ||
|
|
16b95b8132 | ||
|
|
69d5fb1d64 | ||
|
|
dfaf3a6667 | ||
|
|
0a3b594446 | ||
|
|
fa08fd6703 | ||
|
|
01c0d14396 | ||
|
|
5176890ff3 | ||
|
|
029915f2f9 | ||
|
|
2a0f481b42 | ||
|
|
4089001d99 | ||
|
|
30f01a2e79 | ||
|
|
aacbb5cef8 | ||
|
|
bf89d42c00 | ||
|
|
fae29bf0e1 | ||
|
|
b0f6f29de5 | ||
|
|
a6baead531 | ||
|
|
31a5e28f9a | ||
|
|
173d669206 | ||
|
|
d129539e62 | ||
|
|
58e02c6f24 | ||
|
|
6203fcb852 | ||
|
|
62b59a023d | ||
|
|
faeecbfc94 | ||
|
|
7f11ec177a | ||
|
|
ceae454386 | ||
|
|
cd7dd52002 | ||
|
|
82950a621c | ||
|
|
b885f7e2b6 | ||
|
|
af073a2af1 | ||
|
|
59c758368a | ||
|
|
69ef29bc2d | ||
|
|
2baa1af264 | ||
|
|
f96f89b14d | ||
|
|
fceb9a57ce | ||
|
|
3bb31b1f09 | ||
|
|
def5ba3d4f | ||
|
|
dbf2202630 | ||
|
|
11d0c28f91 | ||
|
|
59c3c981d3 | ||
|
|
1b91e746ca | ||
|
|
f171777da5 | ||
|
|
5b32e3e2a9 | ||
|
|
832a603939 | ||
|
|
79bd1d2e24 | ||
|
|
44aa9483a4 | ||
|
|
cbcc9bc8ff | ||
|
|
a9d20cf3b4 | ||
|
|
af202868bc | ||
|
|
cd30382c0e | ||
|
|
e724e13564 | ||
|
|
fd000fe35b | ||
|
|
099e02fe64 | ||
|
|
6a1d83b2f4 | ||
|
|
74cb6c3de6 | ||
|
|
31904d58bd | ||
|
|
a51d087797 | ||
|
|
b5039a5a6e | ||
|
|
a634ff7954 | ||
|
|
0b501612ad | ||
|
|
9729005fff | ||
|
|
ca85afeb2f | ||
|
|
b7f46c969f | ||
|
|
866d6c6db4 | ||
|
|
a68ac572ab | ||
|
|
085b4a0d15 | ||
|
|
c87482bdee | ||
|
|
6097a00bf1 | ||
|
|
ac3e1fc84d | ||
|
|
8cff939fb6 | ||
|
|
dd7609a22a | ||
|
|
fecac08fc7 | ||
|
|
735357da1d | ||
|
|
72ca29694a | ||
|
|
d61bbc6a5f | ||
|
|
1f9071d5df | ||
|
|
27229ea979 | ||
|
|
ab29b42fbb | ||
|
|
e1d906256d | ||
|
|
9526edc49d | ||
|
|
761d7fd824 | ||
|
|
5036e36083 | ||
|
|
a7d4c5297e | ||
|
|
013d9090f4 | ||
|
|
b13c2cf6e3 | ||
|
|
a122215b41 | ||
|
|
5ebf93e453 | ||
|
|
4d46477bee | ||
|
|
49ff414c5c | ||
|
|
44f5c0c824 | ||
|
|
9aee01df62 | ||
|
|
13c782eaa6 | ||
|
|
72b3092ef6 | ||
|
|
03942ba38f | ||
|
|
c997192277 | ||
|
|
aebb331fe7 | ||
|
|
dafbc17826 | ||
|
|
cc3da8a50e | ||
|
|
137b4ed75a | ||
|
|
a6a678bf4a | ||
|
|
1d83daa068 | ||
|
|
0bf787ae5e | ||
|
|
d70a13e412 | ||
|
|
8dc8c49dec | ||
|
|
cd704f74bb | ||
|
|
f18b264ca1 | ||
|
|
5bdfbc98dd | ||
|
|
52c8629f4b | ||
|
|
92fc9a6dce | ||
|
|
02d616aaa3 | ||
|
|
5cef463dcf | ||
|
|
e7ce778121 | ||
|
|
667009318e | ||
|
|
838a1ffc82 | ||
|
|
4ce6d03d89 | ||
|
|
24c9f999e1 | ||
|
|
17ee260e3c | ||
|
|
db2469f109 | ||
|
|
7c47619e2f | ||
|
|
ca0bbac685 | ||
|
|
b82f46352d | ||
|
|
b9fc2a66c7 | ||
|
|
24bed97a51 | ||
|
|
2f43c11c94 | ||
|
|
70a1fbfd41 | ||
|
|
1ffd110d05 | ||
|
|
cbf550afbe | ||
|
|
bf6cf86987 | ||
|
|
eacb4638a1 | ||
|
|
b9d681295f | ||
|
|
a767799b36 | ||
|
|
05a41b12ce | ||
|
|
19a0a905a5 | ||
|
|
a626c213a7 | ||
|
|
cc0014f42a | ||
|
|
458779467d | ||
|
|
07f74c6362 | ||
|
|
202cad5424 | ||
|
|
31c1e9468c | ||
|
|
a08cd3e8ff | ||
|
|
c06c207b68 | ||
|
|
371a4780e8 | ||
|
|
300e735a38 | ||
|
|
97abd5f3b0 | ||
|
|
6b5c8aab83 | ||
|
|
c5fa97cb2b | ||
|
|
cb80f91a4a | ||
|
|
6acc116341 | ||
|
|
fa47b873c8 | ||
|
|
1303b657c7 | ||
|
|
63adb9a6c4 | ||
|
|
62840d6e40 | ||
|
|
de7deeddf8 | ||
|
|
f5f6f365f9 | ||
|
|
d43bea6713 | ||
|
|
5f9b7734b1 | ||
|
|
301d449147 | ||
|
|
a4e0fb34c2 | ||
|
|
ee9ac8f267 | ||
|
|
1437c4d8c4 | ||
|
|
cbddfb5cdf | ||
|
|
bbd149b39f | ||
|
|
c9aa8020a7 | ||
|
|
80279a8d8d | ||
|
|
ae2d800b0b | ||
|
|
07aa9843f3 | ||
|
|
34cd24886e | ||
|
|
f17270291e | ||
|
|
db957fc489 | ||
|
|
bc03ef84fc | ||
|
|
5d67db3bfd | ||
|
|
21b1b0fa48 | ||
|
|
1d14949e17 | ||
|
|
18601c4f72 | ||
|
|
9d9190584e | ||
|
|
7936ab8ef9 | ||
|
|
93b9b4dfbe | ||
|
|
5b120cd64f | ||
|
|
f0bcef14b0 | ||
|
|
fc8690a146 | ||
|
|
6a297d854b | ||
|
|
c9d69c0219 | ||
|
|
d162499e73 | ||
|
|
70a8284cb5 | ||
|
|
9228204722 | ||
|
|
d1525cf6ec | ||
|
|
cef7d64d97 | ||
|
|
4f1d6e6f31 | ||
|
|
f3ac3a8740 | ||
|
|
e332a4f441 | ||
|
|
e964ff8b6f | ||
|
|
e5fd451b9d | ||
|
|
f9940825a1 | ||
|
|
fd857b15f6 | ||
|
|
3421447d7f | ||
|
|
ab58af3c87 | ||
|
|
8fe821ed0c | ||
|
|
6448518ce0 | ||
|
|
343bb984f3 | ||
|
|
dee4e6a980 | ||
|
|
05f3e01ece | ||
|
|
56dcaff236 | ||
|
|
9a86f4f0f3 | ||
|
|
90931657e4 | ||
|
|
c49ae3df04 | ||
|
|
8121e2b99c | ||
|
|
aa644ceeb0 | ||
|
|
28cfd0a0f2 | ||
|
|
030304a6eb | ||
|
|
85e689462f | ||
|
|
ad29ebe866 | ||
|
|
f391c9cf22 | ||
|
|
e4d8c4ea17 | ||
|
|
0d663507e6 | ||
|
|
c4f7c49846 | ||
|
|
2cdcdaf932 | ||
|
|
61d81c01c4 | ||
|
|
2e2bf0c01b | ||
|
|
8d97fe3d26 | ||
|
|
1585af5efb | ||
|
|
17dcd836dd | ||
|
|
ff479a0a63 | ||
|
|
9acdad2736 | ||
|
|
ce62a7e679 | ||
|
|
f8bd8c274c | ||
|
|
e132ccbd51 | ||
|
|
dd582c61e9 | ||
|
|
39ba6f2357 | ||
|
|
8fbab4d505 | ||
|
|
5b94e8f4aa | ||
|
|
b618811d2a | ||
|
|
10b5eccc73 | ||
|
|
d4281194c9 | ||
|
|
87c9a4373a | ||
|
|
567ee5f379 | ||
|
|
a71998def0 | ||
|
|
aeb15317e0 | ||
|
|
9c1702f5c3 | ||
|
|
a3222f601a | ||
|
|
c6a3a8f61a | ||
|
|
08214d72d9 | ||
|
|
182192857f | ||
|
|
856b6d658e | ||
|
|
146d83583d | ||
|
|
991f07909c | ||
|
|
8e81e44b24 | ||
|
|
ad2f177592 | ||
|
|
ae4d9dab10 | ||
|
|
237ace5f7f | ||
|
|
438e198e53 | ||
|
|
90069aacda | ||
|
|
db9ff09ae7 | ||
|
|
44670d8bb4 | ||
|
|
a7828d7904 | ||
|
|
7d0bda7e87 | ||
|
|
b0e9140508 | ||
|
|
349aa6c0a5 | ||
|
|
7220c78581 | ||
|
|
1caea9313a | ||
|
|
ba7662910a | ||
|
|
b41b278535 | ||
|
|
58d8328899 | ||
|
|
ee102fbfe8 | ||
|
|
9db6ebf4f6 | ||
|
|
fbf3a20918 | ||
|
|
773d07b3dc | ||
|
|
8be4d06245 | ||
|
|
ae567462d3 | ||
|
|
5eacefb581 | ||
|
|
2c81a44fab | ||
|
|
2af872da5a | ||
|
|
2c622a7f62 | ||
|
|
7e67f495e0 | ||
|
|
51a7496f2e | ||
|
|
8526722ac8 | ||
|
|
6cb91ab60d | ||
|
|
c0600a9e2e | ||
|
|
99d73e03a5 | ||
|
|
275cc3bfb4 | ||
|
|
eb2c0e6ca1 | ||
|
|
df4d8a5238 | ||
|
|
a2566ef7ab | ||
|
|
d3c723666a | ||
|
|
f8362986c7 | ||
|
|
788b9e317f | ||
|
|
0e4aa6a395 | ||
|
|
8a011cf3ac | ||
|
|
ab9a35b541 | ||
|
|
8fb1a954ba | ||
|
|
be13a8edec | ||
|
|
26c8fcd5b3 | ||
|
|
487cfc1cf7 | ||
|
|
60792d943f | ||
|
|
0019dad19c | ||
|
|
abeb4541fe | ||
|
|
c4c331d645 | ||
|
|
2be04b667c | ||
|
|
18bed27bae | ||
|
|
30a570538b | ||
|
|
6faacfbf36 | ||
|
|
215cefd1e0 | ||
|
|
6aa0ff50b2 | ||
|
|
b63e8994e4 | ||
|
|
61f5522661 | ||
|
|
ccdbb9a588 | ||
|
|
8b7a638e9f | ||
|
|
182b385734 | ||
|
|
a340de8c1e | ||
|
|
cb7a7cec29 | ||
|
|
e6271dd5f1 | ||
|
|
2d59e86ab9 | ||
|
|
73565a4718 | ||
|
|
f52b7def1d | ||
|
|
50f305ec64 | ||
|
|
44985f0076 | ||
|
|
71407b4c6d | ||
|
|
839c3fbeff | ||
|
|
7194188e2f | ||
|
|
8d7f6b7b7f | ||
|
|
d2ade8afb1 | ||
|
|
60d0812f77 | ||
|
|
b192634946 | ||
|
|
87ea056565 | ||
|
|
c127dff8e6 | ||
|
|
124c85a5ce | ||
|
|
24067bfc37 | ||
|
|
e020d5a6e2 | ||
|
|
5ce5b5672b | ||
|
|
41c3f6a0b4 | ||
|
|
abf138c842 | ||
|
|
a208e8cc9f | ||
|
|
7a9cf045de | ||
|
|
94a33dc47f | ||
|
|
3a9f328ab2 | ||
|
|
650fec547b | ||
|
|
92c33f6a2b | ||
|
|
67424d941a | ||
|
|
be842ecfa9 | ||
|
|
0f2f6a35f4 | ||
|
|
5ebaab4ac1 | ||
|
|
79ac2cf607 | ||
|
|
bf3d345ce5 | ||
|
|
5add14bf68 | ||
|
|
32275c00d7 | ||
|
|
f79aea6255 | ||
|
|
c2ecb2fe5d | ||
|
|
e0d3d99be0 | ||
|
|
8004dc81f4 | ||
|
|
1e5831969b | ||
|
|
460b76f527 | ||
|
|
8d46c57985 | ||
|
|
a182d322c6 | ||
|
|
30f0215dc6 | ||
|
|
bb7715445a | ||
|
|
50e336bc3a | ||
|
|
b8e423b24a | ||
|
|
63ca73d6f0 | ||
|
|
cd14782641 | ||
|
|
786fffe269 | ||
|
|
f8c20760d5 | ||
|
|
49c189547b | ||
|
|
1be0f3f468 | ||
|
|
acbdeca03b | ||
|
|
0eb0619c0c | ||
|
|
a7cc24254b | ||
|
|
b60452ef47 | ||
|
|
38828c9ece | ||
|
|
fdad44315f | ||
|
|
5c3d2edf3b | ||
|
|
af2ae42fdf | ||
|
|
848f021f71 | ||
|
|
c5b88a557d | ||
|
|
51eca64fde | ||
|
|
8fc93db229 | ||
|
|
27535b032d | ||
|
|
569bf16977 | ||
|
|
7a0f6eafb7 | ||
|
|
927e30eb45 | ||
|
|
e34bdb5d67 | ||
|
|
40d1ff9d17 | ||
|
|
2d95327a79 | ||
|
|
44697f5544 | ||
|
|
1a58701d57 | ||
|
|
59f8362f75 | ||
|
|
324b71c3af | ||
|
|
70f34e4532 | ||
|
|
d1065178bd | ||
|
|
b0ac67a8f6 | ||
|
|
9643086b34 | ||
|
|
8c19075f82 | ||
|
|
db715021bf | ||
|
|
31c26dc03d | ||
|
|
988ee82496 | ||
|
|
207105a21e | ||
|
|
6566b2d2ed | ||
|
|
773b19d373 | ||
|
|
5ec22132a3 | ||
|
|
1b7bbfaf95 | ||
|
|
cadf0e946a | ||
|
|
dd7aff8136 | ||
|
|
89e158cd1d | ||
|
|
b4fe6720ae | ||
|
|
2a85fb099b | ||
|
|
317efea09b | ||
|
|
59095ca11f | ||
|
|
d3d77e3c84 | ||
|
|
ec96eaef74 | ||
|
|
e7565845a0 | ||
|
|
2888983036 | ||
|
|
1bad215015 | ||
|
|
1940ec2eba | ||
|
|
a7021bece2 | ||
|
|
dd7fc3a856 | ||
|
|
531e6bd15d | ||
|
|
a8a10d6d08 | ||
|
|
a974c90dcf | ||
|
|
fa755a64d9 | ||
|
|
0c013f6b59 | ||
|
|
5abfa27f3f | ||
|
|
42594fd66f | ||
|
|
73d03cd48c | ||
|
|
42c36bd295 | ||
|
|
9a85a132ae | ||
|
|
ec45a1a942 | ||
|
|
b28d155f0e | ||
|
|
6017e749eb | ||
|
|
9ebab678c6 | ||
|
|
182bbbdcc2 | ||
|
|
a449c4ede5 | ||
|
|
c633ab450a | ||
|
|
afa96da8e9 | ||
|
|
1e8c9e89f3 | ||
|
|
ebee894b59 | ||
|
|
ad8c1165b7 | ||
|
|
480ea80ed8 | ||
|
|
3407cf6584 | ||
|
|
d218b052a1 | ||
|
|
d955af59af | ||
|
|
8666d3520e | ||
|
|
363aa2ff97 | ||
|
|
ddc7f81c00 | ||
|
|
4b94fe637d | ||
|
|
917d2087c5 | ||
|
|
c4bff4437f | ||
|
|
c25f337ffe | ||
|
|
81fa9b1984 | ||
|
|
768b49224c | ||
|
|
92757a4e2b | ||
|
|
81495f7cca | ||
|
|
cdf8ee8d85 | ||
|
|
ec4a55fc9e | ||
|
|
e3728da256 | ||
|
|
474af626f0 | ||
|
|
198dc8e0cd | ||
|
|
29f0428889 | ||
|
|
8cab6b8ac0 | ||
|
|
5a3a316658 | ||
|
|
7564f5f671 | ||
|
|
51e510e30f | ||
|
|
a2cd373b3e | ||
|
|
e311da3441 | ||
|
|
fd833be535 | ||
|
|
b5056b04f8 | ||
|
|
c8cb3c94ef | ||
|
|
b632970960 | ||
|
|
285811f852 | ||
|
|
b980d32d02 | ||
|
|
37c2441507 | ||
|
|
bb78217f44 | ||
|
|
b0d8a0f0c7 | ||
|
|
47890a8454 | ||
|
|
a526dfe774 | ||
|
|
97ba1379d7 | ||
|
|
578352d500 | ||
|
|
318e8046ba | ||
|
|
24077f802b | ||
|
|
3ce0c30b68 | ||
|
|
ffa08817ea | ||
|
|
867c99469c | ||
|
|
1d38b87719 | ||
|
|
9682f4a6e3 | ||
|
|
1509559e78 | ||
|
|
c3be2e5f8a | ||
|
|
545e304a73 | ||
|
|
08f813d670 | ||
|
|
4c2fba134d | ||
|
|
5dd452554e | ||
|
|
e055c3af7e | ||
|
|
7e245e3fbe | ||
|
|
f01f74ed61 | ||
|
|
4b2afc8ae1 | ||
|
|
ad61a61d91 | ||
|
|
676dc2e377 | ||
|
|
5f9615bd10 | ||
|
|
4b00c2eb30 | ||
|
|
85643ae55e | ||
|
|
215fd658f1 | ||
|
|
19f754704c | ||
|
|
d04f2ff502 | ||
|
|
9b9e64e9ef | ||
|
|
d4a2411eac | ||
|
|
e7724f9017 | ||
|
|
4a0bc28b09 | ||
|
|
d1660cf0c1 | ||
|
|
cb0856f70a | ||
|
|
5f6fd16e84 | ||
|
|
4310d3e2d6 | ||
|
|
7b303deade | ||
|
|
54f55a9b75 | ||
|
|
234c926d98 | ||
|
|
c0ba74dd88 | ||
|
|
98c19740a2 | ||
|
|
ebc27cbc46 | ||
|
|
377d3a9ff3 | ||
|
|
4f15c03686 | ||
|
|
6af173c853 | ||
|
|
4a24523c10 | ||
|
|
a2a1e95c96 | ||
|
|
4d043acfff | ||
|
|
71b024297d | ||
|
|
9e2bb2c08a | ||
|
|
5d6b4842ba | ||
|
|
ca2fe00933 | ||
|
|
4753ebe958 | ||
|
|
29268fc91f | ||
|
|
09291e0df2 | ||
|
|
2444b5c587 | ||
|
|
bf3770dc98 | ||
|
|
484b8e5cc9 | ||
|
|
4c9967e17e | ||
|
|
fa91475836 | ||
|
|
afedd8c235 | ||
|
|
c75ef1af4f | ||
|
|
73f447167e | ||
|
|
cccc6565eb | ||
|
|
6c2030f820 | ||
|
|
ba2702c0d2 | ||
|
|
31b1334720 | ||
|
|
1326b38e6f | ||
|
|
afc47e180e | ||
|
|
f463de5a45 | ||
|
|
8829780def | ||
|
|
a302d52698 | ||
|
|
00087198e0 | ||
|
|
ea3aa62476 | ||
|
|
176c9f4ad9 | ||
|
|
0fdab02d68 | ||
|
|
131eda75a6 | ||
|
|
0fcb5f2ccd | ||
|
|
27287d246a | ||
|
|
2234cd245c | ||
|
|
c5980cd312 | ||
|
|
4e8dbffd0e | ||
|
|
50dcd7a572 | ||
|
|
35f1cca768 | ||
|
|
e5bde6c0b1 | ||
|
|
d31bba2670 | ||
|
|
4f806a1db9 | ||
|
|
f64232df30 | ||
|
|
ecc2f0004c | ||
|
|
4f2e327d33 | ||
|
|
3ce3171dff | ||
|
|
0850cadfdc | ||
|
|
53a5a44def | ||
|
|
ad1d414485 | ||
|
|
ba22f9a3a5 | ||
|
|
51de1740f9 | ||
|
|
1c012b92d5 | ||
|
|
7377922211 | ||
|
|
fae120f1ea | ||
|
|
a915054602 | ||
|
|
c741fc4a6b | ||
|
|
ad718b48e8 | ||
|
|
dd97b9c8dd | ||
|
|
d1e25796e9 | ||
|
|
e38cfc5767 | ||
|
|
69c888d071 | ||
|
|
9b4888e6d7 | ||
|
|
0138b1782d | ||
|
|
9b1b9e73c5 | ||
|
|
0fc60eedfb | ||
|
|
9e19833421 | ||
|
|
31318340e2 | ||
|
|
6cef27e69c | ||
|
|
4f6ab86491 | ||
|
|
4147867098 | ||
|
|
a0dead1586 | ||
|
|
0afc18fd24 | ||
|
|
9f695c783e | ||
|
|
15263ea1d6 | ||
|
|
693c5cd5e4 | ||
|
|
cc3f045efa | ||
|
|
43806a26e7 | ||
|
|
cb4c4b3eb5 | ||
|
|
39558267b9 | ||
|
|
59a3c5a6e6 | ||
|
|
2c9eeccc0e | ||
|
|
7576d85dba | ||
|
|
579f0d752f | ||
|
|
65e9cc2127 | ||
|
|
dc2fd49ecb | ||
|
|
a380ae69d5 | ||
|
|
0b84911d38 | ||
|
|
e64c556f84 | ||
|
|
18644e027e | ||
|
|
65642c029c | ||
|
|
11540a6132 | ||
|
|
a6e728316b | ||
|
|
4cb5e3c674 | ||
|
|
d918a6b2e2 | ||
|
|
d721451d15 | ||
|
|
c5aaebd4a8 | ||
|
|
4c1dbf4e40 | ||
|
|
c20c055788 | ||
|
|
44c13f9fa3 | ||
|
|
ae44a9e0ac | ||
|
|
97ba47f339 | ||
|
|
8671b897d0 | ||
|
|
1a3361a1bb | ||
|
|
9ac438d05a | ||
|
|
18e45ab994 | ||
|
|
f00090846e | ||
|
|
6590de030c | ||
|
|
714fcc5202 | ||
|
|
becc947556 | ||
|
|
d547a955ac | ||
|
|
97e0736d8e | ||
|
|
20db6daa65 | ||
|
|
3aefb5f6de | ||
|
|
30818cdf5e | ||
|
|
4089cf2145 | ||
|
|
d7893c5292 | ||
|
|
cdd3f6ed00 | ||
|
|
e44254346c | ||
|
|
adf82c1267 | ||
|
|
4d98b72702 | ||
|
|
f02240acd3 | ||
|
|
cabef57851 | ||
|
|
98ad12a06c | ||
|
|
d454eb2fe7 | ||
|
|
0facbe04ef | ||
|
|
8f9f4aae32 | ||
|
|
d5bfaf83ee | ||
|
|
9e46c3cbc4 | ||
|
|
d431206e30 | ||
|
|
6adfb8b944 | ||
|
|
0c8ccaac9a | ||
|
|
4f0ee4543b | ||
|
|
1383d13334 | ||
|
|
1b260c4b84 | ||
|
|
0ff586a1ca | ||
|
|
95adb233f7 | ||
|
|
e7f2e494af | ||
|
|
ded9e5886d | ||
|
|
d2757294af | ||
|
|
39da6a68fe | ||
|
|
8e4bc72fca | ||
|
|
bc481e954c | ||
|
|
e4ba924dc1 | ||
|
|
193510b57d | ||
|
|
88ad882d83 | ||
|
|
a90c4f7953 | ||
|
|
0c2d97b9db | ||
|
|
1c77fdd9e1 | ||
|
|
681bc9755e | ||
|
|
31e992696c | ||
|
|
813411a408 | ||
|
|
1702d1ac1f | ||
|
|
022a2af8b1 | ||
|
|
d46d16bc2b | ||
|
|
ae3ff2313d | ||
|
|
669586f15e | ||
|
|
46fbcc8d22 | ||
|
|
178f94af8c | ||
|
|
2f6b3a0bda | ||
|
|
97b70eff9f | ||
|
|
3efa77b57a | ||
|
|
48977ba04c | ||
|
|
94e3271481 | ||
|
|
04f6e7ee38 | ||
|
|
15c9e685c8 | ||
|
|
b00463bdf4 | ||
|
|
c17e642f1f | ||
|
|
a2e118ec50 | ||
|
|
45bda63ed3 | ||
|
|
c909af4a86 | ||
|
|
b5a7c7e30f | ||
|
|
6594e7a607 | ||
|
|
4d8dedeb27 | ||
|
|
b0e3e386e7 | ||
|
|
ad4870e338 | ||
|
|
c1f0bc3a6d | ||
|
|
887d4cc136 | ||
|
|
bbe787b7b4 | ||
|
|
7341988b01 | ||
|
|
44eb880108 | ||
|
|
c01f860009 | ||
|
|
f9315a8cc7 | ||
|
|
40918f44fd | ||
|
|
9fdb586d03 | ||
|
|
448c398341 | ||
|
|
618c322603 | ||
|
|
b5c9ed633b | ||
|
|
80342a22f5 | ||
|
|
c999b16a27 | ||
|
|
9bda793d46 | ||
|
|
5e9fbdd24f | ||
|
|
446e641e64 | ||
|
|
7d53ec6d71 | ||
|
|
7b0cf5bc12 | ||
|
|
a82034d516 | ||
|
|
4973361136 | ||
|
|
3b69d4bf7b | ||
|
|
fd5e14ea0d | ||
|
|
9fc3b2bc26 | ||
|
|
19cc977917 | ||
|
|
ce481d9002 | ||
|
|
2421a31b25 | ||
|
|
94c79820b9 | ||
|
|
80b38a743f | ||
|
|
af01b45852 | ||
|
|
a2de6f12d1 | ||
|
|
2af81d2e7a | ||
|
|
0f691f2757 | ||
|
|
be021db3d3 | ||
|
|
acd0ebd09d | ||
|
|
3d5e594070 | ||
|
|
58247e3d6b | ||
|
|
9f35635233 | ||
|
|
2119bacd22 | ||
|
|
d55fab540c | ||
|
|
1344c50f85 | ||
|
|
e8d97f5706 | ||
|
|
35704f3527 | ||
|
|
96fb5b0755 | ||
|
|
81f017a7c0 | ||
|
|
aca3d43f0a | ||
|
|
5a898cc80a | ||
|
|
bfb3a320bd | ||
|
|
c0b1e387b1 | ||
|
|
c175e6340d | ||
|
|
3a5f7b05df | ||
|
|
26babd7e96 | ||
|
|
349088a96e | ||
|
|
a4ff77bdb9 | ||
|
|
8f70d3a802 | ||
|
|
89021b6409 | ||
|
|
4a078705b3 | ||
|
|
6eea834777 | ||
|
|
b863ff048e | ||
|
|
79a4693f34 | ||
|
|
0f0a62ef7f | ||
|
|
cc8a21aedf | ||
|
|
38fff6fb91 | ||
|
|
e87a2bf0d5 | ||
|
|
6b3cdb5a99 | ||
|
|
e2191175da | ||
|
|
4a7f15bb04 | ||
|
|
e6c58c3c6f | ||
|
|
bb2407b468 | ||
|
|
07e809acb3 | ||
|
|
7714b5dc7b | ||
|
|
ca85d9adab | ||
|
|
41a9f12024 | ||
|
|
669691bbea | ||
|
|
6ac38e7c56 | ||
|
|
359758804b | ||
|
|
9400a0c7a1 | ||
|
|
ea34d1b3a0 | ||
|
|
72e9921901 | ||
|
|
d6af8279bc | ||
|
|
cd005b01c0 | ||
|
|
fa04c23bbf | ||
|
|
6ecc09f286 | ||
|
|
4b0f6aff73 | ||
|
|
c451f57d4e | ||
|
|
721cb2b90a | ||
|
|
01d5302a2d | ||
|
|
706324b9c6 | ||
|
|
244d3c68eb | ||
|
|
fcfa8aa917 | ||
|
|
8438a432e9 | ||
|
|
9d5e0b24f7 | ||
|
|
4480acd6f7 | ||
|
|
cd1ce28639 | ||
|
|
bf5fbd8b09 | ||
|
|
515e284c22 | ||
|
|
f98548827a | ||
|
|
b67e57f275 | ||
|
|
7005fb655c | ||
|
|
b9189771d0 | ||
|
|
b15211064d | ||
|
|
30ea9ac56b | ||
|
|
dab4950f14 | ||
|
|
0fce3655d5 | ||
|
|
91504fbc2c | ||
|
|
4b17684980 | ||
|
|
675245eb15 | ||
|
|
3494fa2d0d | ||
|
|
87a593845c | ||
|
|
b9d80fcdc7 | ||
|
|
3f7d085f73 | ||
|
|
d57dd72780 | ||
|
|
a8d1d5cfcf | ||
|
|
8857e3d521 | ||
|
|
3b1a5be1be | ||
|
|
c9a63a8524 | ||
|
|
cd967d2551 | ||
|
|
92b5247f9f | ||
|
|
45a5b436c8 | ||
|
|
bfd385f969 | ||
|
|
f693fe6b2a | ||
|
|
b040159a9b | ||
|
|
f3af2a1999 | ||
|
|
f613a4cc99 | ||
|
|
e4a96125a6 | ||
|
|
e48074ff54 | ||
|
|
2ed122a534 | ||
|
|
65c0d9b18b | ||
|
|
6702694590 | ||
|
|
6f0d4d039e | ||
|
|
1325b0e48f | ||
|
|
7421eb8068 | ||
|
|
6c7a9a4030 | ||
|
|
ba0a143717 | ||
|
|
28bcb5ed6c | ||
|
|
44fd637a1f | ||
|
|
f13aed1a84 | ||
|
|
cb3de825f2 | ||
|
|
fd4c775710 | ||
|
|
3e550b3e97 | ||
|
|
7a543250f9 | ||
|
|
a071f07634 | ||
|
|
a078f860d2 | ||
|
|
2bfd7a2467 | ||
|
|
55c9392de4 | ||
|
|
7991b555ff | ||
|
|
eab7815c24 | ||
|
|
79c09de103 | ||
|
|
24daa335b6 | ||
|
|
812ba9d52b | ||
|
|
00fb3b56cc | ||
|
|
3644d081f6 | ||
|
|
f05c46b3f1 | ||
|
|
13e76fe278 | ||
|
|
0906ae28c1 | ||
|
|
04905adb89 | ||
|
|
9767109d4e | ||
|
|
a57919bc4d | ||
|
|
c7c94d1f8f | ||
|
|
817e6c3313 | ||
|
|
a23f4c5c88 | ||
|
|
eac9768549 | ||
|
|
a42fb6b558 | ||
|
|
879e825b61 | ||
|
|
07f4310153 | ||
|
|
10c67e5be3 | ||
|
|
1279d5ddaa | ||
|
|
2af15e4b27 | ||
|
|
3096fcf045 | ||
|
|
831492448a | ||
|
|
a5284e846c | ||
|
|
22accaced3 | ||
|
|
f92d97f36e | ||
|
|
4f0a16a24c | ||
|
|
72dade793a | ||
|
|
8addc54015 | ||
|
|
25ab6f9a07 | ||
|
|
b853f72e0c | ||
|
|
449a658521 | ||
|
|
7776a22533 | ||
|
|
554eccc14a | ||
|
|
8cd6928da3 | ||
|
|
8c28be1041 | ||
|
|
810aa8f4f3 | ||
|
|
8e5be952bf | ||
|
|
5a560fee8a | ||
|
|
21819ffc5d | ||
|
|
1f8bdd6061 | ||
|
|
523c813439 | ||
|
|
7ee638bc36 | ||
|
|
76c515d3af | ||
|
|
1c8ce00657 | ||
|
|
0f4bbecd2a | ||
|
|
e292f5a869 | ||
|
|
da25c6f843 | ||
|
|
5122fbe110 | ||
|
|
dee3a3b655 | ||
|
|
4e2bcd22d9 | ||
|
|
17890027a6 | ||
|
|
5e93804525 | ||
|
|
778070dd8a | ||
|
|
74ecc762f3 | ||
|
|
63f7b35cf8 | ||
|
|
0c3f4601cc | ||
|
|
101b74398f |
@@ -53,3 +53,6 @@ applications/examples/static/epydoc
|
|||||||
applications/examples/static/sphinx
|
applications/examples/static/sphinx
|
||||||
applications/admin/cron/cron.master
|
applications/admin/cron/cron.master
|
||||||
HOWTO-web2py-devel
|
HOWTO-web2py-devel
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
||||||
|
.idea/*
|
||||||
|
|||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
language: python
|
||||||
|
|
||||||
|
python:
|
||||||
|
- '2.5'
|
||||||
|
- '2.6'
|
||||||
|
- '2.7'
|
||||||
|
- 'pypy'
|
||||||
|
install:
|
||||||
|
- pip install -e .
|
||||||
|
env:
|
||||||
|
- DB=sqlite:memory
|
||||||
|
- DB=mysql://root:@localhost/test_w2p
|
||||||
|
- DB=postgres://postgres:@localhost/test_w2p
|
||||||
|
before_script:
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then pip install unittest2; fi
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install coverage; fi;
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install python-coveralls; fi
|
||||||
|
- if [[ $DB == postgres* ]]; then pip install psycopg2; fi;
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.5' ]]; then pip install pysqlite; fi
|
||||||
|
- if [[ $DB == mysql* ]]; then mysql -e 'create database test_w2p;'; fi
|
||||||
|
- if [[ $DB == postgres* ]]; then psql -c 'create database test_w2p;' -U postgres; fi
|
||||||
|
#Temporal solution to travis issue #155
|
||||||
|
- sudo chmod 777 /dev/shm
|
||||||
|
- sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm
|
||||||
|
matrix:
|
||||||
|
exclude:
|
||||||
|
- python: 'pypy'
|
||||||
|
env: DB=postgres://postgres:@localhost/test_w2p
|
||||||
|
- python: 'pypy'
|
||||||
|
env: DB=mysql://root:@localhost/test_w2p
|
||||||
|
|
||||||
|
script: export COVERAGE_PROCESS_START=gluon/tests/coverage.ini; ./web2py.py --run_system_tests --with_coverage
|
||||||
|
after_success:
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coverage combine; fi
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls --config_file=gluon/tests/coverage.ini; fi
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email: true
|
||||||
@@ -1,14 +1,102 @@
|
|||||||
## 2.4.1- 2.4.2
|
## 2.7.1 - 2.7.2
|
||||||
|
|
||||||
|
- jQuery 1.10.2
|
||||||
|
- codemirror 3.18, thanks Paolo
|
||||||
|
- namespaces in T("Welcome", ns="namespace"), thanks jamarcer (experimental)
|
||||||
|
- more Auth options, thanks Charles
|
||||||
|
- more admin configuration, thanks Roberto
|
||||||
|
- new gluon.contrib.strip.StripeForm for PCI compliant payments
|
||||||
|
- webclient can hendle lists, thanks Yair
|
||||||
|
- allows SQLFORM.grid(...,ignore_common_filters=True)
|
||||||
|
- more translations, thanks Vladyslav
|
||||||
|
- better session2trash.py, works with scheduler, thanks niphlod
|
||||||
|
- fixed problem with ENABLED/DISABLED
|
||||||
|
- many bug fixes, thanks niphlod, michele, anthony, roberto, tim, and others
|
||||||
|
|
||||||
|
## 2.6.1 - 2.6.4
|
||||||
|
|
||||||
|
Attention all users: For pre 2.6 applications to work with web2py >=2.6, you must copy static/js/web2py.js, controllers/appadmin.py, and views/appadmin.html from the welcome app to your own apps (all of them).
|
||||||
|
|
||||||
|
Attention production users: The updated handlers and examples are in handlers/ and examples/. The updated ones will not override the existing ones. To use the new ones it is not sufficient to upgrade web2py, you also need to copy the desired handler/example in the root web2py/ folder.
|
||||||
|
|
||||||
|
Attention MySQL users: The length of string fields changed from 255 to 512 bytes. If you have migrations enabled this will trigger a large migration. To prevent it, first set migrate_enabled=False, upgrade, check everything is ok, then add length=255 to your string Fields, then re-enable migrations with migrate_enabled=True if needed.
|
||||||
|
|
||||||
|
- better directory structure: handlers/ extras/ examples/
|
||||||
|
- better MongoDb support, thanks Alan
|
||||||
|
- better Admin editor interface, thanks Paolo, Roberto (codemirror 3), and Lightdot
|
||||||
|
- better layout.html and web2py_bootstrap.css, thanks Paolo
|
||||||
|
- refactored web2py.js makes code more readable, thanks Niphlod
|
||||||
|
- compute fields can depend on other compute(d) fields
|
||||||
|
- more functions in appadmin (/manage/auth), thanks Anthony
|
||||||
|
- support for CAST in SQL generation
|
||||||
|
- new API jQuery('#component').reload()
|
||||||
|
- new API rows.render()
|
||||||
|
- new API table.field.referent, table._references
|
||||||
|
- new API db(...).validate_and_update(...)
|
||||||
|
- new API Wiki(..., force_render=True) renders the page source again instead of using cached
|
||||||
|
- Wiki now automatically parses named component arguments @{f:a=1,b='twp',c=variable}
|
||||||
|
- auth.get_or_create_user(login=False)
|
||||||
|
- auth = Auth(crsf_protection = False) prevents creating sessions in login/register forms.
|
||||||
|
- enable multiple renderers in wiki, thanks Alan
|
||||||
|
- log messages from Auth are no longer translated (for speed and readability)
|
||||||
|
- update jQuery mobile to 1.3.1
|
||||||
|
- reduced memory footprint by conditionally loading Tk
|
||||||
|
- faster pbkdf2 uses OpenSSL, thanks Michele
|
||||||
|
- many speed improvements, thanks Michele
|
||||||
|
- better session logic, prevents false positive when detecting session changes.
|
||||||
|
- scripts/import_static.py converts a static site to a web2py app (experimental)
|
||||||
|
- support for new http error code 451
|
||||||
|
- profiler saves dump in dir, thanks Niphlod
|
||||||
|
- upgraded pyfpdf, thanks Mariano
|
||||||
|
- gluon/contrib/pdfinvoice.py for generating PDF invoices (assumes reportlab)
|
||||||
|
- no more double submission of forms (even without crsf protection), thanks Niphlod
|
||||||
|
- speedup for define_table, thanks Michele
|
||||||
|
- settings.cfg to admin, thanks Paolo
|
||||||
|
- many bugs fixed, thanks Niphlod, Michele, Roberto, Jonathan, and many others
|
||||||
|
- 2.6,3 specifically fixed a possible DoS vulnerability
|
||||||
|
- 2.6.4 specifically fixes major problem introduced in 2.6.1 with session logic
|
||||||
|
|
||||||
|
## 2.5.2
|
||||||
|
|
||||||
|
- Web editor with tabs, thanks ilvalle
|
||||||
|
|
||||||
|
## 2.5.1
|
||||||
|
|
||||||
|
- New style virtual fields in grid
|
||||||
|
- Conditional fields (experimental) ``db.table.field.show_if = db.table.otherfield==True`` or ``db.table.field.show_if = db.table.otherfiel.contains(values)``
|
||||||
|
- auth.settings.manager_group_role="manager" enables http://.../app/appadmin/auth_manage and http://.../app/appadmin/manage for members of the "manager" group. (also experimental)
|
||||||
|
- support for POST variables in DELETE
|
||||||
|
- Fixed memory leak when using the TAG helper
|
||||||
|
|
||||||
|
|
||||||
|
## 2.4.7
|
||||||
|
|
||||||
|
- pypy support, thanks Niphlod
|
||||||
|
- more bug fixes
|
||||||
|
- ...
|
||||||
|
|
||||||
|
## 2.4.6
|
||||||
|
|
||||||
|
- better tests
|
||||||
|
- new ANY_OF and IS_IPV6 validators
|
||||||
|
- new custom save option
|
||||||
|
- many small bug fixes
|
||||||
|
|
||||||
|
## 2.4.5
|
||||||
|
|
||||||
|
- travis.ci integration (thanks Marc Abramowitz and Niphlod). Passes all tests (thanks Niplod).
|
||||||
|
- IS_DATE and IS_DATETIME can specify timezone
|
||||||
|
|
||||||
|
## 2.4.1- 2.4.3
|
||||||
|
|
||||||
- 2D GEO API: geoPoint, getLine, geoPolygon
|
- 2D GEO API: geoPoint, getLine, geoPolygon
|
||||||
- support for 'json' field type in DAL
|
- support for 'json' field type in DAL
|
||||||
- schema export with db.as_json/as_xml, thanks Alan
|
- schema export with db.as_json/as_xml, thanks Alan
|
||||||
- graph representation of models
|
- graph representation of models
|
||||||
- admin based on bootstrap, thanks Paolo
|
|
||||||
- support for semantic versioning
|
- support for semantic versioning
|
||||||
- new bootstrap based admin, thanks Paolo
|
- new bootstrap based admin, thanks Paolo
|
||||||
- improved scheduler (and change in scheduler field names), thanks Niphlod
|
- improved scheduler (and change in scheduler field names), thanks Niphlod
|
||||||
- graphiz support added to adm, thanks Jose
|
- graphviz support added to adm, thanks Jose
|
||||||
- on_failure in grid
|
- on_failure in grid
|
||||||
- db.table.field.abs()
|
- db.table.field.abs()
|
||||||
- better wiki
|
- better wiki
|
||||||
@@ -20,7 +108,7 @@
|
|||||||
- improved IMAP DAL support, thanks Alan
|
- improved IMAP DAL support, thanks Alan
|
||||||
- improved security when cookies in sessions
|
- improved security when cookies in sessions
|
||||||
- Row.as_xml, as_json, as_dict, as_yaml thanks Alan
|
- Row.as_xml, as_json, as_dict, as_yaml thanks Alan
|
||||||
- smarted custom_import
|
- smarter custom_import
|
||||||
- setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh
|
- setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh
|
||||||
- added support for motor and pulsar servers, thanks Niphlod
|
- added support for motor and pulsar servers, thanks Niphlod
|
||||||
- added json-rpc2 support
|
- added json-rpc2 support
|
||||||
@@ -71,7 +159,7 @@
|
|||||||
## 2.1.0
|
## 2.1.0
|
||||||
|
|
||||||
- overall faster web2py
|
- overall faster web2py
|
||||||
- when apps are deleted, a w2p copy left in deposit folder
|
- when apps are deleted, a w2p copy is left in deposit folder
|
||||||
- change in cron (it is now disabled by default). removed -N option and introduced -Y.
|
- change in cron (it is now disabled by default). removed -N option and introduced -Y.
|
||||||
- faster web2py_uuid() and request initialization logic, thanks Michele
|
- faster web2py_uuid() and request initialization logic, thanks Michele
|
||||||
- static asset management, thanks Niphlod
|
- static asset management, thanks Niphlod
|
||||||
@@ -1388,4 +1476,3 @@ db.define_table('cirlce',
|
|||||||
## EWF v1.5 -> v1.6 (2007)
|
## EWF v1.5 -> v1.6 (2007)
|
||||||
- load and save .py in ascii, avoids problem with LF+CR on windows
|
- load and save .py in ascii, avoids problem with LF+CR on windows
|
||||||
- added path.join in compileapp, fixed problem with Windows compileapp
|
- added path.join in compileapp, fixed problem with Windows compileapp
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Web2py is Licensed under the LGPL license version 3
|
Web2py is Licensed under the LGPL license version 3
|
||||||
(http://www.gnu.org/licenses/lgpl.html)
|
(http://www.gnu.org/licenses/lgpl.html)
|
||||||
|
|
||||||
Copyrighted (c) by Massimo Di Pierro (2007-2011)
|
Copyrighted (c) by Massimo Di Pierro (2007-2013)
|
||||||
|
|
||||||
### On Commercial Redistribution
|
### On Commercial Redistribution
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
all:
|
all:
|
||||||
echo "The Makefile is used to build the distribution."
|
@echo "The Makefile is used to build the distribution."
|
||||||
echo "In order to run web2py you do not need to make anything."
|
@echo "In order to run web2py you do not need to make anything."
|
||||||
echo "just run web2py.py"
|
@echo "just run web2py.py"
|
||||||
clean:
|
clean:
|
||||||
rm -f httpserver.log
|
rm -f httpserver.log
|
||||||
rm -f parameters*.py
|
rm -f parameters*.py
|
||||||
@@ -20,7 +20,7 @@ clean:
|
|||||||
epydoc:
|
epydoc:
|
||||||
### build epydoc
|
### build epydoc
|
||||||
rm -f -r applications/examples/static/epydoc/
|
rm -f -r applications/examples/static/epydoc/
|
||||||
epydoc --config epydoc.conf
|
epydoc --config extras/epydoc/epydoc.conf
|
||||||
cp applications/examples/static/title.png applications/examples/static/epydoc
|
cp applications/examples/static/title.png applications/examples/static/epydoc
|
||||||
tests:
|
tests:
|
||||||
python web2py.py --run_system_tests
|
python web2py.py --run_system_tests
|
||||||
@@ -30,7 +30,7 @@ update:
|
|||||||
echo "remember that pymysql was tweaked"
|
echo "remember that pymysql was tweaked"
|
||||||
src:
|
src:
|
||||||
### Use semantic versioning
|
### Use semantic versioning
|
||||||
echo 'Version 2.4.2-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
echo 'Version 2.7.3-stable+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
||||||
### rm -f all junk files
|
### rm -f all junk files
|
||||||
make clean
|
make clean
|
||||||
### clean up baisc apps
|
### clean up baisc apps
|
||||||
@@ -54,7 +54,7 @@ src:
|
|||||||
### build web2py_src.zip
|
### build web2py_src.zip
|
||||||
echo '' > NEWINSTALL
|
echo '' > NEWINSTALL
|
||||||
mv web2py_src.zip web2py_src_old.zip | echo 'no old'
|
mv web2py_src.zip web2py_src_old.zip | echo 'no old'
|
||||||
cd ..; zip -r web2py/web2py_src.zip web2py/gluon/*.py web2py/gluon/contrib/* web2py/splashlogo.gif web2py/*.py web2py/README.markdown web2py/LICENSE web2py/CHANGELOG web2py/NEWINSTALL web2py/VERSION web2py/Makefile web2py/epydoc.css web2py/epydoc.conf web2py/app.example.yaml web2py/logging.example.conf web2py/queue.example.yaml web2py/MANIFEST.in web2py/w2p_apps web2py/w2p_clone web2py/w2p_run web2py/web2py.cio web2py/web2py.gif web2py/scripts/*.sh web2py/scripts/*.py web2py/applications/admin web2py/applications/examples/ web2py/applications/welcome web2py/applications/__init__.py web2py/site-packages/__init__.py web2py/gluon/tests/*.sh web2py/gluon/tests/*.py
|
cd ..; zip -r web2py/web2py_src.zip web2py/web2py.py web2py/anyserver.py web2py/gluon/*.py web2py/gluon/contrib/* web2py/extras/* web2py/handlers/* web2py/examples/* web2py/README.markdown web2py/LICENSE web2py/CHANGELOG web2py/NEWINSTALL web2py/VERSION web2py/MANIFEST.in web2py/scripts/*.sh web2py/scripts/*.py web2py/applications/admin web2py/applications/examples/ web2py/applications/welcome web2py/applications/__init__.py web2py/site-packages/__init__.py web2py/gluon/tests/*.sh web2py/gluon/tests/*.py
|
||||||
|
|
||||||
mdp:
|
mdp:
|
||||||
make src
|
make src
|
||||||
@@ -64,30 +64,29 @@ app:
|
|||||||
python2.7 -c 'import compileall; compileall.compile_dir("gluon/")'
|
python2.7 -c 'import compileall; compileall.compile_dir("gluon/")'
|
||||||
#python web2py.py -S welcome -R __exit__.py
|
#python web2py.py -S welcome -R __exit__.py
|
||||||
#cd ../web2py_osx/site-packages/; unzip ../site-packages.zip
|
#cd ../web2py_osx/site-packages/; unzip ../site-packages.zip
|
||||||
find gluon -path '*.pyc' -exec cp {} ../web2py_osx/site-packages/{} \;
|
#find gluon -path '*.pyc' -exec cp {} ../web2py_osx/site-packages/{} \;
|
||||||
cd ../web2py_osx/site-packages/; zip -r ../site-packages.zip *
|
#cd ../web2py_osx/site-packages/; zip -r ../site-packages.zip *
|
||||||
mv ../web2py_osx/site-packages.zip ../web2py_osx/web2py/web2py.app/Contents/Resources/lib/python2.7
|
#mv ../web2py_osx/site-packages.zip ../web2py_osx/web2py/web2py.app/Contents/Resources/lib/python2.7
|
||||||
|
find gluon -path '*.py' -exec cp -R {} ../web2py_osx/web2py/web2py.app/Contents/Resources/{} \;
|
||||||
cp README.markdown ../web2py_osx/web2py/web2py.app/Contents/Resources
|
cp README.markdown ../web2py_osx/web2py/web2py.app/Contents/Resources
|
||||||
cp NEWINSTALL ../web2py_osx/web2py/web2py.app/Contents/Resources
|
cp NEWINSTALL ../web2py_osx/web2py/web2py.app/Contents/Resources
|
||||||
cp LICENSE ../web2py_osx/web2py/web2py.app/Contents/Resources
|
cp LICENSE ../web2py_osx/web2py/web2py.app/Contents/Resources
|
||||||
cp VERSION ../web2py_osx/web2py/web2py.app/Contents/Resources
|
cp VERSION ../web2py_osx/web2py/web2py.app/Contents/Resources
|
||||||
cp CHANGELOG ../web2py_osx/web2py/web2py.app/Contents/Resources
|
cp CHANGELOG ../web2py_osx/web2py/web2py.app/Contents/Resources
|
||||||
cp splashlogo.gif ../web2py_osx/web2py/web2py.app/Contents/Resources
|
cp -r extras ../web2py_osx/web2py/web2py.app/Contents/Resources
|
||||||
cp options_std.py ../web2py_osx/web2py/web2py.app/Contents/Resources
|
cp -r examples ../web2py_osx/web2py/web2py.app/Contents/Resources
|
||||||
cp routes.example.py ../web2py_osx/web2py/web2py.app/Contents/Resources
|
cp -r handlers ../web2py_osx/web2py/web2py.app/Contents/Resources
|
||||||
cp router.example.py ../web2py_osx/web2py/web2py.app/Contents/Resources
|
|
||||||
cp app.example.yaml ../web2py_osx/web2py/web2py.app/Contents/Resources
|
|
||||||
cp queue.example.yaml ../web2py_osx/web2py/web2py.app/Contents/Resources
|
|
||||||
cp -r applications/admin ../web2py_osx/web2py/web2py.app/Contents/Resources/applications
|
cp -r applications/admin ../web2py_osx/web2py/web2py.app/Contents/Resources/applications
|
||||||
cp -r applications/welcome ../web2py_osx/web2py/web2py.app/Contents/Resources/applications
|
cp -r applications/welcome ../web2py_osx/web2py/web2py.app/Contents/Resources/applications
|
||||||
cp -r applications/examples ../web2py_osx/web2py/web2py.app/Contents/Resources/applications
|
cp -r applications/examples ../web2py_osx/web2py/web2py.app/Contents/Resources/applications
|
||||||
cp applications/__init__.py ../web2py_osx/web2py/web2py.app/Contents/Resources/applications
|
cp applications/__init__.py ../web2py_osx/web2py/web2py.app/Contents/Resources/applications
|
||||||
cd ../web2py_osx; zip -r web2py_osx.zip web2py
|
cd ../web2py_osx; zip -r web2py_osx.zip web2py
|
||||||
|
|
||||||
mv ../web2py_osx/web2py_osx.zip .
|
mv ../web2py_osx/web2py_osx.zip .
|
||||||
win:
|
win:
|
||||||
python2.7 -c 'import compileall; compileall.compile_dir("gluon/")'
|
python2.7 -c 'import compileall; compileall.compile_dir("gluon/")'
|
||||||
#cd ../web2py_win/library/; unzip ../library.zip
|
#cd ../web2py_win/library/; unzip ../library.zip
|
||||||
find gluon -path '*.pyc' -exec cp {} ../web2py_win/library/{} \;
|
find gluon -path '*.pyc' -exec cp -R {} ../web2py_win/library/{} \;
|
||||||
cd ../web2py_win/library/; zip -r ../library.zip *
|
cd ../web2py_win/library/; zip -r ../library.zip *
|
||||||
mv ../web2py_win/library.zip ../web2py_win/web2py
|
mv ../web2py_win/library.zip ../web2py_win/web2py
|
||||||
cp README.markdown ../web2py_win/web2py/
|
cp README.markdown ../web2py_win/web2py/
|
||||||
@@ -95,15 +94,12 @@ win:
|
|||||||
cp LICENSE ../web2py_win/web2py/
|
cp LICENSE ../web2py_win/web2py/
|
||||||
cp VERSION ../web2py_win/web2py/
|
cp VERSION ../web2py_win/web2py/
|
||||||
cp CHANGELOG ../web2py_win/web2py/
|
cp CHANGELOG ../web2py_win/web2py/
|
||||||
cp splashlogo.gif ../web2py_win/web2py/
|
cp -R extras ../web2py_win/web2py/
|
||||||
cp options_std.py ../web2py_win/web2py/
|
cp -R examples ../web2py_win/web2py/
|
||||||
cp routes.example.py ../web2py_win/web2py/
|
cp -R handlers ../web2py_win/web2py/
|
||||||
cp router.example.py ../web2py_win/web2py/
|
cp -R applications/admin ../web2py_win/web2py/applications
|
||||||
cp app.example.yaml ../web2py_win/web2py/
|
cp -R applications/welcome ../web2py_win/web2py/applications
|
||||||
cp queue.example.yaml ../web2py_win/web2py/
|
cp -R applications/examples ../web2py_win/web2py/applications
|
||||||
cp -r applications/admin ../web2py_win/web2py/applications
|
|
||||||
cp -r applications/welcome ../web2py_win/web2py/applications
|
|
||||||
cp -r applications/examples ../web2py_win/web2py/applications
|
|
||||||
cp applications/__init__.py ../web2py_win/web2py/applications
|
cp applications/__init__.py ../web2py_win/web2py/applications
|
||||||
cd ../web2py_win; zip -r web2py_win.zip web2py
|
cd ../web2py_win; zip -r web2py_win.zip web2py
|
||||||
mv ../web2py_win/web2py_win.zip .
|
mv ../web2py_win/web2py_win.zip .
|
||||||
@@ -114,11 +110,11 @@ commit:
|
|||||||
make src
|
make src
|
||||||
echo '' > NEWINSTALL
|
echo '' > NEWINSTALL
|
||||||
hg commit -m "$(S)"
|
hg commit -m "$(S)"
|
||||||
#bzr commit -m "$(S)"
|
|
||||||
git commit -a -m "$(S)"
|
git commit -a -m "$(S)"
|
||||||
push:
|
push:
|
||||||
hg push
|
hg push
|
||||||
git push
|
git push
|
||||||
|
git push --tags
|
||||||
tag:
|
tag:
|
||||||
git tag -l '$(S)'
|
git tag -l '$(S)'
|
||||||
hg tag -l '$(S)'
|
hg tag -l '$(S)'
|
||||||
|
|||||||
+11
-1
@@ -6,6 +6,13 @@ It is written and programmable in Python. LGPLv3 License
|
|||||||
|
|
||||||
Learn more at http://web2py.com
|
Learn more at http://web2py.com
|
||||||
|
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
[](https://travis-ci.org/web2py/web2py)
|
||||||
|
|
||||||
|
[](https://coveralls.io/r/web2py/web2py)
|
||||||
|
|
||||||
## Installation Instructions
|
## Installation Instructions
|
||||||
|
|
||||||
To start web2py there is NO NEED to install it. Just unzip and do:
|
To start web2py there is NO NEED to install it. Just unzip and do:
|
||||||
@@ -47,9 +54,12 @@ That's it!!!
|
|||||||
cron/
|
cron/
|
||||||
tests/
|
tests/
|
||||||
... > your own apps
|
... > your own apps
|
||||||
|
examples/ > example config files, mv .. and customize
|
||||||
|
extras/ > other files which are required for building web2py
|
||||||
scripts/ > utility and installation scripts
|
scripts/ > utility and installation scripts
|
||||||
site-packages/ > additional optional modules
|
site-packages/ > additional optional modules
|
||||||
|
logs/ > log files will go in there
|
||||||
|
deposit/ > a place where web2py stores apps temporarily
|
||||||
|
|
||||||
## Issues?
|
## Issues?
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Version 2.4.2-stable+timestamp.2013.03.03.21.22.42
|
Version 2.7.3-stable+timestamp.2013.10.11.18.10.01
|
||||||
|
|||||||
+36
-25
@@ -33,7 +33,7 @@ class Servers:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def wsgiref(app, address, **options): # pragma: no cover
|
def wsgiref(app, address, **options): # pragma: no cover
|
||||||
from wsgiref.simple_server import make_server, WSGIRequestHandler
|
from wsgiref.simple_server import make_server, WSGIRequestHandler
|
||||||
|
options = {}
|
||||||
class QuietHandler(WSGIRequestHandler):
|
class QuietHandler(WSGIRequestHandler):
|
||||||
def log_request(*args, **kw):
|
def log_request(*args, **kw):
|
||||||
pass
|
pass
|
||||||
@@ -71,6 +71,7 @@ class Servers:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def paste(app, address, **options):
|
def paste(app, address, **options):
|
||||||
|
options = {}
|
||||||
from paste import httpserver
|
from paste import httpserver
|
||||||
from paste.translogger import TransLogger
|
from paste.translogger import TransLogger
|
||||||
httpserver.serve(app, host=address[0], port=address[1], **options)
|
httpserver.serve(app, host=address[0], port=address[1], **options)
|
||||||
@@ -90,10 +91,12 @@ class Servers:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def gevent(app, address, **options):
|
def gevent(app, address, **options):
|
||||||
|
options = options['options']
|
||||||
|
workers = options.workers
|
||||||
from gevent import pywsgi
|
from gevent import pywsgi
|
||||||
from gevent.pool import Pool
|
from gevent.pool import Pool
|
||||||
pywsgi.WSGIServer(address, app, spawn='workers' in options and Pool(
|
pywsgi.WSGIServer(address, app, spawn=workers and Pool(
|
||||||
int(options.workers)) or 'default').serve_forever()
|
int(options.workers)) or 'default', log=None).serve_forever()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def bjoern(app, address, **options):
|
def bjoern(app, address, **options):
|
||||||
@@ -130,6 +133,7 @@ class Servers:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def gunicorn(app, address, **options):
|
def gunicorn(app, address, **options):
|
||||||
|
options = {}
|
||||||
from gunicorn.app.base import Application
|
from gunicorn.app.base import Application
|
||||||
config = {'bind': "%s:%d" % address}
|
config = {'bind': "%s:%d" % address}
|
||||||
config.update(options)
|
config.update(options)
|
||||||
@@ -176,24 +180,6 @@ class Servers:
|
|||||||
s = wsgi.WSGIServer(callable=app, bind="%s:%d" % address)
|
s = wsgi.WSGIServer(callable=app, bind="%s:%d" % address)
|
||||||
s.start()
|
s.start()
|
||||||
|
|
||||||
def run(servername, ip, port, softcron=True, logging=False, profiler=None):
|
|
||||||
if servername == 'gevent':
|
|
||||||
from gevent import monkey
|
|
||||||
monkey.patch_all()
|
|
||||||
|
|
||||||
import gluon.main
|
|
||||||
|
|
||||||
if logging:
|
|
||||||
application = gluon.main.appfactory(wsgiapp=gluon.main.wsgibase,
|
|
||||||
logfilename='httpserver.log',
|
|
||||||
profilerfilename=profiler)
|
|
||||||
else:
|
|
||||||
application = gluon.main.wsgibase
|
|
||||||
if softcron:
|
|
||||||
from gluon.settings import global_settings
|
|
||||||
global_settings.web2py_crontype = 'soft'
|
|
||||||
getattr(Servers, servername)(application, (ip, int(port)))
|
|
||||||
|
|
||||||
|
|
||||||
def mongrel2_handler(application, conn, debug=False):
|
def mongrel2_handler(application, conn, debug=False):
|
||||||
"""
|
"""
|
||||||
@@ -300,6 +286,30 @@ def mongrel2_handler(application, conn, debug=False):
|
|||||||
req, data, code=code, status=status, headers=headers)
|
req, data, code=code, status=status, headers=headers)
|
||||||
|
|
||||||
|
|
||||||
|
def run(servername, ip, port, softcron=True, logging=False, profiler=None,
|
||||||
|
options=None):
|
||||||
|
if servername == 'gevent':
|
||||||
|
from gevent import monkey
|
||||||
|
monkey.patch_all()
|
||||||
|
elif servername == 'eventlet':
|
||||||
|
import eventlet
|
||||||
|
eventlet.monkey_patch()
|
||||||
|
|
||||||
|
import gluon.main
|
||||||
|
|
||||||
|
if logging:
|
||||||
|
application = gluon.main.appfactory(wsgiapp=gluon.main.wsgibase,
|
||||||
|
logfilename='httpserver.log',
|
||||||
|
profiler_dir=profiler)
|
||||||
|
else:
|
||||||
|
application = gluon.main.wsgibase
|
||||||
|
if softcron:
|
||||||
|
from gluon.settings import global_settings
|
||||||
|
global_settings.web2py_crontype = 'soft'
|
||||||
|
getattr(Servers, servername)(application, (ip, int(port)), options=options)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
usage = "python anyserver.py -s tornado -i 127.0.0.1 -p 8000 -l -P"
|
usage = "python anyserver.py -s tornado -i 127.0.0.1 -p 8000 -l -P"
|
||||||
try:
|
try:
|
||||||
@@ -316,8 +326,8 @@ def main():
|
|||||||
parser.add_option('-P',
|
parser.add_option('-P',
|
||||||
'--profiler',
|
'--profiler',
|
||||||
default=False,
|
default=False,
|
||||||
dest='profiler',
|
dest='profiler_dir',
|
||||||
help='profiler filename')
|
help='profiler dir')
|
||||||
servers = ', '.join(x for x in dir(Servers) if not x[0] == '_')
|
servers = ', '.join(x for x in dir(Servers) if not x[0] == '_')
|
||||||
parser.add_option('-s',
|
parser.add_option('-s',
|
||||||
'--server',
|
'--server',
|
||||||
@@ -336,14 +346,15 @@ def main():
|
|||||||
help='port number')
|
help='port number')
|
||||||
parser.add_option('-w',
|
parser.add_option('-w',
|
||||||
'--workers',
|
'--workers',
|
||||||
default='',
|
default=None,
|
||||||
dest='workers',
|
dest='workers',
|
||||||
help='number of workers number')
|
help='number of workers number')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
print 'starting %s on %s:%s...' % (
|
print 'starting %s on %s:%s...' % (
|
||||||
options.server, options.ip, options.port)
|
options.server, options.ip, options.port)
|
||||||
run(options.server, options.ip, options.port,
|
run(options.server, options.ip, options.port,
|
||||||
logging=options.logging, profiler=options.profiler)
|
logging=options.logging, profiler=options.profiler_dir,
|
||||||
|
options=options)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pgv = None
|
pgv = None
|
||||||
|
|
||||||
response.subtitle = 'Database Administration (appadmin)'
|
|
||||||
|
|
||||||
# ## critical --- make a copy of the environment
|
# ## critical --- make a copy of the environment
|
||||||
|
|
||||||
global_env = copy.copy(globals())
|
global_env = copy.copy(globals())
|
||||||
@@ -34,17 +32,35 @@ except:
|
|||||||
|
|
||||||
if request.env.http_x_forwarded_for or request.is_https:
|
if request.env.http_x_forwarded_for or request.is_https:
|
||||||
session.secure()
|
session.secure()
|
||||||
elif (remote_addr not in hosts) and (remote_addr != "127.0.0.1"):
|
elif (remote_addr not in hosts) and (remote_addr != "127.0.0.1") and \
|
||||||
|
(request.function != 'manage'):
|
||||||
raise HTTP(200, T('appadmin is disabled because insecure channel'))
|
raise HTTP(200, T('appadmin is disabled because insecure channel'))
|
||||||
|
|
||||||
if (request.application == 'admin' and not session.authorized) or \
|
if request.function == 'manage':
|
||||||
|
if not 'auth' in globals() or not request.args:
|
||||||
|
redirect(URL(request.controller, 'index'))
|
||||||
|
manager_action = auth.settings.manager_actions.get(request.args(0), None)
|
||||||
|
if manager_action is None and request.args(0) == 'auth':
|
||||||
|
manager_action = dict(role=auth.settings.auth_manager_role,
|
||||||
|
heading=T('Manage Access Control'),
|
||||||
|
tables=[auth.table_user(),
|
||||||
|
auth.table_group(),
|
||||||
|
auth.table_permission()])
|
||||||
|
manager_role = manager_action.get('role', None) if manager_action else None
|
||||||
|
auth.requires_membership(manager_role)(lambda: None)()
|
||||||
|
menu = False
|
||||||
|
elif (request.application == 'admin' and not session.authorized) or \
|
||||||
(request.application != 'admin' and not gluon.fileutils.check_credentials(request)):
|
(request.application != 'admin' and not gluon.fileutils.check_credentials(request)):
|
||||||
redirect(URL('admin', 'default', 'index',
|
redirect(URL('admin', 'default', 'index',
|
||||||
vars=dict(send=URL(args=request.args, vars=request.vars))))
|
vars=dict(send=URL(args=request.args, vars=request.vars))))
|
||||||
|
else:
|
||||||
|
response.subtitle = T('Database Administration (appadmin)')
|
||||||
|
menu = True
|
||||||
|
|
||||||
ignore_rw = True
|
ignore_rw = True
|
||||||
response.view = 'appadmin.html'
|
response.view = 'appadmin.html'
|
||||||
response.menu = [[T('design'), False, URL('admin', 'default', 'design',
|
if menu:
|
||||||
|
response.menu = [[T('design'), False, URL('admin', 'default', 'design',
|
||||||
args=[request.application])], [T('db'), False,
|
args=[request.application])], [T('db'), False,
|
||||||
URL('index')], [T('state'), False,
|
URL('index')], [T('state'), False,
|
||||||
URL('state')], [T('cache'), False,
|
URL('state')], [T('cache'), False,
|
||||||
@@ -54,6 +70,10 @@ response.menu = [[T('design'), False, URL('admin', 'default', 'design',
|
|||||||
# ## auxiliary functions
|
# ## auxiliary functions
|
||||||
# ###########################################################
|
# ###########################################################
|
||||||
|
|
||||||
|
if False and request.tickets_db:
|
||||||
|
from gluon.restricted import TicketStorage
|
||||||
|
ts = TicketStorage()
|
||||||
|
ts._get_table(request.tickets_db, ts.tablename, request.application)
|
||||||
|
|
||||||
def get_databases(request):
|
def get_databases(request):
|
||||||
dbs = {}
|
dbs = {}
|
||||||
@@ -275,14 +295,15 @@ def update():
|
|||||||
(db, table) = get_table(request)
|
(db, table) = get_table(request)
|
||||||
keyed = hasattr(db[table], '_primarykey')
|
keyed = hasattr(db[table], '_primarykey')
|
||||||
record = None
|
record = None
|
||||||
|
db[table]._common_filter = None
|
||||||
if keyed:
|
if keyed:
|
||||||
key = [f for f in request.vars if f in db[table]._primarykey]
|
key = [f for f in request.vars if f in db[table]._primarykey]
|
||||||
if key:
|
if key:
|
||||||
record = db(db[table][key[0]] == request.vars[key[
|
record = db(db[table][key[0]] == request.vars[key[
|
||||||
0]], ignore_common_filters=True).select().first()
|
0]]).select().first()
|
||||||
else:
|
else:
|
||||||
record = db(db[table].id == request.args(
|
record = db(db[table].id == request.args(
|
||||||
2), ignore_common_filters=True).select().first()
|
2)).select().first()
|
||||||
|
|
||||||
if not record:
|
if not record:
|
||||||
qry = query_by_table_type(table, db)
|
qry = query_by_table_type(table, db)
|
||||||
@@ -319,6 +340,9 @@ def state():
|
|||||||
|
|
||||||
|
|
||||||
def ccache():
|
def ccache():
|
||||||
|
cache.ram.initialize()
|
||||||
|
cache.disk.initialize()
|
||||||
|
|
||||||
form = FORM(
|
form = FORM(
|
||||||
P(TAG.BUTTON(
|
P(TAG.BUTTON(
|
||||||
T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")),
|
T("Clear CACHE?"), _type="submit", _name="yes", _value="yes")),
|
||||||
@@ -385,7 +409,7 @@ def ccache():
|
|||||||
|
|
||||||
return (hours, minutes, seconds)
|
return (hours, minutes, seconds)
|
||||||
|
|
||||||
for key, value in cache.ram.storage.items():
|
for key, value in cache.ram.storage.iteritems():
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
ram['hits'] = value['hit_total'] - value['misses']
|
ram['hits'] = value['hit_total'] - value['misses']
|
||||||
ram['misses'] = value['misses']
|
ram['misses'] = value['misses']
|
||||||
@@ -565,3 +589,45 @@ def bg_graph_model():
|
|||||||
|
|
||||||
def graph_model():
|
def graph_model():
|
||||||
return dict(databases=databases, pgv=pgv)
|
return dict(databases=databases, pgv=pgv)
|
||||||
|
|
||||||
|
def manage():
|
||||||
|
tables = manager_action['tables']
|
||||||
|
if isinstance(tables[0], str):
|
||||||
|
db = manager_action.get('db', auth.db)
|
||||||
|
db = globals()[db] if isinstance(db, str) else db
|
||||||
|
tables = [db[table] for table in tables]
|
||||||
|
if request.args(0) == 'auth':
|
||||||
|
auth.table_user()._plural = T('Users')
|
||||||
|
auth.table_group()._plural = T('Roles')
|
||||||
|
auth.table_membership()._plural = T('Memberships')
|
||||||
|
auth.table_permission()._plural = T('Permissions')
|
||||||
|
if request.extension != 'load':
|
||||||
|
return dict(heading=manager_action.get('heading',
|
||||||
|
T('Manage %(action)s') % dict(action=request.args(0).replace('_', ' ').title())),
|
||||||
|
tablenames=[table._tablename for table in tables],
|
||||||
|
labels=[table._plural.title() for table in tables])
|
||||||
|
|
||||||
|
table = tables[request.args(1, cast=int)]
|
||||||
|
formname = '%s_grid' % table._tablename
|
||||||
|
linked_tables = orderby = None
|
||||||
|
if request.args(0) == 'auth':
|
||||||
|
auth.table_group()._id.readable = \
|
||||||
|
auth.table_membership()._id.readable = \
|
||||||
|
auth.table_permission()._id.readable = False
|
||||||
|
auth.table_membership().user_id.label = T('User')
|
||||||
|
auth.table_membership().group_id.label = T('Role')
|
||||||
|
auth.table_permission().group_id.label = T('Role')
|
||||||
|
auth.table_permission().name.label = T('Permission')
|
||||||
|
if table == auth.table_user():
|
||||||
|
linked_tables=[auth.settings.table_membership_name]
|
||||||
|
elif table == auth.table_group():
|
||||||
|
orderby = 'role' if not request.args(3) or '.group_id' not in request.args(3) else None
|
||||||
|
elif table == auth.table_permission():
|
||||||
|
orderby = 'group_id'
|
||||||
|
kwargs = dict(user_signature=True, maxtextlength=1000,
|
||||||
|
orderby=orderby, linked_tables=linked_tables)
|
||||||
|
smartgrid_args = manager_action.get('smartgrid_args', {})
|
||||||
|
kwargs.update(**smartgrid_args.get('DEFAULT', {}))
|
||||||
|
kwargs.update(**smartgrid_args.get(table._tablename, {}))
|
||||||
|
grid = SQLFORM.smartgrid(table, args=request.args[:2], formname=formname, **kwargs)
|
||||||
|
return grid
|
||||||
|
|||||||
@@ -234,4 +234,3 @@ def list_breakpoints():
|
|||||||
session.flash = str(e)
|
session.flash = str(e)
|
||||||
ok = False
|
ok = False
|
||||||
return response.json({'ok': ok, 'breakpoints': breakpoints})
|
return response.json({'ok': ok, 'breakpoints': breakpoints})
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,11 @@ import re
|
|||||||
from gluon.admin import *
|
from gluon.admin import *
|
||||||
from gluon.fileutils import abspath, read_file, write_file
|
from gluon.fileutils import abspath, read_file, write_file
|
||||||
from gluon.utils import web2py_uuid
|
from gluon.utils import web2py_uuid
|
||||||
|
from gluon.tools import Config
|
||||||
from glob import glob
|
from glob import glob
|
||||||
import shutil
|
import shutil
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import git
|
import git
|
||||||
if git.__version__ < '0.3.1':
|
if git.__version__ < '0.3.1':
|
||||||
@@ -27,7 +29,7 @@ from gluon.languages import (read_possible_languages, read_dict, write_dict,
|
|||||||
read_plural_dict, write_plural_dict)
|
read_plural_dict, write_plural_dict)
|
||||||
|
|
||||||
|
|
||||||
if DEMO_MODE and request.function in ['change_password', 'pack', 'pack_plugin', 'upgrade_web2py', 'uninstall', 'cleanup', 'compile_app', 'remove_compiled_app', 'delete', 'delete_plugin', 'create_file', 'upload_file', 'update_languages', 'reload_routes', 'git_push', 'git_pull']:
|
if DEMO_MODE and request.function in ['change_password', 'pack', 'pack_custom','pack_plugin', 'upgrade_web2py', 'uninstall', 'cleanup', 'compile_app', 'remove_compiled_app', 'delete', 'delete_plugin', 'create_file', 'upload_file', 'update_languages', 'reload_routes', 'git_push', 'git_pull']:
|
||||||
session.flash = T('disabled in demo mode')
|
session.flash = T('disabled in demo mode')
|
||||||
redirect(URL('site'))
|
redirect(URL('site'))
|
||||||
|
|
||||||
@@ -86,10 +88,11 @@ def safe_write(a, value, b='w'):
|
|||||||
|
|
||||||
def get_app(name=None):
|
def get_app(name=None):
|
||||||
app = name or request.args(0)
|
app = name or request.args(0)
|
||||||
if app and (not MULTI_USER_MODE or is_manager() or
|
if (app and os.path.exists(apath(app, r=request)) and
|
||||||
db(db.app.name == app)(db.app.owner == auth.user.id).count()):
|
(not MULTI_USER_MODE or is_manager() or
|
||||||
|
db(db.app.name == app)(db.app.owner == auth.user.id).count())):
|
||||||
return app
|
return app
|
||||||
session.flash = T('App does not exist or your are not authorized')
|
session.flash = T('App does not exist or you are not authorized')
|
||||||
redirect(URL('site'))
|
redirect(URL('site'))
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +108,7 @@ def index():
|
|||||||
if session.authorized:
|
if session.authorized:
|
||||||
redirect(send)
|
redirect(send)
|
||||||
elif request.vars.password:
|
elif request.vars.password:
|
||||||
if verify_password(request.vars.password):
|
if verify_password(request.vars.password[:1024]):
|
||||||
session.authorized = True
|
session.authorized = True
|
||||||
login_record(True)
|
login_record(True)
|
||||||
|
|
||||||
@@ -138,19 +141,17 @@ def check_version():
|
|||||||
session.forget()
|
session.forget()
|
||||||
session._unlock(response)
|
session._unlock(response)
|
||||||
|
|
||||||
new_version, version_number = check_new_version(request.env.web2py_version,
|
new_version, version = check_new_version(request.env.web2py_version,
|
||||||
WEB2PY_VERSION_URL)
|
WEB2PY_VERSION_URL)
|
||||||
|
|
||||||
if new_version == -1:
|
if new_version == -1:
|
||||||
return A(T('Unable to check for upgrades'), _href=WEB2PY_URL)
|
return A(T('Unable to check for upgrades'), _href=WEB2PY_URL)
|
||||||
elif new_version != True:
|
elif new_version != True:
|
||||||
return A(T('web2py is up to date'), _href=WEB2PY_URL)
|
return A(T('web2py is up to date'), _href=WEB2PY_URL)
|
||||||
elif platform.system().lower() in ('windows', 'win32', 'win64') and os.path.exists("web2py.exe"):
|
elif platform.system().lower() in ('windows', 'win32', 'win64') and os.path.exists("web2py.exe"):
|
||||||
return SPAN('You should upgrade to version %s.%s.%s' % version_number[:3])
|
return SPAN('You should upgrade to %s' % version.split('(')[0])
|
||||||
else:
|
else:
|
||||||
return sp_button(URL('upgrade_web2py'), T('upgrade now')) \
|
return sp_button(URL('upgrade_web2py'), T('upgrade now to %s') % version.split('(')[0])
|
||||||
+ XML(' <strong class="upgrade_version">%s.%s.%s</strong>'
|
|
||||||
% version_number[:3])
|
|
||||||
|
|
||||||
|
|
||||||
def logout():
|
def logout():
|
||||||
@@ -196,7 +197,7 @@ def site():
|
|||||||
|
|
||||||
class IS_VALID_APPNAME(object):
|
class IS_VALID_APPNAME(object):
|
||||||
def __call__(self, value):
|
def __call__(self, value):
|
||||||
if not re.compile('\w+').match(value):
|
if not re.compile('^\w+$').match(value):
|
||||||
return (value, T('Invalid application name'))
|
return (value, T('Invalid application name'))
|
||||||
if not request.vars.overwrite and \
|
if not request.vars.overwrite and \
|
||||||
os.path.exists(os.path.join(apath(r=request), value)):
|
os.path.exists(os.path.join(apath(r=request), value)):
|
||||||
@@ -205,14 +206,12 @@ def site():
|
|||||||
|
|
||||||
is_appname = IS_VALID_APPNAME()
|
is_appname = IS_VALID_APPNAME()
|
||||||
form_create = SQLFORM.factory(Field('name', requires=is_appname),
|
form_create = SQLFORM.factory(Field('name', requires=is_appname),
|
||||||
table_name='appcreate',
|
table_name='appcreate')
|
||||||
_class='well well-small')
|
|
||||||
form_update = SQLFORM.factory(Field('name', requires=is_appname),
|
form_update = SQLFORM.factory(Field('name', requires=is_appname),
|
||||||
Field('file', 'upload', uploadfield=False),
|
Field('file', 'upload', uploadfield=False),
|
||||||
Field('url'),
|
Field('url'),
|
||||||
Field('overwrite', 'boolean'),
|
Field('overwrite', 'boolean'),
|
||||||
table_name='appupdate',
|
table_name='appupdate')
|
||||||
_class='well well-small')
|
|
||||||
form_create.process()
|
form_create.process()
|
||||||
form_update.process()
|
form_update.process()
|
||||||
|
|
||||||
@@ -300,8 +299,8 @@ def site():
|
|||||||
apps = [f for f in apps if f in FILTER_APPS]
|
apps = [f for f in apps if f in FILTER_APPS]
|
||||||
|
|
||||||
apps = sorted(apps, lambda a, b: cmp(a.upper(), b.upper()))
|
apps = sorted(apps, lambda a, b: cmp(a.upper(), b.upper()))
|
||||||
|
myplatform = platform.python_version()
|
||||||
return dict(app=None, apps=apps, myversion=myversion,
|
return dict(app=None, apps=apps, myversion=myversion, myplatform=myplatform,
|
||||||
form_create=form_create, form_update=form_update)
|
form_create=form_create, form_update=form_update)
|
||||||
|
|
||||||
|
|
||||||
@@ -345,7 +344,6 @@ def pack():
|
|||||||
session.flash = T('internal error: %s' % e)
|
session.flash = T('internal error: %s' % e)
|
||||||
redirect(URL('site'))
|
redirect(URL('site'))
|
||||||
|
|
||||||
|
|
||||||
def pack_plugin():
|
def pack_plugin():
|
||||||
app = get_app()
|
app = get_app()
|
||||||
if len(request.args) == 2:
|
if len(request.args) == 2:
|
||||||
@@ -360,6 +358,33 @@ def pack_plugin():
|
|||||||
session.flash = T('internal error')
|
session.flash = T('internal error')
|
||||||
redirect(URL('plugin', args=request.args))
|
redirect(URL('plugin', args=request.args))
|
||||||
|
|
||||||
|
def pack_custom():
|
||||||
|
app = get_app()
|
||||||
|
base = apath(app, r=request)
|
||||||
|
if request.post_vars.file:
|
||||||
|
files = request.post_vars.file
|
||||||
|
files = [files] if not isinstance(files,list) else files
|
||||||
|
fname = 'web2py.app.%s.w2p' % app
|
||||||
|
try:
|
||||||
|
filename = app_pack(app, request, raise_ex=True, filenames=files)
|
||||||
|
except Exception, e:
|
||||||
|
filename = None
|
||||||
|
if filename:
|
||||||
|
response.headers['Content-Type'] = 'application/w2p'
|
||||||
|
disposition = 'attachment; filename=%s' % fname
|
||||||
|
response.headers['Content-Disposition'] = disposition
|
||||||
|
return safe_read(filename, 'rb')
|
||||||
|
else:
|
||||||
|
session.flash = T('internal error: %s' % e)
|
||||||
|
redirect(URL(args=request.args))
|
||||||
|
def ignore(fs):
|
||||||
|
return [f for f in fs if not (
|
||||||
|
f[:1] in '#' or f.endswith('~') or f.endswith('.bak'))]
|
||||||
|
files = {}
|
||||||
|
for (r,d,f) in os.walk(base):
|
||||||
|
files[r] = {'folders':ignore(d),'files':ignore(f)}
|
||||||
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def upgrade_web2py():
|
def upgrade_web2py():
|
||||||
dialog = FORM.confirm(T('Upgrade'),
|
dialog = FORM.confirm(T('Upgrade'),
|
||||||
@@ -436,32 +461,6 @@ def remove_compiled_app():
|
|||||||
redirect(URL('site'))
|
redirect(URL('site'))
|
||||||
|
|
||||||
|
|
||||||
def delete():
|
|
||||||
""" Object delete handler """
|
|
||||||
app = get_app()
|
|
||||||
filename = '/'.join(request.args)
|
|
||||||
sender = request.vars.sender
|
|
||||||
|
|
||||||
if isinstance(sender, list): # ## fix a problem with Vista
|
|
||||||
sender = sender[0]
|
|
||||||
|
|
||||||
if 'nodelete' in request.vars:
|
|
||||||
redirect(URL(sender, anchor=request.vars.id))
|
|
||||||
elif 'delete' in request.vars:
|
|
||||||
try:
|
|
||||||
full_path = apath(filename, r=request)
|
|
||||||
lineno = count_lines(open(full_path, 'r').read())
|
|
||||||
os.unlink(full_path)
|
|
||||||
log_progress(app, 'DELETE', filename, progress=-lineno)
|
|
||||||
session.flash = T('file "%(filename)s" deleted',
|
|
||||||
dict(filename=filename))
|
|
||||||
except Exception:
|
|
||||||
session.flash = T('unable to delete file "%(filename)s"',
|
|
||||||
dict(filename=filename))
|
|
||||||
redirect(URL(sender, anchor=request.vars.id2))
|
|
||||||
return dict(filename=filename, sender=sender)
|
|
||||||
|
|
||||||
|
|
||||||
def delete():
|
def delete():
|
||||||
""" Object delete handler """
|
""" Object delete handler """
|
||||||
app = get_app()
|
app = get_app()
|
||||||
@@ -498,10 +497,9 @@ def enable():
|
|||||||
os.unlink(filename)
|
os.unlink(filename)
|
||||||
return SPAN(T('Disable'), _style='color:green')
|
return SPAN(T('Disable'), _style='color:green')
|
||||||
else:
|
else:
|
||||||
safe_open(filename, 'wb').write(time.ctime())
|
safe_open(filename, 'wb').write('disabled: True\ntime-disabled: %s' % request.now)
|
||||||
return SPAN(T('Enable'), _style='color:red')
|
return SPAN(T('Enable'), _style='color:red')
|
||||||
|
|
||||||
|
|
||||||
def peek():
|
def peek():
|
||||||
""" Visualize object code """
|
""" Visualize object code """
|
||||||
app = get_app(request.vars.app)
|
app = get_app(request.vars.app)
|
||||||
@@ -561,6 +559,43 @@ def search():
|
|||||||
|
|
||||||
|
|
||||||
def edit():
|
def edit():
|
||||||
|
""" File edit handler """
|
||||||
|
# Load json only if it is ajax edited...
|
||||||
|
app = get_app(request.vars.app)
|
||||||
|
app_path = apath(app, r=request)
|
||||||
|
editor_defaults={'theme':'web2py', 'editor': 'default'}
|
||||||
|
config = Config(os.path.join(request.folder, 'settings.cfg'),
|
||||||
|
section='editor', default_values=editor_defaults)
|
||||||
|
preferences = config.read()
|
||||||
|
|
||||||
|
if not(request.ajax):
|
||||||
|
# return the scaffolding, the rest will be through ajax requests
|
||||||
|
response.title = T('Editing %s') % app
|
||||||
|
editarea_preferences = {}
|
||||||
|
editarea_preferences['FONT_SIZE'] = '10'
|
||||||
|
editarea_preferences['FULL_SCREEN'] = 'false'
|
||||||
|
editarea_preferences['ALLOW_TOGGLE'] = 'true'
|
||||||
|
editarea_preferences['REPLACE_TAB_BY_SPACES'] = '4'
|
||||||
|
editarea_preferences['DISPLAY'] = 'onload'
|
||||||
|
for key in editarea_preferences:
|
||||||
|
if key in globals():
|
||||||
|
editarea_preferences[key] = globals()[key]
|
||||||
|
return response.render ('default/edit.html', dict(app=request.args[0], editor_settings=preferences, editarea_preferences=editarea_preferences))
|
||||||
|
|
||||||
|
# show settings tab and save prefernces
|
||||||
|
if 'settings' in request.vars:
|
||||||
|
if request.post_vars: #save new preferences
|
||||||
|
if config.save(request.post_vars.items()):
|
||||||
|
response.headers["web2py-component-flash"] = T('Preferences saved correctly')
|
||||||
|
else:
|
||||||
|
response.headers["web2py-component-flash"] = T('Preferences saved on session only')
|
||||||
|
response.headers["web2py-component-command"] = "update_theme('%s');update_editor('%s');jQuery('a[href=#editor_settings] button.close').click();" % (config.read()['theme'], config.read()['editor'])
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
details = {'filename':'settings', 'id':'editor_settings', 'force': False}
|
||||||
|
details['plain_html'] = response.render('default/editor_settings.html', {'editor_settings':preferences})
|
||||||
|
return response.json(details)
|
||||||
|
|
||||||
""" File edit handler """
|
""" File edit handler """
|
||||||
# Load json only if it is ajax edited...
|
# Load json only if it is ajax edited...
|
||||||
app = get_app(request.vars.app)
|
app = get_app(request.vars.app)
|
||||||
@@ -570,7 +605,7 @@ def edit():
|
|||||||
path = abspath(filename)
|
path = abspath(filename)
|
||||||
else:
|
else:
|
||||||
path = apath(filename, r=request)
|
path = apath(filename, r=request)
|
||||||
# Try to discover the file type
|
# Try to discover the file type
|
||||||
if filename[-3:] == '.py':
|
if filename[-3:] == '.py':
|
||||||
filetype = 'python'
|
filetype = 'python'
|
||||||
elif filename[-5:] == '.html':
|
elif filename[-5:] == '.html':
|
||||||
@@ -666,7 +701,6 @@ def edit():
|
|||||||
offset and ' ' +
|
offset and ' ' +
|
||||||
T('at char %s', offset) or '',
|
T('at char %s', offset) or '',
|
||||||
PRE(str(e)))
|
PRE(str(e)))
|
||||||
|
|
||||||
if data_or_revert and request.args[1] == 'modules':
|
if data_or_revert and request.args[1] == 'modules':
|
||||||
# Lets try to reload the modules
|
# Lets try to reload the modules
|
||||||
try:
|
try:
|
||||||
@@ -686,7 +720,7 @@ def edit():
|
|||||||
cfilename = os.path.join(request.args[0], 'controllers',
|
cfilename = os.path.join(request.args[0], 'controllers',
|
||||||
request.args[2] + '.py')
|
request.args[2] + '.py')
|
||||||
if os.path.exists(apath(cfilename, r=request)):
|
if os.path.exists(apath(cfilename, r=request)):
|
||||||
edit_controller = URL('edit', args=[cfilename])
|
edit_controller = URL('edit', args=[cfilename.replace(os.sep, "/")])
|
||||||
view = request.args[3].replace('.html', '')
|
view = request.args[3].replace('.html', '')
|
||||||
view_link = URL(request.args[0], request.args[2], view)
|
view_link = URL(request.args[0], request.args[2], view)
|
||||||
elif filetype == 'python' and request.args[1] == 'controllers':
|
elif filetype == 'python' and request.args[1] == 'controllers':
|
||||||
@@ -708,6 +742,7 @@ def edit():
|
|||||||
vf = os.path.split(v)[-1]
|
vf = os.path.split(v)[-1]
|
||||||
vargs = "/".join([viewpath.replace(os.sep, "/"), vf])
|
vargs = "/".join([viewpath.replace(os.sep, "/"), vf])
|
||||||
editviewlinks.append(A(vf.split(".")[0],
|
editviewlinks.append(A(vf.split(".")[0],
|
||||||
|
_class="editor_filelink",
|
||||||
_href=URL('edit', args=[vargs])))
|
_href=URL('edit', args=[vargs])))
|
||||||
|
|
||||||
if len(request.args) > 2 and request.args[1] == 'controllers':
|
if len(request.args) > 2 and request.args[1] == 'controllers':
|
||||||
@@ -719,17 +754,7 @@ def edit():
|
|||||||
if 'from_ajax' in request.vars:
|
if 'from_ajax' in request.vars:
|
||||||
return response.json({'file_hash': file_hash, 'saved_on': saved_on, 'functions': functions, 'controller': controller, 'application': request.args[0], 'highlight': highlight})
|
return response.json({'file_hash': file_hash, 'saved_on': saved_on, 'functions': functions, 'controller': controller, 'application': request.args[0], 'highlight': highlight})
|
||||||
else:
|
else:
|
||||||
|
file_details = dict(app=request.args[0],
|
||||||
editarea_preferences = {}
|
|
||||||
editarea_preferences['FONT_SIZE'] = '10'
|
|
||||||
editarea_preferences['FULL_SCREEN'] = 'false'
|
|
||||||
editarea_preferences['ALLOW_TOGGLE'] = 'true'
|
|
||||||
editarea_preferences['REPLACE_TAB_BY_SPACES'] = '4'
|
|
||||||
editarea_preferences['DISPLAY'] = 'onload'
|
|
||||||
for key in editarea_preferences:
|
|
||||||
if key in globals():
|
|
||||||
editarea_preferences[key] = globals()[key]
|
|
||||||
return dict(app=request.args[0],
|
|
||||||
filename=filename,
|
filename=filename,
|
||||||
filetype=filetype,
|
filetype=filetype,
|
||||||
data=data,
|
data=data,
|
||||||
@@ -739,8 +764,12 @@ def edit():
|
|||||||
controller=controller,
|
controller=controller,
|
||||||
functions=functions,
|
functions=functions,
|
||||||
view_link=view_link,
|
view_link=view_link,
|
||||||
editarea_preferences=editarea_preferences,
|
editviewlinks=editviewlinks,
|
||||||
editviewlinks=editviewlinks)
|
id=IS_SLUG()(filename)[0],
|
||||||
|
force= True if (request.vars.restore or request.vars.revert) else False)
|
||||||
|
plain_html = response.render('default/edit_js.html', file_details)
|
||||||
|
file_details['plain_html'] = plain_html
|
||||||
|
return response.json(file_details)
|
||||||
|
|
||||||
|
|
||||||
def resolve():
|
def resolve():
|
||||||
@@ -1008,8 +1037,9 @@ def design():
|
|||||||
privates.sort()
|
privates.sort()
|
||||||
|
|
||||||
# Get all static files
|
# Get all static files
|
||||||
|
MAXNFILES = 1000
|
||||||
statics = listdir(apath('%s/static/' % app, r=request), '[^\.#].*')
|
statics = listdir(apath('%s/static/' % app, r=request), '[^\.#].*')
|
||||||
statics = [x.replace('\\', '/') for x in statics]
|
statics = [x.replace('\\', '/') for x in statics[:MAXNFILES]]
|
||||||
statics.sort()
|
statics.sort()
|
||||||
|
|
||||||
# Get all languages
|
# Get all languages
|
||||||
@@ -1430,7 +1460,7 @@ def errors():
|
|||||||
hash2error[hash]['count'] += 1
|
hash2error[hash]['count'] += 1
|
||||||
except KeyError:
|
except KeyError:
|
||||||
error_lines = error['traceback'].split("\n")
|
error_lines = error['traceback'].split("\n")
|
||||||
last_line = error_lines[-2]
|
last_line = error_lines[-2] if len(error_lines)>1 else 'unknown'
|
||||||
error_causer = os.path.split(error['layer'])[1]
|
error_causer = os.path.split(error['layer'])[1]
|
||||||
hash2error[hash] = dict(count=1, pickel=error,
|
hash2error[hash] = dict(count=1, pickel=error,
|
||||||
causer=error_causer,
|
causer=error_causer,
|
||||||
@@ -1655,26 +1685,6 @@ def update_languages():
|
|||||||
redirect(URL('design', args=app, anchor='languages'))
|
redirect(URL('design', args=app, anchor='languages'))
|
||||||
|
|
||||||
|
|
||||||
def twitter():
|
|
||||||
session.forget()
|
|
||||||
session._unlock(response)
|
|
||||||
import gluon.tools
|
|
||||||
import gluon.contrib.simplejson as sj
|
|
||||||
try:
|
|
||||||
if TWITTER_HASH:
|
|
||||||
page = urllib.urlopen("http://search.twitter.com/search.json?q=%%40%s" % TWITTER_HASH).read()
|
|
||||||
data = sj.loads(page, encoding="utf-8")['results']
|
|
||||||
d = dict()
|
|
||||||
for e in data:
|
|
||||||
d[e["id"]] = e
|
|
||||||
r = reversed(sorted(d))
|
|
||||||
return dict(tweets=[d[k] for k in r])
|
|
||||||
else:
|
|
||||||
return 'disabled'
|
|
||||||
except Exception, e:
|
|
||||||
return DIV(T('Unable to download because:'), BR(), str(e))
|
|
||||||
|
|
||||||
|
|
||||||
def user():
|
def user():
|
||||||
if MULTI_USER_MODE:
|
if MULTI_USER_MODE:
|
||||||
if not db(db.auth_user).count():
|
if not db(db.auth_user).count():
|
||||||
@@ -1781,4 +1791,3 @@ def git_push():
|
|||||||
session.flash = T("Push failed, there are unmerged entries in the cache. Resolve merge issues manually and try again.")
|
session.flash = T("Push failed, there are unmerged entries in the cache. Resolve merge issues manually and try again.")
|
||||||
redirect(URL('site'))
|
redirect(URL('site'))
|
||||||
return dict(app=app, form=form)
|
return dict(app=app, form=form)
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ if MULTI_USER_MODE and not is_manager():
|
|||||||
session.flash = 'Not Authorized'
|
session.flash = 'Not Authorized'
|
||||||
redirect(URL('default', 'site'))
|
redirect(URL('default', 'site'))
|
||||||
|
|
||||||
|
from gluon.settings import settings
|
||||||
|
if not settings.is_source:
|
||||||
|
session.flash = 'Requires running web2py from source'
|
||||||
|
redirect(URL(request.application, 'default', 'site'))
|
||||||
|
|
||||||
forever = 10 ** 8
|
forever = 10 ** 8
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ def commit():
|
|||||||
app = request.args(0)
|
app = request.args(0)
|
||||||
path = apath(app, r=request)
|
path = apath(app, r=request)
|
||||||
repo = hg_repo(path)
|
repo = hg_repo(path)
|
||||||
form = FORM('Comment:', INPUT(_name='comment', requires=IS_NOT_EMPTY()),
|
form = FORM(T('Comment:'), INPUT(_name='comment', requires=IS_NOT_EMPTY()),
|
||||||
INPUT(_type='submit', _value=T('Commit')))
|
INPUT(_type='submit', _value=T('Commit')))
|
||||||
if form.accepts(request.vars, session):
|
if form.accepts(request.vars, session):
|
||||||
oldid = repo[repo.lookup('.')]
|
oldid = repo[repo.lookup('.')]
|
||||||
addremove(repo)
|
addremove(repo)
|
||||||
repo.commit(text=form.vars.comment)
|
repo.commit(text=form.vars.comment)
|
||||||
if repo[repo.lookup('.')] == oldid:
|
if repo[repo.lookup('.')] == oldid:
|
||||||
response.flash = 'no changes'
|
response.flash = T('no changes')
|
||||||
try:
|
try:
|
||||||
files = TABLE(*[TR(file) for file in repo[repo.lookup('.')].files()])
|
files = TABLE(*[TR(file) for file in repo[repo.lookup('.')].files()])
|
||||||
changes = TABLE(TR(TH('revision'), TH('description')))
|
changes = TABLE(TR(TH('revision'), TH('description')))
|
||||||
@@ -75,7 +75,7 @@ def revision():
|
|||||||
form = FORM(INPUT(_type='submit', _value=T('Revert')))
|
form = FORM(INPUT(_type='submit', _value=T('Revert')))
|
||||||
if form.accepts(request.vars):
|
if form.accepts(request.vars):
|
||||||
hg.update(repo, revision)
|
hg.update(repo, revision)
|
||||||
session.flash = "reverted to revision %s" % ctx.rev()
|
session.flash = T("reverted to revision %s") % ctx.rev()
|
||||||
redirect(URL('default', 'design', args=app))
|
redirect(URL('default', 'design', args=app))
|
||||||
return dict(
|
return dict(
|
||||||
files=ctx.files(),
|
files=ctx.files(),
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ except ImportError:
|
|||||||
session.flash = T('requires python-git, but not installed')
|
session.flash = T('requires python-git, but not installed')
|
||||||
redirect(URL('default', 'site'))
|
redirect(URL('default', 'site'))
|
||||||
|
|
||||||
|
from gluon.settings import settings
|
||||||
|
if not settings.is_source:
|
||||||
|
session.flash = 'Requires running web2py from source'
|
||||||
|
redirect(URL(request.application, 'default', 'site'))
|
||||||
|
|
||||||
def deploy():
|
def deploy():
|
||||||
apps = sorted(file for file in os.listdir(apath(r=request)))
|
apps = sorted(file for file in os.listdir(apath(r=request)))
|
||||||
|
|||||||
@@ -83,20 +83,20 @@ def step1():
|
|||||||
from gluon.contrib.simplejson import loads
|
from gluon.contrib.simplejson import loads
|
||||||
import urllib
|
import urllib
|
||||||
if not session.themes:
|
if not session.themes:
|
||||||
url = LAYOUTS_APP + '/default/layouts.json'
|
#url = LAYOUTS_APP + '/default/layouts.json'
|
||||||
try:
|
#try:
|
||||||
data = urllib.urlopen(url).read()
|
# data = urllib.urlopen(url).read()
|
||||||
session.themes = ['Default'] + loads(data)['layouts']
|
# session.themes = ['Default'] + loads(data)['layouts']
|
||||||
except:
|
#except:
|
||||||
session.themes = ['Default']
|
session.themes = ['Default']
|
||||||
themes = session.themes
|
themes = session.themes
|
||||||
if not session.plugins:
|
if not session.plugins:
|
||||||
url = PLUGINS_APP + '/default/plugins.json'
|
#url = PLUGINS_APP + '/default/plugins.json'
|
||||||
try:
|
#try:
|
||||||
data = urllib.urlopen(url).read()
|
# data = urllib.urlopen(url).read()
|
||||||
session.plugins = loads(data)['plugins']
|
# session.plugins = loads(data)['plugins']
|
||||||
except:
|
#except:
|
||||||
session.plugins = []
|
session.plugins = []
|
||||||
plugins = [x.split('.')[2] for x in session.plugins]
|
plugins = [x.split('.')[2] for x in session.plugins]
|
||||||
response.view = 'wizard/step.html'
|
response.view = 'wizard/step.html'
|
||||||
params = dict(session.app['params'])
|
params = dict(session.app['params'])
|
||||||
|
|||||||
+362
-272
@@ -1,390 +1,480 @@
|
|||||||
# coding: utf8
|
# coding: utf8
|
||||||
{
|
{
|
||||||
'!langcode!': 'cs-cz',
|
'!langcode!': 'cs-cz',
|
||||||
'!langname!': '?e?tina',
|
'!langname!': 'čeština',
|
||||||
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': 'Kolonka "Upravit" je nepovinn? v?raz, nap??klad "pole1=\'nov?hodnota\'". V?sledky datab?zov?ho JOINu nem??ete mazat ani upravovat.',
|
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': 'Kolonka "Upravit" je nepovinný výraz, například "pole1=\'nováhodnota\'". Výsledky databázového JOINu nemůžete mazat ani upravovat.',
|
||||||
'%%{Row} in Table': '%%{??dek} v tabulce',
|
'"User Exception" debug mode. An error ticket could be issued!': '"User Exception" debug mode. An error ticket could be issued!',
|
||||||
'%%{Row} selected': 'ozna?en?ch %%{??dek}',
|
'%%{Row} in Table': '%%{řádek} v tabulce',
|
||||||
'%s %%{row} deleted': '%s smazan?ch %%{z?znam}',
|
'%%{Row} selected': 'označených %%{řádek}',
|
||||||
'%s %%{row} updated': '%s upraven?ch %%{z?znam}',
|
'%s %%{row} deleted': '%s smazaných %%{záznam}',
|
||||||
'%s selected': '%s ozna?en?ch',
|
'%s %%{row} updated': '%s upravených %%{záznam}',
|
||||||
|
'%s selected': '%s označených',
|
||||||
'%Y-%m-%d': '%d.%m.%Y',
|
'%Y-%m-%d': '%d.%m.%Y',
|
||||||
'%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M:%S',
|
'%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M:%S',
|
||||||
'(requires internet access)': '(vy?aduje p?ipojen? k internetu)',
|
'(requires internet access)': '(vyžaduje připojení k internetu)',
|
||||||
'(something like "it-it")': '(nap??klad "cs-cs")',
|
'(requires internet access, experimental)': '(requires internet access, experimental)',
|
||||||
|
'(something like "it-it")': '(například "cs-cs")',
|
||||||
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(soubor **gluon/contrib/plural_rules/%s.py** nenalezen)',
|
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(soubor **gluon/contrib/plural_rules/%s.py** nenalezen)',
|
||||||
'@markmin\x01Searching: **%s** %%{file}': 'Hled?n?: **%s** %%{soubor}',
|
'@markmin\x01Searching: **%s** %%{file}': 'Hledání: **%s** %%{soubor}',
|
||||||
'About': 'O programu',
|
'About': 'O programu',
|
||||||
'About application': 'O aplikaci',
|
'About application': 'O aplikaci',
|
||||||
'Access Control': '??zen? p??stupu',
|
'Access Control': 'Řízení přístupu',
|
||||||
'Add breakpoint': 'P?idat bod p?eru?en?',
|
'Add breakpoint': 'Přidat bod přerušení',
|
||||||
'Additional code for your application': 'Dal?? k?d pro Va?i aplikaci',
|
'Additional code for your application': 'Další kód pro Vaši aplikaci',
|
||||||
'Admin language': 'jazyk rozhran?',
|
'Admin design page': 'Admin design page',
|
||||||
'Administrative interface': 'pro administr?torsk? rozhran? klikn?te sem',
|
'Admin language': 'jazyk rozhraní',
|
||||||
'Administrative Interface': 'Administr?torsk? rozhran?',
|
'Administrative interface': 'pro administrátorské rozhraní klikněte sem',
|
||||||
'administrative interface': 'rozhran? pro spr?vu',
|
'Administrative Interface': 'Administrátorské rozhraní',
|
||||||
'Administrator Password:': 'Administr?torsk? heslo:',
|
'administrative interface': 'rozhraní pro správu',
|
||||||
|
'Administrator Password:': 'Administrátorské heslo:',
|
||||||
'Ajax Recipes': 'Recepty s ajaxem',
|
'Ajax Recipes': 'Recepty s ajaxem',
|
||||||
'and rename it:': 'a p?ejmenovat na:',
|
'An error occured, please %s the page': 'An error occured, please %s the page',
|
||||||
|
'and rename it:': 'a přejmenovat na:',
|
||||||
'appadmin': 'appadmin',
|
'appadmin': 'appadmin',
|
||||||
'appadmin is disabled because insecure channel': 'appadmin je zak?zan? bez zabezpe?en?ho spojen?',
|
'appadmin is disabled because insecure channel': 'appadmin je zakázaná bez zabezpečeného spojení',
|
||||||
'application "%s" uninstalled': 'application "%s" odinstalov?na',
|
'Application': 'Application',
|
||||||
'application compiled': 'aplikace zkompilov?na',
|
'application "%s" uninstalled': 'application "%s" odinstalována',
|
||||||
'Application name:': 'N?zev aplikace:',
|
'application compiled': 'aplikace zkompilována',
|
||||||
'are not used': 'nepou?ita',
|
'Application name:': 'Název aplikace:',
|
||||||
'are not used yet': 'je?t? nepou?ita',
|
'are not used': 'nepoužita',
|
||||||
|
'are not used yet': 'ještě nepoužita',
|
||||||
'Are you sure you want to delete this object?': 'Opravdu chcete odstranit tento objekt?',
|
'Are you sure you want to delete this object?': 'Opravdu chcete odstranit tento objekt?',
|
||||||
'Are you sure you want to uninstall application "%s"?': 'Opravdu chcete odinstalovat aplikaci "%s"?',
|
'Are you sure you want to uninstall application "%s"?': 'Opravdu chcete odinstalovat aplikaci "%s"?',
|
||||||
'Available Databases and Tables': 'Dostupn? datab?ze a tabulky',
|
'arguments': 'arguments',
|
||||||
'back': 'zp?t',
|
'at char %s': 'at char %s',
|
||||||
|
'at line %s': 'at line %s',
|
||||||
|
'ATTENTION:': 'ATTENTION:',
|
||||||
|
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.',
|
||||||
|
'Available Databases and Tables': 'Dostupné databáze a tabulky',
|
||||||
|
'back': 'zpět',
|
||||||
|
'Back to wizard': 'Back to wizard',
|
||||||
'Basics': 'Basics',
|
'Basics': 'Basics',
|
||||||
'Begin': 'Za??t',
|
'Begin': 'Začít',
|
||||||
'breakpoint': 'bod p?eru?en?',
|
'breakpoint': 'bod přerušení',
|
||||||
'Breakpoints': 'Body p?eru?en?',
|
'Breakpoints': 'Body přerušení',
|
||||||
'breakpoints': 'body p?eru?en?',
|
'breakpoints': 'body přerušení',
|
||||||
'Buy this book': 'Koupit web2py knihu',
|
'Buy this book': 'Koupit web2py knihu',
|
||||||
'Cache': 'Cache',
|
'Cache': 'Cache',
|
||||||
'cache': 'cache',
|
'cache': 'cache',
|
||||||
'Cache Keys': 'Kl??e cache',
|
'Cache Keys': 'Klíče cache',
|
||||||
'cache, errors and sessions cleaned': 'cache, chyby a relace byly pro?i?t?ny',
|
'cache, errors and sessions cleaned': 'cache, chyby a relace byly pročištěny',
|
||||||
'can be a git repo': 'm??e to b?t git repo',
|
'can be a git repo': 'může to být git repo',
|
||||||
'Cancel': 'Storno',
|
'Cancel': 'Storno',
|
||||||
'Cannot be empty': 'Nem??e b?t pr?zdn?',
|
'Cannot be empty': 'Nemůže být prázdné',
|
||||||
'Change admin password': 'Zm?nit heslo pro str?vu aplikac?',
|
'Change Admin Password': 'Změnit heslo pro správu',
|
||||||
'Change password': 'Zm?na hesla',
|
'Change admin password': 'Změnit heslo pro správu aplikací',
|
||||||
'check all': 'v?e ozna?it',
|
'Change password': 'Změna hesla',
|
||||||
|
'check all': 'vše označit',
|
||||||
'Check for upgrades': 'Zkusit aktualizovat',
|
'Check for upgrades': 'Zkusit aktualizovat',
|
||||||
'Check to delete': 'Ozna?it ke smaz?n?',
|
'Check to delete': 'Označit ke smazání',
|
||||||
'Check to delete:': 'Ozna?it ke smaz?n?:',
|
'Check to delete:': 'Označit ke smazání:',
|
||||||
'Checking for upgrades...': 'Zji??uji, zda jsou k dispozici aktualizace...',
|
'Checking for upgrades...': 'Zjišťuji, zda jsou k dispozici aktualizace...',
|
||||||
'Clean': 'Pro?istit',
|
'Clean': 'Pročistit',
|
||||||
'Clear CACHE?': 'Vymazat CACHE?',
|
'Clear CACHE?': 'Vymazat CACHE?',
|
||||||
'Clear DISK': 'Vymazat DISK',
|
'Clear DISK': 'Vymazat DISK',
|
||||||
'Clear RAM': 'Vymazat RAM',
|
'Clear RAM': 'Vymazat RAM',
|
||||||
'Click row to expand traceback': 'Pro rozbalen? stopy, klikn?te na ??dek',
|
'Click row to expand traceback': 'Pro rozbalení stopy, klikněte na řádek',
|
||||||
'Click row to view a ticket': 'Pro zobrazen? chyby (ticketu), klikn?te na ??dku...',
|
'Click row to view a ticket': 'Pro zobrazení chyby (ticketu), klikněte na řádku...',
|
||||||
'Client IP': 'IP adresa klienta',
|
'Client IP': 'IP adresa klienta',
|
||||||
'collapse/expand all': 'v?e sbalit/rozbalit',
|
'code': 'code',
|
||||||
|
'Code listing': 'Code listing',
|
||||||
|
'collapse/expand all': 'vše sbalit/rozbalit',
|
||||||
'Community': 'Komunita',
|
'Community': 'Komunita',
|
||||||
'Compile': 'Zkompilovat',
|
'Compile': 'Zkompilovat',
|
||||||
'compiled application removed': 'zkompilovan? aplikace smaz?na',
|
'compiled application removed': 'zkompilovaná aplikace smazána',
|
||||||
'Components and Plugins': 'Komponenty a z?suvn? moduly',
|
'Components and Plugins': 'Komponenty a zásuvné moduly',
|
||||||
'Condition': 'Podm?nka',
|
'Condition': 'Podmínka',
|
||||||
'Controller': 'Kontrol?r (Controller)',
|
'continue': 'continue',
|
||||||
'Controllers': 'Kontrol?ry',
|
'Controller': 'Kontrolér (Controller)',
|
||||||
'controllers': 'kontrol?ry',
|
'Controllers': 'Kontroléry',
|
||||||
|
'controllers': 'kontroléry',
|
||||||
'Copyright': 'Copyright',
|
'Copyright': 'Copyright',
|
||||||
'Count': 'Po?et',
|
'Count': 'Počet',
|
||||||
'Create': 'Vytvo?it',
|
'Create': 'Vytvořit',
|
||||||
'create file with filename:': 'vytvo?it soubor s n?zvem:',
|
'create file with filename:': 'vytvořit soubor s názvem:',
|
||||||
'created by': 'vytvo?il',
|
'created by': 'vytvořil',
|
||||||
'Created By': 'Vytvo?eno - k?m',
|
'Created By': 'Vytvořeno - kým',
|
||||||
'Created On': 'Vytvo?eno - kdy',
|
'Created On': 'Vytvořeno - kdy',
|
||||||
'crontab': 'crontab',
|
'crontab': 'crontab',
|
||||||
'Current request': 'Aktu?ln? po?adavek',
|
'Current request': 'Aktuální požadavek',
|
||||||
'Current response': 'Aktu?ln? odpov??',
|
'Current response': 'Aktuální odpověď',
|
||||||
'Current session': 'Aktu?ln? relace',
|
'Current session': 'Aktuální relace',
|
||||||
'currently running': 'pr?v? b???',
|
'currently running': 'právě běží',
|
||||||
'currently saved or': 'ulo?eno nebo',
|
'currently saved or': 'uloženo nebo',
|
||||||
'customize me!': 'upravte m?!',
|
'customize me!': 'upravte mě!',
|
||||||
'data uploaded': 'data nahr?na',
|
'data uploaded': 'data nahrána',
|
||||||
'Database': 'Rozhran? datab?ze',
|
'Database': 'Rozhraní databáze',
|
||||||
'Database %s select': 'datab?ze %s v?b?r',
|
'Database %s select': 'databáze %s výběr',
|
||||||
'database administration': 'spr?va datab?ze',
|
'Database administration': 'Database administration',
|
||||||
'Date and Time': 'Datum a ?as',
|
'database administration': 'správa databáze',
|
||||||
|
'Date and Time': 'Datum a čas',
|
||||||
'day': 'den',
|
'day': 'den',
|
||||||
'db': 'db',
|
'db': 'db',
|
||||||
'DB Model': 'Datab?zov? model',
|
'DB Model': 'Databázový model',
|
||||||
'Debug': 'Lad?n?',
|
'Debug': 'Ladění',
|
||||||
|
'defines tables': 'defines tables',
|
||||||
'Delete': 'Smazat',
|
'Delete': 'Smazat',
|
||||||
'delete': 'smazat',
|
'delete': 'smazat',
|
||||||
'delete all checked': 'smazat v?e ozna?en?',
|
'delete all checked': 'smazat vše označené',
|
||||||
'Delete this file (you will be asked to confirm deletion)': 'Smazat tento soubor (budete po??d?n o potvrzen? maz?n?)',
|
'delete plugin': 'delete plugin',
|
||||||
|
'Delete this file (you will be asked to confirm deletion)': 'Smazat tento soubor (budete požádán o potvrzení mazání)',
|
||||||
'Delete:': 'Smazat:',
|
'Delete:': 'Smazat:',
|
||||||
'deleted after first hit': 'smazat po prvn?m dosa?en?',
|
'deleted after first hit': 'smazat po prvním dosažení',
|
||||||
'Demo': 'Demo',
|
'Demo': 'Demo',
|
||||||
'Deploy': 'Nahr?t',
|
'Deploy': 'Nahrát',
|
||||||
'Deploy on Google App Engine': 'Nahr?t na Google App Engine',
|
'Deploy on Google App Engine': 'Nahrát na Google App Engine',
|
||||||
'Deploy to OpenShift': 'Nahr?t na OpenShift',
|
'Deploy to OpenShift': 'Nahrát na OpenShift',
|
||||||
'Deployment Recipes': 'Postupy pro deployment',
|
'Deployment Recipes': 'Postupy pro deployment',
|
||||||
'Description': 'Popis',
|
'Description': 'Popis',
|
||||||
'design': 'n?vrh',
|
'design': 'návrh',
|
||||||
'direction: ltr': 'direction: ltr',
|
'Detailed traceback description': 'Podrobný výpis prostředí',
|
||||||
|
'details': 'podrobnosti',
|
||||||
|
'direction: ltr': 'směr: ltr',
|
||||||
'Disable': 'Zablokovat',
|
'Disable': 'Zablokovat',
|
||||||
'DISK': 'DISK',
|
'DISK': 'DISK',
|
||||||
'Disk Cache Keys': 'Kl??e diskov? cache',
|
'Disk Cache Keys': 'Klíče diskové cache',
|
||||||
'Disk Cleared': 'Disk smaz?n',
|
'Disk Cleared': 'Disk smazán',
|
||||||
'docs': 'dokumentace',
|
'docs': 'dokumentace',
|
||||||
'Documentation': 'Dokumentace',
|
'Documentation': 'Dokumentace',
|
||||||
"Don't know what to do?": 'Nev?te kudy kam?',
|
"Don't know what to do?": 'Nevíte kudy kam?',
|
||||||
'done!': 'hotovo!',
|
'done!': 'hotovo!',
|
||||||
'Download': 'St?hnout',
|
'Download': 'Stáhnout',
|
||||||
'download layouts': 'st?hnout moduly rozvr?en? str?nky',
|
'download layouts': 'stáhnout moduly rozvržení stránky',
|
||||||
'download plugins': 'st?hnout z?suvn? moduly',
|
'download plugins': 'stáhnout zásuvné moduly',
|
||||||
'E-mail': 'E-mail',
|
'E-mail': 'E-mail',
|
||||||
'Edit': 'Upravit',
|
'Edit': 'Upravit',
|
||||||
'edit all': 'edit all',
|
'edit all': 'edit all',
|
||||||
'Edit application': 'Spr?va aplikace',
|
'Edit application': 'Správa aplikace',
|
||||||
'Edit current record': 'Upravit aktu?ln? z?znam',
|
'edit controller': 'edit controller',
|
||||||
|
'Edit current record': 'Upravit aktuální záznam',
|
||||||
'Edit Profile': 'Upravit profil',
|
'Edit Profile': 'Upravit profil',
|
||||||
'Editing file "%s"': '?prava souboru "%s"',
|
'edit views:': 'upravit pohled:',
|
||||||
'Editing Language file': '?prava jazykov?ho souboru',
|
'Editing file "%s"': 'Úprava souboru "%s"',
|
||||||
|
'Editing Language file': 'Úprava jazykového souboru',
|
||||||
|
'Editing Plural Forms File': 'Editing Plural Forms File',
|
||||||
'Email and SMS': 'Email a SMS',
|
'Email and SMS': 'Email a SMS',
|
||||||
'Enable': 'Odblokovat',
|
'Enable': 'Odblokovat',
|
||||||
'enter a number between %(min)g and %(max)g': 'zadejte ??slo mezi %(min)g a %(max)g',
|
'enter a number between %(min)g and %(max)g': 'zadejte číslo mezi %(min)g a %(max)g',
|
||||||
'enter an integer between %(min)g and %(max)g': 'zadejte cel? ??slo mezi %(min)g a %(max)g',
|
'enter an integer between %(min)g and %(max)g': 'zadejte celé číslo mezi %(min)g a %(max)g',
|
||||||
'Error': 'Chyba',
|
'Error': 'Chyba',
|
||||||
'Error logs for "%(app)s"': 'Seznam v?skytu chyb pro aplikaci "%(app)s"',
|
'Error logs for "%(app)s"': 'Seznam výskytu chyb pro aplikaci "%(app)s"',
|
||||||
|
'Error snapshot': 'Snapshot chyby',
|
||||||
|
'Error ticket': 'Ticket chyby',
|
||||||
'Errors': 'Chyby',
|
'Errors': 'Chyby',
|
||||||
|
'Exception %(extype)s: %(exvalue)s': 'Exception %(extype)s: %(exvalue)s',
|
||||||
|
'Exception %s': 'Exception %s',
|
||||||
|
'Exception instance attributes': 'Prvky instance výjimky',
|
||||||
|
'Expand Abbreviation': 'Expand Abbreviation',
|
||||||
'export as csv file': 'exportovat do .csv souboru',
|
'export as csv file': 'exportovat do .csv souboru',
|
||||||
'exposes': 'vystavuje',
|
'exposes': 'vystavuje',
|
||||||
'extends': 'roz?i?uje',
|
'exposes:': 'vystavuje funkce:',
|
||||||
'FAQ': '?asto kladen? dotazy',
|
'extends': 'rozšiřuje',
|
||||||
|
'failed to compile file because:': 'soubor se nepodařilo zkompilovat, protože:',
|
||||||
|
'FAQ': 'Často kladené dotazy',
|
||||||
'File': 'Soubor',
|
'File': 'Soubor',
|
||||||
'file': 'soubor',
|
'file': 'soubor',
|
||||||
'file saved on %(time)s': 'soubor ulo?en %(time)s',
|
'file "%(filename)s" created': 'file "%(filename)s" created',
|
||||||
'Filename': 'N?zev souboru',
|
'file saved on %(time)s': 'soubor uložen %(time)s',
|
||||||
|
'file saved on %s': 'soubor uložen %s',
|
||||||
|
'Filename': 'Název souboru',
|
||||||
'filter': 'filtr',
|
'filter': 'filtr',
|
||||||
'Find Next': 'Naj?t dal??',
|
'Find Next': 'Najít další',
|
||||||
'Find Previous': 'Naj?t p?edchoz?',
|
'Find Previous': 'Najít předchozí',
|
||||||
'First name': 'K?estn? jm?no',
|
'First name': 'Křestní jméno',
|
||||||
'Forgot username?': 'Zapomn?l jste svoje p?ihla?ovac? jm?no?',
|
'Forgot username?': 'Zapomněl jste svoje přihlašovací jméno?',
|
||||||
'forgot username?': 'zapomn?l jste svoje p?ihla?ovac? jm?no?',
|
'forgot username?': 'zapomněl jste svoje přihlašovací jméno?',
|
||||||
'Forms and Validators': 'Formul??e a valid?tory',
|
'Forms and Validators': 'Formuláře a validátory',
|
||||||
|
'Frames': 'Frames',
|
||||||
'Free Applications': 'Aplikace zdarma',
|
'Free Applications': 'Aplikace zdarma',
|
||||||
'Generate': 'Vytvo?it',
|
'Functions with no doctests will result in [passed] tests.': 'Functions with no doctests will result in [passed] tests.',
|
||||||
'Get from URL:': 'St?hnout z internetu:',
|
'Generate': 'Vytvořit',
|
||||||
|
'Get from URL:': 'Stáhnout z internetu:',
|
||||||
'Git Pull': 'Git Pull',
|
'Git Pull': 'Git Pull',
|
||||||
'Git Push': 'Git Push',
|
'Git Push': 'Git Push',
|
||||||
'Globals##debug': 'Glob?ln? prom?nn?',
|
'Globals##debug': 'Globální proměnné',
|
||||||
'go!': 'OK!',
|
'go!': 'OK!',
|
||||||
'Group %(group_id)s created': 'Skupina %(group_id)s vytvo?ena',
|
'Goto': 'Goto',
|
||||||
|
'graph model': 'graph model',
|
||||||
|
'Group %(group_id)s created': 'Skupina %(group_id)s vytvořena',
|
||||||
'Group ID': 'ID skupiny',
|
'Group ID': 'ID skupiny',
|
||||||
'Groups': 'Skupiny',
|
'Groups': 'Skupiny',
|
||||||
'Hello World': 'Ahoj sv?te',
|
'Hello World': 'Ahoj světe',
|
||||||
'Help': 'N?pov?da',
|
'Help': 'Nápověda',
|
||||||
'Hide/Show Translated strings': 'Skr?t/Zobrazit p?elo?en? texty',
|
'Hide/Show Translated strings': 'Skrýt/Zobrazit přeložené texty',
|
||||||
'Hits': 'Kolikr?t dosa?eno',
|
'Hits': 'Kolikrát dosaženo',
|
||||||
'Home': 'Domovsk? str?nka',
|
'Home': 'Domovská stránka',
|
||||||
'honored only if the expression evaluates to true': 'br?t v potaz jen kdy? se tato podm?nka vyhodnot? kladn?',
|
'honored only if the expression evaluates to true': 'brát v potaz jen když se tato podmínka vyhodnotí kladně',
|
||||||
'How did you get here?': 'Jak jste se sem vlastn? dostal?',
|
'How did you get here?': 'Jak jste se sem vlastně dostal?',
|
||||||
|
'If start the upgrade, be patient, it may take a while to download': 'If start the upgrade, be patient, it may take a while to download',
|
||||||
|
'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.',
|
||||||
'import': 'import',
|
'import': 'import',
|
||||||
'Import/Export': 'Import/Export',
|
'Import/Export': 'Import/Export',
|
||||||
'includes': 'zahrnuje',
|
'includes': 'zahrnuje',
|
||||||
'Index': 'Index',
|
'Index': 'Index',
|
||||||
'insert new': 'vlo?it nov? z?znam ',
|
'insert new': 'vložit nový záznam ',
|
||||||
'insert new %s': 'vlo?it nov? z?znam %s',
|
'insert new %s': 'vložit nový záznam %s',
|
||||||
|
'inspect attributes': 'inspect attributes',
|
||||||
'Install': 'Instalovat',
|
'Install': 'Instalovat',
|
||||||
'Installed applications': 'Nainstalovan? aplikace',
|
'Installed applications': 'Nainstalované aplikace',
|
||||||
'Internal State': 'Vnit?n? stav',
|
'Interaction at %s line %s': 'Interakce v %s, na řádce %s',
|
||||||
'Introduction': '?vod',
|
'Interactive console': 'Interaktivní příkazová řádka',
|
||||||
'Invalid email': 'Neplatn? email',
|
'Internal State': 'Vnitřní stav',
|
||||||
'Invalid password': 'Nespr?vn? heslo',
|
'Introduction': 'Úvod',
|
||||||
'invalid password.': 'neplatn? heslo',
|
'Invalid email': 'Neplatný email',
|
||||||
'Invalid Query': 'Neplatn? dotaz',
|
'Invalid password': 'Nesprávné heslo',
|
||||||
'invalid request': 'Neplatn? po?adavek',
|
'invalid password.': 'neplatné heslo',
|
||||||
'Is Active': 'Je aktivn?',
|
'Invalid Query': 'Neplatný dotaz',
|
||||||
|
'invalid request': 'Neplatný požadavek',
|
||||||
|
'Is Active': 'Je aktivní',
|
||||||
'It is %s %%{day} today.': 'Dnes je to %s %%{den}.',
|
'It is %s %%{day} today.': 'Dnes je to %s %%{den}.',
|
||||||
'Key': 'Kl??',
|
'Key': 'Klíč',
|
||||||
'Key bindings': 'Vazby kl???',
|
'Key bindings': 'Vazby klíčů',
|
||||||
|
'Key bindings for ZenCoding Plugin': 'Key bindings for ZenCoding Plugin',
|
||||||
'languages': 'jazyky',
|
'languages': 'jazyky',
|
||||||
'Languages': 'Jazyky',
|
'Languages': 'Jazyky',
|
||||||
'Last name': 'P??jmen?',
|
'Last name': 'Příjmení',
|
||||||
'Last saved on:': 'Naposledy ulo?eno:',
|
'Last saved on:': 'Naposledy uloženo:',
|
||||||
'Layout': 'Rozvr?en? str?nky (layout)',
|
'Layout': 'Rozvržení stránky (layout)',
|
||||||
'Layout Plugins': 'Moduly rozvr?en? str?nky (Layout Plugins)',
|
'Layout Plugins': 'Moduly rozvržení stránky (Layout Plugins)',
|
||||||
'Layouts': 'Rozvr?en? str?nek',
|
'Layouts': 'Rozvržení stránek',
|
||||||
'License for': 'Licence pro',
|
'License for': 'Licence pro',
|
||||||
'Line number': '??slo ??dku',
|
'Line number': 'Číslo řádku',
|
||||||
'LineNo': '?.??dku',
|
'LineNo': 'Č.řádku',
|
||||||
'Live Chat': 'Online pokec',
|
'Live Chat': 'Online pokec',
|
||||||
'loading...': 'nahr?v?m...',
|
'loading...': 'nahrávám...',
|
||||||
'Locals##debug': 'Lok?ln? prom?nn?',
|
'locals': 'locals',
|
||||||
'Logged in': 'P?ihl??en? prob?hlo ?sp??n?',
|
'Locals##debug': 'Lokální proměnné',
|
||||||
'Logged out': 'Odhl??en? prob?hlo ?sp??n?',
|
'Logged in': 'Přihlášení proběhlo úspěšně',
|
||||||
'Login': 'P?ihl?sit se',
|
'Logged out': 'Odhlášení proběhlo úspěšně',
|
||||||
'login': 'p?ihl?sit se',
|
'Login': 'Přihlásit se',
|
||||||
'Login to the Administrative Interface': 'P?ihl?sit se do Spr?vce aplikac?',
|
'login': 'přihlásit se',
|
||||||
'logout': 'odhl?sit se',
|
'Login to the Administrative Interface': 'Přihlásit se do Správce aplikací',
|
||||||
'Logout': 'Odhl?sit se',
|
'logout': 'odhlásit se',
|
||||||
'Lost Password': 'Zapomn?l jste heslo',
|
'Logout': 'Odhlásit se',
|
||||||
'Lost password?': 'Zapomn?l jste heslo?',
|
'Lost Password': 'Zapomněl jste heslo',
|
||||||
'lost password?': 'zapomn?l jste heslo?',
|
'Lost password?': 'Zapomněl jste heslo?',
|
||||||
|
'lost password?': 'zapomněl jste heslo?',
|
||||||
|
'Manage': 'Manage',
|
||||||
'Manage Cache': 'Manage Cache',
|
'Manage Cache': 'Manage Cache',
|
||||||
'Menu Model': 'Model rozbalovac? nab?dky',
|
'Menu Model': 'Model rozbalovací nabídky',
|
||||||
'Models': 'Modely',
|
'Models': 'Modely',
|
||||||
'models': 'modely',
|
'models': 'modely',
|
||||||
'Modified By': 'Zm?n?no - k?m',
|
'Modified By': 'Změněno - kým',
|
||||||
'Modified On': 'Zm?n?no - kdy',
|
'Modified On': 'Změněno - kdy',
|
||||||
'Modules': 'Moduly',
|
'Modules': 'Moduly',
|
||||||
'modules': 'moduly',
|
'modules': 'moduly',
|
||||||
'My Sites': 'Spr?va aplikac?',
|
'My Sites': 'Správa aplikací',
|
||||||
'Name': 'Jm?no',
|
'Name': 'Jméno',
|
||||||
'New Application Wizard': 'Nov? pr?vodce aplikac?',
|
'new application "%s" created': 'nová aplikace "%s" vytvořena',
|
||||||
'New application wizard': 'Nov? pr?vodce aplikac?',
|
'New Application Wizard': 'Nový průvodce aplikací',
|
||||||
'New password': 'Nov? heslo',
|
'New application wizard': 'Nový průvodce aplikací',
|
||||||
'New Record': 'Nov? z?znam',
|
'New password': 'Nové heslo',
|
||||||
'new record inserted': 'nov? z?znam byl zalo?en',
|
'New Record': 'Nový záznam',
|
||||||
'New simple application': 'Vytvo?it primitivn? aplikaci',
|
'new record inserted': 'nový záznam byl založen',
|
||||||
'next 100 rows': 'dal??ch 100 ??dk?',
|
'New simple application': 'Vytvořit primitivní aplikaci',
|
||||||
'No databases in this application': 'V t?to aplik?ci nejsou ??dn? datab?ze',
|
'next': 'next',
|
||||||
'No Interaction yet': 'Je?t? ??dn? interakce nenastala',
|
'next 100 rows': 'dalších 100 řádků',
|
||||||
'No ticket_storage.txt found under /private folder': 'Soubor ticket_storage.txt v adres??i /private nenalezen',
|
'No databases in this application': 'V této aplikaci nejsou žádné databáze',
|
||||||
'Object or table name': 'Objekt ?i tabulka',
|
'No Interaction yet': 'Ještě žádná interakce nenastala',
|
||||||
'Old password': 'P?vodn? heslo',
|
'No ticket_storage.txt found under /private folder': 'Soubor ticket_storage.txt v adresáři /private nenalezen',
|
||||||
'online designer': 'online n?vrh??',
|
'Object or table name': 'Objekt či tabulka',
|
||||||
'Online examples': 'P??klady online',
|
'Old password': 'Původní heslo',
|
||||||
|
'online designer': 'online návrhář',
|
||||||
|
'Online examples': 'Příklady online',
|
||||||
|
'Open new app in new window': 'Open new app in new window',
|
||||||
|
'or alternatively': 'or alternatively',
|
||||||
|
'Or Get from URL:': 'Or Get from URL:',
|
||||||
'or import from csv file': 'nebo importovat z .csv souboru',
|
'or import from csv file': 'nebo importovat z .csv souboru',
|
||||||
'Origin': 'P?vod',
|
'Origin': 'Původ',
|
||||||
'Original/Translation': 'Origin?l/P?eklad',
|
'Original/Translation': 'Originál/Překlad',
|
||||||
'Other Plugins': 'Ostatn? moduly',
|
'Other Plugins': 'Ostatní moduly',
|
||||||
'Other Recipes': 'Ostatn? z?suvn? moduly',
|
'Other Recipes': 'Ostatní zásuvné moduly',
|
||||||
'Overview': 'P?ehled',
|
'Overview': 'Přehled',
|
||||||
'Overwrite installed app': 'P?epsat instalovanou aplikaci',
|
'Overwrite installed app': 'Přepsat instalovanou aplikaci',
|
||||||
'Pack all': 'Zabalit',
|
'Pack all': 'Zabalit',
|
||||||
'Pack compiled': 'Zabalit zkompilovan?',
|
'Pack compiled': 'Zabalit zkompilované',
|
||||||
|
'pack plugin': 'pack plugin',
|
||||||
'password': 'heslo',
|
'password': 'heslo',
|
||||||
'Password': 'Heslo',
|
'Password': 'Heslo',
|
||||||
"Password fields don't match": 'Hesla se neshoduj?',
|
"Password fields don't match": 'Hesla se neshodují',
|
||||||
'Please': 'Pros?m',
|
'Peeking at file': 'Peeking at file',
|
||||||
'plugins': 'z?suvn? moduly',
|
'Please': 'Prosím',
|
||||||
'Plugins': 'Z?suvn? moduly',
|
'Plugin "%s" in application': 'Plugin "%s" in application',
|
||||||
'Plural-Forms:': 'Mno?n? ??sla:',
|
'plugins': 'zásuvné moduly',
|
||||||
'Powered by': 'Poh?n?no',
|
'Plugins': 'Zásuvné moduly',
|
||||||
'Preface': 'P?edmluva',
|
'Plural Form #%s': 'Plural Form #%s',
|
||||||
'previous 100 rows': 'p?edchoz?ch 100 ??dk?',
|
'Plural-Forms:': 'Množná čísla:',
|
||||||
'Private files': 'Soukrom? soubory',
|
'Powered by': 'Poháněno',
|
||||||
'private files': 'soukrom? soubory',
|
'Preface': 'Předmluva',
|
||||||
|
'previous 100 rows': 'předchozích 100 řádků',
|
||||||
|
'Private files': 'Soukromé soubory',
|
||||||
|
'private files': 'soukromé soubory',
|
||||||
'profile': 'profil',
|
'profile': 'profil',
|
||||||
'Project Progress': 'V?voj projektu',
|
'Project Progress': 'Vývoj projektu',
|
||||||
'Python': 'Python',
|
'Python': 'Python',
|
||||||
'Query:': 'Dotaz:',
|
'Query:': 'Dotaz:',
|
||||||
'Quick Examples': 'Kr?tk? p??klady',
|
'Quick Examples': 'Krátké příklady',
|
||||||
'RAM': 'RAM',
|
'RAM': 'RAM',
|
||||||
'RAM Cache Keys': 'Kl??e RAM Cache',
|
'RAM Cache Keys': 'Klíče RAM Cache',
|
||||||
'Ram Cleared': 'RAM smaz?na',
|
'Ram Cleared': 'RAM smazána',
|
||||||
'Readme': 'N?pov?da',
|
'Readme': 'Nápověda',
|
||||||
'Recipes': 'Postupy jak na to',
|
'Recipes': 'Postupy jak na to',
|
||||||
'Record': 'Z?znam',
|
'Record': 'Záznam',
|
||||||
'record does not exist': 'z?znam neexistuje',
|
'record does not exist': 'záznam neexistuje',
|
||||||
'Record ID': 'ID z?znamu',
|
'Record ID': 'ID záznamu',
|
||||||
'Record id': 'id z?znamu',
|
'Record id': 'id záznamu',
|
||||||
'refresh': 'obnovte',
|
'refresh': 'obnovte',
|
||||||
'register': 'registrovat',
|
'register': 'registrovat',
|
||||||
'Register': 'Zaregistrovat se',
|
'Register': 'Zaregistrovat se',
|
||||||
'Registration identifier': 'Registra?n? identifik?tor',
|
'Registration identifier': 'Registrační identifikátor',
|
||||||
'Registration key': 'Registra?n? kl??',
|
'Registration key': 'Registrační klíč',
|
||||||
'Reload routes': 'Znovu nahr?t cesty',
|
'reload': 'reload',
|
||||||
'Remember me (for 30 days)': 'Zapamatovat na 30 dn?',
|
'Reload routes': 'Znovu nahrát cesty',
|
||||||
'Remove compiled': 'Odstranit zkompilovan?',
|
'Remember me (for 30 days)': 'Zapamatovat na 30 dní',
|
||||||
'Removed Breakpoint on %s at line %s': 'Bod p?eru?en? smaz?n - soubor %s na ??dce %s',
|
'Remove compiled': 'Odstranit zkompilované',
|
||||||
'Replace': 'Zam?nit',
|
'Removed Breakpoint on %s at line %s': 'Bod přerušení smazán - soubor %s na řádce %s',
|
||||||
'Replace All': 'Zam?nit v?e',
|
'Replace': 'Zaměnit',
|
||||||
'Reset Password key': 'Reset registra?n?ho kl??e',
|
'Replace All': 'Zaměnit vše',
|
||||||
|
'request': 'request',
|
||||||
|
'Reset Password key': 'Reset registračního klíče',
|
||||||
|
'response': 'response',
|
||||||
'restart': 'restart',
|
'restart': 'restart',
|
||||||
'restore': 'obnovit',
|
'restore': 'obnovit',
|
||||||
'Retrieve username': 'Z?skat p?ihla?ovac? jm?no',
|
'Retrieve username': 'Získat přihlašovací jméno',
|
||||||
'revert': 'vr?tit se k p?vodn?mu',
|
'return': 'return',
|
||||||
|
'revert': 'vrátit se k původnímu',
|
||||||
'Role': 'Role',
|
'Role': 'Role',
|
||||||
'Rows in Table': 'Z?znamy v tabulce',
|
'Rows in Table': 'Záznamy v tabulce',
|
||||||
'Rows selected': 'Z?znam? zobrazeno',
|
'Rows selected': 'Záznamů zobrazeno',
|
||||||
'rules are not defined': 'pravidla nejsou definov?na',
|
'rules are not defined': 'pravidla nejsou definována',
|
||||||
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Spust? testy v tomto souboru (ke spu?t?n? v?ech test?, pou?ijte tla??tko 'test')",
|
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Spustí testy v tomto souboru (ke spuštění všech testů, použijte tlačítko 'test')",
|
||||||
'Running on %s': 'B??? na %s',
|
'Running on %s': 'Běží na %s',
|
||||||
'Save': 'Ulo?it',
|
'Save': 'Uložit',
|
||||||
'Save via Ajax': 'Ulo?it pomoc? Ajaxu',
|
'Save file:': 'Save file:',
|
||||||
'Saved file hash:': 'hash ulo?en?ho souboru:',
|
'Save via Ajax': 'Uložit pomocí Ajaxu',
|
||||||
|
'Saved file hash:': 'hash uloženého souboru:',
|
||||||
'Semantic': 'Modul semantic',
|
'Semantic': 'Modul semantic',
|
||||||
'Services': 'Slu?by',
|
'Services': 'Služby',
|
||||||
'Set Breakpoint on %s at line %s: %s': 'Bod p?eru?en? nastaven v souboru %s na ??dce %s: %s',
|
'session': 'session',
|
||||||
'shell': 'p??kazov? ??dka',
|
'session expired': 'session expired',
|
||||||
'Site': 'Spr?va aplikac?',
|
'Set Breakpoint on %s at line %s: %s': 'Bod přerušení nastaven v souboru %s na řádce %s: %s',
|
||||||
|
'shell': 'příkazová řádka',
|
||||||
|
'Singular Form': 'Singular Form',
|
||||||
|
'Site': 'Správa aplikací',
|
||||||
'Size of cache:': 'Velikost cache:',
|
'Size of cache:': 'Velikost cache:',
|
||||||
'skip to generate': 'skip to generate',
|
'skip to generate': 'skip to generate',
|
||||||
'Sorry, could not find mercurial installed': 'Bohu?el mercurial nen? nainstalov?n.',
|
'Sorry, could not find mercurial installed': 'Bohužel mercurial není nainstalován.',
|
||||||
'Start a new app': 'Vytvo?it novou aplikaci',
|
'Start a new app': 'Vytvořit novou aplikaci',
|
||||||
'Start searching': 'Za??t hled?n?',
|
'Start searching': 'Začít hledání',
|
||||||
'Start wizard': 'Spustit pr?vodce',
|
'Start wizard': 'Spustit průvodce',
|
||||||
'state': 'stav',
|
'state': 'stav',
|
||||||
'static': 'statick? soubory',
|
'Static': 'Static',
|
||||||
'Static files': 'Statick? soubory',
|
'static': 'statické soubory',
|
||||||
|
'Static files': 'Statické soubory',
|
||||||
'Statistics': 'Statistika',
|
'Statistics': 'Statistika',
|
||||||
'Step': 'Step',
|
'Step': 'Step',
|
||||||
|
'step': 'step',
|
||||||
|
'stop': 'stop',
|
||||||
'Stylesheet': 'CSS styly',
|
'Stylesheet': 'CSS styly',
|
||||||
'submit': 'odeslat',
|
'submit': 'odeslat',
|
||||||
'Submit': 'Odeslat',
|
'Submit': 'Odeslat',
|
||||||
'successful': '?sp??n?',
|
'successful': 'úspěšně',
|
||||||
'Support': 'Podpora',
|
'Support': 'Podpora',
|
||||||
'Sure you want to delete this object?': 'Opravdu chcete smazat tento objekt?',
|
'Sure you want to delete this object?': 'Opravdu chcete smazat tento objekt?',
|
||||||
'Table': 'tabulka',
|
'Table': 'tabulka',
|
||||||
'Table name': 'N?zev tabulky',
|
'Table name': 'Název tabulky',
|
||||||
'Temporary': 'Do?asn?',
|
'Temporary': 'Dočasný',
|
||||||
'test': 'test',
|
'test': 'test',
|
||||||
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"Dotaz" je podm?nka, nap??klad "db.tabulka1.pole1==\'hodnota\'". Podm?nka "db.tabulka1.pole1==db.tabulka2.pole2" pak vytvo?? SQL JOIN.',
|
'Testing application': 'Testing application',
|
||||||
'The application logic, each URL path is mapped in one exposed function in the controller': 'Logika aplikace: ka?d? URL je mapov?na na funkci vystavovanou kontrol?rem.',
|
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': '"Dotaz" je podmínka, například "db.tabulka1.pole1==\'hodnota\'". Podmínka "db.tabulka1.pole1==db.tabulka2.pole2" pak vytvoří SQL JOIN.',
|
||||||
'The Core': 'J?dro (The Core)',
|
'The application logic, each URL path is mapped in one exposed function in the controller': 'Logika aplikace: každá URL je mapována na funkci vystavovanou kontrolérem.',
|
||||||
'The data representation, define database tables and sets': 'Reprezentace dat: definovat tabulky datab?ze a z?znamy',
|
'The Core': 'Jádro (The Core)',
|
||||||
'The output of the file is a dictionary that was rendered by the view %s': 'V?stup ze souboru je slovn?k, kter? se zobrazil v pohledu %s.',
|
'The data representation, define database tables and sets': 'Reprezentace dat: definovat tabulky databáze a záznamy',
|
||||||
'The presentations layer, views are also known as templates': 'Prezenta?n? vrstva: pohledy ?i templaty (?ablony)',
|
'The output of the file is a dictionary that was rendered by the view %s': 'Výstup ze souboru je slovník, který se zobrazil v pohledu %s.',
|
||||||
|
'The presentations layer, views are also known as templates': 'Prezentační vrstva: pohledy či templaty (šablony)',
|
||||||
'The Views': 'Pohledy (The Views)',
|
'The Views': 'Pohledy (The Views)',
|
||||||
'There are no plugins': '??dn? moduly nejsou instalov?ny.',
|
'There are no controllers': 'There are no controllers',
|
||||||
'There are no private files': '??dn? soukrom? soubory neexistuj?.',
|
'There are no modules': 'There are no modules',
|
||||||
'These files are not served, they are only available from within your app': 'Tyto soubory jsou klient?m nep??stupn?. K dispozici jsou pouze v r?mci aplikace.',
|
'There are no plugins': 'Žádné moduly nejsou instalovány.',
|
||||||
'These files are served without processing, your images go here': 'Tyto soubory jsou serv?rov?ny bez p??davn? logiky, sem pat?? nap?. obr?zky.',
|
'There are no private files': 'Žádné soukromé soubory neexistují.',
|
||||||
|
'There are no static files': 'There are no static files',
|
||||||
|
'There are no translators, only default language is supported': 'There are no translators, only default language is supported',
|
||||||
|
'There are no views': 'There are no views',
|
||||||
|
'These files are not served, they are only available from within your app': 'Tyto soubory jsou klientům nepřístupné. K dispozici jsou pouze v rámci aplikace.',
|
||||||
|
'These files are served without processing, your images go here': 'Tyto soubory jsou servírovány bez přídavné logiky, sem patří např. obrázky.',
|
||||||
'This App': 'Tato aplikace',
|
'This App': 'Tato aplikace',
|
||||||
'This is a copy of the scaffolding application': 'Toto je kopie aplikace skelet.',
|
'This is a copy of the scaffolding application': 'Toto je kopie aplikace skelet.',
|
||||||
'this page to see if a breakpoint was hit and debug interaction is required.': 'tuto str?nku, abyste uvid?li, zda se dos?hlo bodu p?eru?en?.',
|
'This is an experimental feature and it needs more testing. If you decide to upgrade you do it at your own risk': 'This is an experimental feature and it needs more testing. If you decide to upgrade you do it at your own risk',
|
||||||
|
'This is the %(filename)s template': 'This is the %(filename)s template',
|
||||||
|
'this page to see if a breakpoint was hit and debug interaction is required.': 'tuto stránku, abyste uviděli, zda se dosáhlo bodu přerušení.',
|
||||||
'Ticket': 'Ticket',
|
'Ticket': 'Ticket',
|
||||||
'Time in Cache (h:m:s)': '?as v Cache (h:m:s)',
|
'Ticket ID': 'Ticket ID',
|
||||||
'Timestamp': '?asov? raz?tko',
|
'Time in Cache (h:m:s)': 'Čas v Cache (h:m:s)',
|
||||||
'to previous version.': 'k p?edchoz? verzi.',
|
'Timestamp': 'Časové razítko',
|
||||||
'To create a plugin, name a file/folder plugin_[name]': 'Z?suvn? modul vytvo??te tak, ?e pojmenujete soubor/adres?? plugin_[jm?no modulu]',
|
'to previous version.': 'k předchozí verzi.',
|
||||||
'To emulate a breakpoint programatically, write:': 'K nastaven? bodu p?eru?en? v k?du programu, napi?te:',
|
'To create a plugin, name a file/folder plugin_[name]': 'Zásuvný modul vytvoříte tak, že pojmenujete soubor/adresář plugin_[jméno modulu]',
|
||||||
'to use the debugger!': ', abyste mohli lad?c? program pou??vat!',
|
'To emulate a breakpoint programatically, write:': 'K nastavení bodu přerušení v kódu programu, napište:',
|
||||||
'toggle breakpoint': 'vyp./zap. bod p?eru?en?',
|
'to use the debugger!': ', abyste mohli ladící program používat!',
|
||||||
'Toggle Fullscreen': 'Na celou obrazovku a zp?t',
|
'toggle breakpoint': 'vyp./zap. bod přerušení',
|
||||||
'too short': 'P??li? kr?tk?',
|
'Toggle Fullscreen': 'Na celou obrazovku a zpět',
|
||||||
'Translation strings for the application': 'P?eklad text? pro aplikaci',
|
'too short': 'Příliš krátké',
|
||||||
'Try the mobile interface': 'Zkuste rozhran? pro mobiln? za??zen?',
|
'Traceback': 'Traceback',
|
||||||
|
'Translation strings for the application': 'Překlad textů pro aplikaci',
|
||||||
|
'try something like': 'try something like',
|
||||||
|
'Try the mobile interface': 'Zkuste rozhraní pro mobilní zařízení',
|
||||||
|
'try view': 'try view',
|
||||||
'Twitter': 'Twitter',
|
'Twitter': 'Twitter',
|
||||||
'unable to parse csv file': 'csv soubor ned? sa zpracovat',
|
'Type python statement in here and hit Return (Enter) to execute it.': 'Type python statement in here and hit Return (Enter) to execute it.',
|
||||||
'uncheck all': 'v?e odzna?it',
|
'Type some Python code in here and hit Return (Enter) to execute it.': 'Type some Python code in here and hit Return (Enter) to execute it.',
|
||||||
|
'Unable to check for upgrades': 'Unable to check for upgrades',
|
||||||
|
'unable to parse csv file': 'csv soubor nedá sa zpracovat',
|
||||||
|
'uncheck all': 'vše odznačit',
|
||||||
'Uninstall': 'Odinstalovat',
|
'Uninstall': 'Odinstalovat',
|
||||||
'update': 'aktualizovat',
|
'update': 'aktualizovat',
|
||||||
'update all languages': 'aktualizovat v?echny jazyky',
|
'update all languages': 'aktualizovat všechny jazyky',
|
||||||
'Update:': 'Upravit:',
|
'Update:': 'Upravit:',
|
||||||
'upload': 'nahr?t',
|
'Upgrade': 'Upgrade',
|
||||||
'Upload a package:': 'Nahr?t bal?k:',
|
'upgrade now': 'upgrade now',
|
||||||
'Upload and install packed application': 'Nahr?t a instalovat zabalenou aplikaci',
|
'upgrade now to %s': 'upgrade now to %s',
|
||||||
'upload file:': 'nahr?t soubor:',
|
'upload': 'nahrát',
|
||||||
'upload plugin file:': 'nahr?t soubor modulu:',
|
'Upload': 'Upload',
|
||||||
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Pou?ijte (...)&(...) pro AND, (...)|(...) pro OR a ~(...) pro NOT pro sestaven? slo?it?j??ch dotaz?.',
|
'Upload a package:': 'Nahrát balík:',
|
||||||
'User %(id)s Logged-in': 'U?ivatel %(id)s p?ihl??en',
|
'Upload and install packed application': 'Nahrát a instalovat zabalenou aplikaci',
|
||||||
'User %(id)s Logged-out': 'U?ivatel %(id)s odhl??en',
|
'upload file:': 'nahrát soubor:',
|
||||||
'User %(id)s Password changed': 'U?ivatel %(id)s zm?nil heslo',
|
'upload plugin file:': 'nahrát soubor modulu:',
|
||||||
'User %(id)s Profile updated': 'U?ivatel %(id)s upravil profil',
|
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Použijte (...)&(...) pro AND, (...)|(...) pro OR a ~(...) pro NOT pro sestavení složitějších dotazů.',
|
||||||
'User %(id)s Registered': 'U?ivatel %(id)s se zaregistroval',
|
'User %(id)s Logged-in': 'Uživatel %(id)s přihlášen',
|
||||||
'User %(id)s Username retrieved': 'U?ivatel %(id)s si nachal zaslat p?ihla?ovac? jm?no',
|
'User %(id)s Logged-out': 'Uživatel %(id)s odhlášen',
|
||||||
'User ID': 'ID u?ivatele',
|
'User %(id)s Password changed': 'Uživatel %(id)s změnil heslo',
|
||||||
'Username': 'P?ihla?ovac? jm?no',
|
'User %(id)s Profile updated': 'Uživatel %(id)s upravil profil',
|
||||||
|
'User %(id)s Registered': 'Uživatel %(id)s se zaregistroval',
|
||||||
|
'User %(id)s Username retrieved': 'Uživatel %(id)s si nachal zaslat přihlašovací jméno',
|
||||||
|
'User ID': 'ID uživatele',
|
||||||
|
'Username': 'Přihlašovací jméno',
|
||||||
|
'variables': 'variables',
|
||||||
'Verify Password': 'Zopakujte heslo',
|
'Verify Password': 'Zopakujte heslo',
|
||||||
|
'Version': 'Verze',
|
||||||
'Version %s.%s.%s (%s) %s': 'Verze %s.%s.%s (%s) %s',
|
'Version %s.%s.%s (%s) %s': 'Verze %s.%s.%s (%s) %s',
|
||||||
'Versioning': 'Verzov?n?',
|
'Versioning': 'Verzování',
|
||||||
'Videos': 'Videa',
|
'Videos': 'Videa',
|
||||||
'View': 'Pohled (View)',
|
'View': 'Pohled (View)',
|
||||||
'Views': 'Pohledy',
|
'Views': 'Pohledy',
|
||||||
'views': 'pohledy',
|
'views': 'pohledy',
|
||||||
'Web Framework': 'Web Framework',
|
'Web Framework': 'Web Framework',
|
||||||
'web2py is up to date': 'M?te aktu?ln? verzi web2py.',
|
'web2py is up to date': 'Máte aktuální verzi web2py.',
|
||||||
'web2py online debugger': 'Lad?c? online web2py program',
|
'web2py online debugger': 'Ladící online web2py program',
|
||||||
'web2py Recent Tweets': '?t?bet?n? na Twitteru o web2py',
|
'web2py Recent Tweets': 'Štěbetání na Twitteru o web2py',
|
||||||
'Welcome': 'V?tejte',
|
'web2py upgrade': 'web2py upgrade',
|
||||||
|
'web2py upgraded; please restart it': 'web2py upgraded; please restart it',
|
||||||
|
'Welcome': 'Vítejte',
|
||||||
'Welcome to web2py': 'Vitejte ve web2py',
|
'Welcome to web2py': 'Vitejte ve web2py',
|
||||||
'Welcome to web2py!': 'V?tejte ve web2py!',
|
'Welcome to web2py!': 'Vítejte ve web2py!',
|
||||||
'Which called the function %s located in the file %s': 'kter? zavolala funkci %s v souboru (kontrol?ru) %s.',
|
'Which called the function %s located in the file %s': 'která zavolala funkci %s v souboru (kontroléru) %s.',
|
||||||
'You are successfully running web2py': '?sp??n? jste spustili web2py.',
|
'You are successfully running web2py': 'Úspěšně jste spustili web2py.',
|
||||||
'You can also set and remove breakpoint in the edit window, using the Toggle Breakpoint button': 'Nastavovat a mazat body p?eru?en? je t?? mo?no v r?mci editov?n? zdrojov?ho souboru p?es tla??tko Vyp./Zap. bod p?eru?en?',
|
'You can also set and remove breakpoint in the edit window, using the Toggle Breakpoint button': 'Nastavovat a mazat body přerušení je též možno v rámci editování zdrojového souboru přes tlačítko Vyp./Zap. bod přerušení',
|
||||||
'You can modify this application and adapt it to your needs': 'Tuto aplikaci si m??ete upravit a p?izp?sobit ji sv?m pot?eb?m.',
|
'You can modify this application and adapt it to your needs': 'Tuto aplikaci si můžete upravit a přizpůsobit ji svým potřebám.',
|
||||||
'You need to set up and reach a': 'Je t?eba nejprve nastavit a doj?t a? na',
|
'You need to set up and reach a': 'Je třeba nejprve nastavit a dojít až na',
|
||||||
'You visited the url %s': 'Nav?t?vili jste str?nku %s,',
|
'You visited the url %s': 'Navštívili jste stránku %s,',
|
||||||
|
'Your application will be blocked until you click an action button (next, step, continue, etc.)': 'Aplikace bude blokována než se klikne na jedno z tlačítek (další, krok, pokračovat, atd.)',
|
||||||
|
'Your can inspect variables using the console bellow': 'Níže pomocí příkazové řádky si můžete prohlédnout proměnné',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,54 +3,62 @@
|
|||||||
'!langcode!': 'de',
|
'!langcode!': 'de',
|
||||||
'!langname!': 'Deutsch',
|
'!langname!': 'Deutsch',
|
||||||
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Update" ist ein optionaler Ausdruck wie "Feld1 = \'newvalue". JOIN Ergebnisse können nicht aktualisiert oder gelöscht werden',
|
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Update" ist ein optionaler Ausdruck wie "Feld1 = \'newvalue". JOIN Ergebnisse können nicht aktualisiert oder gelöscht werden',
|
||||||
'%s %%{row} deleted': '%s Zeilen gelöscht',
|
'%s %%{row} deleted': '%s %%{row} Zeilen gelöscht',
|
||||||
'%s %%{row} updated': '%s Zeilen aktualisiert',
|
'%s %%{row} updated': '%s %%{row} Zeilen aktualisiert',
|
||||||
'%Y-%m-%d': '%Y-%m-%d',
|
'%Y-%m-%d': '%d.%m.%Y',
|
||||||
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
|
'%Y-%m-%d %H:%M:%S': '%d.%m.%Y %H:%M:%S',
|
||||||
'(requires internet access)': '(requires internet access)',
|
'(requires internet access)': '(Internet Zugang wir benötigt)',
|
||||||
|
'(requires internet access, experimental)': '(benötigt Internet Zugang)',
|
||||||
'(something like "it-it")': '(so etwas wie "it-it")',
|
'(something like "it-it")': '(so etwas wie "it-it")',
|
||||||
'@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files',
|
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(file **gluon/contrib/plural_rules/%s.py** is not found)',
|
||||||
|
'@markmin\x01Searching: **%s** %%{file}': '@markmin\x01Suche: **%s** Dateien',
|
||||||
'A new version of web2py is available': 'Eine neue Version von web2py ist verfügbar',
|
'A new version of web2py is available': 'Eine neue Version von web2py ist verfügbar',
|
||||||
'A new version of web2py is available: %s': 'Eine neue Version von web2py ist verfügbar: %s',
|
'A new version of web2py is available: %s': 'Eine neue Version von web2py ist verfügbar: %s',
|
||||||
'Abort': 'Abbrechen',
|
'Abort': 'Abbrechen',
|
||||||
'About': 'Über',
|
'About': 'über',
|
||||||
'About application': 'Über die Anwendung',
|
'About application': 'über die Anwendung',
|
||||||
'Additional code for your application': 'Additional code for your application',
|
'Additional code for your application': 'zusätzlicher Code für Ihre Anwendung',
|
||||||
'additional code for your application': 'zusätzlicher Code für Ihre Anwendung',
|
'admin disabled because no admin password': 'admin ist deaktiviert, weil kein Admin-Passwort gesetzt ist',
|
||||||
'admin disabled because no admin password': ' admin ist deaktiviert, weil kein Admin-Passwort gesetzt ist',
|
|
||||||
'admin disabled because not supported on google apps engine': 'admin ist deaktiviert, es existiert dafür keine Unterstützung auf der google apps engine',
|
'admin disabled because not supported on google apps engine': 'admin ist deaktiviert, es existiert dafür keine Unterstützung auf der google apps engine',
|
||||||
'admin disabled because unable to access password file': 'admin ist deaktiviert, weil kein Zugriff auf die Passwortdatei besteht',
|
'admin disabled because unable to access password file': 'admin ist deaktiviert, weil kein Zugriff auf die Passwortdatei besteht',
|
||||||
'Admin is disabled because insecure channel': 'Appadmin ist deaktiviert, wegen der Benutzung eines unsicheren Kanals',
|
'Admin is disabled because insecure channel': 'Appadmin ist deaktiviert, wegen der Benutzung eines unsicheren Kanals',
|
||||||
'Admin is disabled because unsecure channel': 'Appadmin ist deaktiviert, wegen der Benutzung eines unsicheren Kanals',
|
'Admin is disabled because unsecure channel': 'Appadmin ist deaktiviert, wegen der Benutzung eines unsicheren Kanals',
|
||||||
'Admin language': 'Admin language',
|
'Admin language': 'Admin-Sprache',
|
||||||
'administrative interface': 'administrative interface',
|
'administrative interface': 'Administrative Schnittstelle',
|
||||||
'Administrator Password:': 'Administrator Passwort:',
|
'Administrator Password:': 'Administrator Passwort:',
|
||||||
|
'An error occured, please %s the page': 'Ein Fehler ist aufgetereten, bitte %s die Seite',
|
||||||
'and rename it (required):': 'und benenne sie um (erforderlich):',
|
'and rename it (required):': 'und benenne sie um (erforderlich):',
|
||||||
'and rename it:': ' und benenne sie um:',
|
'and rename it:': ' und benenne sie um:',
|
||||||
'appadmin': 'appadmin',
|
'appadmin': 'appadmin',
|
||||||
'appadmin is disabled because insecure channel': 'Appadmin ist deaktiviert, wegen der Benutzung eines unsicheren Kanals',
|
'appadmin is disabled because insecure channel': 'Appadmin ist deaktiviert, wegen der Benutzung eines unsicheren Kanals',
|
||||||
|
'Application': 'Anwendung',
|
||||||
'application "%s" uninstalled': 'Anwendung "%s" deinstalliert',
|
'application "%s" uninstalled': 'Anwendung "%s" deinstalliert',
|
||||||
'application compiled': 'Anwendung kompiliert',
|
'application compiled': 'Anwendung kompiliert',
|
||||||
'application is compiled and cannot be designed': 'Die Anwendung ist kompiliert kann deswegen nicht mehr geändert werden',
|
'application is compiled and cannot be designed': 'Die Anwendung ist kompiliert kann deswegen nicht mehr geändert werden',
|
||||||
'Application name:': 'Application name:',
|
'Application name:': 'Name der Applikation:',
|
||||||
|
'are not used': 'wird nicht verwendet',
|
||||||
|
'are not used yet': 'wird bisher nicht verwendet',
|
||||||
'Are you sure you want to delete file "%s"?': 'Sind Sie sich sicher, dass Sie diese Datei löschen wollen "%s"?',
|
'Are you sure you want to delete file "%s"?': 'Sind Sie sich sicher, dass Sie diese Datei löschen wollen "%s"?',
|
||||||
'Are you sure you want to delete this object?': 'Are you sure you want to delete this object?',
|
'Are you sure you want to delete this object?': 'Sind Sie sich sicher, dass Sie dieses Objekt löschen wollen?',
|
||||||
'Are you sure you want to uninstall application "%s"': 'Sind Sie sich sicher, dass Sie diese Anwendung deinstallieren wollen "%s"',
|
'Are you sure you want to uninstall application "%s"': 'Sind Sie sich sicher, dass Sie diese Anwendung deinstallieren wollen "%s"',
|
||||||
'Are you sure you want to uninstall application "%s"?': 'Sind Sie sich sicher, dass Sie diese Anwendung deinstallieren wollen "%s"?',
|
'Are you sure you want to uninstall application "%s"?': 'Sind Sie sich sicher, dass Sie diese Anwendung deinstallieren wollen "%s"?',
|
||||||
'Are you sure you want to upgrade web2py now?': 'Sind Sie sich sicher, dass Sie web2py jetzt upgraden möchten?',
|
'Are you sure you want to upgrade web2py now?': 'Sind Sie sich sicher, dass Sie web2py jetzt upgraden möchten?',
|
||||||
'arguments': 'arguments',
|
'arguments': 'arguments',
|
||||||
|
'at char %s': 'at char %s',
|
||||||
|
'at line %s': 'at line %s',
|
||||||
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ACHTUNG: Die Einwahl benötigt eine sichere (HTTPS) Verbindung. Es sei denn sie läuft Lokal(localhost).',
|
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ACHTUNG: Die Einwahl benötigt eine sichere (HTTPS) Verbindung. Es sei denn sie läuft Lokal(localhost).',
|
||||||
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ACHTUNG: Testen ist nicht threadsicher. Führen sie also nicht mehrere Tests gleichzeitig aus.',
|
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ACHTUNG: Testen ist nicht threadsicher. Führen sie also nicht mehrere Tests gleichzeitig aus.',
|
||||||
'ATTENTION: This is an experimental feature and it needs more testing.': 'ACHTUNG: Dies ist eine experimentelle Funktion und benötigt noch weitere Tests.',
|
'ATTENTION: This is an experimental feature and it needs more testing.': 'ACHTUNG: Dies ist eine experimentelle Funktion und benötigt noch weitere Tests.',
|
||||||
'ATTENTION: you cannot edit the running application!': 'ACHTUNG: Eine laufende Anwendung kann nicht editiert werden!',
|
'ATTENTION: you cannot edit the running application!': 'ACHTUNG: Eine laufende Anwendung kann nicht editiert werden!',
|
||||||
'Authentication': 'Authentifizierung',
|
'Authentication': 'Authentifizierung',
|
||||||
'Available databases and tables': 'Verfügbare Datenbanken und Tabellen',
|
'Available databases and tables': 'verfügbare Datenbanken und Tabellen',
|
||||||
'back': 'zurück',
|
'back': 'zurück',
|
||||||
'beautify': 'beautify',
|
'beautify': 'verschönern',
|
||||||
'cache': 'Cache',
|
'cache': 'Pufferspeicher',
|
||||||
'cache, errors and sessions cleaned': 'Zwischenspeicher (cache), Fehler und Sitzungen (sessions) gelöscht',
|
'cache, errors and sessions cleaned': 'Zwischenspeicher (cache), Fehler und Sitzungen (sessions) gelöscht',
|
||||||
'call': 'call',
|
'call': 'Aufruf',
|
||||||
'can be a git repo': 'can be a git repo',
|
'can be a git repo': 'kann ein git Repository sein',
|
||||||
|
'Cancel': 'Cancel',
|
||||||
'Cannot be empty': 'Darf nicht leer sein',
|
'Cannot be empty': 'Darf nicht leer sein',
|
||||||
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Nicht Kompilierbar:Es sind Fehler in der Anwendung. Beseitigen Sie die Fehler und versuchen Sie es erneut.',
|
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Nicht Kompilierbar:Es sind Fehler in der Anwendung. Beseitigen Sie die Fehler und versuchen Sie es erneut.',
|
||||||
'cannot create file': 'Kann Datei nicht erstellen',
|
'cannot create file': 'Kann Datei nicht erstellen',
|
||||||
@@ -62,29 +70,31 @@
|
|||||||
'Check for upgrades': 'check for upgrades',
|
'Check for upgrades': 'check for upgrades',
|
||||||
'Check to delete': 'Markiere zum löschen',
|
'Check to delete': 'Markiere zum löschen',
|
||||||
'Checking for upgrades...': 'Auf Updates überprüfen...',
|
'Checking for upgrades...': 'Auf Updates überprüfen...',
|
||||||
'Clean': 'löschen',
|
'Clean': 'leeren',
|
||||||
'click here for online examples': 'hier klicken für online Beispiele',
|
'click here for online examples': 'hier klicken für online Beispiele',
|
||||||
'click here for the administrative interface': 'hier klicken für die Administrationsoberfläche ',
|
'click here for the administrative interface': 'hier klicken für die Administrationsoberfläche ',
|
||||||
|
'Click row to expand traceback': 'Klicke auf die Zeile für Fehlerverfolgung',
|
||||||
'click to check for upgrades': 'hier klicken um nach Upgrades zu suchen',
|
'click to check for upgrades': 'hier klicken um nach Upgrades zu suchen',
|
||||||
'Client IP': 'Client IP',
|
'Client IP': 'Client IP',
|
||||||
'code': 'code',
|
'code': 'code',
|
||||||
'collapse/expand all': 'collapse/expand all',
|
'collapse/expand all': 'alles zu- bzw. aufklappen',
|
||||||
'Compile': 'kompilieren',
|
'Compile': 'kompilieren',
|
||||||
'compiled application removed': 'kompilierte Anwendung gelöscht',
|
'compiled application removed': 'kompilierte Anwendung gelöscht',
|
||||||
'Controller': 'Controller',
|
'Controller': 'Controller',
|
||||||
'Controllers': 'Controller',
|
'Controllers': 'Controller',
|
||||||
'controllers': 'Controllers',
|
'controllers': 'Controllers',
|
||||||
'Copyright': 'Urheberrecht',
|
'Copyright': 'Urheberrecht',
|
||||||
|
'Count': 'Anzahl',
|
||||||
'Create': 'erstellen',
|
'Create': 'erstellen',
|
||||||
'create file with filename:': 'erzeuge Datei mit Dateinamen:',
|
'create file with filename:': 'erzeuge Datei mit Dateinamen:',
|
||||||
'create new application:': 'erzeuge neue Anwendung:',
|
'create new application:': 'erzeuge neue Anwendung:',
|
||||||
'Create new simple application': 'Erzeuge neue Anwendung',
|
'Create new simple application': 'Erzeuge neue Anwendung',
|
||||||
'created by': 'created by',
|
'created by': 'erstellt von',
|
||||||
'crontab': 'crontab',
|
'crontab': 'crontab',
|
||||||
'Current request': 'Aktuelle Anfrage (request)',
|
'Current request': 'Aktuelle Anfrage (request)',
|
||||||
'Current response': 'Aktuelle Antwort (response)',
|
'Current response': 'Aktuelle Antwort (response)',
|
||||||
'Current session': 'Aktuelle Sitzung (session)',
|
'Current session': 'Aktuelle Sitzung (session)',
|
||||||
'currently running': 'currently running',
|
'currently running': 'aktuell in Betrieb',
|
||||||
'currently saved or': 'des derzeit gespeicherten oder',
|
'currently saved or': 'des derzeit gespeicherten oder',
|
||||||
'customize me!': 'pass mich an!',
|
'customize me!': 'pass mich an!',
|
||||||
'data uploaded': 'Daten hochgeladen',
|
'data uploaded': 'Daten hochgeladen',
|
||||||
@@ -97,23 +107,27 @@
|
|||||||
'DB Model': 'DB Modell',
|
'DB Model': 'DB Modell',
|
||||||
'Debug': 'Debug',
|
'Debug': 'Debug',
|
||||||
'defines tables': 'definiere Tabellen',
|
'defines tables': 'definiere Tabellen',
|
||||||
'Delete': 'Löschen',
|
'Delete': 'löschen',
|
||||||
'delete': 'löschen',
|
'delete': 'löschen',
|
||||||
'delete all checked': 'lösche alle markierten',
|
'delete all checked': 'lösche alle markierten',
|
||||||
'delete plugin': 'Plugin löschen',
|
'delete plugin': 'Plugin löschen',
|
||||||
'Delete:': 'Löschen:',
|
'Delete this file (you will be asked to confirm deletion)': 'Delete this file (you will be asked to confirm deletion)',
|
||||||
'Deploy': 'deploy',
|
'Delete:': 'löschen:',
|
||||||
|
'Deploy': 'Installieren',
|
||||||
'Deploy on Google App Engine': 'Auf Google App Engine installieren',
|
'Deploy on Google App Engine': 'Auf Google App Engine installieren',
|
||||||
'Deploy to OpenShift': 'Deploy to OpenShift',
|
'Deploy to OpenShift': 'Auf OpenShift installieren',
|
||||||
'Description': 'Beschreibung',
|
'Description': 'Beschreibung',
|
||||||
'design': 'design',
|
'design': 'design',
|
||||||
'DESIGN': 'design',
|
'DESIGN': 'design',
|
||||||
'Design for': 'Design für',
|
'Design for': 'Design für',
|
||||||
|
'Detailed traceback description': 'Detailed traceback description',
|
||||||
'direction: ltr': 'direction: ltr',
|
'direction: ltr': 'direction: ltr',
|
||||||
'Disable': 'Disable',
|
'Disable': 'Deaktivieren',
|
||||||
|
'docs': 'docs',
|
||||||
'documentation': 'Dokumentation',
|
'documentation': 'Dokumentation',
|
||||||
'done!': 'fertig!',
|
'done!': 'fertig!',
|
||||||
'download layouts': 'download layouts',
|
'Download .w2p': 'Download .w2p',
|
||||||
|
'download layouts': 'Layouts herunterladen',
|
||||||
'download plugins': 'download plugins',
|
'download plugins': 'download plugins',
|
||||||
'E-mail': 'E-mail',
|
'E-mail': 'E-mail',
|
||||||
'EDIT': 'BEARBEITEN',
|
'EDIT': 'BEARBEITEN',
|
||||||
@@ -128,16 +142,23 @@
|
|||||||
'Editing file': 'Bearbeite Datei',
|
'Editing file': 'Bearbeite Datei',
|
||||||
'Editing file "%s"': 'Bearbeite Datei "%s"',
|
'Editing file "%s"': 'Bearbeite Datei "%s"',
|
||||||
'Editing Language file': 'Sprachdatei bearbeiten',
|
'Editing Language file': 'Sprachdatei bearbeiten',
|
||||||
|
'Enable': 'Enable',
|
||||||
'Enterprise Web Framework': 'Enterprise Web Framework',
|
'Enterprise Web Framework': 'Enterprise Web Framework',
|
||||||
|
'Error': 'Fehler',
|
||||||
'Error logs for "%(app)s"': 'Fehlerprotokoll für "%(app)s"',
|
'Error logs for "%(app)s"': 'Fehlerprotokoll für "%(app)s"',
|
||||||
|
'Error snapshot': 'Error snapshot',
|
||||||
|
'Error ticket': 'Error ticket',
|
||||||
'Errors': 'Fehler',
|
'Errors': 'Fehler',
|
||||||
'escape': 'escape',
|
'escape': 'escape',
|
||||||
'Exception instance attributes': 'Atribute der Ausnahmeinstanz',
|
'Exception instance attributes': 'Atribute der Ausnahmeinstanz',
|
||||||
'Expand Abbreviation': 'Kürzel erweitern',
|
'Expand Abbreviation': 'Kürzel erweitern',
|
||||||
'export as csv file': 'Exportieren als CSV-Datei',
|
'export as csv file': 'Exportieren als CSV-Datei',
|
||||||
'exposes': 'stellt zur Verfügung',
|
'exposes': 'stellt zur Verfügung',
|
||||||
|
'exposes:': 'exposes:',
|
||||||
'extends': 'erweitert',
|
'extends': 'erweitert',
|
||||||
|
'failed to compile file because:': 'failed to compile file because:',
|
||||||
'failed to reload module': 'neu laden des Moduls fehlgeschlagen',
|
'failed to reload module': 'neu laden des Moduls fehlgeschlagen',
|
||||||
|
'File': 'Datei',
|
||||||
'file "%(filename)s" created': 'Datei "%(filename)s" erstellt',
|
'file "%(filename)s" created': 'Datei "%(filename)s" erstellt',
|
||||||
'file "%(filename)s" deleted': 'Datei "%(filename)s" gelöscht',
|
'file "%(filename)s" deleted': 'Datei "%(filename)s" gelöscht',
|
||||||
'file "%(filename)s" uploaded': 'Datei "%(filename)s" hochgeladen',
|
'file "%(filename)s" uploaded': 'Datei "%(filename)s" hochgeladen',
|
||||||
@@ -148,25 +169,33 @@
|
|||||||
'file saved on %(time)s': 'Datei gespeichert am %(time)s',
|
'file saved on %(time)s': 'Datei gespeichert am %(time)s',
|
||||||
'file saved on %s': 'Datei gespeichert auf %s',
|
'file saved on %s': 'Datei gespeichert auf %s',
|
||||||
'filter': 'filter',
|
'filter': 'filter',
|
||||||
|
'Find Next': 'Find Next',
|
||||||
|
'Find Previous': 'Find Previous',
|
||||||
'First name': 'Vorname',
|
'First name': 'Vorname',
|
||||||
|
'Frames': 'Frames',
|
||||||
'Functions with no doctests will result in [passed] tests.': 'Funktionen ohne doctests erzeugen [passed] in Tests',
|
'Functions with no doctests will result in [passed] tests.': 'Funktionen ohne doctests erzeugen [passed] in Tests',
|
||||||
'Get from URL:': 'Get from URL:',
|
'Get from URL:': 'Get from URL:',
|
||||||
'Git Pull': 'Git Pull',
|
'Git Pull': 'Git Pull',
|
||||||
'Git Push': 'Git Push',
|
'Git Push': 'Git Push',
|
||||||
'Go to Matching Pair': 'gehe zum übereinstimmenden Paar',
|
'Go to Matching Pair': 'gehe zum übereinstimmenden Paar',
|
||||||
|
'Goto': 'Goto',
|
||||||
|
'graph model': 'graph model',
|
||||||
'Group ID': 'Gruppen ID',
|
'Group ID': 'Gruppen ID',
|
||||||
'Hello World': 'Hallo Welt',
|
'Hello World': 'Hallo Welt',
|
||||||
'Help': 'Hilfe',
|
'Help': 'Hilfe',
|
||||||
|
'Hide/Show Translated strings': 'Hide/Show Translated strings',
|
||||||
|
'Home': 'Home',
|
||||||
'htmledit': 'htmledit',
|
'htmledit': 'htmledit',
|
||||||
'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Falls der obere Test eine Fehler-Ticketnummer enthält deutet das auf einen Fehler in der Ausführung des Controllers hin, noch bevor der Doctest ausgeführt werden konnte. Gewöhnlich führen fehlerhafte Einrückungen oder fehlerhafter Code ausserhalb der Funktion zu solchen Fehlern. Ein grüner Titel deutet darauf hin, dass alle Test(wenn sie vorhanden sind) erfolgreich durchlaufen wurden. In diesem Fall werden die Testresultate nicht angezeigt.',
|
'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Falls der obere Test eine Fehler-Ticketnummer enthält deutet das auf einen Fehler in der Ausführung des Controllers hin, noch bevor der Doctest ausgeführt werden konnte. Gewöhnlich Führen fehlerhafte Einrückungen oder fehlerhafter Code ausserhalb der Funktion zu solchen Fehlern. Ein grüner Titel deutet darauf hin, dass alle Test(wenn sie vorhanden sind) erfolgreich durchlaufen wurden. In diesem Fall werden die Testresultate nicht angezeigt.',
|
||||||
'If you answer "yes", be patient, it may take a while to download': '',
|
'If you answer "yes", be patient, it may take a while to download': '',
|
||||||
'If you answer yes, be patient, it may take a while to download': 'If you answer yes, be patient, it may take a while to download',
|
'If you answer yes, be patient, it may take a while to download': 'If you answer yes, be patient, it may take a while to download',
|
||||||
'Import/Export': 'Importieren/Exportieren',
|
'Import/Export': 'Importieren/Exportieren',
|
||||||
'includes': 'Einfügen',
|
'includes': 'Einfügen',
|
||||||
'Index': 'Index',
|
'Index': 'Index',
|
||||||
'index': 'index',
|
'index': 'index',
|
||||||
'insert new': 'neu einfügen',
|
'insert new': 'neu Einfügen',
|
||||||
'insert new %s': 'neu einfügen %s',
|
'insert new %s': 'neu Einfügen %s',
|
||||||
|
'inspect attributes': 'inspect attributes',
|
||||||
'Install': 'installieren',
|
'Install': 'installieren',
|
||||||
'Installed applications': 'Installierte Anwendungen',
|
'Installed applications': 'Installierte Anwendungen',
|
||||||
'internal error': 'interner Fehler',
|
'internal error': 'interner Fehler',
|
||||||
@@ -175,9 +204,10 @@
|
|||||||
'Invalid email': 'Ungültige Email',
|
'Invalid email': 'Ungültige Email',
|
||||||
'invalid password': 'Ungültiges Passwort',
|
'invalid password': 'Ungültiges Passwort',
|
||||||
'Invalid Query': 'Ungültige Abfrage',
|
'Invalid Query': 'Ungültige Abfrage',
|
||||||
'invalid request': 'ungültige Anfrage',
|
'invalid request': 'Ungültige Anfrage',
|
||||||
'invalid ticket': 'ungültiges Ticket',
|
'invalid ticket': 'Ungültiges Ticket',
|
||||||
'Key bindings': 'Tastenbelegungen',
|
'Key bindings': 'Tastenbelegungen',
|
||||||
|
'Key bindings for ZenCoding Plugin': 'Key bindings for ZenCoding Plugin',
|
||||||
'Key bindings for ZenConding Plugin': 'Tastenbelegungen für das ZenConding Plugin',
|
'Key bindings for ZenConding Plugin': 'Tastenbelegungen für das ZenConding Plugin',
|
||||||
'language file "%(filename)s" created/updated': 'Sprachdatei "%(filename)s" erstellt/aktualisiert',
|
'language file "%(filename)s" created/updated': 'Sprachdatei "%(filename)s" erstellt/aktualisiert',
|
||||||
'Language files (static strings) updated': 'Sprachdatei (statisch Strings) aktualisiert',
|
'Language files (static strings) updated': 'Sprachdatei (statisch Strings) aktualisiert',
|
||||||
@@ -189,6 +219,7 @@
|
|||||||
'Layout': 'Layout',
|
'Layout': 'Layout',
|
||||||
'License for': 'Lizenz für',
|
'License for': 'Lizenz für',
|
||||||
'loading...': 'lade...',
|
'loading...': 'lade...',
|
||||||
|
'locals': 'locals',
|
||||||
'located in the file': 'located in Datei',
|
'located in the file': 'located in Datei',
|
||||||
'Login': 'Anmelden',
|
'Login': 'Anmelden',
|
||||||
'login': 'anmelden',
|
'login': 'anmelden',
|
||||||
@@ -196,7 +227,8 @@
|
|||||||
'Logout': 'abmelden',
|
'Logout': 'abmelden',
|
||||||
'Lost Password': 'Passwort vergessen',
|
'Lost Password': 'Passwort vergessen',
|
||||||
'lost password?': 'Passwort vergessen?',
|
'lost password?': 'Passwort vergessen?',
|
||||||
'Main Menu': 'Menú principal',
|
'Main Menu': 'Menü principal',
|
||||||
|
'Manage': 'Verwalten',
|
||||||
'Match Pair': 'Paare finden',
|
'Match Pair': 'Paare finden',
|
||||||
'Menu Model': 'Menü Modell',
|
'Menu Model': 'Menü Modell',
|
||||||
'merge': 'verbinden',
|
'merge': 'verbinden',
|
||||||
@@ -207,22 +239,29 @@
|
|||||||
'modules': 'Module',
|
'modules': 'Module',
|
||||||
'Name': 'Name',
|
'Name': 'Name',
|
||||||
'new application "%s" created': 'neue Anwendung "%s" erzeugt',
|
'new application "%s" created': 'neue Anwendung "%s" erzeugt',
|
||||||
'New application wizard': 'New application wizard',
|
'New application wizard': 'Neue Anwendung per Assistent',
|
||||||
|
'new plugin installed': 'new plugin installed',
|
||||||
'New Record': 'Neuer Datensatz',
|
'New Record': 'Neuer Datensatz',
|
||||||
'new record inserted': 'neuer Datensatz eingefügt',
|
'new record inserted': 'neuer Datensatz eingefügt',
|
||||||
'New simple application': 'New simple application',
|
'New simple application': 'Neue einfache Anwendung',
|
||||||
'next 100 rows': 'nächsten 100 Zeilen',
|
'next 100 rows': 'nächsten 100 Zeilen',
|
||||||
'Next Edit Point': 'nächster Bearbeitungsschritt',
|
'Next Edit Point': 'nächster Bearbeitungsschritt',
|
||||||
'NO': 'NEIN',
|
'NO': 'NEIN',
|
||||||
'No databases in this application': 'Keine Datenbank in dieser Anwendung',
|
'No databases in this application': 'Keine Datenbank in dieser Anwendung',
|
||||||
|
'no package selected': 'no package selected',
|
||||||
|
'No ticket_storage.txt found under /private folder': 'No ticket_storage.txt found under /private folder',
|
||||||
|
'online designer': 'online designer',
|
||||||
|
'or alternatively': 'or alternatively',
|
||||||
|
'Or Get from URL:': 'oder hole es von folgender URL:',
|
||||||
'or import from csv file': 'oder importieren von cvs Datei',
|
'or import from csv file': 'oder importieren von cvs Datei',
|
||||||
'or provide app url:': 'oder geben Sie eine Anwendungs-URL an:',
|
'or provide app url:': 'oder geben Sie eine Anwendungs-URL an:',
|
||||||
'or provide application url:': 'oder geben Sie eine Anwendungs-URL an:',
|
'or provide application url:': 'oder geben Sie eine Anwendungs-URL an:',
|
||||||
'Origin': 'Herkunft',
|
'Origin': 'Herkunft',
|
||||||
'Original/Translation': 'Original/Übersetzung',
|
'Original/Translation': 'Original/übersetzung',
|
||||||
'Overwrite installed app': 'installierte Anwendungen überschreiben',
|
'Overwrite installed app': 'installierte Anwendungen überschreiben',
|
||||||
'Pack all': 'verpacke alles',
|
'Pack all': 'verpacke alles',
|
||||||
'Pack compiled': 'Verpacke kompiliert',
|
'Pack compiled': 'Verpacke kompiliert',
|
||||||
|
'Pack custom': 'Verpacke individuell',
|
||||||
'pack plugin': 'Plugin verpacken',
|
'pack plugin': 'Plugin verpacken',
|
||||||
'Password': 'Passwort',
|
'Password': 'Passwort',
|
||||||
'Peeking at file': 'Dateiansicht',
|
'Peeking at file': 'Dateiansicht',
|
||||||
@@ -230,9 +269,13 @@
|
|||||||
'Plugin "%s" in application': 'Plugin "%s" in Anwendung',
|
'Plugin "%s" in application': 'Plugin "%s" in Anwendung',
|
||||||
'plugins': 'plugins',
|
'plugins': 'plugins',
|
||||||
'Plugins': 'Plugins',
|
'Plugins': 'Plugins',
|
||||||
|
'Plural-Forms:': 'Plural-Forms:',
|
||||||
'Powered by': 'Unterstützt von',
|
'Powered by': 'Unterstützt von',
|
||||||
'previous 100 rows': 'vorherige 100 zeilen',
|
'previous 100 rows': 'vorherige 100 zeilen',
|
||||||
'Previous Edit Point': 'vorheriger Bearbeitungsschritt',
|
'Previous Edit Point': 'vorheriger Bearbeitungsschritt',
|
||||||
|
'Private files': 'Private files',
|
||||||
|
'private files': 'private files',
|
||||||
|
'Project Progress': 'Projekt Fortschritt',
|
||||||
'Query:': 'Abfrage:',
|
'Query:': 'Abfrage:',
|
||||||
'record': 'Datensatz',
|
'record': 'Datensatz',
|
||||||
'record does not exist': 'Datensatz existiert nicht',
|
'record does not exist': 'Datensatz existiert nicht',
|
||||||
@@ -241,26 +284,39 @@
|
|||||||
'register': 'Registrierung',
|
'register': 'Registrierung',
|
||||||
'Register': 'registrieren',
|
'Register': 'registrieren',
|
||||||
'Registration key': 'Registrierungsschlüssel',
|
'Registration key': 'Registrierungsschlüssel',
|
||||||
'Reload routes': 'Reload routes',
|
'reload': 'Neu laden',
|
||||||
'Remove compiled': 'kompilat gelöscht',
|
'Reload routes': 'Routen neu laden',
|
||||||
|
'Remove compiled': 'Bytecode löschen',
|
||||||
|
'Replace': 'Replace',
|
||||||
|
'Replace All': 'Replace All',
|
||||||
|
'request': 'request',
|
||||||
'Reset Password key': 'Passwortschlüssel zurücksetzen',
|
'Reset Password key': 'Passwortschlüssel zurücksetzen',
|
||||||
'Resolve Conflict file': 'bereinige Konflikt-Datei',
|
'Resolve Conflict file': 'bereinige Konflikt-Datei',
|
||||||
|
'response': 'Antwort',
|
||||||
'restore': 'wiederherstellen',
|
'restore': 'wiederherstellen',
|
||||||
'revert': 'zurückkehren',
|
'revert': 'zurückkehren',
|
||||||
'Role': 'Rolle',
|
'Role': 'Rolle',
|
||||||
'Rows in table': 'Zeilen in Tabelle',
|
'Rows in table': 'Zeilen in Tabelle',
|
||||||
'Rows selected': 'Zeilen ausgewählt',
|
'Rows selected': 'Zeilen ausgewählt',
|
||||||
'Running on %s': 'Running on %s',
|
'rules are not defined': 'rules are not defined',
|
||||||
|
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')",
|
||||||
|
'Running on %s': 'läuft auf %s',
|
||||||
|
'Save': 'Save',
|
||||||
'save': 'sichern',
|
'save': 'sichern',
|
||||||
|
'Save file:': 'Save file:',
|
||||||
'Save via Ajax': 'via Ajax sichern',
|
'Save via Ajax': 'via Ajax sichern',
|
||||||
'Saved file hash:': 'Gespeicherter Datei-Hash:',
|
'Saved file hash:': 'Gespeicherter Datei-Hash:',
|
||||||
|
'Select Files to Package': 'Dateien zum Paketieren wählen',
|
||||||
'selected': 'ausgewählt(e)',
|
'selected': 'ausgewählt(e)',
|
||||||
'session expired': 'Sitzung Abgelaufen',
|
'session': 'Sitzung',
|
||||||
|
'session expired': 'Sitzung abgelaufen',
|
||||||
'shell': 'shell',
|
'shell': 'shell',
|
||||||
'Site': 'Seite',
|
'Site': 'Seite',
|
||||||
'some files could not be removed': 'einige Dateien konnten nicht gelöscht werden',
|
'some files could not be removed': 'einige Dateien konnten nicht gelöscht werden',
|
||||||
'Start wizard': 'start wizard',
|
'Start searching': 'Start searching',
|
||||||
|
'Start wizard': 'Assistent starten',
|
||||||
'state': 'Status',
|
'state': 'Status',
|
||||||
|
'Static': 'Static',
|
||||||
'static': 'statische Dateien',
|
'static': 'statische Dateien',
|
||||||
'Static files': 'statische Dateien',
|
'Static files': 'statische Dateien',
|
||||||
'Stylesheet': 'Stylesheet',
|
'Stylesheet': 'Stylesheet',
|
||||||
@@ -283,27 +339,35 @@
|
|||||||
'The data representation, define database tables and sets': 'The data representation, define database tables and sets',
|
'The data representation, define database tables and sets': 'The data representation, define database tables and sets',
|
||||||
'The output of the file is a dictionary that was rendered by the view': 'The output of the file is a dictionary that was rendered by the view',
|
'The output of the file is a dictionary that was rendered by the view': 'The output of the file is a dictionary that was rendered by the view',
|
||||||
'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates',
|
'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates',
|
||||||
'the presentations layer, views are also known as templates': 'Die Präsentationsschicht, Views sind auch bekannt als Vorlagen/Templates',
|
'the presentations layer, views are also known as templates': 'Die präsentationsschicht, Views sind auch bekannt als Vorlagen/Templates',
|
||||||
'There are no controllers': 'Keine Controller vorhanden',
|
'There are no controllers': 'Keine Controller vorhanden',
|
||||||
'There are no models': 'Keine Modelle vorhanden',
|
'There are no models': 'Keine Modelle vorhanden',
|
||||||
'There are no modules': 'Keine Module vorhanden',
|
'There are no modules': 'Keine Module vorhanden',
|
||||||
'There are no plugins': 'There are no plugins',
|
'There are no plugins': 'Keine Plugins vorhanden',
|
||||||
|
'There are no private files': 'There are no private files',
|
||||||
'There are no static files': 'Keine statischen Dateien vorhanden',
|
'There are no static files': 'Keine statischen Dateien vorhanden',
|
||||||
'There are no translators, only default language is supported': 'Keine Übersetzungen vorhanden, nur die voreingestellte Sprache wird unterstützt',
|
'There are no translators, only default language is supported': 'Keine übersetzungen vorhanden, nur die voreingestellte Sprache wird Unterstützt',
|
||||||
'There are no views': 'Keine Views vorhanden',
|
'There are no views': 'Keine Views vorhanden',
|
||||||
'These files are served without processing, your images go here': 'These files are served without processing, your images go here',
|
'These files are not served, they are only available from within your app': 'These files are not served, they are only available from within your app',
|
||||||
|
'These files are served without processing, your images go here': 'Diese Dateien werden ohne Verarbeitung ausgeliefert. Beispielsweise Bilder kommen hier hin.',
|
||||||
'these files are served without processing, your images go here': 'Diese Dateien werden ohne Verarbeitung ausgeliefert. Beispielsweise Bilder kommen hier hin.',
|
'these files are served without processing, your images go here': 'Diese Dateien werden ohne Verarbeitung ausgeliefert. Beispielsweise Bilder kommen hier hin.',
|
||||||
'This is a copy of the scaffolding application': 'Dies ist eine Kopie einer Grundgerüst-Anwendung',
|
'This is a copy of the scaffolding application': 'Dies ist eine Kopie einer Grundgerüst-Anwendung',
|
||||||
'This is the %(filename)s template': 'Dies ist das Template %(filename)s',
|
'This is the %(filename)s template': 'Dies ist das Template %(filename)s',
|
||||||
'Ticket': 'Ticket',
|
'Ticket': 'Ticket',
|
||||||
'Timestamp': 'Timestamp',
|
'Ticket ID': 'Ticket ID',
|
||||||
|
'Timestamp': 'Zeitstempel',
|
||||||
'TM': 'TM',
|
'TM': 'TM',
|
||||||
'to previous version.': 'zu einer früheren Version.',
|
'to previous version.': 'zu einer früheren Version.',
|
||||||
'To create a plugin, name a file/folder plugin_[name]': 'Um ein Plugin zu erstellen benennen Sie eine(n) Datei/Ordner plugin_[Name]',
|
'To create a plugin, name a file/folder plugin_[name]': 'Um ein Plugin zu erstellen benennen Sie eine(n) Datei/Ordner plugin_[Name]',
|
||||||
'translation strings for the application': 'Übersetzungs-Strings für die Anwendung',
|
'toggle breakpoint': 'toggle breakpoint',
|
||||||
'Translation strings for the application': 'Translation strings for the application',
|
'Toggle Fullscreen': 'Toggle Fullscreen',
|
||||||
|
'Traceback': 'Traceback',
|
||||||
|
'translation strings for the application': 'übersetzungs-Strings für die Anwendung',
|
||||||
|
'Translation strings for the application': 'übersetzungs-Strings für die Anwendung',
|
||||||
'try': 'versuche',
|
'try': 'versuche',
|
||||||
'try something like': 'versuche so etwas wie',
|
'try something like': 'versuche so etwas wie',
|
||||||
|
'Try the mobile interface': 'Try the mobile interface',
|
||||||
|
'try view': 'try view',
|
||||||
'Unable to check for upgrades': 'überprüfen von Upgrades nicht möglich',
|
'Unable to check for upgrades': 'überprüfen von Upgrades nicht möglich',
|
||||||
'unable to create application "%s"': 'erzeugen von Anwendung "%s" nicht möglich',
|
'unable to create application "%s"': 'erzeugen von Anwendung "%s" nicht möglich',
|
||||||
'unable to delete file "%(filename)s"': 'löschen von Datein "%(filename)s" nicht möglich',
|
'unable to delete file "%(filename)s"': 'löschen von Datein "%(filename)s" nicht möglich',
|
||||||
@@ -311,37 +375,40 @@
|
|||||||
'Unable to download app': 'herunterladen der Anwendung nicht möglich',
|
'Unable to download app': 'herunterladen der Anwendung nicht möglich',
|
||||||
'unable to parse csv file': 'analysieren der cvs Datei nicht möglich',
|
'unable to parse csv file': 'analysieren der cvs Datei nicht möglich',
|
||||||
'unable to uninstall "%s"': 'deinstallieren von "%s" nicht möglich',
|
'unable to uninstall "%s"': 'deinstallieren von "%s" nicht möglich',
|
||||||
'uncheck all': 'alles demarkieren',
|
'uncheck all': 'Selektionen entfernen',
|
||||||
'Uninstall': 'deinstallieren',
|
'Uninstall': 'deinstallieren',
|
||||||
'update': 'aktualisieren',
|
'update': 'aktualisieren',
|
||||||
'update all languages': 'aktualisiere alle Sprachen',
|
'update all languages': 'aktualisiere alle Sprachen',
|
||||||
'Update:': 'Aktualisiere:',
|
'Update:': 'Aktualisiere:',
|
||||||
'upgrade web2py now': 'jetzt web2py upgraden',
|
'upgrade web2py now': 'jetzt web2py upgraden',
|
||||||
'upload': 'upload',
|
'upload': 'upload',
|
||||||
|
'Upload': 'Upload',
|
||||||
'Upload & install packed application': 'Verpackte Anwendung hochladen und installieren',
|
'Upload & install packed application': 'Verpackte Anwendung hochladen und installieren',
|
||||||
'Upload a package:': 'Upload a package:',
|
'Upload a package:': 'Ein Packet hochladen:',
|
||||||
'Upload and install packed application': 'Upload and install packed application',
|
'Upload and install packed application': 'Verpackte Anwendung hochladen und installieren',
|
||||||
'upload application:': 'lade Anwendung hoch:',
|
'upload application:': 'lade Anwendung hoch:',
|
||||||
'Upload existing application': 'lade existierende Anwendung hoch',
|
'Upload existing application': 'lade existierende Anwendung hoch',
|
||||||
'upload file:': 'lade Datei hoch:',
|
'upload file:': 'lade Datei hoch:',
|
||||||
'upload plugin file:': 'Plugin-Datei hochladen:',
|
'upload plugin file:': 'Plugin-Datei hochladen:',
|
||||||
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Benutze (...)&(...) für AND, (...)|(...) für OR, und ~(...) für NOT, um komplexe Abfragen zu erstellen.',
|
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Benutze (...)&(...) für AND, (...)|(...) für OR, und ~(...) für NOT, um komplexe Abfragen zu erstellen.',
|
||||||
'Use an url:': 'Use an url:',
|
'Use an url:': 'Verwende URL:',
|
||||||
'user': 'user',
|
'user': 'Nutzer',
|
||||||
'User ID': 'Benutzer ID',
|
'User ID': 'Benutzer ID',
|
||||||
'variables': 'variables',
|
'variables': 'Variablen',
|
||||||
'Version': 'Version',
|
'Version': 'Version',
|
||||||
'Version %s.%s.%s (%s) %s': 'Version %s.%s.%s (%s) %s',
|
'Version %s.%s.%s (%s) %s': 'Version %s.%s.%s (%s) %s',
|
||||||
'versioning': 'Versionierung',
|
'versioning': 'Versionierung',
|
||||||
'View': 'View',
|
'Versioning': 'Versionierung',
|
||||||
'view': 'View',
|
'View': 'Ansicht',
|
||||||
'Views': 'Views',
|
'view': 'Ansicht',
|
||||||
'views': 'Views',
|
'Views': 'Ansichten',
|
||||||
|
'views': 'Ansichten',
|
||||||
|
'Web Framework': 'Web Framework',
|
||||||
'web2py is up to date': 'web2py ist auf dem neuesten Stand',
|
'web2py is up to date': 'web2py ist auf dem neuesten Stand',
|
||||||
'web2py Recent Tweets': 'neuste Tweets von web2py',
|
'web2py Recent Tweets': 'neuste Tweets von web2py',
|
||||||
'Welcome %s': 'Willkommen %s',
|
'Welcome %s': 'Willkommen %s',
|
||||||
'Welcome to web2py': 'Willkommen zu web2py',
|
'Welcome to web2py': 'Willkommen zu web2py',
|
||||||
'Which called the function': 'Which called the function',
|
'Which called the function': 'welche die Funktion aufrief',
|
||||||
'Wrap with Abbreviation': 'mit Kürzel einhüllen',
|
'Wrap with Abbreviation': 'mit Kürzel einhüllen',
|
||||||
'xml': 'xml',
|
'xml': 'xml',
|
||||||
'YES': 'JA',
|
'YES': 'JA',
|
||||||
|
|||||||
@@ -7,31 +7,35 @@
|
|||||||
'%s %%{row} updated': '%s filas actualizadas',
|
'%s %%{row} updated': '%s filas actualizadas',
|
||||||
'%Y-%m-%d': '%Y-%m-%d',
|
'%Y-%m-%d': '%Y-%m-%d',
|
||||||
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
|
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
|
||||||
|
'(requires internet access, experimental)': '(requiere acceso a internet, experimental)',
|
||||||
'(something like "it-it")': '(algo como "it-it")',
|
'(something like "it-it")': '(algo como "it-it")',
|
||||||
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(file **gluon/contrib/plural_rules/%s.py** is not found)',
|
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(file **gluon/contrib/plural_rules/%s.py** is not found)',
|
||||||
|
'@markmin\x01An error occured, please [[reload %s]] the page': 'An error occured, please [[reload %s]] the page',
|
||||||
'@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files',
|
'@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files',
|
||||||
'A new version of web2py is available': 'Hay una nueva versión de web2py disponible',
|
'A new version of web2py is available': 'Hay una nueva versión de web2py disponible',
|
||||||
'A new version of web2py is available: %s': 'Hay una nueva versión de web2py disponible: %s',
|
'A new version of web2py is available: %s': 'Hay una nueva versión de web2py disponible: %s',
|
||||||
'About': 'acerca de',
|
'About': 'acerca de',
|
||||||
'About application': 'Acerca de la aplicación',
|
'About application': 'Acerca de la aplicación',
|
||||||
'additional code for your application': 'código adicional para su aplicación',
|
'additional code for your application': 'código adicional para su aplicación',
|
||||||
'Additional code for your application': 'Additional code for your application',
|
'Additional code for your application': 'Código adicional para su aplicación',
|
||||||
'admin disabled because no admin password': ' por falta de contraseña',
|
'admin disabled because no admin password': 'admin deshabilitado por falta de contraseña',
|
||||||
'admin disabled because not supported on google app engine': 'admin deshabilitado, no es soportado en GAE',
|
'admin disabled because not supported on google app engine': 'admin deshabilitado, no es soportado en GAE',
|
||||||
'admin disabled because unable to access password file': 'admin deshabilitado, imposible acceder al archivo con la contraseña',
|
'admin disabled because unable to access password file': 'admin deshabilitado, imposible acceder al archivo con la contraseña',
|
||||||
'Admin is disabled because insecure channel': 'Admin deshabilitado, el canal no es seguro',
|
'Admin is disabled because insecure channel': 'Admin deshabilitado, el canal no es seguro',
|
||||||
'Admin is disabled because unsecure channel': 'Admin deshabilitado, el canal no es seguro',
|
'Admin is disabled because unsecure channel': 'Admin deshabilitado, el canal no es seguro',
|
||||||
'Admin language': 'Admin language',
|
'Admin language': 'Lenguaje de administración',
|
||||||
'administrative interface': 'administrative interface',
|
'administrative interface': 'interfaz administrativa',
|
||||||
'Administrator Password:': 'Contraseña del Administrador:',
|
'Administrator Password:': 'Contraseña del Administrador:',
|
||||||
'An error occured, please %s the page': 'An error occured, please %s the page',
|
'An error occured, please %s the page': 'Ha ocurrido un error, por favor %s la página',
|
||||||
'and rename it (required):': 'y renombrela (requerido):',
|
'and rename it (required):': 'y renombrela (requerido):',
|
||||||
'and rename it:': ' y renombrelo:',
|
'and rename it:': ' y renombrelo:',
|
||||||
'appadmin': 'appadmin',
|
'appadmin': 'appadmin',
|
||||||
'appadmin is disabled because insecure channel': 'admin deshabilitado, el canal no es seguro',
|
'appadmin is disabled because insecure channel': 'admin deshabilitado, el canal no es seguro',
|
||||||
'application "%s" uninstalled': 'aplicación "%s" desinstalada',
|
'application "%s" uninstalled': 'aplicación "%s" desinstalada',
|
||||||
|
'application %(appname)s installed with md5sum: %(digest)s': 'application %(appname)s installed with md5sum: %(digest)s',
|
||||||
'application compiled': 'aplicación compilada',
|
'application compiled': 'aplicación compilada',
|
||||||
'application is compiled and cannot be designed': 'la aplicación está compilada y no puede ser modificada',
|
'application is compiled and cannot be designed': 'la aplicación está compilada y no puede ser modificada',
|
||||||
|
'Application name:': 'Nombre de la aplicación:',
|
||||||
'are not used': 'are not used',
|
'are not used': 'are not used',
|
||||||
'are not used yet': 'are not used yet',
|
'are not used yet': 'are not used yet',
|
||||||
'Are you sure you want to delete file "%s"?': '¿Está seguro que desea eliminar el archivo "%s"?',
|
'Are you sure you want to delete file "%s"?': '¿Está seguro que desea eliminar el archivo "%s"?',
|
||||||
@@ -41,12 +45,13 @@
|
|||||||
'Are you sure you want to uninstall application "%s"?': '¿Está seguro que desea desinstalar la aplicación "%s"?',
|
'Are you sure you want to uninstall application "%s"?': '¿Está seguro que desea desinstalar la aplicación "%s"?',
|
||||||
'Are you sure you want to upgrade web2py now?': '¿Está seguro que desea actualizar web2py ahora?',
|
'Are you sure you want to upgrade web2py now?': '¿Está seguro que desea actualizar web2py ahora?',
|
||||||
'arguments': 'argumentos',
|
'arguments': 'argumentos',
|
||||||
'at char %s': 'at char %s',
|
'at char %s': 'en el caracter %s',
|
||||||
'at line %s': 'at line %s',
|
'at line %s': 'en la línea %s',
|
||||||
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATENCION: Inicio de sesión requiere una conexión segura (HTTPS) o localhost.',
|
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATENCION: Inicio de sesión requiere una conexión segura (HTTPS) o localhost.',
|
||||||
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATENCION: NO EJECUTE VARIAS PRUEBAS SIMULTANEAMENTE, NO SON THREAD SAFE.',
|
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATENCION: NO EJECUTE VARIAS PRUEBAS SIMULTANEAMENTE, NO SON THREAD SAFE.',
|
||||||
'ATTENTION: you cannot edit the running application!': 'ATENCION: no puede modificar la aplicación que se ejecuta!',
|
'ATTENTION: you cannot edit the running application!': 'ATENCION: no puede modificar la aplicación que se ejecuta!',
|
||||||
'Autocomplete': 'Autocomplete',
|
'Autocomplete': 'Autocomplete',
|
||||||
|
'Autocomplete Python Code': 'Autocompletar código Python',
|
||||||
'Available databases and tables': 'Bases de datos y tablas disponibles',
|
'Available databases and tables': 'Bases de datos y tablas disponibles',
|
||||||
'back': 'atrás',
|
'back': 'atrás',
|
||||||
'breakpoint': 'breakpoint',
|
'breakpoint': 'breakpoint',
|
||||||
@@ -54,14 +59,17 @@
|
|||||||
'browse': 'buscar',
|
'browse': 'buscar',
|
||||||
'cache': 'cache',
|
'cache': 'cache',
|
||||||
'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados',
|
'cache, errors and sessions cleaned': 'cache, errores y sesiones eliminados',
|
||||||
|
'can be a git repo': 'puede ser un repositorio git',
|
||||||
'Cannot be empty': 'No puede estar vacío',
|
'Cannot be empty': 'No puede estar vacío',
|
||||||
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'No se puede compilar: hay errores en su aplicación. Depure, corrija errores y vuelva a intentarlo.',
|
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'No se puede compilar: hay errores en su aplicación. Depure, corrija errores y vuelva a intentarlo.',
|
||||||
'Cannot compile: there are errors in your app:': 'No se puede compilar: hay errores en su aplicación:',
|
'Cannot compile: there are errors in your app:': 'No se puede compilar: hay errores en su aplicación:',
|
||||||
'cannot create file': 'no es posible crear archivo',
|
'cannot create file': 'no es posible crear archivo',
|
||||||
'cannot upload file "%(filename)s"': 'no es posible subir archivo "%(filename)s"',
|
'cannot upload file "%(filename)s"': 'no es posible subir archivo "%(filename)s"',
|
||||||
'Change admin password': 'cambie contraseña admin',
|
'Change admin password': 'cambie contraseña admin',
|
||||||
|
'change editor settings': 'cambiar la configuración del editor',
|
||||||
'Change Password': 'Cambie Contraseña',
|
'Change Password': 'Cambie Contraseña',
|
||||||
'check all': 'marcar todos',
|
'check all': 'marcar todos',
|
||||||
|
'Check for upgrades': 'buscar actualizaciones',
|
||||||
'Check to delete': 'Marque para eliminar',
|
'Check to delete': 'Marque para eliminar',
|
||||||
'Checking for upgrades...': 'Buscando actulizaciones...',
|
'Checking for upgrades...': 'Buscando actulizaciones...',
|
||||||
'Clean': 'limpiar',
|
'Clean': 'limpiar',
|
||||||
@@ -69,28 +77,30 @@
|
|||||||
'click here for the administrative interface': 'haga clic aquí para usar la interfaz administrativa',
|
'click here for the administrative interface': 'haga clic aquí para usar la interfaz administrativa',
|
||||||
'Click row to expand traceback': 'Click row to expand traceback',
|
'Click row to expand traceback': 'Click row to expand traceback',
|
||||||
'click to check for upgrades': 'haga clic para buscar actualizaciones',
|
'click to check for upgrades': 'haga clic para buscar actualizaciones',
|
||||||
'click to open': 'click to open',
|
'click to open': 'click para abrir',
|
||||||
'Client IP': 'IP del Cliente',
|
'Client IP': 'IP del Cliente',
|
||||||
'code': 'código',
|
'code': 'código',
|
||||||
'Code listing': 'Code listing',
|
'Code listing': 'Listado de código',
|
||||||
'collapse/expand all': 'collapse/expand all',
|
'collapse/expand all': 'contraer/expandir todo',
|
||||||
'commit (mercurial)': 'commit (mercurial)',
|
'commit (mercurial)': 'confirmar (mercurial)',
|
||||||
'Compile': 'compilar',
|
'Compile': 'compilar',
|
||||||
'compiled application removed': 'aplicación compilada removida',
|
'compiled application removed': 'aplicación compilada removida',
|
||||||
'continue': 'continue',
|
'continue': 'continuar',
|
||||||
'Controllers': 'Controladores',
|
'Controllers': 'Controladores',
|
||||||
'controllers': 'controladores',
|
'controllers': 'controladores',
|
||||||
'Count': 'Count',
|
'Count': 'Count',
|
||||||
'Create': 'crear',
|
'Create': 'Crear',
|
||||||
'create file with filename:': 'cree archivo con nombre:',
|
'create file with filename:': 'cree archivo con nombre:',
|
||||||
'Create new application using the Wizard': 'Create new application using the Wizard',
|
'Create new application using the Wizard': 'Crear nueva aplicación utilizando el asistente',
|
||||||
'create new application:': 'nombre de la nueva aplicación:',
|
'create new application:': 'nombre de la nueva aplicación:',
|
||||||
'Create new simple application': 'Cree una nueva aplicación',
|
'Create new simple application': 'Cree una nueva aplicación',
|
||||||
|
'Create/Upload': 'Create/Upload',
|
||||||
'created by': 'creado por',
|
'created by': 'creado por',
|
||||||
'crontab': 'crontab',
|
'crontab': 'crontab',
|
||||||
'Current request': 'Solicitud en curso',
|
'Current request': 'Solicitud en curso',
|
||||||
'Current response': 'Respuesta en curso',
|
'Current response': 'Respuesta en curso',
|
||||||
'Current session': 'Sesión en curso',
|
'Current session': 'Sesión en curso',
|
||||||
|
'currently running': 'currently running',
|
||||||
'currently saved or': 'actualmente guardado o',
|
'currently saved or': 'actualmente guardado o',
|
||||||
'customize me!': 'Adaptame!',
|
'customize me!': 'Adaptame!',
|
||||||
'data uploaded': 'datos subidos',
|
'data uploaded': 'datos subidos',
|
||||||
@@ -105,37 +115,52 @@
|
|||||||
'delete': 'eliminar',
|
'delete': 'eliminar',
|
||||||
'delete all checked': 'eliminar marcados',
|
'delete all checked': 'eliminar marcados',
|
||||||
'delete plugin': 'eliminar plugin',
|
'delete plugin': 'eliminar plugin',
|
||||||
'Delete this file (you will be asked to confirm deletion)': 'Delete this file (you will be asked to confirm deletion)',
|
'Delete this file (you will be asked to confirm deletion)': 'Elimine este fichero (se le pedirá confirmación)',
|
||||||
'Delete:': 'Elimine:',
|
'Delete:': 'Elimine:',
|
||||||
|
'Deploy': 'Deploy',
|
||||||
'Deploy on Google App Engine': 'Instale en Google App Engine',
|
'Deploy on Google App Engine': 'Instale en Google App Engine',
|
||||||
|
'Deploy to OpenShift': 'Instale en OpenShift',
|
||||||
'Description': 'Descripción',
|
'Description': 'Descripción',
|
||||||
'design': 'modificar',
|
'design': 'modificar',
|
||||||
'DESIGN': 'DISEÑO',
|
'DESIGN': 'DISEÑO',
|
||||||
'Design for': 'Diseño para',
|
'Design for': 'Diseño para',
|
||||||
|
'Detailed traceback description': 'Detailed traceback description',
|
||||||
|
'details': 'detalles',
|
||||||
'direction: ltr': 'direction: ltr',
|
'direction: ltr': 'direction: ltr',
|
||||||
|
'Disable': 'Deshabilitar',
|
||||||
'docs': 'docs',
|
'docs': 'docs',
|
||||||
'done!': 'listo!',
|
'done!': 'listo!',
|
||||||
'download layouts': 'download layouts',
|
'Download': 'Descargar',
|
||||||
'download plugins': 'download plugins',
|
'download files via http:': 'descargar archivos via http:',
|
||||||
|
'download layouts': 'descargar layouts',
|
||||||
|
'download plugins': 'descargar plugins',
|
||||||
'E-mail': 'Correo electrónico',
|
'E-mail': 'Correo electrónico',
|
||||||
'EDIT': 'EDITAR',
|
'EDIT': 'EDITAR',
|
||||||
'Edit': 'editar',
|
'Edit': 'editar',
|
||||||
'Edit application': 'Editar aplicación',
|
'Edit application': 'Editar aplicación',
|
||||||
'edit controller': 'editar controlador',
|
'edit controller': 'editar controlador',
|
||||||
|
'edit controller:': 'edit controller:',
|
||||||
'Edit current record': 'Edite el registro actual',
|
'Edit current record': 'Edite el registro actual',
|
||||||
'Edit Profile': 'Editar Perfil',
|
'Edit Profile': 'Editar Perfil',
|
||||||
'edit views:': 'editar vistas:',
|
'edit views:': 'editar vistas:',
|
||||||
'Editing file': 'Editando archivo',
|
'Editing file': 'Editando archivo',
|
||||||
'Editing file "%s"': 'Editando archivo "%s"',
|
'Editing file "%s"': 'Editando archivo "%s"',
|
||||||
'Editing Language file': 'Editando archivo de lenguaje',
|
'Editing Language file': 'Editando archivo de lenguaje',
|
||||||
|
'Editing myclientapi': 'Editing myclientapi',
|
||||||
|
'Editing myemail': 'Editing myemail',
|
||||||
|
'Editing rbare': 'Editing rbare',
|
||||||
|
'Editing ul': 'Editing ul',
|
||||||
'Enterprise Web Framework': 'Armazón Empresarial para Internet',
|
'Enterprise Web Framework': 'Armazón Empresarial para Internet',
|
||||||
'Error': 'Error',
|
'Error': 'Error',
|
||||||
'Error logs for "%(app)s"': 'Bitácora de errores en "%(app)s"',
|
'Error logs for "%(app)s"': 'Bitácora de errores en "%(app)s"',
|
||||||
|
'Error snapshot': 'Error snapshot',
|
||||||
|
'Error ticket': 'Error ticket',
|
||||||
'Errors': 'errores',
|
'Errors': 'errores',
|
||||||
'Exception instance attributes': 'Atributos de la instancia de Excepción',
|
'Exception instance attributes': 'Atributos de la instancia de Excepción',
|
||||||
|
'Expand Abbreviation': 'Expand Abbreviation',
|
||||||
'export as csv file': 'exportar como archivo CSV',
|
'export as csv file': 'exportar como archivo CSV',
|
||||||
'exposes': 'expone',
|
'exposes': 'expone',
|
||||||
'exposes:': 'exposes:',
|
'exposes:': 'expone:',
|
||||||
'extends': 'extiende',
|
'extends': 'extiende',
|
||||||
'failed to compile file because:': 'failed to compile file because:',
|
'failed to compile file because:': 'failed to compile file because:',
|
||||||
'failed to reload module': 'recarga del módulo ha fallado',
|
'failed to reload module': 'recarga del módulo ha fallado',
|
||||||
@@ -151,9 +176,10 @@
|
|||||||
'file saved on %(time)s': 'archivo guardado %(time)s',
|
'file saved on %(time)s': 'archivo guardado %(time)s',
|
||||||
'file saved on %s': 'archivo guardado %s',
|
'file saved on %s': 'archivo guardado %s',
|
||||||
'filter': 'filter',
|
'filter': 'filter',
|
||||||
'Find Next': 'Find Next',
|
'Find Next': 'Buscar próximo',
|
||||||
'Find Previous': 'Find Previous',
|
'Find Previous': 'Bucar anterior',
|
||||||
'First name': 'Nombre',
|
'First name': 'Nombre',
|
||||||
|
'Frames': 'Frames',
|
||||||
'Functions with no doctests will result in [passed] tests.': 'Funciones sin doctests equivalen a pruebas [aceptadas].',
|
'Functions with no doctests will result in [passed] tests.': 'Funciones sin doctests equivalen a pruebas [aceptadas].',
|
||||||
'Globals##debug': 'Globals',
|
'Globals##debug': 'Globals',
|
||||||
'graph model': 'graph model',
|
'graph model': 'graph model',
|
||||||
@@ -166,6 +192,7 @@
|
|||||||
'includes': 'incluye',
|
'includes': 'incluye',
|
||||||
'insert new': 'inserte nuevo',
|
'insert new': 'inserte nuevo',
|
||||||
'insert new %s': 'inserte nuevo %s',
|
'insert new %s': 'inserte nuevo %s',
|
||||||
|
'inspect attributes': 'inspect attributes',
|
||||||
'Install': 'instalar',
|
'Install': 'instalar',
|
||||||
'Installed applications': 'Aplicaciones instaladas',
|
'Installed applications': 'Aplicaciones instaladas',
|
||||||
'Interaction at %s line %s': 'Interaction at %s line %s',
|
'Interaction at %s line %s': 'Interaction at %s line %s',
|
||||||
@@ -175,10 +202,12 @@
|
|||||||
'Invalid action': 'Acción inválida',
|
'Invalid action': 'Acción inválida',
|
||||||
'Invalid email': 'Correo inválido',
|
'Invalid email': 'Correo inválido',
|
||||||
'invalid password': 'contraseña inválida',
|
'invalid password': 'contraseña inválida',
|
||||||
|
'invalid password.': 'invalid password.',
|
||||||
'Invalid Query': 'Consulta inválida',
|
'Invalid Query': 'Consulta inválida',
|
||||||
'invalid request': 'solicitud inválida',
|
'invalid request': 'solicitud inválida',
|
||||||
'invalid ticket': 'tiquete inválido',
|
'invalid ticket': 'tiquete inválido',
|
||||||
'Key bindings': 'Key bindings',
|
'Key bindings': 'Key bindings',
|
||||||
|
'Key bindings for ZenCoding Plugin': 'Key bindings for ZenCoding Plugin',
|
||||||
'language file "%(filename)s" created/updated': 'archivo de lenguaje "%(filename)s" creado/actualizado',
|
'language file "%(filename)s" created/updated': 'archivo de lenguaje "%(filename)s" creado/actualizado',
|
||||||
'Language files (static strings) updated': 'Archivos de lenguaje (cadenas estáticas) actualizados',
|
'Language files (static strings) updated': 'Archivos de lenguaje (cadenas estáticas) actualizados',
|
||||||
'languages': 'lenguajes',
|
'languages': 'lenguajes',
|
||||||
@@ -188,13 +217,15 @@
|
|||||||
'Last saved on:': 'Guardado en:',
|
'Last saved on:': 'Guardado en:',
|
||||||
'License for': 'Licencia para',
|
'License for': 'Licencia para',
|
||||||
'loading...': 'cargando...',
|
'loading...': 'cargando...',
|
||||||
|
'locals': 'locals',
|
||||||
'Locals##debug': 'Locals',
|
'Locals##debug': 'Locals',
|
||||||
'Login': 'Inicio de sesión',
|
'Login': 'Inicio de sesión',
|
||||||
'login': 'inicio de sesión',
|
'login': 'inicio de sesión',
|
||||||
'Login to the Administrative Interface': 'Inicio de sesión para la Interfaz Administrativa',
|
'Login to the Administrative Interface': 'Inicio de sesión para la Interfaz Administrativa',
|
||||||
'Logout': 'fin de sesión',
|
'Logout': 'fin de sesión',
|
||||||
'Lost Password': 'Contraseña perdida',
|
'Lost Password': 'Contraseña perdida',
|
||||||
'manage': 'manage',
|
'manage': 'gestionar',
|
||||||
|
'Manage': 'Gestionar',
|
||||||
'merge': 'combinar',
|
'merge': 'combinar',
|
||||||
'Models': 'Modelos',
|
'Models': 'Modelos',
|
||||||
'models': 'modelos',
|
'models': 'modelos',
|
||||||
@@ -202,24 +233,31 @@
|
|||||||
'modules': 'módulos',
|
'modules': 'módulos',
|
||||||
'Name': 'Nombre',
|
'Name': 'Nombre',
|
||||||
'new application "%s" created': 'nueva aplicación "%s" creada',
|
'new application "%s" created': 'nueva aplicación "%s" creada',
|
||||||
|
'New application wizard': 'Asistente para nueva aplicación',
|
||||||
'new plugin installed': 'nuevo plugin instalado',
|
'new plugin installed': 'nuevo plugin instalado',
|
||||||
'New Record': 'Registro nuevo',
|
'New Record': 'Registro nuevo',
|
||||||
'new record inserted': 'nuevo registro insertado',
|
'new record inserted': 'nuevo registro insertado',
|
||||||
|
'New simple application': 'Nueva aplicación',
|
||||||
'next': 'next',
|
'next': 'next',
|
||||||
'next 100 rows': '100 filas siguientes',
|
'next 100 rows': '100 filas siguientes',
|
||||||
'NO': 'NO',
|
'NO': 'NO',
|
||||||
'No databases in this application': 'No hay bases de datos en esta aplicación',
|
'No databases in this application': 'No hay bases de datos en esta aplicación',
|
||||||
'No Interaction yet': 'No Interaction yet',
|
'No Interaction yet': 'No Interaction yet',
|
||||||
'no match': 'no encontrado',
|
'no match': 'no encontrado',
|
||||||
|
'no package selected': 'no package selected',
|
||||||
|
'No ticket_storage.txt found under /private folder': 'No ticket_storage.txt found under /private folder',
|
||||||
|
'online designer': 'online designer',
|
||||||
'or alternatively': 'or alternatively',
|
'or alternatively': 'or alternatively',
|
||||||
|
'Or Get from URL:': 'O obtener desde una URL:',
|
||||||
'or import from csv file': 'o importar desde archivo CSV',
|
'or import from csv file': 'o importar desde archivo CSV',
|
||||||
'or provide app url:': 'o provea URL de la aplicación:',
|
'or provide app url:': 'o provea URL de la aplicación:',
|
||||||
'or provide application url:': 'o provea URL de la aplicación:',
|
'or provide application url:': 'o provea URL de la aplicación:',
|
||||||
'Origin': 'Origen',
|
'Origin': 'Origen',
|
||||||
'Original/Translation': 'Original/Traducción',
|
'Original/Translation': 'Original/Traducción',
|
||||||
'Overwrite installed app': 'sobreescriba aplicación instalada',
|
'Overwrite installed app': 'sobreescriba la aplicación instalada',
|
||||||
'Pack all': 'empaquetar todo',
|
'Pack all': 'empaquetar todo',
|
||||||
'Pack compiled': 'empaquete compiladas',
|
'Pack compiled': 'empaquete compiladas',
|
||||||
|
'Pack custom': 'empaquetar personalizado',
|
||||||
'pack plugin': 'empaquetar plugin',
|
'pack plugin': 'empaquetar plugin',
|
||||||
'PAM authenticated user, cannot change password here': 'usuario autenticado por PAM, no puede cambiar la contraseña aquí',
|
'PAM authenticated user, cannot change password here': 'usuario autenticado por PAM, no puede cambiar la contraseña aquí',
|
||||||
'Password': 'Contraseña',
|
'Password': 'Contraseña',
|
||||||
@@ -233,9 +271,10 @@
|
|||||||
'Plural-Forms:': 'Plural-Forms:',
|
'Plural-Forms:': 'Plural-Forms:',
|
||||||
'Powered by': 'Este sitio usa',
|
'Powered by': 'Este sitio usa',
|
||||||
'previous 100 rows': '100 filas anteriores',
|
'previous 100 rows': '100 filas anteriores',
|
||||||
'Private files': 'Private files',
|
'Private files': 'Archivos privados',
|
||||||
'private files': 'private files',
|
'private files': 'archivos privados',
|
||||||
'Query:': 'Consulta:',
|
'Query:': 'Consulta:',
|
||||||
|
'Rapid Search': 'Rapid Search',
|
||||||
'record': 'registro',
|
'record': 'registro',
|
||||||
'record does not exist': 'el registro no existe',
|
'record does not exist': 'el registro no existe',
|
||||||
'record id': 'id de registro',
|
'record id': 'id de registro',
|
||||||
@@ -244,11 +283,14 @@
|
|||||||
'Register': 'Registrese',
|
'Register': 'Registrese',
|
||||||
'Registration key': 'Contraseña de Registro',
|
'Registration key': 'Contraseña de Registro',
|
||||||
'reload': 'reload',
|
'reload': 'reload',
|
||||||
|
'Reload routes': 'Reload routes',
|
||||||
'Remove compiled': 'eliminar compiladas',
|
'Remove compiled': 'eliminar compiladas',
|
||||||
'Removed Breakpoint on %s at line %s': 'Removed Breakpoint on %s at line %s',
|
'Removed Breakpoint on %s at line %s': 'Eliminado punto de ruptura en %s en la línea %s',
|
||||||
'Replace': 'Replace',
|
'Replace': 'Reemplazar',
|
||||||
'Replace All': 'Replace All',
|
'Replace All': 'Reemplazar todos',
|
||||||
|
'request': 'request',
|
||||||
'Resolve Conflict file': 'archivo Resolución de Conflicto',
|
'Resolve Conflict file': 'archivo Resolución de Conflicto',
|
||||||
|
'response': 'response',
|
||||||
'restore': 'restaurar',
|
'restore': 'restaurar',
|
||||||
'return': 'return',
|
'return': 'return',
|
||||||
'revert': 'revertir',
|
'revert': 'revertir',
|
||||||
@@ -256,27 +298,33 @@
|
|||||||
'Rows in table': 'Filas en la tabla',
|
'Rows in table': 'Filas en la tabla',
|
||||||
'Rows selected': 'Filas seleccionadas',
|
'Rows selected': 'Filas seleccionadas',
|
||||||
'rules are not defined': 'rules are not defined',
|
'rules are not defined': 'rules are not defined',
|
||||||
|
'Run tests in this file': 'Run tests in this file',
|
||||||
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')",
|
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')",
|
||||||
|
'Running on %s': 'Running on %s',
|
||||||
'Save': 'Save',
|
'Save': 'Save',
|
||||||
'save': 'guardar',
|
'save': 'guardar',
|
||||||
'Save file:': 'Save file:',
|
'Save file:': 'Guardar:',
|
||||||
'Save via Ajax': 'Save via Ajax',
|
'Save file: %s': 'Guardar: %s',
|
||||||
|
'Save via Ajax': 'Guardar via Ajax',
|
||||||
'Saved file hash:': 'Hash del archivo guardado:',
|
'Saved file hash:': 'Hash del archivo guardado:',
|
||||||
'selected': 'seleccionado(s)',
|
'selected': 'seleccionado(s)',
|
||||||
|
'session': 'session',
|
||||||
'session expired': 'sesión expirada',
|
'session expired': 'sesión expirada',
|
||||||
'Set Breakpoint on %s at line %s: %s': 'Set Breakpoint on %s at line %s: %s',
|
'Set Breakpoint on %s at line %s: %s': 'Establecer punto de ruptura en %s en la línea %s: %s',
|
||||||
'shell': 'shell',
|
'shell': 'shell',
|
||||||
'Site': 'sitio',
|
'Site': 'sitio',
|
||||||
'some files could not be removed': 'algunos archivos no pudieron ser removidos',
|
'some files could not be removed': 'algunos archivos no pudieron ser removidos',
|
||||||
'Start searching': 'Start searching',
|
'Start searching': 'Iniciar búsqueda',
|
||||||
|
'Start wizard': 'Iniciar asistente',
|
||||||
'state': 'estado',
|
'state': 'estado',
|
||||||
'static': 'estáticos',
|
|
||||||
'Static': 'Static',
|
'Static': 'Static',
|
||||||
|
'static': 'estáticos',
|
||||||
'Static files': 'Archivos estáticos',
|
'Static files': 'Archivos estáticos',
|
||||||
'step': 'step',
|
'step': 'step',
|
||||||
'stop': 'stop',
|
'stop': 'stop',
|
||||||
'submit': 'enviar',
|
'submit': 'enviar',
|
||||||
'successful': 'successful',
|
'Submit': 'Submit',
|
||||||
|
'successful': 'exitoso',
|
||||||
'Sure you want to delete this object?': '¿Está seguro que desea eliminar este objeto?',
|
'Sure you want to delete this object?': '¿Está seguro que desea eliminar este objeto?',
|
||||||
'table': 'tabla',
|
'table': 'tabla',
|
||||||
'Table name': 'Nombre de la tabla',
|
'Table name': 'Nombre de la tabla',
|
||||||
@@ -284,37 +332,41 @@
|
|||||||
'Testing application': 'Probando aplicación',
|
'Testing application': 'Probando aplicación',
|
||||||
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La "consulta" es una condición como "db.tabla1.campo1==\'valor\'". Algo como "db.tabla1.campo1==db.tabla2.campo2" resulta en un JOIN SQL.',
|
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La "consulta" es una condición como "db.tabla1.campo1==\'valor\'". Algo como "db.tabla1.campo1==db.tabla2.campo2" resulta en un JOIN SQL.',
|
||||||
'the application logic, each URL path is mapped in one exposed function in the controller': 'la lógica de la aplicación, cada ruta URL se mapea en una función expuesta en el controlador',
|
'the application logic, each URL path is mapped in one exposed function in the controller': 'la lógica de la aplicación, cada ruta URL se mapea en una función expuesta en el controlador',
|
||||||
'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller',
|
'The application logic, each URL path is mapped in one exposed function in the controller': 'La lógica de la aplicación, cada ruta URL se mapea en una función expuesta en el controlador',
|
||||||
'the data representation, define database tables and sets': 'la representación de datos, define tablas y conjuntos de base de datos',
|
'the data representation, define database tables and sets': 'la representación de datos, define tablas y conjuntos de base de datos',
|
||||||
'The data representation, define database tables and sets': 'The data representation, define database tables and sets',
|
'The data representation, define database tables and sets': 'La representación de datos, define tablas y conjuntos de base de datos',
|
||||||
'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates',
|
'The presentations layer, views are also known as templates': 'La capa de presentación, las vistas también son llamadas plantillas',
|
||||||
'the presentations layer, views are also known as templates': 'la capa de presentación, las vistas también son llamadas plantillas',
|
'the presentations layer, views are also known as templates': 'la capa de presentación, las vistas también son llamadas plantillas',
|
||||||
'There are no controllers': 'No hay controladores',
|
'There are no controllers': 'No hay controladores',
|
||||||
'There are no models': 'No hay modelos',
|
'There are no models': 'No hay modelos',
|
||||||
'There are no modules': 'No hay módulos',
|
'There are no modules': 'No hay módulos',
|
||||||
'There are no plugins': 'There are no plugins',
|
'There are no plugins': 'No hay plugins',
|
||||||
'There are no private files': 'There are no private files',
|
'There are no private files': 'No hay archivos privados',
|
||||||
'There are no static files': 'No hay archivos estáticos',
|
'There are no static files': 'No hay archivos estáticos',
|
||||||
'There are no translators, only default language is supported': 'No hay traductores, sólo el lenguaje por defecto es soportado',
|
'There are no translators, only default language is supported': 'No hay traductores, sólo el lenguaje por defecto es soportado',
|
||||||
'There are no views': 'No hay vistas',
|
'There are no views': 'No hay vistas',
|
||||||
'These files are not served, they are only available from within your app': 'These files are not served, they are only available from within your app',
|
'These files are not served, they are only available from within your app': 'Estos archivos no son servidos, ellos solo estan disponibles para su aplicación',
|
||||||
'These files are served without processing, your images go here': 'These files are served without processing, your images go here',
|
'These files are served without processing, your images go here': 'Estos archivos son servidos sin procesar, sus imágenes van aquí',
|
||||||
'these files are served without processing, your images go here': 'estos archivos son servidos sin procesar, sus imágenes van aquí',
|
'these files are served without processing, your images go here': 'estos archivos son servidos sin procesar, sus imágenes van aquí',
|
||||||
'This is the %(filename)s template': 'Esta es la plantilla %(filename)s',
|
'This is the %(filename)s template': 'Esta es la plantilla %(filename)s',
|
||||||
'this page to see if a breakpoint was hit and debug interaction is required.': 'this page to see if a breakpoint was hit and debug interaction is required.',
|
'this page to see if a breakpoint was hit and debug interaction is required.': 'this page to see if a breakpoint was hit and debug interaction is required.',
|
||||||
'Ticket': 'Tiquete',
|
'Ticket': 'Tiquete',
|
||||||
|
'Ticket ID': 'Ticket ID',
|
||||||
'Timestamp': 'Timestamp',
|
'Timestamp': 'Timestamp',
|
||||||
'TM': 'MR',
|
'TM': 'MR',
|
||||||
'to previous version.': 'a la versión previa.',
|
'to previous version.': 'a la versión previa.',
|
||||||
'To create a plugin, name a file/folder plugin_[name]': 'Para crear un plugin, nombre un archivo/carpeta plugin_[nombre]',
|
'To create a plugin, name a file/folder plugin_[name]': 'Para crear un plugin, nombre un archivo/carpeta plugin_[nombre]',
|
||||||
'To emulate a breakpoint programatically, write:': 'To emulate a breakpoint programatically, write:',
|
'To emulate a breakpoint programatically, write:': 'To emulate a breakpoint programatically, write:',
|
||||||
'to use the debugger!': 'to use the debugger!',
|
'to use the debugger!': 'to use the debugger!',
|
||||||
'toggle breakpoint': 'toggle breakpoint',
|
'toggle breakpoint': 'alternar punto de ruptura',
|
||||||
'Toggle Fullscreen': 'Toggle Fullscreen',
|
'Toggle Fullscreen': 'Alternar pantalla completa',
|
||||||
|
'Traceback': 'Traceback',
|
||||||
'translation strings for the application': 'cadenas de caracteres de traducción para la aplicación',
|
'translation strings for the application': 'cadenas de caracteres de traducción para la aplicación',
|
||||||
'Translation strings for the application': 'Translation strings for the application',
|
'Translation strings for the application': 'Cadenas de caracteres de traducción para la aplicación',
|
||||||
'try': 'intente',
|
'try': 'intente',
|
||||||
'try something like': 'intente algo como',
|
'try something like': 'intente algo como',
|
||||||
|
'Try the mobile interface': 'Pruebe la interfaz móvil',
|
||||||
|
'try view': 'try view',
|
||||||
'Type some Python code in here and hit Return (Enter) to execute it.': 'Type some Python code in here and hit Return (Enter) to execute it.',
|
'Type some Python code in here and hit Return (Enter) to execute it.': 'Type some Python code in here and hit Return (Enter) to execute it.',
|
||||||
'Unable to check for upgrades': 'No es posible verificar la existencia de actualizaciones',
|
'Unable to check for upgrades': 'No es posible verificar la existencia de actualizaciones',
|
||||||
'unable to create application "%s"': 'no es posible crear la aplicación "%s"',
|
'unable to create application "%s"': 'no es posible crear la aplicación "%s"',
|
||||||
@@ -332,9 +384,12 @@
|
|||||||
'update': 'actualizar',
|
'update': 'actualizar',
|
||||||
'update all languages': 'actualizar todos los lenguajes',
|
'update all languages': 'actualizar todos los lenguajes',
|
||||||
'Update:': 'Actualice:',
|
'Update:': 'Actualice:',
|
||||||
|
'upgrade now to %s': 'upgrade now to %s',
|
||||||
'upgrade web2py now': 'actualize web2py ahora',
|
'upgrade web2py now': 'actualize web2py ahora',
|
||||||
'Upload': 'Upload',
|
'Upload': 'Subir',
|
||||||
'Upload & install packed application': 'Suba e instale aplicación empaquetada',
|
'Upload & install packed application': 'Suba e instale aplicación empaquetada',
|
||||||
|
'Upload a package:': 'Subir un paquete:',
|
||||||
|
'Upload and install packed application': 'Suba e instale una aplicación empaquetada',
|
||||||
'upload application:': 'subir aplicación:',
|
'upload application:': 'subir aplicación:',
|
||||||
'Upload existing application': 'Suba esta aplicación',
|
'Upload existing application': 'Suba esta aplicación',
|
||||||
'upload file:': 'suba archivo:',
|
'upload file:': 'suba archivo:',
|
||||||
@@ -348,6 +403,7 @@
|
|||||||
'view': 'vista',
|
'view': 'vista',
|
||||||
'Views': 'Vistas',
|
'Views': 'Vistas',
|
||||||
'views': 'vistas',
|
'views': 'vistas',
|
||||||
|
'Web Framework': 'Web Framework',
|
||||||
'web2py is up to date': 'web2py está actualizado',
|
'web2py is up to date': 'web2py está actualizado',
|
||||||
'web2py online debugger': 'web2py online debugger',
|
'web2py online debugger': 'web2py online debugger',
|
||||||
'web2py Recent Tweets': 'Tweets Recientes de web2py',
|
'web2py Recent Tweets': 'Tweets Recientes de web2py',
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression en option tels que "field1 = \'newvalue\'". Vous ne pouvez pas mettre à jour ou supprimer les résultats d\'une jointure "a JOIN"',
|
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression en option tels que "field1 = \'newvalue\'". Vous ne pouvez pas mettre à jour ou supprimer les résultats d\'une jointure "a JOIN"',
|
||||||
'%Y-%m-%d': '%d-%m-%Y',
|
'%Y-%m-%d': '%d-%m-%Y',
|
||||||
'%Y-%m-%d %H:%M:%S': '%d-%m-%Y %H:%M:%S',
|
'%Y-%m-%d %H:%M:%S': '%d-%m-%Y %H:%M:%S',
|
||||||
'%s %%{row} deleted': 'lignes %s supprimé',
|
'%s %%{row} deleted': 'lignes %s supprimées',
|
||||||
'%s %%{row} updated': 'lignes %s mis à jour',
|
'%s %%{row} updated': 'lignes %s mises à jour',
|
||||||
'(requires internet access)': '(requires internet access)',
|
'(requires internet access)': '(nécessite un accès Internet)',
|
||||||
'(something like "it-it")': '(quelque chose comme "it-it") ',
|
'(something like "it-it")': '(quelque chose comme "it-it") ',
|
||||||
'@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files',
|
'@markmin\x01Searching: **%s** %%{file}': 'Cherche: **%s** fichiers',
|
||||||
'A new version of web2py is available: %s': 'Une nouvelle version de web2py est disponible: %s ',
|
'A new version of web2py is available: %s': 'Une nouvelle version de web2py est disponible: %s ',
|
||||||
'A new version of web2py is available: Version 1.68.2 (2009-10-21 09:59:29)\n': 'Une nouvelle version de web2py est disponible: Version 1.68.2 (2009-10-21 09:59:29)\r\n',
|
'A new version of web2py is available: Version 1.68.2 (2009-10-21 09:59:29)\n': 'Une nouvelle version de web2py est disponible: Version 1.68.2 (2009-10-21 09:59:29)\r\n',
|
||||||
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATTENTION: nécessite une connexion sécurisée (HTTPS) ou être en localhost. ',
|
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATTENTION: nécessite une connexion sécurisée (HTTPS) ou être en localhost. ',
|
||||||
@@ -17,59 +17,59 @@
|
|||||||
'ATTENTION: you cannot edit the running application!': "ATTENTION: vous ne pouvez pas modifier l'application qui tourne!",
|
'ATTENTION: you cannot edit the running application!': "ATTENTION: vous ne pouvez pas modifier l'application qui tourne!",
|
||||||
'About': 'à propos',
|
'About': 'à propos',
|
||||||
'About application': "A propos de l'application",
|
'About application': "A propos de l'application",
|
||||||
'Additional code for your application': 'Additional code for your application',
|
'Additional code for your application': 'Code additionnel pour votre application',
|
||||||
'Admin is disabled because insecure channel': 'Admin est désactivé parce que canal non sécurisé',
|
'Admin is disabled because insecure channel': 'Admin est désactivé parce que canal non sécurisé',
|
||||||
'Admin language': 'Admin language',
|
'Admin language': "Language de l'admin",
|
||||||
'Administrator Password:': 'Mot de passe Administrateur:',
|
'Administrator Password:': 'Mot de passe Administrateur:',
|
||||||
'Application name:': 'Application name:',
|
'Application name:': "Nom de l'application:",
|
||||||
'Are you sure you want to delete file "%s"?': 'Etes-vous sûr de vouloir supprimer le fichier «%s»?',
|
'Are you sure you want to delete file "%s"?': 'Êtes-vous sûr de vouloir supprimer le fichier «%s»?',
|
||||||
'Are you sure you want to delete plugin "%s"?': 'Etes-vous sûr de vouloir effacer le plugin "%s"?',
|
'Are you sure you want to delete plugin "%s"?': 'Êtes-vous sûr de vouloir supprimer le plugin "%s"?',
|
||||||
'Are you sure you want to delete this object?': 'Are you sure you want to delete this object?',
|
'Are you sure you want to delete this object?': 'Êtes-vous sûr de vouloir supprimer cet objet?',
|
||||||
'Are you sure you want to uninstall application "%s"?': "Êtes-vous sûr de vouloir désinstaller l'application «%s»?",
|
'Are you sure you want to uninstall application "%s"?': "Êtes-vous sûr de vouloir désinstaller l'application «%s»?",
|
||||||
'Are you sure you want to upgrade web2py now?': 'Are you sure you want to upgrade web2py now?',
|
'Are you sure you want to upgrade web2py now?': 'Êtes-vous sûr de vouloir mettre à jour web2py maintenant?',
|
||||||
'Available databases and tables': 'Bases de données et tables disponible',
|
'Available databases and tables': 'Bases de données et tables disponible',
|
||||||
'Cannot be empty': 'Ne peut pas être vide',
|
'Cannot be empty': 'Ne peut pas être vide',
|
||||||
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Ne peut pas compiler: il y a des erreurs dans votre application. corriger les erreurs et essayez à nouveau.',
|
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'Ne peut pas compiler: il y a des erreurs dans votre application. corriger les erreurs et essayez à nouveau.',
|
||||||
'Cannot compile: there are errors in your app:': 'Cannot compile: there are errors in your app:',
|
'Cannot compile: there are errors in your app:': 'Ne peut pas compiler: il y a des erreurs dans votre application:',
|
||||||
'Change admin password': 'change admin password',
|
'Change admin password': 'Changer le mot de passe admin',
|
||||||
'Check for upgrades': 'check for upgrades',
|
'Check for upgrades': 'Vérifier les mises à jour',
|
||||||
'Check to delete': 'Cocher pour supprimer',
|
'Check to delete': 'Cocher pour supprimer',
|
||||||
'Checking for upgrades...': 'Vérification des mises à jour ... ',
|
'Checking for upgrades...': 'Vérification des mises à jour ... ',
|
||||||
'Clean': 'nettoyer',
|
'Clean': 'nettoyer',
|
||||||
'Compile': 'compiler',
|
'Compile': 'compiler',
|
||||||
'Controllers': 'Contrôleurs',
|
'Controllers': 'Contrôleurs',
|
||||||
'Create': 'create',
|
'Create': 'Créer',
|
||||||
'Create new simple application': 'Créer une nouvelle application',
|
'Create new simple application': 'Créer une nouvelle application',
|
||||||
'Current request': 'Requête actuel',
|
'Current request': 'Requête actuelle',
|
||||||
'Current response': 'Réponse actuelle',
|
'Current response': 'Réponse actuelle',
|
||||||
'Current session': 'Session en cours',
|
'Current session': 'Session en cours',
|
||||||
'Date and Time': 'Date et heure',
|
'Date and Time': 'Date et heure',
|
||||||
'Delete': 'Supprimer',
|
'Delete': 'Supprimer',
|
||||||
'Delete this file (you will be asked to confirm deletion)': 'Delete this file (you will be asked to confirm deletion)',
|
'Delete this file (you will be asked to confirm deletion)': 'Supprimer ce fichier (on vous demandera de confirmer la suppression)',
|
||||||
'Delete:': 'Supprimer:',
|
'Delete:': 'Supprimer:',
|
||||||
'Deploy': 'deploy',
|
'Deploy': 'Déployer',
|
||||||
'Deploy on Google App Engine': 'Déployer sur Google App Engine',
|
'Deploy on Google App Engine': 'Déployer sur Google App Engine',
|
||||||
'EDIT': 'MODIFIER',
|
'EDIT': 'MODIFIER',
|
||||||
'Edit': 'modifier',
|
'Edit': 'modifier',
|
||||||
'Edit application': "Modifier l'application",
|
'Edit application': "Modifier l'application",
|
||||||
'Edit current record': 'Modifier cet entrée',
|
'Edit current record': 'Modifier cette entrée',
|
||||||
'Editing Language file': 'Modifier le fichier de langue',
|
'Editing Language file': 'Modifier le fichier de langue',
|
||||||
'Editing file': 'Modifier le fichier',
|
'Editing file': 'Modifier le fichier',
|
||||||
'Editing file "%s"': 'Modifier le fichier "% s" ',
|
'Editing file "%s"': 'Modifier le fichier "% s" ',
|
||||||
'Enterprise Web Framework': 'Enterprise Web Framework',
|
'Enterprise Web Framework': 'Enterprise Web Framework',
|
||||||
'Error logs for "%(app)s"': 'Journal d\'erreurs pour "%(app)s"',
|
'Error logs for "%(app)s"': 'Journal d\'erreurs pour "%(app)s"',
|
||||||
'Errors': 'erreurs',
|
'Errors': 'erreurs',
|
||||||
'Exception instance attributes': 'Exception instance attributes',
|
'Exception instance attributes': "Attributs d'instance Exception",
|
||||||
'Functions with no doctests will result in [passed] tests.': 'Des fonctions sans doctests entraînera tests [passed] .',
|
'Functions with no doctests will result in [passed] tests.': 'Des fonctions sans doctests entraîneront des tests [passed] .',
|
||||||
'Help': 'aide',
|
'Help': 'aide',
|
||||||
'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': "Si le rapport ci-dessus contient un numéro de ticket, cela indique une défaillance dans l'exécution du contrôleur, avant toute tentative d'exécuter les doctests. Cela est généralement dû à une erreur d'indentation ou une erreur à l'extérieur du code de la fonction.\r\nUn titre verte indique que tous les tests (si définie) passed. Dans ce cas, les résultats des essais ne sont pas affichées.",
|
'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': "Si le rapport ci-dessus contient un numéro de ticket, cela indique une défaillance dans l'exécution du contrôleur, avant toute tentative d'exécuter les doctests. Cela est généralement dû à une erreur d'indentation ou une erreur à l'extérieur du code de la fonction.\r\nUn titre vert indique que tous les tests (si définis) sont passés. Dans ce cas, les résultats des essais ne sont pas affichées.",
|
||||||
'Import/Export': 'Importer/Exporter',
|
'Import/Export': 'Importer/Exporter',
|
||||||
'Install': 'install',
|
'Install': 'Installer',
|
||||||
'Installed applications': 'Les applications installées',
|
'Installed applications': 'Applications installées',
|
||||||
'Internal State': 'État Interne',
|
'Internal State': 'État Interne',
|
||||||
'Invalid Query': 'Requête non valide',
|
'Invalid Query': 'Requête non valide',
|
||||||
'Invalid action': 'Action non valide',
|
'Invalid action': 'Action non valide',
|
||||||
'Language files (static strings) updated': 'Fichiers de langue (static strings) Mise à jour ',
|
'Language files (static strings) updated': 'Fichiers de langue (chaînes statiques) mis à jour ',
|
||||||
'Languages': 'Langues',
|
'Languages': 'Langues',
|
||||||
'Last saved on:': 'Dernière sauvegarde le:',
|
'Last saved on:': 'Dernière sauvegarde le:',
|
||||||
'License for': 'Licence pour',
|
'License for': 'Licence pour',
|
||||||
@@ -79,13 +79,13 @@
|
|||||||
'Models': 'Modèles',
|
'Models': 'Modèles',
|
||||||
'Modules': 'Modules',
|
'Modules': 'Modules',
|
||||||
'NO': 'NON',
|
'NO': 'NON',
|
||||||
'New Record': 'Nouvel Entrée',
|
'New Record': 'Nouvelle Entrée',
|
||||||
'New application wizard': 'New application wizard',
|
'New application wizard': 'Assistant nouvelle application',
|
||||||
'New simple application': 'New simple application',
|
'New simple application': 'Nouvelle application simple',
|
||||||
'No databases in this application': 'Aucune base de données dans cette application',
|
'No databases in this application': 'Aucune base de données dans cette application',
|
||||||
'Original/Translation': 'Original / Traduction',
|
'Original/Translation': 'Original / Traduction',
|
||||||
'Overwrite installed app': 'overwrite installed app',
|
'Overwrite installed app': "Écraser l'application installée",
|
||||||
'PAM authenticated user, cannot change password here': 'PAM authenticated user, cannot change password here',
|
'PAM authenticated user, cannot change password here': 'Utilisateur authentifié par PAM, vous ne pouvez pas changer le mot de passe ici',
|
||||||
'Pack all': 'tout empaqueter',
|
'Pack all': 'tout empaqueter',
|
||||||
'Pack compiled': 'paquet compilé',
|
'Pack compiled': 'paquet compilé',
|
||||||
'Peeking at file': 'Jeter un oeil au fichier',
|
'Peeking at file': 'Jeter un oeil au fichier',
|
||||||
@@ -97,101 +97,101 @@
|
|||||||
'Resolve Conflict file': 'Résoudre les conflits de fichiers',
|
'Resolve Conflict file': 'Résoudre les conflits de fichiers',
|
||||||
'Rows in table': 'Lignes de la table',
|
'Rows in table': 'Lignes de la table',
|
||||||
'Rows selected': 'Lignes sélectionnées',
|
'Rows selected': 'Lignes sélectionnées',
|
||||||
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')",
|
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Lancer les tests dans ce fichier (pour lancer tous les fichiers, vous pouvez également utiliser le bouton nommé 'test')",
|
||||||
'Save': 'Save',
|
'Save': 'Enregistrer',
|
||||||
'Saved file hash:': 'Hash du Fichier enregistré:',
|
'Saved file hash:': 'Hash du Fichier enregistré:',
|
||||||
'Site': 'site',
|
'Site': 'Site',
|
||||||
'Start wizard': 'start wizard',
|
'Start wizard': "Démarrer l'assistant",
|
||||||
'Static files': 'Fichiers statiques',
|
'Static files': 'Fichiers statiques',
|
||||||
'Sure you want to delete this object?': 'Vous êtes sûr de vouloir supprimer cet objet? ',
|
'Sure you want to delete this object?': 'Vous êtes sûr de vouloir supprimer cet objet? ',
|
||||||
'TM': 'MD',
|
'TM': 'MD',
|
||||||
'Testing application': "Test de l'application",
|
'Testing application': "Test de l'application",
|
||||||
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La "requête" est une condition comme "db.table1.field1==\'value\'". Quelque chose comme "db.table1.field1==db.table2.field2" aboutit à un JOIN SQL.',
|
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La "requête" est une condition comme "db.table1.field1==\'value\'". Quelque chose comme "db.table1.field1==db.table2.field2" aboutit à un JOIN SQL.',
|
||||||
'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller',
|
'The application logic, each URL path is mapped in one exposed function in the controller': "La logique de l'application, chaque chemin d'URL est mappé avec une fonction exposée dans le contrôleur",
|
||||||
'The data representation, define database tables and sets': 'The data representation, define database tables and sets',
|
'The data representation, define database tables and sets': 'La représentation des données, définir les tables et ensembles de la base de données',
|
||||||
'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates',
|
'The presentations layer, views are also known as templates': "Les couches de présentation, les vues sont également appelées modples",
|
||||||
'There are no controllers': "Il n'existe pas de contrôleurs",
|
'There are no controllers': "Il n'y a pas de contrôleurs",
|
||||||
'There are no models': "Il n'existe pas de modèles",
|
'There are no models': "Il n'y a pas de modèles",
|
||||||
'There are no modules': "Il n'existe pas de modules",
|
'There are no modules': "Il n'y a pas de modules",
|
||||||
'There are no plugins': 'There are no plugins',
|
'There are no plugins': "Il n'y a pas de plugins",
|
||||||
'There are no static files': "Il n'existe pas de fichiers statiques",
|
'There are no static files': "Il n'y a pas de fichiers statiques",
|
||||||
'There are no translators, only default language is supported': "Il n'y a pas de traducteurs, est prise en charge uniquement la langue par défaut",
|
'There are no translators, only default language is supported': "Il n'y a pas de traducteurs, seule la langue par défaut est prise en charge",
|
||||||
'There are no views': "Il n'existe pas de vues",
|
'There are no views': "Il n'y a pas de vues",
|
||||||
'These files are served without processing, your images go here': 'These files are served without processing, your images go here',
|
'These files are served without processing, your images go here': 'Ces fichiers sont renvoyés sans traitement, vos images viennent ici',
|
||||||
'This is the %(filename)s template': 'Ceci est le modèle %(filename)s ',
|
'This is the %(filename)s template': 'Ceci est le modèle %(filename)s ',
|
||||||
'Ticket': 'Ticket',
|
'Ticket': 'Ticket',
|
||||||
'To create a plugin, name a file/folder plugin_[name]': 'Pour créer un plugin, créer un fichier /dossier plugin_[nom]',
|
'To create a plugin, name a file/folder plugin_[name]': 'Pour créer un plugin, créer un fichier /dossier plugin_[nom]',
|
||||||
'Translation strings for the application': 'Translation strings for the application',
|
'Translation strings for the application': "Chaînes de traduction pour l'application",
|
||||||
'Unable to check for upgrades': 'Impossible de vérifier les mises à niveau',
|
'Unable to check for upgrades': 'Impossible de vérifier les mises à jour',
|
||||||
'Unable to download': 'Impossible de télécharger',
|
'Unable to download': 'Impossible de télécharger',
|
||||||
'Unable to download app': 'Impossible de télécharger app',
|
'Unable to download app': "Impossible de télécharger l'app",
|
||||||
'Unable to download app because:': 'Unable to download app because:',
|
'Unable to download app because:': "Impossible de télécharger l'app car:",
|
||||||
'Unable to download because': 'Unable to download because',
|
'Unable to download because': 'Impossible de télécharger car',
|
||||||
'Uninstall': 'désinstaller',
|
'Uninstall': 'désinstaller',
|
||||||
'Update:': 'Mise à jour:',
|
'Update:': 'Mise à jour:',
|
||||||
'Upload & install packed application': 'Upload & install packed application',
|
'Upload & install packed application': "Charger & installer l'application empaquetée",
|
||||||
'Upload a package:': 'Upload a package:',
|
'Upload a package:': 'Charger un paquet:',
|
||||||
'Upload existing application': 'charger une application existante',
|
'Upload existing application': 'Charger une application existante',
|
||||||
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Utilisez (...)&(...) pour AND, (...)|(...) pour OR, et ~(...) pour NOT et construire des requêtes plus complexes. ',
|
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Utilisez (...)&(...) pour AND, (...)|(...) pour OR, et ~(...) pour NOT afin de construire des requêtes plus complexes. ',
|
||||||
'Use an url:': 'Use an url:',
|
'Use an url:': 'Utiliser une url:',
|
||||||
'Version': 'Version',
|
'Version': 'Version',
|
||||||
'Views': 'Vues',
|
'Views': 'Vues',
|
||||||
'Web Framework': 'Web Framework',
|
'Web Framework': 'Framework Web',
|
||||||
'YES': 'OUI',
|
'YES': 'OUI',
|
||||||
'additional code for your application': 'code supplémentaire pour votre application',
|
'additional code for your application': 'code supplémentaire pour votre application',
|
||||||
'admin disabled because no admin password': 'admin désactivé car aucun mot de passe admin',
|
'admin disabled because no admin password': 'admin désactivée car aucun mot de passe admin',
|
||||||
'admin disabled because not supported on google app engine': 'admin désactivé car non pris en charge sur Google Apps engine',
|
'admin disabled because not supported on google app engine': 'admin désactivée car non prise en charge sur Google Apps engine',
|
||||||
'admin disabled because unable to access password file': "admin désactivé car incapable d'accéder au fichier mot de passe",
|
'admin disabled because unable to access password file': "admin désactivée car incapable d'accéder au fichier mot de passe",
|
||||||
'administrative interface': 'administrative interface',
|
'administrative interface': "interface d'administration",
|
||||||
'and rename it (required):': 'et renommez-la (obligatoire):',
|
'and rename it (required):': 'et renommez-la (obligatoire):',
|
||||||
'and rename it:': 'et renommez-le:',
|
'and rename it:': 'et renommez-le:',
|
||||||
'appadmin': 'appadmin',
|
'appadmin': 'appadmin',
|
||||||
'appadmin is disabled because insecure channel': 'appadmin est désactivé parce que canal non sécurisé',
|
'appadmin is disabled because insecure channel': 'appadmin est désactivé parce que canal non sécurisé',
|
||||||
'application "%s" uninstalled': 'application "%s" désinstallé',
|
'application "%s" uninstalled': 'application "%s" désinstallée',
|
||||||
'application %(appname)s installed with md5sum: %(digest)s': 'application %(appname)s installed with md5sum: %(digest)s',
|
'application %(appname)s installed with md5sum: %(digest)s': 'application %(appname)s installée avec md5sum: %(digest)s',
|
||||||
'application compiled': 'application compilée',
|
'application compiled': 'application compilée',
|
||||||
'application is compiled and cannot be designed': "l'application est compilée et ne peut être désigné",
|
'application is compiled and cannot be designed': "l'application est compilée et ne peut être modifiée",
|
||||||
'arguments': 'arguments',
|
'arguments': 'arguments',
|
||||||
'back': 'retour',
|
'back': 'retour',
|
||||||
'cache': 'cache',
|
'cache': 'cache',
|
||||||
'cache, errors and sessions cleaned': 'cache, erreurs et sessions nettoyé',
|
'cache, errors and sessions cleaned': 'cache, erreurs et sessions nettoyés',
|
||||||
'cannot create file': 'ne peu pas créer de fichier',
|
'cannot create file': 'ne peut pas créer de fichier',
|
||||||
'cannot upload file "%(filename)s"': 'ne peu pas charger le fichier "%(filename)s"',
|
'cannot upload file "%(filename)s"': 'ne peut pas charger le fichier "%(filename)s"',
|
||||||
'check all': 'tous vérifier ',
|
'check all': 'tout vérifier ',
|
||||||
'click to check for upgrades': 'Cliquez pour vérifier les mises à niveau',
|
'click to check for upgrades': 'Cliquez pour vérifier les mises jour',
|
||||||
'code': 'code',
|
'code': 'code',
|
||||||
'collapse/expand all': 'collapse/expand all',
|
'collapse/expand all': 'tout réduire/agrandir',
|
||||||
'compiled application removed': 'application compilée enlevé',
|
'compiled application removed': 'application compilée enlevée',
|
||||||
'controllers': 'contrôleurs',
|
'controllers': 'contrôleurs',
|
||||||
'create file with filename:': 'créer un fichier avec nom de fichier:',
|
'create file with filename:': 'créer un fichier avec nom de fichier:',
|
||||||
'create new application:': 'créer une nouvelle application:',
|
'create new application:': 'créer une nouvelle application:',
|
||||||
'created by': 'créé par',
|
'created by': 'créé par',
|
||||||
'crontab': 'crontab',
|
'crontab': 'crontab',
|
||||||
'currently running': 'currently running',
|
'currently running': 'tourne actuellement',
|
||||||
'currently saved or': 'actuellement enregistrés ou',
|
'currently saved or': 'actuellement enregistré ou',
|
||||||
'data uploaded': 'données chargées',
|
'data uploaded': 'données chargées',
|
||||||
'database': 'base de données',
|
'database': 'base de données',
|
||||||
'database %s select': 'base de données %s sélectionner',
|
'database %s select': 'base de données %s sélectionner',
|
||||||
'database administration': 'administration base de données',
|
'database administration': 'administration base de données',
|
||||||
'db': 'db',
|
'db': 'bdd',
|
||||||
'defines tables': 'définit les tables',
|
'defines tables': 'définit les tables',
|
||||||
'delete': 'supprimer',
|
'delete': 'supprimer',
|
||||||
'delete all checked': 'supprimer tout ce qui est cocher',
|
'delete all checked': 'supprimer tout ce qui est coché',
|
||||||
'delete plugin': ' supprimer plugin',
|
'delete plugin': ' supprimer le plugin',
|
||||||
'design': 'conception',
|
'design': 'conception',
|
||||||
'direction: ltr': 'direction: ltr',
|
'direction: ltr': 'direction: ltr',
|
||||||
'docs': 'docs',
|
'docs': 'docs',
|
||||||
'done!': 'fait!',
|
'done!': 'fait!',
|
||||||
'download layouts': 'download layouts',
|
'download layouts': 'télécharger layouts',
|
||||||
'download plugins': 'download plugins',
|
'download plugins': 'télécharger plugins',
|
||||||
'edit controller': 'modifier contrôleur',
|
'edit controller': 'modifier contrôleur',
|
||||||
'edit views:': 'edit views:',
|
'edit views:': 'modifier vues:',
|
||||||
'export as csv file': 'exportation au format CSV',
|
'export as csv file': 'export au format CSV',
|
||||||
'exposes': 'expose',
|
'exposes': 'expose',
|
||||||
'exposes:': 'exposes:',
|
'exposes:': 'expose:',
|
||||||
'extends': 'étend',
|
'extends': 'étend',
|
||||||
'failed to reload module': 'impossible de recharger le module',
|
'failed to reload module': 'impossible de recharger le module',
|
||||||
'failed to reload module because:': 'failed to reload module because:',
|
'failed to reload module because:': 'impossible de recharger le module car:',
|
||||||
'file "%(filename)s" created': 'fichier "%(filename)s" créé',
|
'file "%(filename)s" created': 'fichier "%(filename)s" créé',
|
||||||
'file "%(filename)s" deleted': 'fichier "%(filename)s" supprimé',
|
'file "%(filename)s" deleted': 'fichier "%(filename)s" supprimé',
|
||||||
'file "%(filename)s" uploaded': 'fichier "%(filename)s" chargé',
|
'file "%(filename)s" uploaded': 'fichier "%(filename)s" chargé',
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
'file does not exist': "fichier n'existe pas",
|
'file does not exist': "fichier n'existe pas",
|
||||||
'file saved on %(time)s': 'fichier enregistré le %(time)s',
|
'file saved on %(time)s': 'fichier enregistré le %(time)s',
|
||||||
'file saved on %s': 'fichier enregistré le %s',
|
'file saved on %s': 'fichier enregistré le %s',
|
||||||
'filter': 'filter',
|
'filter': 'filtre',
|
||||||
'htmledit': 'edition html',
|
'htmledit': 'edition html',
|
||||||
'includes': 'inclus',
|
'includes': 'inclus',
|
||||||
'index': 'index',
|
'index': 'index',
|
||||||
@@ -219,14 +219,14 @@
|
|||||||
'modules': 'modules',
|
'modules': 'modules',
|
||||||
'new application "%s" created': 'nouvelle application "%s" créée',
|
'new application "%s" created': 'nouvelle application "%s" créée',
|
||||||
'new plugin installed': 'nouveau plugin installé',
|
'new plugin installed': 'nouveau plugin installé',
|
||||||
'new record inserted': 'nouvelle entrée inséré',
|
'new record inserted': 'nouvelle entrée insérée',
|
||||||
'next 100 rows': '100 lignes suivantes',
|
'next 100 rows': '100 lignes suivantes',
|
||||||
'no match': 'no match',
|
'no match': 'aucune correspondance',
|
||||||
'or import from csv file': 'ou importer depuis un fichier CSV ',
|
'or import from csv file': 'ou importer depuis un fichier CSV ',
|
||||||
'or provide app url:': 'or provide app url:',
|
'or provide app url:': "ou fournir l'URL de l'app:",
|
||||||
'or provide application url:': "ou fournir l'URL de l'application:",
|
'or provide application url:': "ou fournir l'URL de l'application:",
|
||||||
'pack plugin': 'paquet plugin',
|
'pack plugin': 'paquet plugin',
|
||||||
'password changed': 'password changed',
|
'password changed': 'mot de passe modifié',
|
||||||
'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" supprimé',
|
'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" supprimé',
|
||||||
'plugins': 'plugins',
|
'plugins': 'plugins',
|
||||||
'previous 100 rows': '100 lignes précédentes',
|
'previous 100 rows': '100 lignes précédentes',
|
||||||
@@ -245,9 +245,9 @@
|
|||||||
'submit': 'envoyer',
|
'submit': 'envoyer',
|
||||||
'table': 'table',
|
'table': 'table',
|
||||||
'test': 'tester',
|
'test': 'tester',
|
||||||
'the application logic, each URL path is mapped in one exposed function in the controller': "la logique de l'application, chaque route URL est mappé dans une fonction exposée dans le contrôleur",
|
'the application logic, each URL path is mapped in one exposed function in the controller': "la logique de l'application, chaque chemin d'URL est mappé dans une fonction exposée dans le contrôleur",
|
||||||
'the data representation, define database tables and sets': 'la représentation des données, défini les tables de bases de données et sets',
|
'the data representation, define database tables and sets': 'La représentation des données, définir les tables et ensembles de la base de données',
|
||||||
'the presentations layer, views are also known as templates': 'la couche des présentations, les vues sont également connus en tant que modèles',
|
'the presentations layer, views are also known as templates': 'la couche de présentation, les vues sont également appelées modèles',
|
||||||
'these files are served without processing, your images go here': 'ces fichiers sont servis sans transformation, vos images vont ici',
|
'these files are served without processing, your images go here': 'ces fichiers sont servis sans transformation, vos images vont ici',
|
||||||
'to previous version.': 'à la version précédente.',
|
'to previous version.': 'à la version précédente.',
|
||||||
'translation strings for the application': "chaînes de traduction de l'application",
|
'translation strings for the application': "chaînes de traduction de l'application",
|
||||||
@@ -258,22 +258,22 @@
|
|||||||
'unable to delete file plugin "%(plugin)s"': 'impossible de supprimer le plugin "%(plugin)s"',
|
'unable to delete file plugin "%(plugin)s"': 'impossible de supprimer le plugin "%(plugin)s"',
|
||||||
'unable to parse csv file': "impossible d'analyser les fichiers CSV",
|
'unable to parse csv file': "impossible d'analyser les fichiers CSV",
|
||||||
'unable to uninstall "%s"': 'impossible de désinstaller "%s"',
|
'unable to uninstall "%s"': 'impossible de désinstaller "%s"',
|
||||||
'unable to upgrade because "%s"': 'unable to upgrade because "%s"',
|
'unable to upgrade because "%s"': 'impossible de mettre à jour car "%s"',
|
||||||
'uncheck all': 'tout décocher',
|
'uncheck all': 'tout décocher',
|
||||||
'update': 'mettre à jour',
|
'update': 'mettre à jour',
|
||||||
'update all languages': 'mettre à jour toutes les langues',
|
'update all languages': 'mettre à jour toutes les langues',
|
||||||
'upgrade now': 'upgrade now',
|
'upgrade now': 'mettre à jour maintenant',
|
||||||
'upgrade web2py now': 'upgrade web2py now',
|
'upgrade web2py now': 'mettre à jour web2py maintenant',
|
||||||
'upload': 'upload',
|
'upload': 'charger',
|
||||||
'upload application:': "charger l'application:",
|
'upload application:': "charger l'application:",
|
||||||
'upload file:': 'charger le fichier:',
|
'upload file:': 'charger le fichier:',
|
||||||
'upload plugin file:': 'charger fichier plugin:',
|
'upload plugin file:': 'charger fichier plugin:',
|
||||||
'user': 'user',
|
'user': 'utilisateur',
|
||||||
'variables': 'variables',
|
'variables': 'variables',
|
||||||
'versioning': 'versioning',
|
'versioning': 'versioning',
|
||||||
'view': 'vue',
|
'view': 'vue',
|
||||||
'views': 'vues',
|
'views': 'vues',
|
||||||
'web2py Recent Tweets': 'web2py Tweets récentes',
|
'web2py Recent Tweets': 'Tweets récents sur web2py ',
|
||||||
'web2py is up to date': 'web2py est à jour',
|
'web2py is up to date': 'web2py est à jour',
|
||||||
'web2py upgraded; please restart it': 'web2py upgraded; please restart it',
|
'web2py upgraded; please restart it': 'web2py mis à jour; veuillez le redémarrer',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,10 @@
|
|||||||
'%Y-%m-%d': '%d/%m/%Y',
|
'%Y-%m-%d': '%d/%m/%Y',
|
||||||
'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S',
|
'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S',
|
||||||
'(requires internet access)': '(requires internet access)',
|
'(requires internet access)': '(requires internet access)',
|
||||||
|
'(requires internet access, experimental)': '(requires internet access, experimental)',
|
||||||
'(something like "it-it")': '(qualcosa simile a "it-it")',
|
'(something like "it-it")': '(qualcosa simile a "it-it")',
|
||||||
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(file **gluon/contrib/plural_rules/%s.py** is not found)',
|
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(file **gluon/contrib/plural_rules/%s.py** is not found)',
|
||||||
|
'@markmin\x01An error occured, please [[reload %s]] the page': 'An error occured, please [[reload %s]] the page',
|
||||||
'@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files',
|
'@markmin\x01Searching: **%s** %%{file}': 'Searching: **%s** files',
|
||||||
'A new version of web2py is available: %s': 'È disponibile una nuova versione di web2py: %s',
|
'A new version of web2py is available: %s': 'È disponibile una nuova versione di web2py: %s',
|
||||||
'About': 'informazioni',
|
'About': 'informazioni',
|
||||||
@@ -43,6 +45,7 @@
|
|||||||
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': "ATTENZIONE: L'accesso richiede una connessione sicura (HTTPS) o l'esecuzione di web2py in locale (connessione su localhost)",
|
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': "ATTENZIONE: L'accesso richiede una connessione sicura (HTTPS) o l'esecuzione di web2py in locale (connessione su localhost)",
|
||||||
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTZIONE: NON ESEGUIRE PIÙ TEST IN PARALLELO (I TEST NON SONO "THREAD SAFE")',
|
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATTENTZIONE: NON ESEGUIRE PIÙ TEST IN PARALLELO (I TEST NON SONO "THREAD SAFE")',
|
||||||
'ATTENTION: you cannot edit the running application!': "ATTENZIONE: non puoi modificare l'applicazione correntemente in uso ",
|
'ATTENTION: you cannot edit the running application!': "ATTENZIONE: non puoi modificare l'applicazione correntemente in uso ",
|
||||||
|
'Autocomplete Python Code': 'Autocomplete Python Code',
|
||||||
'Available databases and tables': 'Database e tabelle disponibili',
|
'Available databases and tables': 'Database e tabelle disponibili',
|
||||||
'back': 'indietro',
|
'back': 'indietro',
|
||||||
'cache': 'cache',
|
'cache': 'cache',
|
||||||
@@ -53,6 +56,7 @@
|
|||||||
'cannot create file': 'impossibile creare il file',
|
'cannot create file': 'impossibile creare il file',
|
||||||
'cannot upload file "%(filename)s"': 'impossibile caricare il file "%(filename)s"',
|
'cannot upload file "%(filename)s"': 'impossibile caricare il file "%(filename)s"',
|
||||||
'Change admin password': 'change admin password',
|
'Change admin password': 'change admin password',
|
||||||
|
'change editor settings': 'change editor settings',
|
||||||
'change password': 'cambia password',
|
'change password': 'cambia password',
|
||||||
'check all': 'controlla tutto',
|
'check all': 'controlla tutto',
|
||||||
'Check for upgrades': 'check for upgrades',
|
'Check for upgrades': 'check for upgrades',
|
||||||
@@ -74,6 +78,7 @@
|
|||||||
'create file with filename:': 'crea un file col nome:',
|
'create file with filename:': 'crea un file col nome:',
|
||||||
'create new application:': 'create new application:',
|
'create new application:': 'create new application:',
|
||||||
'Create new simple application': 'Crea nuova applicazione',
|
'Create new simple application': 'Crea nuova applicazione',
|
||||||
|
'Create/Upload': 'Create/Upload',
|
||||||
'created by': 'creato da',
|
'created by': 'creato da',
|
||||||
'crontab': 'crontab',
|
'crontab': 'crontab',
|
||||||
'Current request': 'Richiesta (request) corrente',
|
'Current request': 'Richiesta (request) corrente',
|
||||||
@@ -113,18 +118,19 @@
|
|||||||
'Edit': 'modifica',
|
'Edit': 'modifica',
|
||||||
'Edit application': 'Modifica applicazione',
|
'Edit application': 'Modifica applicazione',
|
||||||
'edit controller': 'modifica controller',
|
'edit controller': 'modifica controller',
|
||||||
|
'edit controller:': 'edit controller:',
|
||||||
'Edit current record': 'Modifica record corrente',
|
'Edit current record': 'Modifica record corrente',
|
||||||
'edit profile': 'modifica profilo',
|
'edit profile': 'modifica profilo',
|
||||||
'Edit This App': 'Modifica questa applicazione',
|
'Edit This App': 'Modifica questa applicazione',
|
||||||
'edit views:': 'modifica viste (view):',
|
'edit views:': 'modifica viste (view):',
|
||||||
'Editing file "%s"': 'Modifica del file "%s"',
|
'Editing %s': 'Editing %s',
|
||||||
'Editing Language file': 'Modifica file linguaggio',
|
|
||||||
'Enterprise Web Framework': 'Enterprise Web Framework',
|
'Enterprise Web Framework': 'Enterprise Web Framework',
|
||||||
'Error logs for "%(app)s"': 'Log degli errori per "%(app)s"',
|
'Error logs for "%(app)s"': 'Log degli errori per "%(app)s"',
|
||||||
'Error snapshot': 'Error snapshot',
|
'Error snapshot': 'Error snapshot',
|
||||||
'Error ticket': 'Error ticket',
|
'Error ticket': 'Error ticket',
|
||||||
'Errors': 'errori',
|
'Errors': 'errori',
|
||||||
'Exception instance attributes': 'Exception instance attributes',
|
'Exception instance attributes': 'Exception instance attributes',
|
||||||
|
'Exit Fullscreen': 'Exit Fullscreen',
|
||||||
'Expand Abbreviation': 'Expand Abbreviation',
|
'Expand Abbreviation': 'Expand Abbreviation',
|
||||||
'export as csv file': 'esporta come file CSV',
|
'export as csv file': 'esporta come file CSV',
|
||||||
'exposes': 'espone',
|
'exposes': 'espone',
|
||||||
@@ -140,6 +146,8 @@
|
|||||||
'file saved on %(time)s': "file salvato nell'istante %(time)s",
|
'file saved on %(time)s': "file salvato nell'istante %(time)s",
|
||||||
'file saved on %s': 'file salvato: %s',
|
'file saved on %s': 'file salvato: %s',
|
||||||
'filter': 'filter',
|
'filter': 'filter',
|
||||||
|
'Find Next': 'Find Next',
|
||||||
|
'Find Previous': 'Find Previous',
|
||||||
'Frames': 'Frames',
|
'Frames': 'Frames',
|
||||||
'Functions with no doctests will result in [passed] tests.': 'I test delle funzioni senza "doctests" risulteranno sempre [passed].',
|
'Functions with no doctests will result in [passed] tests.': 'I test delle funzioni senza "doctests" risulteranno sempre [passed].',
|
||||||
'Get from URL:': 'Get from URL:',
|
'Get from URL:': 'Get from URL:',
|
||||||
@@ -177,15 +185,16 @@
|
|||||||
'License for': 'Licenza relativa a',
|
'License for': 'Licenza relativa a',
|
||||||
'loading...': 'caricamento...',
|
'loading...': 'caricamento...',
|
||||||
'locals': 'locals',
|
'locals': 'locals',
|
||||||
'login': 'accesso',
|
|
||||||
'Login': 'Accesso',
|
'Login': 'Accesso',
|
||||||
|
'login': 'accesso',
|
||||||
'Login to the Administrative Interface': "Accesso all'interfaccia amministrativa",
|
'Login to the Administrative Interface': "Accesso all'interfaccia amministrativa",
|
||||||
'Logout': 'uscita',
|
'Logout': 'uscita',
|
||||||
'Main Menu': 'Menu principale',
|
'Main Menu': 'Menu principale',
|
||||||
|
'Manage': 'Manage',
|
||||||
'Menu Model': 'Menu Modelli',
|
'Menu Model': 'Menu Modelli',
|
||||||
'merge': 'unisci',
|
'merge': 'unisci',
|
||||||
'models': 'modelli',
|
|
||||||
'Models': 'Modelli',
|
'Models': 'Modelli',
|
||||||
|
'models': 'modelli',
|
||||||
'Modules': 'Moduli',
|
'Modules': 'Moduli',
|
||||||
'modules': 'moduli',
|
'modules': 'moduli',
|
||||||
'new application "%s" created': 'creata la nuova applicazione "%s"',
|
'new application "%s" created': 'creata la nuova applicazione "%s"',
|
||||||
@@ -198,6 +207,8 @@
|
|||||||
'NO': 'NO',
|
'NO': 'NO',
|
||||||
'No databases in this application': 'Nessun database presente in questa applicazione',
|
'No databases in this application': 'Nessun database presente in questa applicazione',
|
||||||
'no match': 'nessuna corrispondenza',
|
'no match': 'nessuna corrispondenza',
|
||||||
|
'no package selected': 'no package selected',
|
||||||
|
'online designer': 'online designer',
|
||||||
'or alternatively': 'or alternatively',
|
'or alternatively': 'or alternatively',
|
||||||
'Or Get from URL:': 'Or Get from URL:',
|
'Or Get from URL:': 'Or Get from URL:',
|
||||||
'or import from csv file': 'oppure importa da file CSV',
|
'or import from csv file': 'oppure importa da file CSV',
|
||||||
@@ -206,6 +217,7 @@
|
|||||||
'Overwrite installed app': 'sovrascrivi applicazione installata',
|
'Overwrite installed app': 'sovrascrivi applicazione installata',
|
||||||
'Pack all': 'crea pacchetto',
|
'Pack all': 'crea pacchetto',
|
||||||
'Pack compiled': 'crea pacchetto del codice compilato',
|
'Pack compiled': 'crea pacchetto del codice compilato',
|
||||||
|
'Pack custom': 'Pack custom',
|
||||||
'pack plugin': 'crea pacchetto del plugin',
|
'pack plugin': 'crea pacchetto del plugin',
|
||||||
'PAM authenticated user, cannot change password here': 'utente autenticato tramite PAM, impossibile modificare password qui',
|
'PAM authenticated user, cannot change password here': 'utente autenticato tramite PAM, impossibile modificare password qui',
|
||||||
'password changed': 'password modificata',
|
'password changed': 'password modificata',
|
||||||
@@ -217,15 +229,19 @@
|
|||||||
'Plural-Forms:': 'Plural-Forms:',
|
'Plural-Forms:': 'Plural-Forms:',
|
||||||
'Powered by': 'Powered by',
|
'Powered by': 'Powered by',
|
||||||
'previous 100 rows': '100 righe precedenti',
|
'previous 100 rows': '100 righe precedenti',
|
||||||
'private files': 'private files',
|
|
||||||
'Private files': 'Private files',
|
'Private files': 'Private files',
|
||||||
|
'private files': 'private files',
|
||||||
'Query:': 'Richiesta (query):',
|
'Query:': 'Richiesta (query):',
|
||||||
|
'Rapid Search': 'Rapid Search',
|
||||||
'record': 'record',
|
'record': 'record',
|
||||||
'record does not exist': 'il record non esiste',
|
'record does not exist': 'il record non esiste',
|
||||||
'record id': 'ID del record',
|
'record id': 'ID del record',
|
||||||
'register': 'registrazione',
|
'register': 'registrazione',
|
||||||
'reload': 'reload',
|
'reload': 'reload',
|
||||||
|
'Reload routes': 'Reload routes',
|
||||||
'Remove compiled': 'rimozione codice compilato',
|
'Remove compiled': 'rimozione codice compilato',
|
||||||
|
'Replace': 'Replace',
|
||||||
|
'Replace All': 'Replace All',
|
||||||
'request': 'request',
|
'request': 'request',
|
||||||
'Resolve Conflict file': 'File di risoluzione conflitto',
|
'Resolve Conflict file': 'File di risoluzione conflitto',
|
||||||
'response': 'response',
|
'response': 'response',
|
||||||
@@ -237,31 +253,36 @@
|
|||||||
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')",
|
"Run tests in this file (to run all files, you may also use the button labelled 'test')": "Run tests in this file (to run all files, you may also use the button labelled 'test')",
|
||||||
'Running on %s': 'Running on %s',
|
'Running on %s': 'Running on %s',
|
||||||
'Save': 'Save',
|
'Save': 'Save',
|
||||||
|
'Save file:': 'Save file:',
|
||||||
|
'Save file: %s': 'Save file: %s',
|
||||||
'Save via Ajax': 'Save via Ajax',
|
'Save via Ajax': 'Save via Ajax',
|
||||||
'Saved file hash:': 'Hash del file salvato:',
|
'Saved file hash:': 'Hash del file salvato:',
|
||||||
'selected': 'selezionato',
|
'selected': 'selezionato',
|
||||||
'session': 'session',
|
'session': 'session',
|
||||||
'session expired': 'sessions scaduta',
|
'session expired': 'sessions scaduta',
|
||||||
|
'Set Breakpoint on %s at line %s: %s': 'Set Breakpoint on %s at line %s: %s',
|
||||||
'shell': 'shell',
|
'shell': 'shell',
|
||||||
'Site': 'sito',
|
'Site': 'sito',
|
||||||
'some files could not be removed': 'non è stato possibile rimuovere alcuni files',
|
'some files could not be removed': 'non è stato possibile rimuovere alcuni files',
|
||||||
|
'Start searching': 'Start searching',
|
||||||
'Start wizard': 'start wizard',
|
'Start wizard': 'start wizard',
|
||||||
'state': 'stato',
|
'state': 'stato',
|
||||||
'static': 'statico',
|
'static': 'statico',
|
||||||
'Static': 'Static',
|
'Static': 'Static',
|
||||||
'Static files': 'Files statici',
|
'Static files': 'Files statici',
|
||||||
'Stylesheet': 'Foglio di stile (stylesheet)',
|
'Stylesheet': 'Foglio di stile (stylesheet)',
|
||||||
'submit': 'invia',
|
|
||||||
'Submit': 'Submit',
|
'Submit': 'Submit',
|
||||||
|
'submit': 'invia',
|
||||||
|
'successful': 'successful',
|
||||||
'Sure you want to delete this object?': 'Vuoi veramente cancellare questo oggetto?',
|
'Sure you want to delete this object?': 'Vuoi veramente cancellare questo oggetto?',
|
||||||
'table': 'tabella',
|
'table': 'tabella',
|
||||||
'test': 'test',
|
'test': 'test',
|
||||||
'Testing application': 'Test applicazione in corsg',
|
'Testing application': 'Test applicazione in corsg',
|
||||||
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La richiesta (query) è una condizione come ad esempio "db.tabella1.campo1==\'valore\'". Una condizione come "db.tabella1.campo1==db.tabella2.campo2" produce un "JOIN" SQL.',
|
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La richiesta (query) è una condizione come ad esempio "db.tabella1.campo1==\'valore\'". Una condizione come "db.tabella1.campo1==db.tabella2.campo2" produce un "JOIN" SQL.',
|
||||||
'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller',
|
|
||||||
'the application logic, each URL path is mapped in one exposed function in the controller': 'logica dell\'applicazione, ogni percorso "URL" corrisponde ad una funzione esposta da un controller',
|
'the application logic, each URL path is mapped in one exposed function in the controller': 'logica dell\'applicazione, ogni percorso "URL" corrisponde ad una funzione esposta da un controller',
|
||||||
'The data representation, define database tables and sets': 'The data representation, define database tables and sets',
|
'The application logic, each URL path is mapped in one exposed function in the controller': 'The application logic, each URL path is mapped in one exposed function in the controller',
|
||||||
'the data representation, define database tables and sets': 'rappresentazione dei dati, definizione di tabelle di database e di "set" ',
|
'the data representation, define database tables and sets': 'rappresentazione dei dati, definizione di tabelle di database e di "set" ',
|
||||||
|
'The data representation, define database tables and sets': 'The data representation, define database tables and sets',
|
||||||
'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates',
|
'The presentations layer, views are also known as templates': 'The presentations layer, views are also known as templates',
|
||||||
'the presentations layer, views are also known as templates': 'Presentazione dell\'applicazione, viste (views, chiamate anche "templates")',
|
'the presentations layer, views are also known as templates': 'Presentazione dell\'applicazione, viste (views, chiamate anche "templates")',
|
||||||
'There are no controllers': 'Non ci sono controller',
|
'There are no controllers': 'Non ci sono controller',
|
||||||
@@ -273,8 +294,8 @@
|
|||||||
'There are no translators, only default language is supported': 'Non ci sono traduzioni, viene solo supportato il linguaggio di base',
|
'There are no translators, only default language is supported': 'Non ci sono traduzioni, viene solo supportato il linguaggio di base',
|
||||||
'There are no views': 'Non ci sono viste ("view")',
|
'There are no views': 'Non ci sono viste ("view")',
|
||||||
'These files are not served, they are only available from within your app': 'These files are not served, they are only available from within your app',
|
'These files are not served, they are only available from within your app': 'These files are not served, they are only available from within your app',
|
||||||
'these files are served without processing, your images go here': 'questi files vengono serviti così come sono, le immagini vanno qui',
|
|
||||||
'These files are served without processing, your images go here': 'These files are served without processing, your images go here',
|
'These files are served without processing, your images go here': 'These files are served without processing, your images go here',
|
||||||
|
'these files are served without processing, your images go here': 'questi files vengono serviti così come sono, le immagini vanno qui',
|
||||||
'This is the %(filename)s template': 'Questo è il template %(filename)s',
|
'This is the %(filename)s template': 'Questo è il template %(filename)s',
|
||||||
'Ticket': 'Ticket',
|
'Ticket': 'Ticket',
|
||||||
'Ticket ID': 'Ticket ID',
|
'Ticket ID': 'Ticket ID',
|
||||||
@@ -322,8 +343,8 @@
|
|||||||
'Version %s.%s.%s (%s) %s': 'Version %s.%s.%s (%s) %s',
|
'Version %s.%s.%s (%s) %s': 'Version %s.%s.%s (%s) %s',
|
||||||
'versioning': 'sistema di versioni',
|
'versioning': 'sistema di versioni',
|
||||||
'Versioning': 'Versioning',
|
'Versioning': 'Versioning',
|
||||||
'view': 'vista',
|
|
||||||
'View': 'Vista',
|
'View': 'Vista',
|
||||||
|
'view': 'vista',
|
||||||
'Views': 'viste',
|
'Views': 'viste',
|
||||||
'views': 'viste',
|
'views': 'viste',
|
||||||
'Web Framework': 'Web Framework',
|
'Web Framework': 'Web Framework',
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
{
|
{
|
||||||
# "singular form (0)": ["first plural form (1)", "second plural form (2)", ...],
|
# "singular form (0)": ["first plural form (1)", "second plural form (2)", ...],
|
||||||
|
'останній': ['останні','останніх'],
|
||||||
'файл': ['файли','файлів'],
|
'файл': ['файли','файлів'],
|
||||||
|
'твіт': ['твіти','твітів'],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,16 @@
|
|||||||
'%s': '%s',
|
'%s': '%s',
|
||||||
'%s %%{row} deleted': 'Вилучено %s %%{рядок}',
|
'%s %%{row} deleted': 'Вилучено %s %%{рядок}',
|
||||||
'%s %%{row} updated': 'Вилучено %s %%{рядок}',
|
'%s %%{row} updated': 'Вилучено %s %%{рядок}',
|
||||||
'%s Recent Tweets': '%s останніх твітів',
|
'%s Recent Tweets': '%s %%{останній} %%{твіт}',
|
||||||
'%s students registered': '%s студентів зареєстровано',
|
'%s students registered': '%s студентів зареєстровано',
|
||||||
'%Y-%m-%d': '%Y/%m/%d',
|
'%Y-%m-%d': '%Y/%m/%d',
|
||||||
'%Y-%m-%d %H:%M:%S': '%Y/%m/%d %H:%M:%S',
|
'%Y-%m-%d %H:%M:%S': '%Y/%m/%d %H:%M:%S',
|
||||||
'(requires internet access)': '(потрібно мати доступ в інтернет)',
|
'(requires internet access)': '(потрібно мати доступ в інтернет)',
|
||||||
|
'(requires internet access, experimental)': '(потрібно мати доступ в інтернет, експериментально)',
|
||||||
'(something like "it-it")': '(щось схоже на "uk-ua")',
|
'(something like "it-it")': '(щось схоже на "uk-ua")',
|
||||||
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(не існує файлу **gluon/contrib/plural_rules/%s.py**)',
|
'@markmin\x01(file **gluon/contrib/plural_rules/%s.py** is not found)': '(не існує файлу **gluon/contrib/plural_rules/%s.py**)',
|
||||||
|
'@markmin\x01An error occured, please [[reload %s]] the page': 'Сталась помилка, будь-ласка [[переватажте %s]] сторінку',
|
||||||
|
"@markmin\x01Mercurial Version Control System Interface[[NEWLINE]]for application '%s'": "Інтерфейс системи контролю версій Mercurial[[NEWLINE]]для додатку '%s'",
|
||||||
'@markmin\x01Searching: **%s** %%{file}': 'Знайдено: **%s** %%{файл}',
|
'@markmin\x01Searching: **%s** %%{file}': 'Знайдено: **%s** %%{файл}',
|
||||||
'Abort': 'Припинити',
|
'Abort': 'Припинити',
|
||||||
'About': 'Про',
|
'About': 'Про',
|
||||||
@@ -55,6 +58,7 @@
|
|||||||
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': "УВАГА: Вхід потребує надійного (HTTPS) з'єднання або запуску на локальному комп'ютері.",
|
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': "УВАГА: Вхід потребує надійного (HTTPS) з'єднання або запуску на локальному комп'ютері.",
|
||||||
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ОБЕРЕЖНО: ТЕСТУВАННЯ НЕ Є ПОТОКО-БЕЗПЕЧНИМ, ТОЖ НЕ ЗАПУСКАЙТЕ ДЕКІЛЬКА ТЕСТІВ ОДНОЧАСНО.',
|
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ОБЕРЕЖНО: ТЕСТУВАННЯ НЕ Є ПОТОКО-БЕЗПЕЧНИМ, ТОЖ НЕ ЗАПУСКАЙТЕ ДЕКІЛЬКА ТЕСТІВ ОДНОЧАСНО.',
|
||||||
'ATTENTION: you cannot edit the running application!': 'УВАГА: Ви не можете редагувати додаток, який зараз виконуєте!',
|
'ATTENTION: you cannot edit the running application!': 'УВАГА: Ви не можете редагувати додаток, який зараз виконуєте!',
|
||||||
|
'Autocomplete Python Code': 'Автозавершення коду на Python',
|
||||||
'Available databases and tables': 'Доступні бази даних та таблиці',
|
'Available databases and tables': 'Доступні бази даних та таблиці',
|
||||||
'back': '<< назад',
|
'back': '<< назад',
|
||||||
'bad_resource': 'поганий_ресурс',
|
'bad_resource': 'поганий_ресурс',
|
||||||
@@ -75,6 +79,7 @@
|
|||||||
'cannot create file': 'не можу створити файл',
|
'cannot create file': 'не можу створити файл',
|
||||||
'cannot upload file "%(filename)s"': 'не можу завантажити файл "%(filename)s"',
|
'cannot upload file "%(filename)s"': 'не можу завантажити файл "%(filename)s"',
|
||||||
'Change admin password': 'Змінити пароль адміністратора',
|
'Change admin password': 'Змінити пароль адміністратора',
|
||||||
|
'change editor settings': 'змінити налаштування редактора',
|
||||||
'check all': 'відмітити всі',
|
'check all': 'відмітити всі',
|
||||||
'Check for upgrades': 'Перевірити оновлення',
|
'Check for upgrades': 'Перевірити оновлення',
|
||||||
'Check to delete': 'Помітити на вилучення',
|
'Check to delete': 'Помітити на вилучення',
|
||||||
@@ -89,7 +94,9 @@
|
|||||||
'Code listing': 'Лістинг',
|
'Code listing': 'Лістинг',
|
||||||
'collapse/expand all': 'згорнути/розгорнути все',
|
'collapse/expand all': 'згорнути/розгорнути все',
|
||||||
'Command': 'Команда',
|
'Command': 'Команда',
|
||||||
|
'Comment:': 'Пояснення:',
|
||||||
'Commit': 'Комміт',
|
'Commit': 'Комміт',
|
||||||
|
'Commit form': 'Commit form',
|
||||||
'Compile': 'Компілювати',
|
'Compile': 'Компілювати',
|
||||||
'compiled application removed': 'скомпільований додаток вилучено',
|
'compiled application removed': 'скомпільований додаток вилучено',
|
||||||
'Condition': 'Умова',
|
'Condition': 'Умова',
|
||||||
@@ -103,6 +110,7 @@
|
|||||||
'create file with filename:': 'створити файл з назвою:',
|
'create file with filename:': 'створити файл з назвою:',
|
||||||
'create plural-form': 'створити форму множини',
|
'create plural-form': 'створити форму множини',
|
||||||
'Create rules': 'Створити правила',
|
'Create rules': 'Створити правила',
|
||||||
|
'Create/Upload': 'Створити/Завантажити',
|
||||||
'created by': 'Автор:',
|
'created by': 'Автор:',
|
||||||
'Created On': 'Створено в',
|
'Created On': 'Створено в',
|
||||||
'crontab': 'таблиця cron',
|
'crontab': 'таблиця cron',
|
||||||
@@ -150,8 +158,10 @@
|
|||||||
'edit all': 'редагувати всі',
|
'edit all': 'редагувати всі',
|
||||||
'Edit application': 'Налаштування додатку',
|
'Edit application': 'Налаштування додатку',
|
||||||
'edit controller': 'редагувати контролер',
|
'edit controller': 'редагувати контролер',
|
||||||
|
'edit controller:': 'редагувати контролер:',
|
||||||
'Edit current record': 'Редагувати поточний запис',
|
'Edit current record': 'Редагувати поточний запис',
|
||||||
'edit views:': 'редагувати відображення (views):',
|
'edit views:': 'редагувати відображення (views):',
|
||||||
|
'Editing %s': 'Редагується %s',
|
||||||
'Editing file "%s"': 'Редагується файл "%s"',
|
'Editing file "%s"': 'Редагується файл "%s"',
|
||||||
'Editing Language file': 'Редагується файл перекладу',
|
'Editing Language file': 'Редагується файл перекладу',
|
||||||
'Editing Plural Forms File': 'Редагується файл форм множини',
|
'Editing Plural Forms File': 'Редагується файл форм множини',
|
||||||
@@ -166,6 +176,7 @@
|
|||||||
'Exception %(extype)s: %(exvalue)s': 'Виключення %(extype)s: %(exvalue)s',
|
'Exception %(extype)s: %(exvalue)s': 'Виключення %(extype)s: %(exvalue)s',
|
||||||
'Exception %s': 'Виключення %s',
|
'Exception %s': 'Виключення %s',
|
||||||
'Exception instance attributes': 'Атрибути примірника класу Exception (виключення)',
|
'Exception instance attributes': 'Атрибути примірника класу Exception (виключення)',
|
||||||
|
'Exit Fullscreen': 'Вийти з повноекранного режиму',
|
||||||
'Expand Abbreviation': 'Розгорнути абревіатуру',
|
'Expand Abbreviation': 'Розгорнути абревіатуру',
|
||||||
'export as csv file': 'експортувати як файл csv',
|
'export as csv file': 'експортувати як файл csv',
|
||||||
'exposes': 'обслуговує',
|
'exposes': 'обслуговує',
|
||||||
@@ -186,6 +197,8 @@
|
|||||||
'file saved on %s': 'файл збережено в %s',
|
'file saved on %s': 'файл збережено в %s',
|
||||||
'Filename': "Ім'я файлу",
|
'Filename': "Ім'я файлу",
|
||||||
'filter': 'фільтр',
|
'filter': 'фільтр',
|
||||||
|
'Find Next': 'Шукати наступний',
|
||||||
|
'Find Previous': 'Шукати попередній',
|
||||||
'Frames': 'Стек викликів',
|
'Frames': 'Стек викликів',
|
||||||
'Functions with no doctests will result in [passed] tests.': 'Функції, в яких відсутні док-тести відносяться до функцій, які успішно пройшли тести.',
|
'Functions with no doctests will result in [passed] tests.': 'Функції, в яких відсутні док-тести відносяться до функцій, які успішно пройшли тести.',
|
||||||
'GAE Email': 'Ел.пошта GAE',
|
'GAE Email': 'Ел.пошта GAE',
|
||||||
@@ -201,6 +214,7 @@
|
|||||||
'Google App Engine Deployment Interface': 'Інтерфейс розгортання Google App Engine',
|
'Google App Engine Deployment Interface': 'Інтерфейс розгортання Google App Engine',
|
||||||
'Google Application Id': 'Ідентифікатор Google Application',
|
'Google Application Id': 'Ідентифікатор Google Application',
|
||||||
'Goto': 'Перейти до',
|
'Goto': 'Перейти до',
|
||||||
|
'graph model': 'графова модель',
|
||||||
'Help': 'Допомога',
|
'Help': 'Допомога',
|
||||||
'Hide/Show Translated strings': 'Сховати/показати ВЖЕ ПЕРЕКЛАДЕНІ рядки',
|
'Hide/Show Translated strings': 'Сховати/показати ВЖЕ ПЕРЕКЛАДЕНІ рядки',
|
||||||
'Hits': 'Спрацьовувань',
|
'Hits': 'Спрацьовувань',
|
||||||
@@ -208,7 +222,7 @@
|
|||||||
'honored only if the expression evaluates to true': 'точка зупинки активується тільки за істинності умови',
|
'honored only if the expression evaluates to true': 'точка зупинки активується тільки за істинності умови',
|
||||||
'If start the downgrade, be patient, it may take a while to rollback': 'Запустивши повернення на попередню версію, будьте терплячими, це може зайняти трохи часу',
|
'If start the downgrade, be patient, it may take a while to rollback': 'Запустивши повернення на попередню версію, будьте терплячими, це може зайняти трохи часу',
|
||||||
'If start the upgrade, be patient, it may take a while to download': 'Запустивши оновлення, будьте терплячими, потрібен час для завантаження необхідних даних',
|
'If start the upgrade, be patient, it may take a while to download': 'Запустивши оновлення, будьте терплячими, потрібен час для завантаження необхідних даних',
|
||||||
'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Якщо в наданому вище звіті присутня позначка про помилку (ticket number), то це вказує на збій у виконанні контролера ще до початку запуску док-тестів. Це, зазвичай, сигналізує про помилку вирівнювання тексту програми (indention error) або помилку за межами функції (error outside function code). Зелений заголовок сигналізує, що всі тести (з наявних) пройшли успішно. В цьому випадку результат тестів показано не буде.',
|
'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\n\t\tA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Якщо в наданому вище звіті присутня позначка про помилку (ticket number), то це вказує на збій у виконанні контролера ще до початку запуску док-тестів. Це, зазвичай, сигналізує про помилку вирівнювання тексту програми (indention error) або помилку за межами функції (error outside function code).\n\t\tЗелений заголовок сигналізує, що всі тести (з наявних) пройшли успішно. В цьому випадку результат тестів показано не буде.',
|
||||||
'Import/Export': 'Імпорт/Експорт',
|
'Import/Export': 'Імпорт/Експорт',
|
||||||
'In development, use the default Rocket webserver that is currently supported by this debugger.': 'Під час розробки , використовуйте вбудований веб-сервер Rocket, він найкраще налаштований на спільну роботу з інтерактивним ладначем.',
|
'In development, use the default Rocket webserver that is currently supported by this debugger.': 'Під час розробки , використовуйте вбудований веб-сервер Rocket, він найкраще налаштований на спільну роботу з інтерактивним ладначем.',
|
||||||
'includes': 'включає',
|
'includes': 'включає',
|
||||||
@@ -245,6 +259,8 @@
|
|||||||
'License for': 'Ліцензія додатку',
|
'License for': 'Ліцензія додатку',
|
||||||
'Line number': '№ рядка',
|
'Line number': '№ рядка',
|
||||||
'LineNo': '№ рядка',
|
'LineNo': '№ рядка',
|
||||||
|
'lists by exception': 'список виключень (exceptions)',
|
||||||
|
'lists by ticket': 'список позначок (tickets)',
|
||||||
'loading...': 'завантаження...',
|
'loading...': 'завантаження...',
|
||||||
'locals': 'локальні',
|
'locals': 'локальні',
|
||||||
'Locals##debug': 'Локальні змінні',
|
'Locals##debug': 'Локальні змінні',
|
||||||
@@ -253,6 +269,7 @@
|
|||||||
'Login to the Administrative Interface': 'Вхід в адміністративний інтерфейс',
|
'Login to the Administrative Interface': 'Вхід в адміністративний інтерфейс',
|
||||||
'Logout': 'Вихід',
|
'Logout': 'Вихід',
|
||||||
'Main Menu': 'Основне меню',
|
'Main Menu': 'Основне меню',
|
||||||
|
'Manage': 'Керувати',
|
||||||
'Manage Admin Users/Students': 'Адміністратор керування користувачами/студентами',
|
'Manage Admin Users/Students': 'Адміністратор керування користувачами/студентами',
|
||||||
'Manage Students': 'Керувати студентами',
|
'Manage Students': 'Керувати студентами',
|
||||||
'Match Pair': 'Знайти пару',
|
'Match Pair': 'Знайти пару',
|
||||||
@@ -282,6 +299,7 @@
|
|||||||
'No databases in this application': 'Даний додаток не використовує бази даних',
|
'No databases in this application': 'Даний додаток не використовує бази даних',
|
||||||
'No Interaction yet': 'Ладнач не активовано',
|
'No Interaction yet': 'Ладнач не активовано',
|
||||||
'no match': 'співпадань нема',
|
'no match': 'співпадань нема',
|
||||||
|
'no package selected': 'пакет не вибрано',
|
||||||
'no permission to uninstall "%s"': 'нема прав на вилучення (uninstall) "%s"',
|
'no permission to uninstall "%s"': 'нема прав на вилучення (uninstall) "%s"',
|
||||||
'No ticket_storage.txt found under /private folder': 'В каталозі /private відсутній файл ticket_storage.txt',
|
'No ticket_storage.txt found under /private folder': 'В каталозі /private відсутній файл ticket_storage.txt',
|
||||||
'Not Authorized': 'Не дозволено',
|
'Not Authorized': 'Не дозволено',
|
||||||
@@ -290,11 +308,14 @@
|
|||||||
'online designer': 'дизайнер БД',
|
'online designer': 'дизайнер БД',
|
||||||
'OpenShift Deployment Interface': 'OpenShift: Інтерфейс розгортання',
|
'OpenShift Deployment Interface': 'OpenShift: Інтерфейс розгортання',
|
||||||
'OpenShift Output': 'Вивід OpenShift',
|
'OpenShift Output': 'Вивід OpenShift',
|
||||||
|
'or alternatively': 'або альтернативно',
|
||||||
|
'Or Get from URL:': 'Або Отримати з мережі (ч/з URL):',
|
||||||
'or import from csv file': 'або імпортувати через csv-файл',
|
'or import from csv file': 'або імпортувати через csv-файл',
|
||||||
'Original/Translation': 'Оригінал/переклад',
|
'Original/Translation': 'Оригінал/переклад',
|
||||||
'Overwrite installed app': 'Перезаписати встановлений додаток',
|
'Overwrite installed app': 'Перезаписати встановлений додаток',
|
||||||
'Pack all': 'Запак.все',
|
'Pack all': 'Пакувати все',
|
||||||
'Pack compiled': 'Запак.компл',
|
'Pack compiled': 'Пакувати зкомпільоване',
|
||||||
|
'Pack custom': 'Пакувати вибране',
|
||||||
'pack plugin': 'запакувати втулку',
|
'pack plugin': 'запакувати втулку',
|
||||||
'PAM authenticated user, cannot change password here': 'Ввімкнена система ідентифікації користувачів PAM. Для зміни паролю скористайтесь командами вашої ОС ',
|
'PAM authenticated user, cannot change password here': 'Ввімкнена система ідентифікації користувачів PAM. Для зміни паролю скористайтесь командами вашої ОС ',
|
||||||
'password changed': 'пароль змінено',
|
'password changed': 'пароль змінено',
|
||||||
@@ -322,13 +343,17 @@
|
|||||||
'Query:': 'Запит:',
|
'Query:': 'Запит:',
|
||||||
'RAM Cache Keys': 'Ключ ОЗП-кешу (RAM Cache)',
|
'RAM Cache Keys': 'Ключ ОЗП-кешу (RAM Cache)',
|
||||||
'Ram Cleared': "Кеш в пам'яті очищено",
|
'Ram Cleared': "Кеш в пам'яті очищено",
|
||||||
|
'Rapid Search': 'Миттєвий пошук',
|
||||||
'record': 'запис',
|
'record': 'запис',
|
||||||
'record does not exist': 'запису не існує',
|
'record does not exist': 'запису не існує',
|
||||||
'record id': 'Ід.запису',
|
'record id': 'Ід.запису',
|
||||||
'refresh': 'оновіть',
|
'refresh': 'оновіть',
|
||||||
|
'reload': 'перевантажити',
|
||||||
'Reload routes': 'Перезавантажити маршрути',
|
'Reload routes': 'Перезавантажити маршрути',
|
||||||
'Remove compiled': 'Вилуч.компл',
|
'Remove compiled': 'Вилуч.компл',
|
||||||
'Removed Breakpoint on %s at line %s': 'Вилучено точку зупинки у %s в рядку %s',
|
'Removed Breakpoint on %s at line %s': 'Вилучено точку зупинки у %s в рядку %s',
|
||||||
|
'Replace': 'Замінити',
|
||||||
|
'Replace All': 'Замінити все',
|
||||||
'request': 'запит',
|
'request': 'запит',
|
||||||
'requires python-git, but not installed': 'Для розгортання необхідний пакет python-git, але він не встановлений',
|
'requires python-git, but not installed': 'Для розгортання необхідний пакет python-git, але він не встановлений',
|
||||||
'resolve': "розв'язати",
|
'resolve': "розв'язати",
|
||||||
@@ -349,6 +374,8 @@
|
|||||||
'Running on %s': 'Запущено на %s',
|
'Running on %s': 'Запущено на %s',
|
||||||
'runonce': 'одноразово',
|
'runonce': 'одноразово',
|
||||||
'Save': 'Зберегти',
|
'Save': 'Зберегти',
|
||||||
|
'Save file:': 'Зберегти файл:',
|
||||||
|
'Save file: %s': 'Зберегти файл: %s',
|
||||||
'Save via Ajax': 'зберегти через Ajax',
|
'Save via Ajax': 'зберегти через Ajax',
|
||||||
'Saved file hash:': 'Хеш збереженого файлу:',
|
'Saved file hash:': 'Хеш збереженого файлу:',
|
||||||
'search': 'пошук',
|
'search': 'пошук',
|
||||||
@@ -366,8 +393,10 @@
|
|||||||
'some files could not be removed': 'деякі файли не можна вилучити',
|
'some files could not be removed': 'деякі файли не можна вилучити',
|
||||||
'Sorry, could not find mercurial installed': 'Не вдалось виявити встановлену систему контролю версій Mercurial',
|
'Sorry, could not find mercurial installed': 'Не вдалось виявити встановлену систему контролю версій Mercurial',
|
||||||
'Start a new app': 'Створюється новий додаток',
|
'Start a new app': 'Створюється новий додаток',
|
||||||
|
'Start searching': 'Розпочати пошук',
|
||||||
'Start wizard': 'Активувати майстра',
|
'Start wizard': 'Активувати майстра',
|
||||||
'state': 'стан',
|
'state': 'стан',
|
||||||
|
'Static': 'Статичні',
|
||||||
'static': 'статичні',
|
'static': 'статичні',
|
||||||
'Static files': 'Статичні файли',
|
'Static files': 'Статичні файли',
|
||||||
'Step': 'Крок',
|
'Step': 'Крок',
|
||||||
@@ -376,6 +405,7 @@
|
|||||||
'submit': 'застосувати',
|
'submit': 'застосувати',
|
||||||
'Submit': 'Застосувати',
|
'Submit': 'Застосувати',
|
||||||
'successful': 'успішно',
|
'successful': 'успішно',
|
||||||
|
'switch to : db': 'перемкнути на : БД',
|
||||||
'table': 'таблиця',
|
'table': 'таблиця',
|
||||||
'tags': 'мітки (tags)',
|
'tags': 'мітки (tags)',
|
||||||
'Temporary': 'Тимчасово',
|
'Temporary': 'Тимчасово',
|
||||||
@@ -450,8 +480,10 @@
|
|||||||
'Update:': 'Поновити:',
|
'Update:': 'Поновити:',
|
||||||
'Upgrade': 'Оновити',
|
'Upgrade': 'Оновити',
|
||||||
'upgrade now': 'оновитись зараз',
|
'upgrade now': 'оновитись зараз',
|
||||||
|
'upgrade now to %s': 'оновити зараз до %s',
|
||||||
'upgrade_web2py': 'оновити web2py',
|
'upgrade_web2py': 'оновити web2py',
|
||||||
'upload': 'завантажити',
|
'upload': 'завантажити',
|
||||||
|
'Upload': 'Завантажити',
|
||||||
'Upload a package:': 'Завантажити пакет:',
|
'Upload a package:': 'Завантажити пакет:',
|
||||||
'Upload and install packed application': 'Завантажити та встановити запакований додаток',
|
'Upload and install packed application': 'Завантажити та встановити запакований додаток',
|
||||||
'upload file:': 'завантажити файл:',
|
'upload file:': 'завантажити файл:',
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ WEB2PY_VERSION_URL = WEB2PY_URL + '/examples/default/version'
|
|||||||
# browser.
|
# browser.
|
||||||
|
|
||||||
## Default editor (to change editor you need web2py.admin.editors.zip)
|
## Default editor (to change editor you need web2py.admin.editors.zip)
|
||||||
TEXT_EDITOR = 'codemirror' or 'ace' or 'edit_area' or 'amy'
|
## old editors like 'ace' or 'edit_area' or 'amy' are no longer supported
|
||||||
|
TEXT_EDITOR = 'codemirror'
|
||||||
|
|
||||||
## Editor Color scheme (only for ace)
|
## Editor Color scheme (only for ace)
|
||||||
TEXT_EDITOR_THEME = (
|
TEXT_EDITOR_THEME = (
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from gluon.fileutils import read_file
|
|||||||
# ## make sure administrator is on localhost or https
|
# ## make sure administrator is on localhost or https
|
||||||
# ###########################################################
|
# ###########################################################
|
||||||
|
|
||||||
|
|
||||||
http_host = request.env.http_host.split(':')[0]
|
http_host = request.env.http_host.split(':')[0]
|
||||||
|
|
||||||
if request.env.web2py_runtime_gae:
|
if request.env.web2py_runtime_gae:
|
||||||
@@ -49,7 +50,7 @@ def verify_password(password):
|
|||||||
session.pam_user = None
|
session.pam_user = None
|
||||||
if DEMO_MODE:
|
if DEMO_MODE:
|
||||||
return True
|
return True
|
||||||
elif not 'password' in _config:
|
elif not _config.get('password'):
|
||||||
return False
|
return False
|
||||||
elif _config['password'].startswith('pam_user:'):
|
elif _config['password'].startswith('pam_user:'):
|
||||||
session.pam_user = _config['password'][9:].strip()
|
session.pam_user = _config['password'][9:].strip()
|
||||||
@@ -145,6 +146,10 @@ elif session.is_mobile == 'false':
|
|||||||
else:
|
else:
|
||||||
is_mobile = request.user_agent().is_mobile
|
is_mobile = request.user_agent().is_mobile
|
||||||
|
|
||||||
|
if DEMO_MODE:
|
||||||
|
session.authorized = True
|
||||||
|
session.forget()
|
||||||
|
|
||||||
if request.controller == "webservices":
|
if request.controller == "webservices":
|
||||||
basic = request.env.http_authorization
|
basic = request.env.http_authorization
|
||||||
if not basic or not basic[:6].lower() == 'basic ':
|
if not basic or not basic[:6].lower() == 'basic ':
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ if request.vars.app or request.args:
|
|||||||
|
|
||||||
if os.path.exists('applications/examples'):
|
if os.path.exists('applications/examples'):
|
||||||
response.menu.append(
|
response.menu.append(
|
||||||
(T('Help'), False, URL('examples', 'default', 'index')))
|
(T('Help'), False, URL('examples', 'default', 'documentation')))
|
||||||
else:
|
else:
|
||||||
response.menu.append((T('Help'), False, 'http://web2py.com/examples'))
|
response.menu.append((T('Help'), False, 'http://web2py.com/examples/default/documentation'))
|
||||||
|
|
||||||
if not session.authorized:
|
if not session.authorized:
|
||||||
response.menu = [(T('Login'), True, URL('site'))]
|
response.menu = [(T('Login'), True, URL('site'))]
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
theme = web2py
|
||||||
|
|
||||||
|
[editor]
|
||||||
|
theme = web2py
|
||||||
|
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
# How to contribute
|
||||||
|
|
||||||
|
- [Getting help](#getting-help-)
|
||||||
|
- [Submitting bug reports](#submitting-bug-reports-)
|
||||||
|
- [Contributing code](#contributing-code-)
|
||||||
|
|
||||||
|
## Getting help
|
||||||
|
|
||||||
|
Community discussion, questions, and informal bug reporting is done on the
|
||||||
|
[CodeMirror Google group](http://groups.google.com/group/codemirror).
|
||||||
|
|
||||||
|
## Submitting bug reports
|
||||||
|
|
||||||
|
The preferred way to report bugs is to use the
|
||||||
|
[GitHub issue tracker](http://github.com/marijnh/CodeMirror/issues). Before
|
||||||
|
reporting a bug, read these pointers.
|
||||||
|
|
||||||
|
**Note:** The issue tracker is for *bugs*, not requests for help. Questions
|
||||||
|
should be asked on the
|
||||||
|
[CodeMirror Google group](http://groups.google.com/group/codemirror) instead.
|
||||||
|
|
||||||
|
### Reporting bugs effectively
|
||||||
|
|
||||||
|
- CodeMirror is maintained by volunteers. They don't owe you anything, so be
|
||||||
|
polite. Reports with an indignant or belligerent tone tend to be moved to the
|
||||||
|
bottom of the pile.
|
||||||
|
|
||||||
|
- Include information about **the browser in which the problem occurred**. Even
|
||||||
|
if you tested several browsers, and the problem occurred in all of them,
|
||||||
|
mention this fact in the bug report. Also include browser version numbers and
|
||||||
|
the operating system that you're on.
|
||||||
|
|
||||||
|
- Mention which release of CodeMirror you're using. Preferably, try also with
|
||||||
|
the current development snapshot, to ensure the problem has not already been
|
||||||
|
fixed.
|
||||||
|
|
||||||
|
- Mention very precisely what went wrong. "X is broken" is not a good bug
|
||||||
|
report. What did you expect to happen? What happened instead? Describe the
|
||||||
|
exact steps a maintainer has to take to make the problem occur. We can not
|
||||||
|
fix something that we can not observe.
|
||||||
|
|
||||||
|
- If the problem can not be reproduced in any of the demos included in the
|
||||||
|
CodeMirror distribution, please provide an HTML document that demonstrates
|
||||||
|
the problem. The best way to do this is to go to
|
||||||
|
[jsbin.com](http://jsbin.com/ihunin/edit), enter it there, press save, and
|
||||||
|
include the resulting link in your bug report.
|
||||||
|
|
||||||
|
## Contributing code
|
||||||
|
|
||||||
|
- Make sure you have a [GitHub Account](https://github.com/signup/free)
|
||||||
|
- Fork [CodeMirror](https://github.com/marijnh/CodeMirror/)
|
||||||
|
([how to fork a repo](https://help.github.com/articles/fork-a-repo))
|
||||||
|
- Make your changes
|
||||||
|
- If your changes are easy to test or likely to regress, add tests.
|
||||||
|
Tests for the core go into `test/test.js`, some modes have their own
|
||||||
|
test suite under `mode/XXX/test.js`. Feel free to add new test
|
||||||
|
suites to modes that don't have one yet (be sure to link the new
|
||||||
|
tests into `test/index.html`).
|
||||||
|
- Follow the general code style of the rest of the project (see
|
||||||
|
below). Run `bin/lint` to verify that the linter is happy.
|
||||||
|
- Make sure all tests pass. Visit `test/index.html` in your browser to
|
||||||
|
run them.
|
||||||
|
- Submit a pull request
|
||||||
|
([how to create a pull request](https://help.github.com/articles/fork-a-repo))
|
||||||
|
|
||||||
|
### Coding standards
|
||||||
|
|
||||||
|
- 2 spaces per indentation level, no tabs.
|
||||||
|
- Include semicolons after statements.
|
||||||
|
- Note that the linter (`bin/lint`) which is run after each commit
|
||||||
|
complains about unused variables and functions. Prefix their names
|
||||||
|
with an underscore to muffle it.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
Copyright (C) 2012 by Marijn Haverbeke <marijnh@gmail.com>
|
Copyright (C) 2013 by Marijn Haverbeke <marijnh@gmail.com> and others
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -17,7 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
Please note that some subdirectories of the CodeMirror distribution
|
|
||||||
include their own LICENSE files, and are released under different
|
|
||||||
licences.
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# CodeMirror [](http://travis-ci.org/marijnh/CodeMirror)
|
# CodeMirror
|
||||||
|
[](http://travis-ci.org/marijnh/CodeMirror)
|
||||||
|
[](http://badge.fury.io/js/codemirror)
|
||||||
|
|
||||||
CodeMirror is a JavaScript component that provides a code editor in
|
CodeMirror is a JavaScript component that provides a code editor in
|
||||||
the browser. When a mode is available for the language you are coding
|
the browser. When a mode is available for the language you are coding
|
||||||
@@ -6,3 +8,4 @@ in, it will color your code, and optionally help with indentation.
|
|||||||
|
|
||||||
The project page is http://codemirror.net
|
The project page is http://codemirror.net
|
||||||
The manual is at http://codemirror.net/doc/manual.html
|
The manual is at http://codemirror.net/doc/manual.html
|
||||||
|
The contributing guidelines are in [CONTRIBUTING.md](https://github.com/marijnh/CodeMirror/blob/master/CONTRIBUTING.md)
|
||||||
|
|||||||
@@ -0,0 +1,145 @@
|
|||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var noOptions = {};
|
||||||
|
var nonWS = /[^\s\u00a0]/;
|
||||||
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
|
function firstNonWS(str) {
|
||||||
|
var found = str.search(nonWS);
|
||||||
|
return found == -1 ? 0 : found;
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeMirror.commands.toggleComment = function(cm) {
|
||||||
|
var from = cm.getCursor("start"), to = cm.getCursor("end");
|
||||||
|
cm.uncomment(from, to) || cm.lineComment(from, to);
|
||||||
|
};
|
||||||
|
|
||||||
|
CodeMirror.defineExtension("lineComment", function(from, to, options) {
|
||||||
|
if (!options) options = noOptions;
|
||||||
|
var self = this, mode = self.getModeAt(from);
|
||||||
|
var commentString = options.lineComment || mode.lineComment;
|
||||||
|
if (!commentString) {
|
||||||
|
if (options.blockCommentStart || mode.blockCommentStart) {
|
||||||
|
options.fullLines = true;
|
||||||
|
self.blockComment(from, to, options);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var firstLine = self.getLine(from.line);
|
||||||
|
if (firstLine == null) return;
|
||||||
|
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
|
||||||
|
var pad = options.padding == null ? " " : options.padding;
|
||||||
|
var blankLines = options.commentBlankLines || from.line == to.line;
|
||||||
|
|
||||||
|
self.operation(function() {
|
||||||
|
if (options.indent) {
|
||||||
|
var baseString = firstLine.slice(0, firstNonWS(firstLine));
|
||||||
|
for (var i = from.line; i < end; ++i) {
|
||||||
|
var line = self.getLine(i), cut = baseString.length;
|
||||||
|
if (!blankLines && !nonWS.test(line)) continue;
|
||||||
|
if (line.slice(0, cut) != baseString) cut = firstNonWS(line);
|
||||||
|
self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (var i = from.line; i < end; ++i) {
|
||||||
|
if (blankLines || nonWS.test(self.getLine(i)))
|
||||||
|
self.replaceRange(commentString + pad, Pos(i, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
CodeMirror.defineExtension("blockComment", function(from, to, options) {
|
||||||
|
if (!options) options = noOptions;
|
||||||
|
var self = this, mode = self.getModeAt(from);
|
||||||
|
var startString = options.blockCommentStart || mode.blockCommentStart;
|
||||||
|
var endString = options.blockCommentEnd || mode.blockCommentEnd;
|
||||||
|
if (!startString || !endString) {
|
||||||
|
if ((options.lineComment || mode.lineComment) && options.fullLines != false)
|
||||||
|
self.lineComment(from, to, options);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var end = Math.min(to.line, self.lastLine());
|
||||||
|
if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;
|
||||||
|
|
||||||
|
var pad = options.padding == null ? " " : options.padding;
|
||||||
|
if (from.line > end) return;
|
||||||
|
|
||||||
|
self.operation(function() {
|
||||||
|
if (options.fullLines != false) {
|
||||||
|
var lastLineHasText = nonWS.test(self.getLine(end));
|
||||||
|
self.replaceRange(pad + endString, Pos(end));
|
||||||
|
self.replaceRange(startString + pad, Pos(from.line, 0));
|
||||||
|
var lead = options.blockCommentLead || mode.blockCommentLead;
|
||||||
|
if (lead != null) for (var i = from.line + 1; i <= end; ++i)
|
||||||
|
if (i != end || lastLineHasText)
|
||||||
|
self.replaceRange(lead + pad, Pos(i, 0));
|
||||||
|
} else {
|
||||||
|
self.replaceRange(endString, to);
|
||||||
|
self.replaceRange(startString, from);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
CodeMirror.defineExtension("uncomment", function(from, to, options) {
|
||||||
|
if (!options) options = noOptions;
|
||||||
|
var self = this, mode = self.getModeAt(from);
|
||||||
|
var end = Math.min(to.line, self.lastLine()), start = Math.min(from.line, end);
|
||||||
|
|
||||||
|
// Try finding line comments
|
||||||
|
var lineString = options.lineComment || mode.lineComment, lines = [];
|
||||||
|
var pad = options.padding == null ? " " : options.padding, didSomething;
|
||||||
|
lineComment: {
|
||||||
|
if (!lineString) break lineComment;
|
||||||
|
for (var i = start; i <= end; ++i) {
|
||||||
|
var line = self.getLine(i);
|
||||||
|
var found = line.indexOf(lineString);
|
||||||
|
if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment;
|
||||||
|
if (i != start && found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
|
||||||
|
lines.push(line);
|
||||||
|
}
|
||||||
|
self.operation(function() {
|
||||||
|
for (var i = start; i <= end; ++i) {
|
||||||
|
var line = lines[i - start];
|
||||||
|
var pos = line.indexOf(lineString), endPos = pos + lineString.length;
|
||||||
|
if (pos < 0) continue;
|
||||||
|
if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;
|
||||||
|
didSomething = true;
|
||||||
|
self.replaceRange("", Pos(i, pos), Pos(i, endPos));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (didSomething) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try block comments
|
||||||
|
var startString = options.blockCommentStart || mode.blockCommentStart;
|
||||||
|
var endString = options.blockCommentEnd || mode.blockCommentEnd;
|
||||||
|
if (!startString || !endString) return false;
|
||||||
|
var lead = options.blockCommentLead || mode.blockCommentLead;
|
||||||
|
var startLine = self.getLine(start), endLine = end == start ? startLine : self.getLine(end);
|
||||||
|
var open = startLine.indexOf(startString), close = endLine.lastIndexOf(endString);
|
||||||
|
if (close == -1 && start != end) {
|
||||||
|
endLine = self.getLine(--end);
|
||||||
|
close = endLine.lastIndexOf(endString);
|
||||||
|
}
|
||||||
|
if (open == -1 || close == -1) return false;
|
||||||
|
|
||||||
|
self.operation(function() {
|
||||||
|
self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),
|
||||||
|
Pos(end, close + endString.length));
|
||||||
|
var openEnd = open + startString.length;
|
||||||
|
if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;
|
||||||
|
self.replaceRange("", Pos(start, open), Pos(start, openEnd));
|
||||||
|
if (lead) for (var i = start + 1; i <= end; ++i) {
|
||||||
|
var line = self.getLine(i), found = line.indexOf(lead);
|
||||||
|
if (found == -1 || nonWS.test(line.slice(0, found))) continue;
|
||||||
|
var foundEnd = found + lead.length;
|
||||||
|
if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;
|
||||||
|
self.replaceRange("", Pos(i, found), Pos(i, foundEnd));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
})();
|
||||||
+11
-6
@@ -1,18 +1,23 @@
|
|||||||
.CodeMirror-dialog {
|
.CodeMirror-dialog {
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.CodeMirror-dialog > div {
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0; left: 0; right: 0;
|
left: 0; right: 0;
|
||||||
background: white;
|
background: white;
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
z-index: 15;
|
z-index: 15;
|
||||||
padding: .1em .8em;
|
padding: .1em .8em;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.CodeMirror-dialog-top {
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-dialog-bottom {
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.CodeMirror-dialog input {
|
.CodeMirror-dialog input {
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
+25
-15
@@ -1,16 +1,21 @@
|
|||||||
// Open simple dialogs on top of an editor. Relies on dialog.css.
|
// Open simple dialogs on top of an editor. Relies on dialog.css.
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
function dialogDiv(cm, template) {
|
function dialogDiv(cm, template, bottom) {
|
||||||
var wrap = cm.getWrapperElement();
|
var wrap = cm.getWrapperElement();
|
||||||
var dialog = wrap.insertBefore(document.createElement("div"), wrap.firstChild);
|
var dialog;
|
||||||
dialog.className = "CodeMirror-dialog";
|
dialog = wrap.appendChild(document.createElement("div"));
|
||||||
dialog.innerHTML = '<div>' + template + '</div>';
|
if (bottom) {
|
||||||
|
dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
|
||||||
|
} else {
|
||||||
|
dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
|
||||||
|
}
|
||||||
|
dialog.innerHTML = template;
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.defineExtension("openDialog", function(template, callback) {
|
CodeMirror.defineExtension("openDialog", function(template, callback, options) {
|
||||||
var dialog = dialogDiv(this, template);
|
var dialog = dialogDiv(this, template, options && options.bottom);
|
||||||
var closed = false, me = this;
|
var closed = false, me = this;
|
||||||
function close() {
|
function close() {
|
||||||
if (closed) return;
|
if (closed) return;
|
||||||
@@ -19,7 +24,8 @@
|
|||||||
}
|
}
|
||||||
var inp = dialog.getElementsByTagName("input")[0], button;
|
var inp = dialog.getElementsByTagName("input")[0], button;
|
||||||
if (inp) {
|
if (inp) {
|
||||||
CodeMirror.connect(inp, "keydown", function(e) {
|
CodeMirror.on(inp, "keydown", function(e) {
|
||||||
|
if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
|
||||||
if (e.keyCode == 13 || e.keyCode == 27) {
|
if (e.keyCode == 13 || e.keyCode == 27) {
|
||||||
CodeMirror.e_stop(e);
|
CodeMirror.e_stop(e);
|
||||||
close();
|
close();
|
||||||
@@ -27,21 +33,25 @@
|
|||||||
if (e.keyCode == 13) callback(inp.value);
|
if (e.keyCode == 13) callback(inp.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (options && options.onKeyUp) {
|
||||||
|
CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
|
||||||
|
}
|
||||||
|
if (options && options.value) inp.value = options.value;
|
||||||
inp.focus();
|
inp.focus();
|
||||||
CodeMirror.connect(inp, "blur", close);
|
CodeMirror.on(inp, "blur", close);
|
||||||
} else if (button = dialog.getElementsByTagName("button")[0]) {
|
} else if (button = dialog.getElementsByTagName("button")[0]) {
|
||||||
CodeMirror.connect(button, "click", function() {
|
CodeMirror.on(button, "click", function() {
|
||||||
close();
|
close();
|
||||||
me.focus();
|
me.focus();
|
||||||
});
|
});
|
||||||
button.focus();
|
button.focus();
|
||||||
CodeMirror.connect(button, "blur", close);
|
CodeMirror.on(button, "blur", close);
|
||||||
}
|
}
|
||||||
return close;
|
return close;
|
||||||
});
|
});
|
||||||
|
|
||||||
CodeMirror.defineExtension("openConfirm", function(template, callbacks) {
|
CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
|
||||||
var dialog = dialogDiv(this, template);
|
var dialog = dialogDiv(this, template, options && options.bottom);
|
||||||
var buttons = dialog.getElementsByTagName("button");
|
var buttons = dialog.getElementsByTagName("button");
|
||||||
var closed = false, me = this, blurring = 1;
|
var closed = false, me = this, blurring = 1;
|
||||||
function close() {
|
function close() {
|
||||||
@@ -54,17 +64,17 @@
|
|||||||
for (var i = 0; i < buttons.length; ++i) {
|
for (var i = 0; i < buttons.length; ++i) {
|
||||||
var b = buttons[i];
|
var b = buttons[i];
|
||||||
(function(callback) {
|
(function(callback) {
|
||||||
CodeMirror.connect(b, "click", function(e) {
|
CodeMirror.on(b, "click", function(e) {
|
||||||
CodeMirror.e_preventDefault(e);
|
CodeMirror.e_preventDefault(e);
|
||||||
close();
|
close();
|
||||||
if (callback) callback(me);
|
if (callback) callback(me);
|
||||||
});
|
});
|
||||||
})(callbacks[i]);
|
})(callbacks[i]);
|
||||||
CodeMirror.connect(b, "blur", function() {
|
CodeMirror.on(b, "blur", function() {
|
||||||
--blurring;
|
--blurring;
|
||||||
setTimeout(function() { if (blurring <= 0) close(); }, 200);
|
setTimeout(function() { if (blurring <= 0) close(); }, 200);
|
||||||
});
|
});
|
||||||
CodeMirror.connect(b, "focus", function() { ++blurring; });
|
CodeMirror.on(b, "focus", function() { ++blurring; });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
.CodeMirror-fullscreen {
|
||||||
|
position: fixed;
|
||||||
|
top: 0; left: 0; right: 0; bottom: 0;
|
||||||
|
height: auto;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {
|
||||||
|
if (old == CodeMirror.Init) old = false;
|
||||||
|
if (!old == !val) return;
|
||||||
|
if (val) setFullscreen(cm);
|
||||||
|
else setNormal(cm);
|
||||||
|
});
|
||||||
|
|
||||||
|
function setFullscreen(cm) {
|
||||||
|
var wrap = cm.getWrapperElement();
|
||||||
|
cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
|
||||||
|
width: wrap.style.width, height: wrap.style.height};
|
||||||
|
wrap.style.width = wrap.style.height = "";
|
||||||
|
wrap.className += " CodeMirror-fullscreen";
|
||||||
|
document.documentElement.style.overflow = "hidden";
|
||||||
|
cm.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNormal(cm) {
|
||||||
|
var wrap = cm.getWrapperElement();
|
||||||
|
wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
|
||||||
|
document.documentElement.style.overflow = "";
|
||||||
|
var info = cm.state.fullScreenRestore;
|
||||||
|
wrap.style.width = info.width; wrap.style.height = info.height;
|
||||||
|
window.scrollTo(info.scrollLeft, info.scrollTop);
|
||||||
|
cm.refresh();
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
(function() {
|
||||||
|
CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
|
||||||
|
var prev = old && old != CodeMirror.Init;
|
||||||
|
if (val && !prev) {
|
||||||
|
cm.on("focus", onFocus);
|
||||||
|
cm.on("blur", onBlur);
|
||||||
|
cm.on("change", onChange);
|
||||||
|
onChange(cm);
|
||||||
|
} else if (!val && prev) {
|
||||||
|
cm.off("focus", onFocus);
|
||||||
|
cm.off("blur", onBlur);
|
||||||
|
cm.off("change", onChange);
|
||||||
|
clearPlaceholder(cm);
|
||||||
|
var wrapper = cm.getWrapperElement();
|
||||||
|
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val && !cm.hasFocus()) onBlur(cm);
|
||||||
|
});
|
||||||
|
|
||||||
|
function clearPlaceholder(cm) {
|
||||||
|
if (cm.state.placeholder) {
|
||||||
|
cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
|
||||||
|
cm.state.placeholder = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function setPlaceholder(cm) {
|
||||||
|
clearPlaceholder(cm);
|
||||||
|
var elt = cm.state.placeholder = document.createElement("pre");
|
||||||
|
elt.style.cssText = "height: 0; overflow: visible";
|
||||||
|
elt.className = "CodeMirror-placeholder";
|
||||||
|
elt.appendChild(document.createTextNode(cm.getOption("placeholder")));
|
||||||
|
cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onFocus(cm) {
|
||||||
|
clearPlaceholder(cm);
|
||||||
|
}
|
||||||
|
function onBlur(cm) {
|
||||||
|
if (isEmpty(cm)) setPlaceholder(cm);
|
||||||
|
}
|
||||||
|
function onChange(cm) {
|
||||||
|
var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
|
||||||
|
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
|
||||||
|
|
||||||
|
if (cm.hasFocus()) return;
|
||||||
|
if (empty) setPlaceholder(cm);
|
||||||
|
else clearPlaceholder(cm);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isEmpty(cm) {
|
||||||
|
return (cm.lineCount() === 1) && (cm.getLine(0) === "");
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
(function() {
|
||||||
|
var DEFAULT_BRACKETS = "()[]{}''\"\"";
|
||||||
|
var DEFAULT_EXPLODE_ON_ENTER = "[]{}";
|
||||||
|
var SPACE_CHAR_REGEX = /\s/;
|
||||||
|
|
||||||
|
CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
|
||||||
|
if (old != CodeMirror.Init && old)
|
||||||
|
cm.removeKeyMap("autoCloseBrackets");
|
||||||
|
if (!val) return;
|
||||||
|
var pairs = DEFAULT_BRACKETS, explode = DEFAULT_EXPLODE_ON_ENTER;
|
||||||
|
if (typeof val == "string") pairs = val;
|
||||||
|
else if (typeof val == "object") {
|
||||||
|
if (val.pairs != null) pairs = val.pairs;
|
||||||
|
if (val.explode != null) explode = val.explode;
|
||||||
|
}
|
||||||
|
var map = buildKeymap(pairs);
|
||||||
|
if (explode) map.Enter = buildExplodeHandler(explode);
|
||||||
|
cm.addKeyMap(map);
|
||||||
|
});
|
||||||
|
|
||||||
|
function charsAround(cm, pos) {
|
||||||
|
var str = cm.getRange(CodeMirror.Pos(pos.line, pos.ch - 1),
|
||||||
|
CodeMirror.Pos(pos.line, pos.ch + 1));
|
||||||
|
return str.length == 2 ? str : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildKeymap(pairs) {
|
||||||
|
var map = {
|
||||||
|
name : "autoCloseBrackets",
|
||||||
|
Backspace: function(cm) {
|
||||||
|
if (cm.somethingSelected()) return CodeMirror.Pass;
|
||||||
|
var cur = cm.getCursor(), around = charsAround(cm, cur);
|
||||||
|
if (around && pairs.indexOf(around) % 2 == 0)
|
||||||
|
cm.replaceRange("", CodeMirror.Pos(cur.line, cur.ch - 1), CodeMirror.Pos(cur.line, cur.ch + 1));
|
||||||
|
else
|
||||||
|
return CodeMirror.Pass;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var closingBrackets = "";
|
||||||
|
for (var i = 0; i < pairs.length; i += 2) (function(left, right) {
|
||||||
|
if (left != right) closingBrackets += right;
|
||||||
|
function surround(cm) {
|
||||||
|
var selection = cm.getSelection();
|
||||||
|
cm.replaceSelection(left + selection + right);
|
||||||
|
}
|
||||||
|
function maybeOverwrite(cm) {
|
||||||
|
var cur = cm.getCursor(), ahead = cm.getRange(cur, CodeMirror.Pos(cur.line, cur.ch + 1));
|
||||||
|
if (ahead != right || cm.somethingSelected()) return CodeMirror.Pass;
|
||||||
|
else cm.execCommand("goCharRight");
|
||||||
|
}
|
||||||
|
map["'" + left + "'"] = function(cm) {
|
||||||
|
if (left == "'" && cm.getTokenAt(cm.getCursor()).type == "comment")
|
||||||
|
return CodeMirror.Pass;
|
||||||
|
if (cm.somethingSelected()) return surround(cm);
|
||||||
|
if (left == right && maybeOverwrite(cm) != CodeMirror.Pass) return;
|
||||||
|
var cur = cm.getCursor(), ahead = CodeMirror.Pos(cur.line, cur.ch + 1);
|
||||||
|
var line = cm.getLine(cur.line), nextChar = line.charAt(cur.ch), curChar = cur.ch > 0 ? line.charAt(cur.ch - 1) : "";
|
||||||
|
if (left == right && CodeMirror.isWordChar(curChar))
|
||||||
|
return CodeMirror.Pass;
|
||||||
|
if (line.length == cur.ch || closingBrackets.indexOf(nextChar) >= 0 || SPACE_CHAR_REGEX.test(nextChar))
|
||||||
|
cm.replaceSelection(left + right, {head: ahead, anchor: ahead});
|
||||||
|
else
|
||||||
|
return CodeMirror.Pass;
|
||||||
|
};
|
||||||
|
if (left != right) map["'" + right + "'"] = maybeOverwrite;
|
||||||
|
})(pairs.charAt(i), pairs.charAt(i + 1));
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildExplodeHandler(pairs) {
|
||||||
|
return function(cm) {
|
||||||
|
var cur = cm.getCursor(), around = charsAround(cm, cur);
|
||||||
|
if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
|
||||||
|
cm.operation(function() {
|
||||||
|
var newPos = CodeMirror.Pos(cur.line + 1, 0);
|
||||||
|
cm.replaceSelection("\n\n", {anchor: newPos, head: newPos}, "+input");
|
||||||
|
cm.indentLine(cur.line + 1, null, true);
|
||||||
|
cm.indentLine(cur.line + 2, null, true);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
/**
|
||||||
|
* Tag-closer extension for CodeMirror.
|
||||||
|
*
|
||||||
|
* This extension adds an "autoCloseTags" option that can be set to
|
||||||
|
* either true to get the default behavior, or an object to further
|
||||||
|
* configure its behavior.
|
||||||
|
*
|
||||||
|
* These are supported options:
|
||||||
|
*
|
||||||
|
* `whenClosing` (default true)
|
||||||
|
* Whether to autoclose when the '/' of a closing tag is typed.
|
||||||
|
* `whenOpening` (default true)
|
||||||
|
* Whether to autoclose the tag when the final '>' of an opening
|
||||||
|
* tag is typed.
|
||||||
|
* `dontCloseTags` (default is empty tags for HTML, none for XML)
|
||||||
|
* An array of tag names that should not be autoclosed.
|
||||||
|
* `indentTags` (default is block tags for HTML, none for XML)
|
||||||
|
* An array of tag names that should, when opened, cause a
|
||||||
|
* blank line to be added inside the tag, and the blank line and
|
||||||
|
* closing line to be indented.
|
||||||
|
*
|
||||||
|
* See demos/closetag.html for a usage example.
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
|
||||||
|
if (val && (old == CodeMirror.Init || !old)) {
|
||||||
|
var map = {name: "autoCloseTags"};
|
||||||
|
if (typeof val != "object" || val.whenClosing)
|
||||||
|
map["'/'"] = function(cm) { return autoCloseSlash(cm); };
|
||||||
|
if (typeof val != "object" || val.whenOpening)
|
||||||
|
map["'>'"] = function(cm) { return autoCloseGT(cm); };
|
||||||
|
cm.addKeyMap(map);
|
||||||
|
} else if (!val && (old != CodeMirror.Init && old)) {
|
||||||
|
cm.removeKeyMap("autoCloseTags");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
|
||||||
|
"source", "track", "wbr"];
|
||||||
|
var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
|
||||||
|
"h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
|
||||||
|
|
||||||
|
function autoCloseGT(cm) {
|
||||||
|
var pos = cm.getCursor(), tok = cm.getTokenAt(pos);
|
||||||
|
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
||||||
|
if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
|
||||||
|
|
||||||
|
var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
|
||||||
|
var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
|
||||||
|
var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
|
||||||
|
|
||||||
|
var tagName = state.tagName;
|
||||||
|
if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
|
||||||
|
var lowerTagName = tagName.toLowerCase();
|
||||||
|
// Don't process the '>' at the end of an end-tag or self-closing tag
|
||||||
|
if (tok.type == "tag" && state.type == "closeTag" ||
|
||||||
|
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
|
||||||
|
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1)
|
||||||
|
return CodeMirror.Pass;
|
||||||
|
|
||||||
|
var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1;
|
||||||
|
var curPos = doIndent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1);
|
||||||
|
cm.replaceSelection(">" + (doIndent ? "\n\n" : "") + "</" + tagName + ">",
|
||||||
|
{head: curPos, anchor: curPos});
|
||||||
|
if (doIndent) {
|
||||||
|
cm.indentLine(pos.line + 1);
|
||||||
|
cm.indentLine(pos.line + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function autoCloseSlash(cm) {
|
||||||
|
var pos = cm.getCursor(), tok = cm.getTokenAt(pos);
|
||||||
|
var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
|
||||||
|
if (tok.string.charAt(0) != "<" || inner.mode.name != "xml") return CodeMirror.Pass;
|
||||||
|
|
||||||
|
var tagName = state.context && state.context.tagName;
|
||||||
|
if (tagName) cm.replaceSelection("/" + tagName + ">", "end");
|
||||||
|
}
|
||||||
|
|
||||||
|
function indexOf(collection, elt) {
|
||||||
|
if (collection.indexOf) return collection.indexOf(elt);
|
||||||
|
for (var i = 0, e = collection.length; i < e; ++i)
|
||||||
|
if (collection[i] == elt) return i;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
(function() {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var listRE = /^(\s*)([*+-]|(\d+)\.)(\s*)/,
|
||||||
|
unorderedBullets = '*+-';
|
||||||
|
|
||||||
|
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
|
||||||
|
var pos = cm.getCursor(),
|
||||||
|
inList = cm.getStateAfter(pos.line).list,
|
||||||
|
match;
|
||||||
|
|
||||||
|
if (!inList || !(match = cm.getLine(pos.line).match(listRE))) {
|
||||||
|
cm.execCommand('newlineAndIndent');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var indent = match[1], after = match[4];
|
||||||
|
var bullet = unorderedBullets.indexOf(match[2]) >= 0
|
||||||
|
? match[2]
|
||||||
|
: (parseInt(match[3], 10) + 1) + '.';
|
||||||
|
|
||||||
|
cm.replaceSelection('\n' + indent + bullet + after, 'end');
|
||||||
|
};
|
||||||
|
|
||||||
|
}());
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
(function() {
|
||||||
|
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
||||||
|
(document.documentMode == null || document.documentMode < 8);
|
||||||
|
|
||||||
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
|
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
||||||
|
function findMatchingBracket(cm, where, strict) {
|
||||||
|
var state = cm.state.matchBrackets;
|
||||||
|
var maxScanLen = (state && state.maxScanLineLength) || 10000;
|
||||||
|
|
||||||
|
var cur = where || cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;
|
||||||
|
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
||||||
|
if (!match) return null;
|
||||||
|
var forward = match.charAt(1) == ">", d = forward ? 1 : -1;
|
||||||
|
if (strict && forward != (pos == cur.ch)) return null;
|
||||||
|
var style = cm.getTokenTypeAt(Pos(cur.line, pos + 1));
|
||||||
|
|
||||||
|
var stack = [line.text.charAt(pos)], re = /[(){}[\]]/;
|
||||||
|
function scan(line, lineNo, start) {
|
||||||
|
if (!line.text) return;
|
||||||
|
var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1;
|
||||||
|
if (line.text.length > maxScanLen) return null;
|
||||||
|
if (start != null) pos = start + d;
|
||||||
|
for (; pos != end; pos += d) {
|
||||||
|
var ch = line.text.charAt(pos);
|
||||||
|
if (re.test(ch) && cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style) {
|
||||||
|
var match = matching[ch];
|
||||||
|
if (match.charAt(1) == ">" == forward) stack.push(ch);
|
||||||
|
else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false};
|
||||||
|
else if (!stack.length) return {pos: pos, match: true};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var i = cur.line, found, e = forward ? Math.min(i + 100, cm.lineCount()) : Math.max(-1, i - 100); i != e; i+=d) {
|
||||||
|
if (i == cur.line) found = scan(line, i, pos);
|
||||||
|
else found = scan(cm.getLineHandle(i), i);
|
||||||
|
if (found) break;
|
||||||
|
}
|
||||||
|
return {from: Pos(cur.line, pos), to: found && Pos(i, found.pos),
|
||||||
|
match: found && found.match, forward: forward};
|
||||||
|
}
|
||||||
|
|
||||||
|
function matchBrackets(cm, autoclear) {
|
||||||
|
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
||||||
|
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
||||||
|
var found = findMatchingBracket(cm);
|
||||||
|
if (!found || cm.getLine(found.from.line).length > maxHighlightLen ||
|
||||||
|
found.to && cm.getLine(found.to.line).length > maxHighlightLen)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
||||||
|
var one = cm.markText(found.from, Pos(found.from.line, found.from.ch + 1), {className: style});
|
||||||
|
var two = found.to && cm.markText(found.to, Pos(found.to.line, found.to.ch + 1), {className: style});
|
||||||
|
// Kludge to work around the IE bug from issue #1193, where text
|
||||||
|
// input stops going to the textare whever this fires.
|
||||||
|
if (ie_lt8 && cm.state.focused) cm.display.input.focus();
|
||||||
|
var clear = function() {
|
||||||
|
cm.operation(function() { one.clear(); two && two.clear(); });
|
||||||
|
};
|
||||||
|
if (autoclear) setTimeout(clear, 800);
|
||||||
|
else return clear;
|
||||||
|
}
|
||||||
|
|
||||||
|
var currentlyHighlighted = null;
|
||||||
|
function doMatchBrackets(cm) {
|
||||||
|
cm.operation(function() {
|
||||||
|
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
||||||
|
if (!cm.somethingSelected()) currentlyHighlighted = matchBrackets(cm, false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
||||||
|
if (old && old != CodeMirror.Init)
|
||||||
|
cm.off("cursorActivity", doMatchBrackets);
|
||||||
|
if (val) {
|
||||||
|
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
||||||
|
cm.on("cursorActivity", doMatchBrackets);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
||||||
|
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict){
|
||||||
|
return findMatchingBracket(this, pos, strict);
|
||||||
|
});
|
||||||
|
})();
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
|
||||||
|
if (prev == CodeMirror.Init) prev = false;
|
||||||
|
if (prev && !val)
|
||||||
|
cm.removeOverlay("trailingspace");
|
||||||
|
else if (!prev && val)
|
||||||
|
cm.addOverlay({
|
||||||
|
token: function(stream) {
|
||||||
|
for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
|
||||||
|
if (i > stream.pos) { stream.pos = i; return null; }
|
||||||
|
stream.pos = l;
|
||||||
|
return "trailingspace";
|
||||||
|
},
|
||||||
|
name: "trailingspace"
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
CodeMirror.registerHelper("fold", "brace", function(cm, start) {
|
||||||
|
var line = start.line, lineText = cm.getLine(line);
|
||||||
|
var startCh, tokenType;
|
||||||
|
|
||||||
|
function findOpening(openCh) {
|
||||||
|
for (var at = start.ch, pass = 0;;) {
|
||||||
|
var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1);
|
||||||
|
if (found == -1) {
|
||||||
|
if (pass == 1) break;
|
||||||
|
pass = 1;
|
||||||
|
at = lineText.length;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (pass == 1 && found < start.ch) break;
|
||||||
|
tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1));
|
||||||
|
if (!/^(comment|string)/.test(tokenType)) return found + 1;
|
||||||
|
at = found - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var startToken = "{", endToken = "}", startCh = findOpening("{");
|
||||||
|
if (startCh == null) {
|
||||||
|
startToken = "[", endToken = "]";
|
||||||
|
startCh = findOpening("[");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (startCh == null) return;
|
||||||
|
var count = 1, lastLine = cm.lastLine(), end, endCh;
|
||||||
|
outer: for (var i = line; i <= lastLine; ++i) {
|
||||||
|
var text = cm.getLine(i), pos = i == line ? startCh : 0;
|
||||||
|
for (;;) {
|
||||||
|
var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
|
||||||
|
if (nextOpen < 0) nextOpen = text.length;
|
||||||
|
if (nextClose < 0) nextClose = text.length;
|
||||||
|
pos = Math.min(nextOpen, nextClose);
|
||||||
|
if (pos == text.length) break;
|
||||||
|
if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) {
|
||||||
|
if (pos == nextOpen) ++count;
|
||||||
|
else if (!--count) { end = i; endCh = pos; break outer; }
|
||||||
|
}
|
||||||
|
++pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (end == null || line == end && endCh == startCh) return;
|
||||||
|
return {from: CodeMirror.Pos(line, startCh),
|
||||||
|
to: CodeMirror.Pos(end, endCh)};
|
||||||
|
});
|
||||||
|
CodeMirror.braceRangeFinder = CodeMirror.fold.brace; // deprecated
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("fold", "import", function(cm, start) {
|
||||||
|
function hasImport(line) {
|
||||||
|
if (line < cm.firstLine() || line > cm.lastLine()) return null;
|
||||||
|
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
|
||||||
|
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
|
||||||
|
if (start.type != "keyword" || start.string != "import") return null;
|
||||||
|
// Now find closing semicolon, return its position
|
||||||
|
for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) {
|
||||||
|
var text = cm.getLine(i), semi = text.indexOf(";");
|
||||||
|
if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var start = start.line, has = hasImport(start), prev;
|
||||||
|
if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1))
|
||||||
|
return null;
|
||||||
|
for (var end = has.end;;) {
|
||||||
|
var next = hasImport(end.line + 1);
|
||||||
|
if (next == null) break;
|
||||||
|
end = next.end;
|
||||||
|
}
|
||||||
|
return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end};
|
||||||
|
});
|
||||||
|
CodeMirror.importRangeFinder = CodeMirror.fold["import"]; // deprecated
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("fold", "include", function(cm, start) {
|
||||||
|
function hasInclude(line) {
|
||||||
|
if (line < cm.firstLine() || line > cm.lastLine()) return null;
|
||||||
|
var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
|
||||||
|
if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
|
||||||
|
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
var start = start.line, has = hasInclude(start);
|
||||||
|
if (has == null || hasInclude(start - 1) != null) return null;
|
||||||
|
for (var end = start;;) {
|
||||||
|
var next = hasInclude(end + 1);
|
||||||
|
if (next == null) break;
|
||||||
|
++end;
|
||||||
|
}
|
||||||
|
return {from: CodeMirror.Pos(start, has + 1),
|
||||||
|
to: cm.clipPos(CodeMirror.Pos(end))};
|
||||||
|
});
|
||||||
|
CodeMirror.includeRangeFinder = CodeMirror.fold.include; // deprecated
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function doFold(cm, pos, options) {
|
||||||
|
var finder = options && (options.call ? options : options.rangeFinder);
|
||||||
|
if (!finder) finder = cm.getHelper(pos, "fold");
|
||||||
|
if (!finder) return;
|
||||||
|
if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
|
||||||
|
var minSize = options && options.minFoldSize || 0;
|
||||||
|
|
||||||
|
function getRange(allowFolded) {
|
||||||
|
var range = finder(cm, pos);
|
||||||
|
if (!range || range.to.line - range.from.line < minSize) return null;
|
||||||
|
var marks = cm.findMarksAt(range.from);
|
||||||
|
for (var i = 0; i < marks.length; ++i) {
|
||||||
|
if (marks[i].__isFold) {
|
||||||
|
if (!allowFolded) return null;
|
||||||
|
range.cleared = true;
|
||||||
|
marks[i].clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return range;
|
||||||
|
}
|
||||||
|
|
||||||
|
var range = getRange(true);
|
||||||
|
if (options && options.scanUp) while (!range && pos.line > cm.firstLine()) {
|
||||||
|
pos = CodeMirror.Pos(pos.line - 1, 0);
|
||||||
|
range = getRange(false);
|
||||||
|
}
|
||||||
|
if (!range || range.cleared) return;
|
||||||
|
|
||||||
|
var myWidget = makeWidget(options);
|
||||||
|
CodeMirror.on(myWidget, "mousedown", function() { myRange.clear(); });
|
||||||
|
var myRange = cm.markText(range.from, range.to, {
|
||||||
|
replacedWith: myWidget,
|
||||||
|
clearOnEnter: true,
|
||||||
|
__isFold: true
|
||||||
|
});
|
||||||
|
myRange.on("clear", function(from, to) {
|
||||||
|
CodeMirror.signal(cm, "unfold", cm, from, to);
|
||||||
|
});
|
||||||
|
CodeMirror.signal(cm, "fold", cm, range.from, range.to);
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeWidget(options) {
|
||||||
|
var widget = (options && options.widget) || "\u2194";
|
||||||
|
if (typeof widget == "string") {
|
||||||
|
var text = document.createTextNode(widget);
|
||||||
|
widget = document.createElement("span");
|
||||||
|
widget.appendChild(text);
|
||||||
|
widget.className = "CodeMirror-foldmarker";
|
||||||
|
}
|
||||||
|
return widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clumsy backwards-compatible interface
|
||||||
|
CodeMirror.newFoldFunction = function(rangeFinder, widget) {
|
||||||
|
return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };
|
||||||
|
};
|
||||||
|
|
||||||
|
// New-style interface
|
||||||
|
CodeMirror.defineExtension("foldCode", function(pos, options) { doFold(this, pos, options); });
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("fold", "combine", function() {
|
||||||
|
var funcs = Array.prototype.slice.call(arguments, 0);
|
||||||
|
return function(cm, start) {
|
||||||
|
for (var i = 0; i < funcs.length; ++i) {
|
||||||
|
var found = funcs[i](cm, start);
|
||||||
|
if (found) return found;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
})();
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
CodeMirror.registerHelper("fold", "indent", function(cm, start) {
|
||||||
|
var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
|
||||||
|
var myIndent = CodeMirror.countColumn(firstLine, null, tabSize);
|
||||||
|
for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) {
|
||||||
|
var curLine = cm.getLine(i);
|
||||||
|
if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent &&
|
||||||
|
CodeMirror.countColumn(cm.getLine(i-1), null, tabSize) > myIndent)
|
||||||
|
return {from: CodeMirror.Pos(start.line, firstLine.length),
|
||||||
|
to: CodeMirror.Pos(i, curLine.length)};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
CodeMirror.indentRangeFinder = CodeMirror.fold.indent; // deprecated
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var Pos = CodeMirror.Pos;
|
||||||
|
function cmp(a, b) { return a.line - b.line || a.ch - b.ch; }
|
||||||
|
|
||||||
|
var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
||||||
|
var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
||||||
|
var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g");
|
||||||
|
|
||||||
|
function Iter(cm, line, ch, range) {
|
||||||
|
this.line = line; this.ch = ch;
|
||||||
|
this.cm = cm; this.text = cm.getLine(line);
|
||||||
|
this.min = range ? range.from : cm.firstLine();
|
||||||
|
this.max = range ? range.to - 1 : cm.lastLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
function tagAt(iter, ch) {
|
||||||
|
var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch));
|
||||||
|
return type && /\btag\b/.test(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextLine(iter) {
|
||||||
|
if (iter.line >= iter.max) return;
|
||||||
|
iter.ch = 0;
|
||||||
|
iter.text = iter.cm.getLine(++iter.line);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function prevLine(iter) {
|
||||||
|
if (iter.line <= iter.min) return;
|
||||||
|
iter.text = iter.cm.getLine(--iter.line);
|
||||||
|
iter.ch = iter.text.length;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toTagEnd(iter) {
|
||||||
|
for (;;) {
|
||||||
|
var gt = iter.text.indexOf(">", iter.ch);
|
||||||
|
if (gt == -1) { if (nextLine(iter)) continue; else return; }
|
||||||
|
if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; }
|
||||||
|
var lastSlash = iter.text.lastIndexOf("/", gt);
|
||||||
|
var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
|
||||||
|
iter.ch = gt + 1;
|
||||||
|
return selfClose ? "selfClose" : "regular";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function toTagStart(iter) {
|
||||||
|
for (;;) {
|
||||||
|
var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1;
|
||||||
|
if (lt == -1) { if (prevLine(iter)) continue; else return; }
|
||||||
|
if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; }
|
||||||
|
xmlTagStart.lastIndex = lt;
|
||||||
|
iter.ch = lt;
|
||||||
|
var match = xmlTagStart.exec(iter.text);
|
||||||
|
if (match && match.index == lt) return match;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function toNextTag(iter) {
|
||||||
|
for (;;) {
|
||||||
|
xmlTagStart.lastIndex = iter.ch;
|
||||||
|
var found = xmlTagStart.exec(iter.text);
|
||||||
|
if (!found) { if (nextLine(iter)) continue; else return; }
|
||||||
|
if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; }
|
||||||
|
iter.ch = found.index + found[0].length;
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function toPrevTag(iter) {
|
||||||
|
for (;;) {
|
||||||
|
var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1;
|
||||||
|
if (gt == -1) { if (prevLine(iter)) continue; else return; }
|
||||||
|
if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; }
|
||||||
|
var lastSlash = iter.text.lastIndexOf("/", gt);
|
||||||
|
var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
|
||||||
|
iter.ch = gt + 1;
|
||||||
|
return selfClose ? "selfClose" : "regular";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function findMatchingClose(iter, tag) {
|
||||||
|
var stack = [];
|
||||||
|
for (;;) {
|
||||||
|
var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0);
|
||||||
|
if (!next || !(end = toTagEnd(iter))) return;
|
||||||
|
if (end == "selfClose") continue;
|
||||||
|
if (next[1]) { // closing tag
|
||||||
|
for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) {
|
||||||
|
stack.length = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (i < 0 && (!tag || tag == next[2])) return {
|
||||||
|
tag: next[2],
|
||||||
|
from: Pos(startLine, startCh),
|
||||||
|
to: Pos(iter.line, iter.ch)
|
||||||
|
};
|
||||||
|
} else { // opening tag
|
||||||
|
stack.push(next[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function findMatchingOpen(iter, tag) {
|
||||||
|
var stack = [];
|
||||||
|
for (;;) {
|
||||||
|
var prev = toPrevTag(iter);
|
||||||
|
if (!prev) return;
|
||||||
|
if (prev == "selfClose") { toTagStart(iter); continue; }
|
||||||
|
var endLine = iter.line, endCh = iter.ch;
|
||||||
|
var start = toTagStart(iter);
|
||||||
|
if (!start) return;
|
||||||
|
if (start[1]) { // closing tag
|
||||||
|
stack.push(start[2]);
|
||||||
|
} else { // opening tag
|
||||||
|
for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) {
|
||||||
|
stack.length = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (i < 0 && (!tag || tag == start[2])) return {
|
||||||
|
tag: start[2],
|
||||||
|
from: Pos(iter.line, iter.ch),
|
||||||
|
to: Pos(endLine, endCh)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("fold", "xml", function(cm, start) {
|
||||||
|
var iter = new Iter(cm, start.line, 0);
|
||||||
|
for (;;) {
|
||||||
|
var openTag = toNextTag(iter), end;
|
||||||
|
if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return;
|
||||||
|
if (!openTag[1] && end != "selfClose") {
|
||||||
|
var start = Pos(iter.line, iter.ch);
|
||||||
|
var close = findMatchingClose(iter, openTag[2]);
|
||||||
|
return close && {from: start, to: close.from};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
CodeMirror.tagRangeFinder = CodeMirror.fold.xml; // deprecated
|
||||||
|
|
||||||
|
CodeMirror.findMatchingTag = function(cm, pos, range) {
|
||||||
|
var iter = new Iter(cm, pos.line, pos.ch, range);
|
||||||
|
if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return;
|
||||||
|
var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch);
|
||||||
|
var start = end && toTagStart(iter);
|
||||||
|
if (!end || end == "selfClose" || !start || cmp(iter, pos) > 0) return;
|
||||||
|
var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]};
|
||||||
|
|
||||||
|
if (start[1]) { // closing tag
|
||||||
|
return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"};
|
||||||
|
} else { // opening tag
|
||||||
|
iter = new Iter(cm, to.line, to.ch, range);
|
||||||
|
return {open: here, close: findMatchingClose(iter, start[2]), at: "open"};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CodeMirror.findEnclosingTag = function(cm, pos, range) {
|
||||||
|
var iter = new Iter(cm, pos.line, pos.ch, range);
|
||||||
|
for (;;) {
|
||||||
|
var open = findMatchingOpen(iter);
|
||||||
|
if (!open) break;
|
||||||
|
var forward = new Iter(cm, pos.line, pos.ch, range);
|
||||||
|
var close = findMatchingClose(forward, open.tag);
|
||||||
|
if (close) return {open: open, close: close};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})();
|
||||||
+337
@@ -0,0 +1,337 @@
|
|||||||
|
(function () {
|
||||||
|
var langs = "ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" ");
|
||||||
|
var targets = ["_blank", "_self", "_top", "_parent"];
|
||||||
|
var charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
|
||||||
|
var methods = ["get", "post", "put", "delete"];
|
||||||
|
var encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
|
||||||
|
var media = ["all", "screen", "print", "embossed", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "speech",
|
||||||
|
"3d-glasses", "resolution [>][<][=] [X]", "device-aspect-ratio: X/Y", "orientation:portrait",
|
||||||
|
"orientation:landscape", "device-height: [X]", "device-width: [X]"];
|
||||||
|
var s = { attrs: {} }; // Simple tag, reused for a whole lot of tags
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
a: {
|
||||||
|
attrs: {
|
||||||
|
href: null, ping: null, type: null,
|
||||||
|
media: media,
|
||||||
|
target: targets,
|
||||||
|
hreflang: langs
|
||||||
|
}
|
||||||
|
},
|
||||||
|
abbr: s,
|
||||||
|
acronym: s,
|
||||||
|
address: s,
|
||||||
|
applet: s,
|
||||||
|
area: {
|
||||||
|
attrs: {
|
||||||
|
alt: null, coords: null, href: null, target: null, ping: null,
|
||||||
|
media: media, hreflang: langs, type: null,
|
||||||
|
shape: ["default", "rect", "circle", "poly"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
article: s,
|
||||||
|
aside: s,
|
||||||
|
audio: {
|
||||||
|
attrs: {
|
||||||
|
src: null, mediagroup: null,
|
||||||
|
crossorigin: ["anonymous", "use-credentials"],
|
||||||
|
preload: ["none", "metadata", "auto"],
|
||||||
|
autoplay: ["", "autoplay"],
|
||||||
|
loop: ["", "loop"],
|
||||||
|
controls: ["", "controls"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
b: s,
|
||||||
|
base: { attrs: { href: null, target: targets } },
|
||||||
|
basefont: s,
|
||||||
|
bdi: s,
|
||||||
|
bdo: s,
|
||||||
|
big: s,
|
||||||
|
blockquote: { attrs: { cite: null } },
|
||||||
|
body: s,
|
||||||
|
br: s,
|
||||||
|
button: {
|
||||||
|
attrs: {
|
||||||
|
form: null, formaction: null, name: null, value: null,
|
||||||
|
autofocus: ["", "autofocus"],
|
||||||
|
disabled: ["", "autofocus"],
|
||||||
|
formenctype: encs,
|
||||||
|
formmethod: methods,
|
||||||
|
formnovalidate: ["", "novalidate"],
|
||||||
|
formtarget: targets,
|
||||||
|
type: ["submit", "reset", "button"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
canvas: { attrs: { width: null, height: null } },
|
||||||
|
caption: s,
|
||||||
|
center: s,
|
||||||
|
cite: s,
|
||||||
|
code: s,
|
||||||
|
col: { attrs: { span: null } },
|
||||||
|
colgroup: { attrs: { span: null } },
|
||||||
|
command: {
|
||||||
|
attrs: {
|
||||||
|
type: ["command", "checkbox", "radio"],
|
||||||
|
label: null, icon: null, radiogroup: null, command: null, title: null,
|
||||||
|
disabled: ["", "disabled"],
|
||||||
|
checked: ["", "checked"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: { attrs: { value: null } },
|
||||||
|
datagrid: { attrs: { disabled: ["", "disabled"], multiple: ["", "multiple"] } },
|
||||||
|
datalist: { attrs: { data: null } },
|
||||||
|
dd: s,
|
||||||
|
del: { attrs: { cite: null, datetime: null } },
|
||||||
|
details: { attrs: { open: ["", "open"] } },
|
||||||
|
dfn: s,
|
||||||
|
dir: s,
|
||||||
|
div: s,
|
||||||
|
dl: s,
|
||||||
|
dt: s,
|
||||||
|
em: s,
|
||||||
|
embed: { attrs: { src: null, type: null, width: null, height: null } },
|
||||||
|
eventsource: { attrs: { src: null } },
|
||||||
|
fieldset: { attrs: { disabled: ["", "disabled"], form: null, name: null } },
|
||||||
|
figcaption: s,
|
||||||
|
figure: s,
|
||||||
|
font: s,
|
||||||
|
footer: s,
|
||||||
|
form: {
|
||||||
|
attrs: {
|
||||||
|
action: null, name: null,
|
||||||
|
"accept-charset": charsets,
|
||||||
|
autocomplete: ["on", "off"],
|
||||||
|
enctype: encs,
|
||||||
|
method: methods,
|
||||||
|
novalidate: ["", "novalidate"],
|
||||||
|
target: targets
|
||||||
|
}
|
||||||
|
},
|
||||||
|
frame: s,
|
||||||
|
frameset: s,
|
||||||
|
h1: s, h2: s, h3: s, h4: s, h5: s, h6: s,
|
||||||
|
head: {
|
||||||
|
attrs: {},
|
||||||
|
children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
|
||||||
|
},
|
||||||
|
header: s,
|
||||||
|
hgroup: s,
|
||||||
|
hr: s,
|
||||||
|
html: {
|
||||||
|
attrs: { manifest: null },
|
||||||
|
children: ["head", "body"]
|
||||||
|
},
|
||||||
|
i: s,
|
||||||
|
iframe: {
|
||||||
|
attrs: {
|
||||||
|
src: null, srcdoc: null, name: null, width: null, height: null,
|
||||||
|
sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
|
||||||
|
seamless: ["", "seamless"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
img: {
|
||||||
|
attrs: {
|
||||||
|
alt: null, src: null, ismap: null, usemap: null, width: null, height: null,
|
||||||
|
crossorigin: ["anonymous", "use-credentials"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
input: {
|
||||||
|
attrs: {
|
||||||
|
alt: null, dirname: null, form: null, formaction: null,
|
||||||
|
height: null, list: null, max: null, maxlength: null, min: null,
|
||||||
|
name: null, pattern: null, placeholder: null, size: null, src: null,
|
||||||
|
step: null, value: null, width: null,
|
||||||
|
accept: ["audio/*", "video/*", "image/*"],
|
||||||
|
autocomplete: ["on", "off"],
|
||||||
|
autofocus: ["", "autofocus"],
|
||||||
|
checked: ["", "checked"],
|
||||||
|
disabled: ["", "disabled"],
|
||||||
|
formenctype: encs,
|
||||||
|
formmethod: methods,
|
||||||
|
formnovalidate: ["", "novalidate"],
|
||||||
|
formtarget: targets,
|
||||||
|
multiple: ["", "multiple"],
|
||||||
|
readonly: ["", "readonly"],
|
||||||
|
required: ["", "required"],
|
||||||
|
type: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month",
|
||||||
|
"week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio",
|
||||||
|
"file", "submit", "image", "reset", "button"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ins: { attrs: { cite: null, datetime: null } },
|
||||||
|
kbd: s,
|
||||||
|
keygen: {
|
||||||
|
attrs: {
|
||||||
|
challenge: null, form: null, name: null,
|
||||||
|
autofocus: ["", "autofocus"],
|
||||||
|
disabled: ["", "disabled"],
|
||||||
|
keytype: ["RSA"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label: { attrs: { "for": null, form: null } },
|
||||||
|
legend: s,
|
||||||
|
li: { attrs: { value: null } },
|
||||||
|
link: {
|
||||||
|
attrs: {
|
||||||
|
href: null, type: null,
|
||||||
|
hreflang: langs,
|
||||||
|
media: media,
|
||||||
|
sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
map: { attrs: { name: null } },
|
||||||
|
mark: s,
|
||||||
|
menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
|
||||||
|
meta: {
|
||||||
|
attrs: {
|
||||||
|
content: null,
|
||||||
|
charset: charsets,
|
||||||
|
name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
|
||||||
|
"http-equiv": ["content-language", "content-type", "default-style", "refresh"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
|
||||||
|
nav: s,
|
||||||
|
noframes: s,
|
||||||
|
noscript: s,
|
||||||
|
object: {
|
||||||
|
attrs: {
|
||||||
|
data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,
|
||||||
|
typemustmatch: ["", "typemustmatch"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ol: { attrs: { reversed: ["", "reversed"], start: null, type: ["1", "a", "A", "i", "I"] } },
|
||||||
|
optgroup: { attrs: { disabled: ["", "disabled"], label: null } },
|
||||||
|
option: { attrs: { disabled: ["", "disabled"], label: null, selected: ["", "selected"], value: null } },
|
||||||
|
output: { attrs: { "for": null, form: null, name: null } },
|
||||||
|
p: s,
|
||||||
|
param: { attrs: { name: null, value: null } },
|
||||||
|
pre: s,
|
||||||
|
progress: { attrs: { value: null, max: null } },
|
||||||
|
q: { attrs: { cite: null } },
|
||||||
|
rp: s,
|
||||||
|
rt: s,
|
||||||
|
ruby: s,
|
||||||
|
s: s,
|
||||||
|
samp: s,
|
||||||
|
script: {
|
||||||
|
attrs: {
|
||||||
|
type: ["text/javascript"],
|
||||||
|
src: null,
|
||||||
|
async: ["", "async"],
|
||||||
|
defer: ["", "defer"],
|
||||||
|
charset: charsets
|
||||||
|
}
|
||||||
|
},
|
||||||
|
section: s,
|
||||||
|
select: {
|
||||||
|
attrs: {
|
||||||
|
form: null, name: null, size: null,
|
||||||
|
autofocus: ["", "autofocus"],
|
||||||
|
disabled: ["", "disabled"],
|
||||||
|
multiple: ["", "multiple"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
small: s,
|
||||||
|
source: { attrs: { src: null, type: null, media: null } },
|
||||||
|
span: s,
|
||||||
|
strike: s,
|
||||||
|
strong: s,
|
||||||
|
style: {
|
||||||
|
attrs: {
|
||||||
|
type: ["text/css"],
|
||||||
|
media: media,
|
||||||
|
scoped: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sub: s,
|
||||||
|
summary: s,
|
||||||
|
sup: s,
|
||||||
|
table: s,
|
||||||
|
tbody: s,
|
||||||
|
td: { attrs: { colspan: null, rowspan: null, headers: null } },
|
||||||
|
textarea: {
|
||||||
|
attrs: {
|
||||||
|
dirname: null, form: null, maxlength: null, name: null, placeholder: null,
|
||||||
|
rows: null, cols: null,
|
||||||
|
autofocus: ["", "autofocus"],
|
||||||
|
disabled: ["", "disabled"],
|
||||||
|
readonly: ["", "readonly"],
|
||||||
|
required: ["", "required"],
|
||||||
|
wrap: ["soft", "hard"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tfoot: s,
|
||||||
|
th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
|
||||||
|
thead: s,
|
||||||
|
time: { attrs: { datetime: null } },
|
||||||
|
title: s,
|
||||||
|
tr: s,
|
||||||
|
track: {
|
||||||
|
attrs: {
|
||||||
|
src: null, label: null, "default": null,
|
||||||
|
kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
|
||||||
|
srclang: langs
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tt: s,
|
||||||
|
u: s,
|
||||||
|
ul: s,
|
||||||
|
"var": s,
|
||||||
|
video: {
|
||||||
|
attrs: {
|
||||||
|
src: null, poster: null, width: null, height: null,
|
||||||
|
crossorigin: ["anonymous", "use-credentials"],
|
||||||
|
preload: ["auto", "metadata", "none"],
|
||||||
|
autoplay: ["", "autoplay"],
|
||||||
|
mediagroup: ["movie"],
|
||||||
|
muted: ["", "muted"],
|
||||||
|
controls: ["", "controls"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
wbr: s
|
||||||
|
};
|
||||||
|
|
||||||
|
var globalAttrs = {
|
||||||
|
accesskey: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
||||||
|
"class": null,
|
||||||
|
contenteditable: ["true", "false"],
|
||||||
|
contextmenu: null,
|
||||||
|
dir: ["ltr", "rtl", "auto"],
|
||||||
|
draggable: ["true", "false", "auto"],
|
||||||
|
dropzone: ["copy", "move", "link", "string:", "file:"],
|
||||||
|
hidden: ["hidden"],
|
||||||
|
id: null,
|
||||||
|
inert: ["inert"],
|
||||||
|
itemid: null,
|
||||||
|
itemprop: null,
|
||||||
|
itemref: null,
|
||||||
|
itemscope: ["itemscope"],
|
||||||
|
itemtype: null,
|
||||||
|
lang: ["en", "es"],
|
||||||
|
spellcheck: ["true", "false"],
|
||||||
|
style: null,
|
||||||
|
tabindex: ["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
||||||
|
title: null,
|
||||||
|
translate: ["yes", "no"],
|
||||||
|
onclick: null,
|
||||||
|
rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"]
|
||||||
|
};
|
||||||
|
function populate(obj) {
|
||||||
|
for (var attr in globalAttrs) if (globalAttrs.hasOwnProperty(attr))
|
||||||
|
obj.attrs[attr] = globalAttrs[attr];
|
||||||
|
}
|
||||||
|
|
||||||
|
populate(s);
|
||||||
|
for (var tag in data) if (data.hasOwnProperty(tag) && data[tag] != s)
|
||||||
|
populate(data[tag]);
|
||||||
|
|
||||||
|
CodeMirror.htmlSchema = data;
|
||||||
|
function htmlHint(cm, options) {
|
||||||
|
var local = {schemaInfo: data};
|
||||||
|
if (options) for (var opt in options) local[opt] = options[opt];
|
||||||
|
return CodeMirror.hint.xml(cm, local);
|
||||||
|
}
|
||||||
|
CodeMirror.htmlHint = htmlHint; // deprecated
|
||||||
|
CodeMirror.registerHelper("hint", "html", htmlHint);
|
||||||
|
})();
|
||||||
+40
-28
@@ -1,4 +1,6 @@
|
|||||||
(function () {
|
(function () {
|
||||||
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
function forEach(arr, f) {
|
function forEach(arr, f) {
|
||||||
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
|
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
|
||||||
}
|
}
|
||||||
@@ -16,46 +18,51 @@
|
|||||||
return arr.indexOf(item) != -1;
|
return arr.indexOf(item) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function scriptHint(editor, keywords, getToken) {
|
function scriptHint(editor, keywords, getToken, options) {
|
||||||
// Find the token at the cursor
|
// Find the token at the cursor
|
||||||
var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
|
var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
|
||||||
|
token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;
|
||||||
|
|
||||||
// If it's not a 'word-style' token, ignore the token.
|
// If it's not a 'word-style' token, ignore the token.
|
||||||
if (!/^[\w$_]*$/.test(token.string)) {
|
if (!/^[\w$_]*$/.test(token.string)) {
|
||||||
token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
|
token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
|
||||||
className: token.string == "." ? "property" : null};
|
type: token.string == "." ? "property" : null};
|
||||||
}
|
}
|
||||||
// If it is a property, find out what it is a property of.
|
// If it is a property, find out what it is a property of.
|
||||||
while (tprop.className == "property") {
|
while (tprop.type == "property") {
|
||||||
tprop = getToken(editor, {line: cur.line, ch: tprop.start});
|
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
||||||
if (tprop.string != ".") return;
|
if (tprop.string != ".") return;
|
||||||
tprop = getToken(editor, {line: cur.line, ch: tprop.start});
|
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
||||||
if (tprop.string == ')') {
|
if (tprop.string == ')') {
|
||||||
var level = 1;
|
var level = 1;
|
||||||
do {
|
do {
|
||||||
tprop = getToken(editor, {line: cur.line, ch: tprop.start});
|
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
||||||
switch (tprop.string) {
|
switch (tprop.string) {
|
||||||
case ')': level++; break;
|
case ')': level++; break;
|
||||||
case '(': level--; break;
|
case '(': level--; break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
} while (level > 0);
|
} while (level > 0);
|
||||||
tprop = getToken(editor, {line: cur.line, ch: tprop.start});
|
tprop = getToken(editor, Pos(cur.line, tprop.start));
|
||||||
if (tprop.className == 'variable')
|
if (tprop.type.indexOf("variable") === 0)
|
||||||
tprop.className = 'function';
|
tprop.type = "function";
|
||||||
else return; // no clue
|
else return; // no clue
|
||||||
}
|
}
|
||||||
if (!context) var context = [];
|
if (!context) var context = [];
|
||||||
context.push(tprop);
|
context.push(tprop);
|
||||||
}
|
}
|
||||||
return {list: getCompletions(token, context, keywords),
|
return {list: getCompletions(token, context, keywords, options),
|
||||||
from: {line: cur.line, ch: token.start},
|
from: Pos(cur.line, token.start),
|
||||||
to: {line: cur.line, ch: token.end}};
|
to: Pos(cur.line, token.end)};
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.javascriptHint = function(editor) {
|
function javascriptHint(editor, options) {
|
||||||
return scriptHint(editor, javascriptKeywords,
|
return scriptHint(editor, javascriptKeywords,
|
||||||
function (e, cur) {return e.getTokenAt(cur);});
|
function (e, cur) {return e.getTokenAt(cur);},
|
||||||
|
options);
|
||||||
};
|
};
|
||||||
|
CodeMirror.javascriptHint = javascriptHint; // deprecated
|
||||||
|
CodeMirror.registerHelper("hint", "javascript", javascriptHint);
|
||||||
|
|
||||||
function getCoffeeScriptToken(editor, cur) {
|
function getCoffeeScriptToken(editor, cur) {
|
||||||
// This getToken, it is for coffeescript, imitates the behavior of
|
// This getToken, it is for coffeescript, imitates the behavior of
|
||||||
@@ -65,19 +72,21 @@
|
|||||||
if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') {
|
if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') {
|
||||||
token.end = token.start;
|
token.end = token.start;
|
||||||
token.string = '.';
|
token.string = '.';
|
||||||
token.className = "property";
|
token.type = "property";
|
||||||
}
|
}
|
||||||
else if (/^\.[\w$_]*$/.test(token.string)) {
|
else if (/^\.[\w$_]*$/.test(token.string)) {
|
||||||
token.className = "property";
|
token.type = "property";
|
||||||
token.start++;
|
token.start++;
|
||||||
token.string = token.string.replace(/\./, '');
|
token.string = token.string.replace(/\./, '');
|
||||||
}
|
}
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.coffeescriptHint = function(editor) {
|
function coffeescriptHint(editor, options) {
|
||||||
return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken);
|
return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options);
|
||||||
};
|
}
|
||||||
|
CodeMirror.coffeescriptHint = coffeescriptHint; // deprecated
|
||||||
|
CodeMirror.registerHelper("hint", "coffeescript", coffeescriptHint);
|
||||||
|
|
||||||
var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " +
|
var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " +
|
||||||
"toUpperCase toLowerCase split concat match replace search").split(" ");
|
"toUpperCase toLowerCase split concat match replace search").split(" ");
|
||||||
@@ -89,7 +98,7 @@
|
|||||||
var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " +
|
var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " +
|
||||||
"if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");
|
"if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");
|
||||||
|
|
||||||
function getCompletions(token, context, keywords) {
|
function getCompletions(token, context, keywords, options) {
|
||||||
var found = [], start = token.string;
|
var found = [], start = token.string;
|
||||||
function maybeAdd(str) {
|
function maybeAdd(str) {
|
||||||
if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
|
if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
|
||||||
@@ -105,13 +114,15 @@
|
|||||||
// If this is a property, see if it belongs to some object we can
|
// If this is a property, see if it belongs to some object we can
|
||||||
// find in the current environment.
|
// find in the current environment.
|
||||||
var obj = context.pop(), base;
|
var obj = context.pop(), base;
|
||||||
if (obj.className == "variable")
|
if (obj.type.indexOf("variable") === 0) {
|
||||||
base = window[obj.string];
|
if (options && options.additionalContext)
|
||||||
else if (obj.className == "string")
|
base = options.additionalContext[obj.string];
|
||||||
|
base = base || window[obj.string];
|
||||||
|
} else if (obj.type == "string") {
|
||||||
base = "";
|
base = "";
|
||||||
else if (obj.className == "atom")
|
} else if (obj.type == "atom") {
|
||||||
base = 1;
|
base = 1;
|
||||||
else if (obj.className == "function") {
|
} else if (obj.type == "function") {
|
||||||
if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
|
if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
|
||||||
(typeof window.jQuery == 'function'))
|
(typeof window.jQuery == 'function'))
|
||||||
base = window.jQuery();
|
base = window.jQuery();
|
||||||
@@ -124,8 +135,9 @@
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If not, just look in the window object and any local scope
|
// If not, just look in the window object and any local scope
|
||||||
// (reading into JS mode internals to get at the local variables)
|
// (reading into JS mode internals to get at the local and global variables)
|
||||||
for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
|
for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
|
||||||
|
for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);
|
||||||
gatherCompletions(window);
|
gatherCompletions(window);
|
||||||
forEach(keywords, maybeAdd);
|
forEach(keywords, maybeAdd);
|
||||||
}
|
}
|
||||||
+11
-13
@@ -1,4 +1,6 @@
|
|||||||
(function () {
|
(function () {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function forEach(arr, f) {
|
function forEach(arr, f) {
|
||||||
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
|
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
|
||||||
}
|
}
|
||||||
@@ -16,7 +18,7 @@
|
|||||||
return arr.indexOf(item) != -1;
|
return arr.indexOf(item) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function scriptHint(editor, keywords, getToken) {
|
function scriptHint(editor, _keywords, getToken) {
|
||||||
// Find the token at the cursor
|
// Find the token at the cursor
|
||||||
var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
|
var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
|
||||||
// If it's not a 'word-style' token, ignore the token.
|
// If it's not a 'word-style' token, ignore the token.
|
||||||
@@ -37,19 +39,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {list: completionList,
|
return {list: completionList,
|
||||||
from: {line: cur.line, ch: token.start},
|
from: CodeMirror.Pos(cur.line, token.start),
|
||||||
to: {line: cur.line, ch: token.end}};
|
to: CodeMirror.Pos(cur.line, token.end)};
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeMirror.pigHint = function(editor) {
|
function pigHint(editor) {
|
||||||
return scriptHint(editor, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
|
return scriptHint(editor, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
|
||||||
};
|
}
|
||||||
|
CodeMirror.pigHint = pigHint; // deprecated
|
||||||
function toTitleCase(str) {
|
CodeMirror.registerHelper("hint", "pig", pigHint);
|
||||||
return str.replace(/(?:^|\s)\w/g, function(match) {
|
|
||||||
return match.toUpperCase();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var pigKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP "
|
var pigKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP "
|
||||||
+ "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL "
|
+ "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL "
|
||||||
@@ -109,9 +107,9 @@
|
|||||||
// find in the current environment.
|
// find in the current environment.
|
||||||
var obj = context.pop(), base;
|
var obj = context.pop(), base;
|
||||||
|
|
||||||
if (obj.className == "pig-word")
|
if (obj.type == "variable")
|
||||||
base = obj.string;
|
base = obj.string;
|
||||||
else if(obj.className == "pig-type")
|
else if(obj.type == "variable-3")
|
||||||
base = ":" + obj.string;
|
base = ":" + obj.string;
|
||||||
|
|
||||||
while (base != null && context.length)
|
while (base != null && context.length)
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
(function () {
|
||||||
|
function forEach(arr, f) {
|
||||||
|
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function arrayContains(arr, item) {
|
||||||
|
if (!Array.prototype.indexOf) {
|
||||||
|
var i = arr.length;
|
||||||
|
while (i--) {
|
||||||
|
if (arr[i] === item) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return arr.indexOf(item) != -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function scriptHint(editor, _keywords, getToken) {
|
||||||
|
// Find the token at the cursor
|
||||||
|
var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
|
||||||
|
// If it's not a 'word-style' token, ignore the token.
|
||||||
|
|
||||||
|
if (!/^[\w$_]*$/.test(token.string)) {
|
||||||
|
token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
|
||||||
|
className: token.string == ":" ? "python-type" : null};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!context) var context = [];
|
||||||
|
context.push(tprop);
|
||||||
|
|
||||||
|
var completionList = getCompletions(token, context);
|
||||||
|
completionList = completionList.sort();
|
||||||
|
//prevent autocomplete for last word, instead show dropdown with one word
|
||||||
|
if(completionList.length == 1) {
|
||||||
|
completionList.push(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
return {list: completionList,
|
||||||
|
from: CodeMirror.Pos(cur.line, token.start),
|
||||||
|
to: CodeMirror.Pos(cur.line, token.end)};
|
||||||
|
}
|
||||||
|
|
||||||
|
function pythonHint(editor) {
|
||||||
|
return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
|
||||||
|
}
|
||||||
|
CodeMirror.pythonHint = pythonHint; // deprecated
|
||||||
|
CodeMirror.registerHelper("hint", "python", pythonHint);
|
||||||
|
|
||||||
|
var pythonKeywords = "and del from not while as elif global or with assert else if pass yield"
|
||||||
|
+ "break except import print class exec in raise continue finally is return def for lambda try";
|
||||||
|
var pythonKeywordsL = pythonKeywords.split(" ");
|
||||||
|
var pythonKeywordsU = pythonKeywords.toUpperCase().split(" ");
|
||||||
|
|
||||||
|
var pythonBuiltins = "abs divmod input open staticmethod all enumerate int ord str "
|
||||||
|
+ "any eval isinstance pow sum basestring execfile issubclass print super"
|
||||||
|
+ "bin file iter property tuple bool filter len range type"
|
||||||
|
+ "bytearray float list raw_input unichr callable format locals reduce unicode"
|
||||||
|
+ "chr frozenset long reload vars classmethod getattr map repr xrange"
|
||||||
|
+ "cmp globals max reversed zip compile hasattr memoryview round __import__"
|
||||||
|
+ "complex hash min set apply delattr help next setattr buffer"
|
||||||
|
+ "dict hex object slice coerce dir id oct sorted intern ";
|
||||||
|
var pythonBuiltinsL = pythonBuiltins.split(" ").join("() ").split(" ");
|
||||||
|
var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(" ").join("() ").split(" ");
|
||||||
|
|
||||||
|
function getCompletions(token, context) {
|
||||||
|
var found = [], start = token.string;
|
||||||
|
function maybeAdd(str) {
|
||||||
|
if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
function gatherCompletions(_obj) {
|
||||||
|
forEach(pythonBuiltinsL, maybeAdd);
|
||||||
|
forEach(pythonBuiltinsU, maybeAdd);
|
||||||
|
forEach(pythonKeywordsL, maybeAdd);
|
||||||
|
forEach(pythonKeywordsU, maybeAdd);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context) {
|
||||||
|
// If this is a property, see if it belongs to some object we can
|
||||||
|
// find in the current environment.
|
||||||
|
var obj = context.pop(), base;
|
||||||
|
|
||||||
|
if (obj.type == "variable")
|
||||||
|
base = obj.string;
|
||||||
|
else if(obj.type == "variable-3")
|
||||||
|
base = ":" + obj.string;
|
||||||
|
|
||||||
|
while (base != null && context.length)
|
||||||
|
base = base[context.pop().string];
|
||||||
|
if (base != null) gatherCompletions(base);
|
||||||
|
}
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
.CodeMirror-hints {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
overflow: hidden;
|
||||||
|
list-style: none;
|
||||||
|
|
||||||
|
margin: 0;
|
||||||
|
padding: 2px;
|
||||||
|
|
||||||
|
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||||
|
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||||
|
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid silver;
|
||||||
|
|
||||||
|
background: white;
|
||||||
|
font-size: 90%;
|
||||||
|
font-family: monospace;
|
||||||
|
|
||||||
|
max-height: 20em;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-hint {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 4px;
|
||||||
|
border-radius: 2px;
|
||||||
|
max-width: 19em;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: pre;
|
||||||
|
color: black;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-hint-active {
|
||||||
|
background: #08f;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@@ -0,0 +1,274 @@
|
|||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
CodeMirror.showHint = function(cm, getHints, options) {
|
||||||
|
// We want a single cursor position.
|
||||||
|
if (cm.somethingSelected()) return;
|
||||||
|
if (getHints == null) getHints = cm.getHelper(cm.getCursor(), "hint");
|
||||||
|
if (getHints == null) return;
|
||||||
|
|
||||||
|
if (cm.state.completionActive) cm.state.completionActive.close();
|
||||||
|
|
||||||
|
var completion = cm.state.completionActive = new Completion(cm, getHints, options || {});
|
||||||
|
CodeMirror.signal(cm, "startCompletion", cm);
|
||||||
|
if (completion.options.async)
|
||||||
|
getHints(cm, function(hints) { completion.showHints(hints); }, completion.options);
|
||||||
|
else
|
||||||
|
return completion.showHints(getHints(cm, completion.options));
|
||||||
|
};
|
||||||
|
|
||||||
|
function Completion(cm, getHints, options) {
|
||||||
|
this.cm = cm;
|
||||||
|
this.getHints = getHints;
|
||||||
|
this.options = options;
|
||||||
|
this.widget = this.onClose = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Completion.prototype = {
|
||||||
|
close: function() {
|
||||||
|
if (!this.active()) return;
|
||||||
|
this.cm.state.completionActive = null;
|
||||||
|
|
||||||
|
if (this.widget) this.widget.close();
|
||||||
|
if (this.onClose) this.onClose();
|
||||||
|
CodeMirror.signal(this.cm, "endCompletion", this.cm);
|
||||||
|
},
|
||||||
|
|
||||||
|
active: function() {
|
||||||
|
return this.cm.state.completionActive == this;
|
||||||
|
},
|
||||||
|
|
||||||
|
pick: function(data, i) {
|
||||||
|
var completion = data.list[i];
|
||||||
|
if (completion.hint) completion.hint(this.cm, data, completion);
|
||||||
|
else this.cm.replaceRange(getText(completion), data.from, data.to);
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
showHints: function(data) {
|
||||||
|
if (!data || !data.list.length || !this.active()) return this.close();
|
||||||
|
|
||||||
|
if (this.options.completeSingle != false && data.list.length == 1)
|
||||||
|
this.pick(data, 0);
|
||||||
|
else
|
||||||
|
this.showWidget(data);
|
||||||
|
},
|
||||||
|
|
||||||
|
showWidget: function(data) {
|
||||||
|
this.widget = new Widget(this, data);
|
||||||
|
CodeMirror.signal(data, "shown");
|
||||||
|
|
||||||
|
var debounce = null, completion = this, finished;
|
||||||
|
var closeOn = this.options.closeCharacters || /[\s()\[\]{};:>,]/;
|
||||||
|
var startPos = this.cm.getCursor(), startLen = this.cm.getLine(startPos.line).length;
|
||||||
|
|
||||||
|
function done() {
|
||||||
|
if (finished) return;
|
||||||
|
finished = true;
|
||||||
|
completion.close();
|
||||||
|
completion.cm.off("cursorActivity", activity);
|
||||||
|
if (data) CodeMirror.signal(data, "close");
|
||||||
|
}
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
if (finished) return;
|
||||||
|
CodeMirror.signal(data, "update");
|
||||||
|
if (completion.options.async)
|
||||||
|
completion.getHints(completion.cm, finishUpdate, completion.options);
|
||||||
|
else
|
||||||
|
finishUpdate(completion.getHints(completion.cm, completion.options));
|
||||||
|
}
|
||||||
|
function finishUpdate(data_) {
|
||||||
|
data = data_;
|
||||||
|
if (finished) return;
|
||||||
|
if (!data || !data.list.length) return done();
|
||||||
|
completion.widget = new Widget(completion, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function activity() {
|
||||||
|
clearTimeout(debounce);
|
||||||
|
var pos = completion.cm.getCursor(), line = completion.cm.getLine(pos.line);
|
||||||
|
if (pos.line != startPos.line || line.length - pos.ch != startLen - startPos.ch ||
|
||||||
|
pos.ch < startPos.ch || completion.cm.somethingSelected() ||
|
||||||
|
(pos.ch && closeOn.test(line.charAt(pos.ch - 1)))) {
|
||||||
|
completion.close();
|
||||||
|
} else {
|
||||||
|
debounce = setTimeout(update, 170);
|
||||||
|
if (completion.widget) completion.widget.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.cm.on("cursorActivity", activity);
|
||||||
|
this.onClose = done;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function getText(completion) {
|
||||||
|
if (typeof completion == "string") return completion;
|
||||||
|
else return completion.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildKeyMap(options, handle) {
|
||||||
|
var baseMap = {
|
||||||
|
Up: function() {handle.moveFocus(-1);},
|
||||||
|
Down: function() {handle.moveFocus(1);},
|
||||||
|
PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},
|
||||||
|
PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},
|
||||||
|
Home: function() {handle.setFocus(0);},
|
||||||
|
End: function() {handle.setFocus(handle.length - 1);},
|
||||||
|
Enter: handle.pick,
|
||||||
|
Tab: handle.pick,
|
||||||
|
Esc: handle.close
|
||||||
|
};
|
||||||
|
var ourMap = options.customKeys ? {} : baseMap;
|
||||||
|
function addBinding(key, val) {
|
||||||
|
var bound;
|
||||||
|
if (typeof val != "string")
|
||||||
|
bound = function(cm) { return val(cm, handle); };
|
||||||
|
// This mechanism is deprecated
|
||||||
|
else if (baseMap.hasOwnProperty(val))
|
||||||
|
bound = baseMap[val];
|
||||||
|
else
|
||||||
|
bound = val;
|
||||||
|
ourMap[key] = bound;
|
||||||
|
}
|
||||||
|
if (options.customKeys)
|
||||||
|
for (var key in options.customKeys) if (options.customKeys.hasOwnProperty(key))
|
||||||
|
addBinding(key, options.customKeys[key]);
|
||||||
|
if (options.extraKeys)
|
||||||
|
for (var key in options.extraKeys) if (options.extraKeys.hasOwnProperty(key))
|
||||||
|
addBinding(key, options.extraKeys[key]);
|
||||||
|
return ourMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Widget(completion, data) {
|
||||||
|
this.completion = completion;
|
||||||
|
this.data = data;
|
||||||
|
var widget = this, cm = completion.cm, options = completion.options;
|
||||||
|
|
||||||
|
var hints = this.hints = document.createElement("ul");
|
||||||
|
hints.className = "CodeMirror-hints";
|
||||||
|
this.selectedHint = 0;
|
||||||
|
|
||||||
|
var completions = data.list;
|
||||||
|
for (var i = 0; i < completions.length; ++i) {
|
||||||
|
var elt = hints.appendChild(document.createElement("li")), cur = completions[i];
|
||||||
|
var className = "CodeMirror-hint" + (i ? "" : " CodeMirror-hint-active");
|
||||||
|
if (cur.className != null) className = cur.className + " " + className;
|
||||||
|
elt.className = className;
|
||||||
|
if (cur.render) cur.render(elt, data, cur);
|
||||||
|
else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));
|
||||||
|
elt.hintId = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
var pos = cm.cursorCoords(options.alignWithWord !== false ? data.from : null);
|
||||||
|
var left = pos.left, top = pos.bottom, below = true;
|
||||||
|
hints.style.left = left + "px";
|
||||||
|
hints.style.top = top + "px";
|
||||||
|
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
|
||||||
|
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
|
||||||
|
var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
|
||||||
|
(options.container || document.body).appendChild(hints);
|
||||||
|
var box = hints.getBoundingClientRect();
|
||||||
|
var overlapX = box.right - winW, overlapY = box.bottom - winH;
|
||||||
|
if (overlapX > 0) {
|
||||||
|
if (box.right - box.left > winW) {
|
||||||
|
hints.style.width = (winW - 5) + "px";
|
||||||
|
overlapX -= (box.right - box.left) - winW;
|
||||||
|
}
|
||||||
|
hints.style.left = (left = pos.left - overlapX) + "px";
|
||||||
|
}
|
||||||
|
if (overlapY > 0) {
|
||||||
|
var height = box.bottom - box.top;
|
||||||
|
if (box.top - (pos.bottom - pos.top) - height > 0) {
|
||||||
|
overlapY = height + (pos.bottom - pos.top);
|
||||||
|
below = false;
|
||||||
|
} else if (height > winH) {
|
||||||
|
hints.style.height = (winH - 5) + "px";
|
||||||
|
overlapY -= height - winH;
|
||||||
|
}
|
||||||
|
hints.style.top = (top = pos.bottom - overlapY) + "px";
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.addKeyMap(this.keyMap = buildKeyMap(options, {
|
||||||
|
moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
|
||||||
|
setFocus: function(n) { widget.changeActive(n); },
|
||||||
|
menuSize: function() { return widget.screenAmount(); },
|
||||||
|
length: completions.length,
|
||||||
|
close: function() { completion.close(); },
|
||||||
|
pick: function() { widget.pick(); }
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (options.closeOnUnfocus !== false) {
|
||||||
|
var closingOnBlur;
|
||||||
|
cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });
|
||||||
|
cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); });
|
||||||
|
}
|
||||||
|
|
||||||
|
var startScroll = cm.getScrollInfo();
|
||||||
|
cm.on("scroll", this.onScroll = function() {
|
||||||
|
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
|
||||||
|
var newTop = top + startScroll.top - curScroll.top;
|
||||||
|
var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);
|
||||||
|
if (!below) point += hints.offsetHeight;
|
||||||
|
if (point <= editor.top || point >= editor.bottom) return completion.close();
|
||||||
|
hints.style.top = newTop + "px";
|
||||||
|
hints.style.left = (left + startScroll.left - curScroll.left) + "px";
|
||||||
|
});
|
||||||
|
|
||||||
|
CodeMirror.on(hints, "dblclick", function(e) {
|
||||||
|
var t = e.target || e.srcElement;
|
||||||
|
if (t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}
|
||||||
|
});
|
||||||
|
CodeMirror.on(hints, "click", function(e) {
|
||||||
|
var t = e.target || e.srcElement;
|
||||||
|
if (t.hintId != null) widget.changeActive(t.hintId);
|
||||||
|
});
|
||||||
|
CodeMirror.on(hints, "mousedown", function() {
|
||||||
|
setTimeout(function(){cm.focus();}, 20);
|
||||||
|
});
|
||||||
|
|
||||||
|
CodeMirror.signal(data, "select", completions[0], hints.firstChild);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget.prototype = {
|
||||||
|
close: function() {
|
||||||
|
if (this.completion.widget != this) return;
|
||||||
|
this.completion.widget = null;
|
||||||
|
this.hints.parentNode.removeChild(this.hints);
|
||||||
|
this.completion.cm.removeKeyMap(this.keyMap);
|
||||||
|
|
||||||
|
var cm = this.completion.cm;
|
||||||
|
if (this.completion.options.closeOnUnfocus !== false) {
|
||||||
|
cm.off("blur", this.onBlur);
|
||||||
|
cm.off("focus", this.onFocus);
|
||||||
|
}
|
||||||
|
cm.off("scroll", this.onScroll);
|
||||||
|
},
|
||||||
|
|
||||||
|
pick: function() {
|
||||||
|
this.completion.pick(this.data, this.selectedHint);
|
||||||
|
},
|
||||||
|
|
||||||
|
changeActive: function(i, avoidWrap) {
|
||||||
|
if (i >= this.data.list.length)
|
||||||
|
i = avoidWrap ? this.data.list.length - 1 : 0;
|
||||||
|
else if (i < 0)
|
||||||
|
i = avoidWrap ? 0 : this.data.list.length - 1;
|
||||||
|
if (this.selectedHint == i) return;
|
||||||
|
var node = this.hints.childNodes[this.selectedHint];
|
||||||
|
node.className = node.className.replace(" CodeMirror-hint-active", "");
|
||||||
|
node = this.hints.childNodes[this.selectedHint = i];
|
||||||
|
node.className += " CodeMirror-hint-active";
|
||||||
|
if (node.offsetTop < this.hints.scrollTop)
|
||||||
|
this.hints.scrollTop = node.offsetTop - 3;
|
||||||
|
else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
|
||||||
|
this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;
|
||||||
|
CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
|
||||||
|
},
|
||||||
|
|
||||||
|
screenAmount: function() {
|
||||||
|
return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})();
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
|
function getHints(cm, options) {
|
||||||
|
var tags = options && options.schemaInfo;
|
||||||
|
var quote = (options && options.quoteChar) || '"';
|
||||||
|
if (!tags) return;
|
||||||
|
var cur = cm.getCursor(), token = cm.getTokenAt(cur);
|
||||||
|
var inner = CodeMirror.innerMode(cm.getMode(), token.state);
|
||||||
|
if (inner.mode.name != "xml") return;
|
||||||
|
var result = [], replaceToken = false, prefix;
|
||||||
|
var isTag = token.string.charAt(0) == "<";
|
||||||
|
if (!inner.state.tagName || isTag) { // Tag completion
|
||||||
|
if (isTag) {
|
||||||
|
prefix = token.string.slice(1);
|
||||||
|
replaceToken = true;
|
||||||
|
}
|
||||||
|
var cx = inner.state.context, curTag = cx && tags[cx.tagName];
|
||||||
|
var childList = cx ? curTag && curTag.children : tags["!top"];
|
||||||
|
if (childList) {
|
||||||
|
for (var i = 0; i < childList.length; ++i) if (!prefix || childList[i].indexOf(prefix) == 0)
|
||||||
|
result.push("<" + childList[i]);
|
||||||
|
} else {
|
||||||
|
for (var name in tags) if (tags.hasOwnProperty(name) && name != "!top" && (!prefix || name.indexOf(prefix) == 0))
|
||||||
|
result.push("<" + name);
|
||||||
|
}
|
||||||
|
if (cx && (!prefix || ("/" + cx.tagName).indexOf(prefix) == 0))
|
||||||
|
result.push("</" + cx.tagName + ">");
|
||||||
|
} else {
|
||||||
|
// Attribute completion
|
||||||
|
var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;
|
||||||
|
if (!attrs) return;
|
||||||
|
if (token.type == "string" || token.string == "=") { // A value
|
||||||
|
var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),
|
||||||
|
Pos(cur.line, token.type == "string" ? token.start : token.end));
|
||||||
|
var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues;
|
||||||
|
if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;
|
||||||
|
if (token.type == "string") {
|
||||||
|
prefix = token.string;
|
||||||
|
if (/['"]/.test(token.string.charAt(0))) {
|
||||||
|
quote = token.string.charAt(0);
|
||||||
|
prefix = token.string.slice(1);
|
||||||
|
}
|
||||||
|
replaceToken = true;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < atValues.length; ++i) if (!prefix || atValues[i].indexOf(prefix) == 0)
|
||||||
|
result.push(quote + atValues[i] + quote);
|
||||||
|
} else { // An attribute name
|
||||||
|
if (token.type == "attribute") {
|
||||||
|
prefix = token.string;
|
||||||
|
replaceToken = true;
|
||||||
|
}
|
||||||
|
for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || attr.indexOf(prefix) == 0))
|
||||||
|
result.push(attr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
list: result,
|
||||||
|
from: replaceToken ? Pos(cur.line, token.start) : cur,
|
||||||
|
to: replaceToken ? Pos(cur.line, token.end) : cur
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeMirror.xmlHint = getHints; // deprecated
|
||||||
|
CodeMirror.registerHelper("hint", "xml", getHints);
|
||||||
|
})();
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js
|
||||||
|
|
||||||
|
// declare global: coffeelint
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("lint", "coffeescript", function(text) {
|
||||||
|
var found = [];
|
||||||
|
var parseError = function(err) {
|
||||||
|
var loc = err.lineNumber;
|
||||||
|
found.push({from: CodeMirror.Pos(loc-1, 0),
|
||||||
|
to: CodeMirror.Pos(loc, 0),
|
||||||
|
severity: err.level,
|
||||||
|
message: err.message});
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
var res = coffeelint.lint(text);
|
||||||
|
for(var i = 0; i < res.length; i++) {
|
||||||
|
parseError(res[i]);
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
found.push({from: CodeMirror.Pos(e.location.first_line, 0),
|
||||||
|
to: CodeMirror.Pos(e.location.last_line, e.location.last_column),
|
||||||
|
severity: 'error',
|
||||||
|
message: e.message});
|
||||||
|
}
|
||||||
|
return found;
|
||||||
|
});
|
||||||
|
CodeMirror.coffeeValidator = CodeMirror.lint.coffeescript; // deprecated
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
// declare global: JSHINT
|
||||||
|
|
||||||
|
var bogus = [ "Dangerous comment" ];
|
||||||
|
|
||||||
|
var warnings = [ [ "Expected '{'",
|
||||||
|
"Statement body should be inside '{ }' braces." ] ];
|
||||||
|
|
||||||
|
var errors = [ "Missing semicolon", "Extra comma", "Missing property name",
|
||||||
|
"Unmatched ", " and instead saw", " is not defined",
|
||||||
|
"Unclosed string", "Stopping, unable to continue" ];
|
||||||
|
|
||||||
|
function validator(text, options) {
|
||||||
|
JSHINT(text, options);
|
||||||
|
var errors = JSHINT.data().errors, result = [];
|
||||||
|
if (errors) parseErrors(errors, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("lint", "javascript", validator);
|
||||||
|
CodeMirror.javascriptValidator = CodeMirror.lint.javascript; // deprecated
|
||||||
|
|
||||||
|
function cleanup(error) {
|
||||||
|
// All problems are warnings by default
|
||||||
|
fixWith(error, warnings, "warning", true);
|
||||||
|
fixWith(error, errors, "error");
|
||||||
|
|
||||||
|
return isBogus(error) ? null : error;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fixWith(error, fixes, severity, force) {
|
||||||
|
var description, fix, find, replace, found;
|
||||||
|
|
||||||
|
description = error.description;
|
||||||
|
|
||||||
|
for ( var i = 0; i < fixes.length; i++) {
|
||||||
|
fix = fixes[i];
|
||||||
|
find = (typeof fix === "string" ? fix : fix[0]);
|
||||||
|
replace = (typeof fix === "string" ? null : fix[1]);
|
||||||
|
found = description.indexOf(find) !== -1;
|
||||||
|
|
||||||
|
if (force || found) {
|
||||||
|
error.severity = severity;
|
||||||
|
}
|
||||||
|
if (found && replace) {
|
||||||
|
error.description = replace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isBogus(error) {
|
||||||
|
var description = error.description;
|
||||||
|
for ( var i = 0; i < bogus.length; i++) {
|
||||||
|
if (description.indexOf(bogus[i]) !== -1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseErrors(errors, output) {
|
||||||
|
for ( var i = 0; i < errors.length; i++) {
|
||||||
|
var error = errors[i];
|
||||||
|
if (error) {
|
||||||
|
var linetabpositions, index;
|
||||||
|
|
||||||
|
linetabpositions = [];
|
||||||
|
|
||||||
|
// This next block is to fix a problem in jshint. Jshint
|
||||||
|
// replaces
|
||||||
|
// all tabs with spaces then performs some checks. The error
|
||||||
|
// positions (character/space) are then reported incorrectly,
|
||||||
|
// not taking the replacement step into account. Here we look
|
||||||
|
// at the evidence line and try to adjust the character position
|
||||||
|
// to the correct value.
|
||||||
|
if (error.evidence) {
|
||||||
|
// Tab positions are computed once per line and cached
|
||||||
|
var tabpositions = linetabpositions[error.line];
|
||||||
|
if (!tabpositions) {
|
||||||
|
var evidence = error.evidence;
|
||||||
|
tabpositions = [];
|
||||||
|
// ugggh phantomjs does not like this
|
||||||
|
// forEachChar(evidence, function(item, index) {
|
||||||
|
Array.prototype.forEach.call(evidence, function(item,
|
||||||
|
index) {
|
||||||
|
if (item === '\t') {
|
||||||
|
// First col is 1 (not 0) to match error
|
||||||
|
// positions
|
||||||
|
tabpositions.push(index + 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
linetabpositions[error.line] = tabpositions;
|
||||||
|
}
|
||||||
|
if (tabpositions.length > 0) {
|
||||||
|
var pos = error.character;
|
||||||
|
tabpositions.forEach(function(tabposition) {
|
||||||
|
if (pos > tabposition) pos -= 1;
|
||||||
|
});
|
||||||
|
error.character = pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var start = error.character - 1, end = start + 1;
|
||||||
|
if (error.evidence) {
|
||||||
|
index = error.evidence.substring(start).search(/.\b/);
|
||||||
|
if (index > -1) {
|
||||||
|
end += index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert to format expected by validation service
|
||||||
|
error.description = error.reason;// + "(jshint)";
|
||||||
|
error.start = error.character;
|
||||||
|
error.end = end;
|
||||||
|
error = cleanup(error);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
output.push({message: error.description,
|
||||||
|
severity: error.severity,
|
||||||
|
from: CodeMirror.Pos(error.line - 1, start),
|
||||||
|
to: CodeMirror.Pos(error.line - 1, end)});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// Depends on jsonlint.js from https://github.com/zaach/jsonlint
|
||||||
|
|
||||||
|
// declare global: jsonlint
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("lint", "json", function(text) {
|
||||||
|
var found = [];
|
||||||
|
jsonlint.parseError = function(str, hash) {
|
||||||
|
var loc = hash.loc;
|
||||||
|
found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
|
||||||
|
to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
|
||||||
|
message: str});
|
||||||
|
};
|
||||||
|
try { jsonlint.parse(text); }
|
||||||
|
catch(e) {}
|
||||||
|
return found;
|
||||||
|
});
|
||||||
|
CodeMirror.jsonValidator = CodeMirror.lint.json; // deprecated
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
/* The lint marker gutter */
|
||||||
|
.CodeMirror-lint-markers {
|
||||||
|
width: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lint-tooltip {
|
||||||
|
background-color: infobackground;
|
||||||
|
border: 1px solid black;
|
||||||
|
border-radius: 4px 4px 4px 4px;
|
||||||
|
color: infotext;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 10pt;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 2px 5px;
|
||||||
|
position: fixed;
|
||||||
|
white-space: pre;
|
||||||
|
z-index: 100;
|
||||||
|
max-width: 600px;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity .4s;
|
||||||
|
-moz-transition: opacity .4s;
|
||||||
|
-webkit-transition: opacity .4s;
|
||||||
|
-o-transition: opacity .4s;
|
||||||
|
-ms-transition: opacity .4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning {
|
||||||
|
background-position: left bottom;
|
||||||
|
background-repeat: repeat-x;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lint-mark-error {
|
||||||
|
background-image:
|
||||||
|
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lint-mark-warning {
|
||||||
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {
|
||||||
|
background-position: center center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
vertical-align: middle;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
|
||||||
|
padding-left: 18px;
|
||||||
|
background-position: top left;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
|
||||||
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {
|
||||||
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=");
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-lint-marker-multiple {
|
||||||
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: right bottom;
|
||||||
|
width: 100%; height: 100%;
|
||||||
|
}
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
var GUTTER_ID = "CodeMirror-lint-markers";
|
||||||
|
var SEVERITIES = /^(?:error|warning)$/;
|
||||||
|
|
||||||
|
function showTooltip(e, content) {
|
||||||
|
var tt = document.createElement("div");
|
||||||
|
tt.className = "CodeMirror-lint-tooltip";
|
||||||
|
tt.appendChild(content.cloneNode(true));
|
||||||
|
document.body.appendChild(tt);
|
||||||
|
|
||||||
|
function position(e) {
|
||||||
|
if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
|
||||||
|
tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
|
||||||
|
tt.style.left = (e.clientX + 5) + "px";
|
||||||
|
}
|
||||||
|
CodeMirror.on(document, "mousemove", position);
|
||||||
|
position(e);
|
||||||
|
if (tt.style.opacity != null) tt.style.opacity = 1;
|
||||||
|
return tt;
|
||||||
|
}
|
||||||
|
function rm(elt) {
|
||||||
|
if (elt.parentNode) elt.parentNode.removeChild(elt);
|
||||||
|
}
|
||||||
|
function hideTooltip(tt) {
|
||||||
|
if (!tt.parentNode) return;
|
||||||
|
if (tt.style.opacity == null) rm(tt);
|
||||||
|
tt.style.opacity = 0;
|
||||||
|
setTimeout(function() { rm(tt); }, 600);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showTooltipFor(e, content, node) {
|
||||||
|
var tooltip = showTooltip(e, content);
|
||||||
|
function hide() {
|
||||||
|
CodeMirror.off(node, "mouseout", hide);
|
||||||
|
if (tooltip) { hideTooltip(tooltip); tooltip = null; }
|
||||||
|
}
|
||||||
|
var poll = setInterval(function() {
|
||||||
|
if (tooltip) for (var n = node;; n = n.parentNode) {
|
||||||
|
if (n == document.body) return;
|
||||||
|
if (!n) { hide(); break; }
|
||||||
|
}
|
||||||
|
if (!tooltip) return clearInterval(poll);
|
||||||
|
}, 400);
|
||||||
|
CodeMirror.on(node, "mouseout", hide);
|
||||||
|
}
|
||||||
|
|
||||||
|
function LintState(cm, options, hasGutter) {
|
||||||
|
this.marked = [];
|
||||||
|
this.options = options;
|
||||||
|
this.timeout = null;
|
||||||
|
this.hasGutter = hasGutter;
|
||||||
|
this.onMouseOver = function(e) { onMouseOver(cm, e); };
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseOptions(cm, options) {
|
||||||
|
if (options instanceof Function) return {getAnnotations: options};
|
||||||
|
if (!options || options === true) options = {};
|
||||||
|
if (!options.getAnnotations) options.getAnnotations = cm.getHelper(CodeMirror.Pos(0, 0), "lint");
|
||||||
|
if (!options.getAnnotations) throw new Error("Required option 'getAnnotations' missing (lint addon)");
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearMarks(cm) {
|
||||||
|
var state = cm.state.lint;
|
||||||
|
if (state.hasGutter) cm.clearGutter(GUTTER_ID);
|
||||||
|
for (var i = 0; i < state.marked.length; ++i)
|
||||||
|
state.marked[i].clear();
|
||||||
|
state.marked.length = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeMarker(labels, severity, multiple, tooltips) {
|
||||||
|
var marker = document.createElement("div"), inner = marker;
|
||||||
|
marker.className = "CodeMirror-lint-marker-" + severity;
|
||||||
|
if (multiple) {
|
||||||
|
inner = marker.appendChild(document.createElement("div"));
|
||||||
|
inner.className = "CodeMirror-lint-marker-multiple";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
|
||||||
|
showTooltipFor(e, labels, inner);
|
||||||
|
});
|
||||||
|
|
||||||
|
return marker;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMaxSeverity(a, b) {
|
||||||
|
if (a == "error") return a;
|
||||||
|
else return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
function groupByLine(annotations) {
|
||||||
|
var lines = [];
|
||||||
|
for (var i = 0; i < annotations.length; ++i) {
|
||||||
|
var ann = annotations[i], line = ann.from.line;
|
||||||
|
(lines[line] || (lines[line] = [])).push(ann);
|
||||||
|
}
|
||||||
|
return lines;
|
||||||
|
}
|
||||||
|
|
||||||
|
function annotationTooltip(ann) {
|
||||||
|
var severity = ann.severity;
|
||||||
|
if (!SEVERITIES.test(severity)) severity = "error";
|
||||||
|
var tip = document.createElement("div");
|
||||||
|
tip.className = "CodeMirror-lint-message-" + severity;
|
||||||
|
tip.appendChild(document.createTextNode(ann.message));
|
||||||
|
return tip;
|
||||||
|
}
|
||||||
|
|
||||||
|
function startLinting(cm) {
|
||||||
|
var state = cm.state.lint, options = state.options;
|
||||||
|
if (options.async)
|
||||||
|
options.getAnnotations(cm, updateLinting, options);
|
||||||
|
else
|
||||||
|
updateLinting(cm, options.getAnnotations(cm.getValue(), options));
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateLinting(cm, annotationsNotSorted) {
|
||||||
|
clearMarks(cm);
|
||||||
|
var state = cm.state.lint, options = state.options;
|
||||||
|
|
||||||
|
var annotations = groupByLine(annotationsNotSorted);
|
||||||
|
|
||||||
|
for (var line = 0; line < annotations.length; ++line) {
|
||||||
|
var anns = annotations[line];
|
||||||
|
if (!anns) continue;
|
||||||
|
|
||||||
|
var maxSeverity = null;
|
||||||
|
var tipLabel = state.hasGutter && document.createDocumentFragment();
|
||||||
|
|
||||||
|
for (var i = 0; i < anns.length; ++i) {
|
||||||
|
var ann = anns[i];
|
||||||
|
var severity = ann.severity;
|
||||||
|
if (!SEVERITIES.test(severity)) severity = "error";
|
||||||
|
maxSeverity = getMaxSeverity(maxSeverity, severity);
|
||||||
|
|
||||||
|
if (options.formatAnnotation) ann = options.formatAnnotation(ann);
|
||||||
|
if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));
|
||||||
|
|
||||||
|
if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {
|
||||||
|
className: "CodeMirror-lint-mark-" + severity,
|
||||||
|
__annotation: ann
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.hasGutter)
|
||||||
|
cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1,
|
||||||
|
state.options.tooltips));
|
||||||
|
}
|
||||||
|
if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onChange(cm) {
|
||||||
|
var state = cm.state.lint;
|
||||||
|
clearTimeout(state.timeout);
|
||||||
|
state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
function popupSpanTooltip(ann, e) {
|
||||||
|
var target = e.target || e.srcElement;
|
||||||
|
showTooltipFor(e, annotationTooltip(ann), target);
|
||||||
|
}
|
||||||
|
|
||||||
|
// When the mouseover fires, the cursor might not actually be over
|
||||||
|
// the character itself yet. These pairs of x,y offsets are used to
|
||||||
|
// probe a few nearby points when no suitable marked range is found.
|
||||||
|
var nearby = [0, 0, 0, 5, 0, -5, 5, 0, -5, 0];
|
||||||
|
|
||||||
|
function onMouseOver(cm, e) {
|
||||||
|
if (!/\bCodeMirror-lint-mark-/.test((e.target || e.srcElement).className)) return;
|
||||||
|
for (var i = 0; i < nearby.length; i += 2) {
|
||||||
|
var spans = cm.findMarksAt(cm.coordsChar({left: e.clientX + nearby[i],
|
||||||
|
top: e.clientY + nearby[i + 1]}));
|
||||||
|
for (var j = 0; j < spans.length; ++j) {
|
||||||
|
var span = spans[j], ann = span.__annotation;
|
||||||
|
if (ann) return popupSpanTooltip(ann, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function optionHandler(cm, val, old) {
|
||||||
|
if (old && old != CodeMirror.Init) {
|
||||||
|
clearMarks(cm);
|
||||||
|
cm.off("change", onChange);
|
||||||
|
CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
|
||||||
|
delete cm.state.lint;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val) {
|
||||||
|
var gutters = cm.getOption("gutters"), hasLintGutter = false;
|
||||||
|
for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
|
||||||
|
var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);
|
||||||
|
cm.on("change", onChange);
|
||||||
|
if (state.options.tooltips != false)
|
||||||
|
CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
|
||||||
|
|
||||||
|
startLinting(cm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeMirror.defineOption("lintWith", false, optionHandler); // deprecated
|
||||||
|
CodeMirror.defineOption("lint", false, optionHandler); // deprecated
|
||||||
|
})();
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
// From https://code.google.com/p/google-diff-match-patch/ , licensed under the Apache License 2.0
|
||||||
|
(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32}
|
||||||
|
diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a,
|
||||||
|
b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a};
|
||||||
|
diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100<a.length&&100<b.length?this.diff_lineMode_(a,b,
|
||||||
|
d):this.diff_bisect_(a,b,d)};
|
||||||
|
diff_match_patch.prototype.diff_lineMode_=function(a,b,c){var d=this.diff_linesToChars_(a,b);a=d.chars1;b=d.chars2;d=d.lineArray;a=this.diff_main(a,b,!1,c);this.diff_charsToLines_(a,d);this.diff_cleanupSemantic(a);a.push([0,""]);for(var e=d=b=0,f="",g="";b<a.length;){switch(a[b][0]){case 1:e++;g+=a[b][1];break;case -1:d++;f+=a[b][1];break;case 0:if(1<=d&&1<=e){a.splice(b-d-e,d+e);b=b-d-e;d=this.diff_main(f,g,!1,c);for(e=d.length-1;0<=e;e--)a.splice(b,0,d[e]);b+=d.length}d=e=0;g=f=""}b++}a.pop();return a};
|
||||||
|
diff_match_patch.prototype.diff_bisect_=function(a,b,c){for(var d=a.length,e=b.length,f=Math.ceil((d+e)/2),g=f,h=2*f,j=Array(h),i=Array(h),k=0;k<h;k++)j[k]=-1,i[k]=-1;j[g+1]=0;i[g+1]=0;for(var k=d-e,q=0!=k%2,r=0,t=0,p=0,w=0,v=0;v<f&&!((new Date).getTime()>c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]<j[l+1]?j[l+1]:j[l-1]+1;for(var s=m-n;m<d&&s<e&&a.charAt(m)==b.charAt(s);)m++,s++;j[l]=m;if(m>d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l<h&&-1!=i[l])){var u=d-i[l];if(m>=
|
||||||
|
u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]<i[l+1]?i[l+1]:i[l-1]+1;for(m=u-n;u<d&&m<e&&a.charAt(d-u-1)==b.charAt(e-m-1);)u++,m++;i[l]=u;if(u>d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l<h&&-1!=j[l])&&(m=j[l],s=g+m-l,u=d-u,m>=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]};
|
||||||
|
diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)};
|
||||||
|
diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;f<a.length-1;){f=a.indexOf("\n",c);-1==f&&(f=a.length-1);var r=a.substring(c,f+1),c=f+1;(e.hasOwnProperty?e.hasOwnProperty(r):void 0!==e[r])?b+=String.fromCharCode(e[r]):(b+=String.fromCharCode(g),e[r]=g,d[g++]=r)}return b}var d=[],e={};d[0]="";var f=c(a),g=c(b);return{chars1:f,chars2:g,lineArray:d}};
|
||||||
|
diff_match_patch.prototype.diff_charsToLines_=function(a,b){for(var c=0;c<a.length;c++){for(var d=a[c][1],e=[],f=0;f<d.length;f++)e[f]=b[d.charCodeAt(f)];a[c][1]=e.join("")}};diff_match_patch.prototype.diff_commonPrefix=function(a,b){if(!a||!b||a.charAt(0)!=b.charAt(0))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(f,e)==b.substring(f,e)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
||||||
|
diff_match_patch.prototype.diff_commonSuffix=function(a,b){if(!a||!b||a.charAt(a.length-1)!=b.charAt(b.length-1))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(a.length-e,a.length-f)==b.substring(b.length-e,b.length-f)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
|
||||||
|
diff_match_patch.prototype.diff_commonOverlap_=function(a,b){var c=a.length,d=b.length;if(0==c||0==d)return 0;c>d?a=a.substring(c-d):c<d&&(b=b.substring(0,c));c=Math.min(c,d);if(a==b)return c;for(var d=0,e=1;;){var f=a.substring(c-e),f=b.indexOf(f);if(-1==f)return d;e+=f;if(0==f||a.substring(c-e)==b.substring(0,e))d=e,e++}};
|
||||||
|
diff_match_patch.prototype.diff_halfMatch_=function(a,b){function c(a,b,c){for(var d=a.substring(c,c+Math.floor(a.length/4)),e=-1,g="",h,j,n,l;-1!=(e=b.indexOf(d,e+1));){var m=f.diff_commonPrefix(a.substring(c),b.substring(e)),s=f.diff_commonSuffix(a.substring(0,c),b.substring(0,e));g.length<s+m&&(g=b.substring(e-s,e)+b.substring(e,e+m),h=a.substring(0,c-s),j=a.substring(c+m),n=b.substring(0,e-s),l=b.substring(e+m))}return 2*g.length>=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null;
|
||||||
|
var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.length<d.length)return null;var f=this,g=c(d,e,Math.ceil(d.length/4)),d=c(d,e,Math.ceil(d.length/2)),h;if(!g&&!d)return null;h=d?g?g[4].length>d[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]};
|
||||||
|
diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f<a.length;)0==a[f][0]?(c[d++]=f,g=j,h=i,i=j=0,e=a[f][1]):(1==a[f][0]?j+=a[f][1].length:i+=a[f][1].length,e&&(e.length<=Math.max(g,h)&&e.length<=Math.max(j,i))&&(a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,d--,f=0<d?c[d-1]:-1,i=j=h=g=0,e=null,b=!0)),f++;b&&this.diff_cleanupMerge(a);this.diff_cleanupSemanticLossless(a);for(f=1;f<a.length;){if(-1==a[f-1][0]&&1==a[f][0]){b=a[f-1][1];c=a[f][1];
|
||||||
|
d=this.diff_commonOverlap_(b,c);e=this.diff_commonOverlap_(c,b);if(d>=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}};
|
||||||
|
diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_);
|
||||||
|
return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c<a.length-1;){if(0==a[c-1][0]&&0==a[c+1][0]){var d=a[c-1][1],e=a[c][1],f=a[c+1][1],g=this.diff_commonSuffix(d,e);if(g)var h=e.substring(e.length-g),d=d.substring(0,d.length-g),e=h+e.substring(0,e.length-g),f=h+f;for(var g=d,h=e,j=f,i=b(d,e)+b(e,f);e.charAt(0)===f.charAt(0);){var d=d+e.charAt(0),e=e.substring(1)+f.charAt(0),f=f.substring(1),k=b(d,e)+b(e,f);k>=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]=
|
||||||
|
h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/;
|
||||||
|
diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;f<a.length;){if(0==a[f][0])a[f][1].length<this.Diff_EditCost&&(j||i)?(c[d++]=f,g=j,h=i,e=a[f][1]):(d=0,e=null),j=i=!1;else if(-1==a[f][0]?i=!0:j=!0,e&&(g&&h&&j&&i||e.length<this.Diff_EditCost/2&&3==g+h+j+i))a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,e=null,g&&h?(j=i=!0,d=0):(d--,f=0<d?c[d-1]:-1,j=i=!1),b=!0;f++}b&&this.diff_cleanupMerge(a)};
|
||||||
|
diff_match_patch.prototype.diff_cleanupMerge=function(a){a.push([0,""]);for(var b=0,c=0,d=0,e="",f="",g;b<a.length;)switch(a[b][0]){case 1:d++;f+=a[b][1];b++;break;case -1:c++;e+=a[b][1];b++;break;case 0:1<c+d?(0!==c&&0!==d&&(g=this.diff_commonPrefix(f,e),0!==g&&(0<b-c-d&&0==a[b-c-d-1][0]?a[b-c-d-1][1]+=f.substring(0,g):(a.splice(0,0,[0,f.substring(0,g)]),b++),f=f.substring(g),e=e.substring(g)),g=this.diff_commonSuffix(f,e),0!==g&&(a[b][1]=f.substring(f.length-g)+a[b][1],f=f.substring(0,f.length-
|
||||||
|
g),e=e.substring(0,e.length-g))),0===c?a.splice(b-d,c+d,[1,f]):0===d?a.splice(b-c,c+d,[-1,e]):a.splice(b-c-d,c+d,[-1,e],[1,f]),b=b-c-d+(c?1:0)+(d?1:0)+1):0!==b&&0==a[b-1][0]?(a[b-1][1]+=a[b][1],a.splice(b,1)):b++,c=d=0,f=e=""}""===a[a.length-1][1]&&a.pop();c=!1;for(b=1;b<a.length-1;)0==a[b-1][0]&&0==a[b+1][0]&&(a[b][1].substring(a[b][1].length-a[b-1][1].length)==a[b-1][1]?(a[b][1]=a[b-1][1]+a[b][1].substring(0,a[b][1].length-a[b-1][1].length),a[b+1][1]=a[b-1][1]+a[b+1][1],a.splice(b-1,1),c=!0):a[b][1].substring(0,
|
||||||
|
a[b+1][1].length)==a[b+1][1]&&(a[b-1][1]+=a[b+1][1],a[b][1]=a[b][1].substring(a[b+1][1].length)+a[b+1][1],a.splice(b+1,1),c=!0)),b++;c&&this.diff_cleanupMerge(a)};diff_match_patch.prototype.diff_xIndex=function(a,b){var c=0,d=0,e=0,f=0,g;for(g=0;g<a.length;g++){1!==a[g][0]&&(c+=a[g][1].length);-1!==a[g][0]&&(d+=a[g][1].length);if(c>b)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)};
|
||||||
|
diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=/</g,e=/>/g,f=/\n/g,g=0;g<a.length;g++){var h=a[g][0],j=a[g][1],j=j.replace(c,"&").replace(d,"<").replace(e,">").replace(f,"¶<br>");switch(h){case 1:b[g]='<ins style="background:#e6ffe6;">'+j+"</ins>";break;case -1:b[g]='<del style="background:#ffe6e6;">'+j+"</del>";break;case 0:b[g]="<span>"+j+"</span>"}}return b.join("")};
|
||||||
|
diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;c<a.length;c++)1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_text2=function(a){for(var b=[],c=0;c<a.length;c++)-1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_levenshtein=function(a){for(var b=0,c=0,d=0,e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];switch(f){case 1:c+=g.length;break;case -1:d+=g.length;break;case 0:b+=Math.max(c,d),d=c=0}}return b+=Math.max(c,d)};
|
||||||
|
diff_match_patch.prototype.diff_toDelta=function(a){for(var b=[],c=0;c<a.length;c++)switch(a[c][0]){case 1:b[c]="+"+encodeURI(a[c][1]);break;case -1:b[c]="-"+a[c][1].length;break;case 0:b[c]="="+a[c][1].length}return b.join("\t").replace(/%20/g," ")};
|
||||||
|
diff_match_patch.prototype.diff_fromDelta=function(a,b){for(var c=[],d=0,e=0,f=b.split(/\t/g),g=0;g<f.length;g++){var h=f[g].substring(1);switch(f[g].charAt(0)){case "+":try{c[d++]=[1,decodeURI(h)]}catch(j){throw Error("Illegal escape in diff_fromDelta: "+h);}break;case "-":case "=":var i=parseInt(h,10);if(isNaN(i)||0>i)throw Error("Invalid number in diff_fromDelta: "+h);h=a.substring(e,e+=i);"="==f[g].charAt(0)?c[d++]=[0,h]:c[d++]=[-1,h];break;default:if(f[g])throw Error("Invalid diff operation in diff_fromDelta: "+
|
||||||
|
f[g]);}}if(e!=a.length)throw Error("Delta length ("+e+") does not equal source text length ("+a.length+").");return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error("Null input. (match_main)");c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1};
|
||||||
|
diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<<b.length-1,h=-1,i,k,q=b.length+a.length,r,t=0;t<b.length;t++){i=0;for(k=q;i<k;)d(t,c+
|
||||||
|
k)<=g?i=k:q=k,k=Math.floor((q-i)/2+i);q=k;i=Math.max(1,c-k+1);var p=Math.min(c+k,a.length)+b.length;k=Array(p+2);for(k[p+1]=(1<<t)-1;p>=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h};
|
||||||
|
diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=0;for(c=0;c<a.length;c++)b[a.charAt(c)]|=1<<a.length-c-1;return b};
|
||||||
|
diff_match_patch.prototype.patch_addContext_=function(a,b){if(0!=b.length){for(var c=b.substring(a.start2,a.start2+a.length1),d=0;b.indexOf(c)!=b.lastIndexOf(c)&&c.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)d+=this.Patch_Margin,c=b.substring(a.start2-d,a.start2+a.length1+d);d+=this.Patch_Margin;(c=b.substring(a.start2-d,a.start2))&&a.diffs.unshift([0,c]);(d=b.substring(a.start2+a.length1,a.start2+a.length1+d))&&a.diffs.push([0,d]);a.start1-=c.length;a.start2-=c.length;a.length1+=
|
||||||
|
c.length+d.length;a.length2+=c.length+d.length}};
|
||||||
|
diff_match_patch.prototype.patch_make=function(a,b,c){var d;if("string"==typeof a&&"string"==typeof b&&"undefined"==typeof c)d=a,b=this.diff_main(d,b,!0),2<b.length&&(this.diff_cleanupSemantic(b),this.diff_cleanupEfficiency(b));else if(a&&"object"==typeof a&&"undefined"==typeof b&&"undefined"==typeof c)b=a,d=this.diff_text1(b);else if("string"==typeof a&&b&&"object"==typeof b&&"undefined"==typeof c)d=a;else if("string"==typeof a&&"string"==typeof b&&c&&"object"==typeof c)d=a,b=c;else throw Error("Unknown call format to patch_make.");
|
||||||
|
if(0===b.length)return[];c=[];a=new diff_match_patch.patch_obj;for(var e=0,f=0,g=0,h=d,j=0;j<b.length;j++){var i=b[j][0],k=b[j][1];!e&&0!==i&&(a.start1=f,a.start2=g);switch(i){case 1:a.diffs[e++]=b[j];a.length2+=k.length;d=d.substring(0,g)+k+d.substring(g);break;case -1:a.length1+=k.length;a.diffs[e++]=b[j];d=d.substring(0,g)+d.substring(g+k.length);break;case 0:k.length<=2*this.Patch_Margin&&e&&b.length!=j+1?(a.diffs[e++]=b[j],a.length1+=k.length,a.length2+=k.length):k.length>=2*this.Patch_Margin&&
|
||||||
|
e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=new diff_match_patch.patch_obj;e.diffs=[];for(var f=0;f<d.diffs.length;f++)e.diffs[f]=d.diffs[f].slice();e.start1=d.start1;e.start2=d.start2;e.length1=d.length1;e.length2=d.length2;b[c]=e}return b};
|
||||||
|
diff_match_patch.prototype.patch_apply=function(a,b){if(0==a.length)return[b,[]];a=this.patch_deepCopy(a);var c=this.patch_addPadding(a);b=c+b+c;this.patch_splitMax(a);for(var d=0,e=[],f=0;f<a.length;f++){var g=a[f].start2+d,h=this.diff_text1(a[f].diffs),j,i=-1;if(h.length>this.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g);
|
||||||
|
if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;i<a[f].diffs.length;i++){var q=a[f].diffs[i];0!==q[0]&&(k=this.diff_xIndex(g,h));1===q[0]?b=b.substring(0,
|
||||||
|
j+k)+q[1]+b.substring(j+k):-1===q[0]&&(b=b.substring(0,j+k)+b.substring(j+this.diff_xIndex(g,h+q[1].length)));-1!==q[0]&&(h+=q[1].length)}}}b=b.substring(c.length,b.length-c.length);return[b,e]};
|
||||||
|
diff_match_patch.prototype.patch_addPadding=function(a){for(var b=this.Patch_Margin,c="",d=1;d<=b;d++)c+=String.fromCharCode(d);for(d=0;d<a.length;d++)a[d].start1+=b,a[d].start2+=b;var d=a[0],e=d.diffs;if(0==e.length||0!=e[0][0])e.unshift([0,c]),d.start1-=b,d.start2-=b,d.length1+=b,d.length2+=b;else if(b>e[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0,
|
||||||
|
c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c};
|
||||||
|
diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c<a.length;c++)if(!(a[c].length1<=b)){var d=a[c];a.splice(c--,1);for(var e=d.start1,f=d.start2,g="";0!==d.diffs.length;){var h=new diff_match_patch.patch_obj,j=!0;h.start1=e-g.length;h.start2=f-g.length;""!==g&&(h.length1=h.length2=g.length,h.diffs.push([0,g]));for(;0!==d.diffs.length&&h.length1<b-this.Patch_Margin;){var g=d.diffs[0][0],i=d.diffs[0][1];1===g?(h.length2+=i.length,f+=i.length,h.diffs.push(d.diffs.shift()),
|
||||||
|
j=!1):-1===g&&1==h.diffs.length&&0==h.diffs[0][0]&&i.length>2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&&
|
||||||
|
(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b.join("")};
|
||||||
|
diff_match_patch.prototype.patch_fromText=function(a){var b=[];if(!a)return b;a=a.split("\n");for(var c=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;c<a.length;){var e=a[c].match(d);if(!e)throw Error("Invalid patch string: "+a[c]);var f=new diff_match_patch.patch_obj;b.push(f);f.start1=parseInt(e[1],10);""===e[2]?(f.start1--,f.length1=1):"0"==e[2]?f.length1=0:(f.start1--,f.length1=parseInt(e[2],10));f.start2=parseInt(e[3],10);""===e[4]?(f.start2--,f.length2=1):"0"==e[4]?f.length2=0:(f.start2--,f.length2=
|
||||||
|
parseInt(e[4],10));for(c++;c<a.length;){e=a[c].charAt(0);try{var g=decodeURI(a[c].substring(1))}catch(h){throw Error("Illegal escape in patch_fromText: "+g);}if("-"==e)f.diffs.push([-1,g]);else if("+"==e)f.diffs.push([1,g]);else if(" "==e)f.diffs.push([0,g]);else if("@"==e)break;else if(""!==e)throw Error('Invalid patch mode "'+e+'" in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0};
|
||||||
|
diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;b=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;a=["@@ -"+a+" +"+b+" @@\n"];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[b][0]){case 1:c="+";break;case -1:c="-";break;case 0:c=" "}a[b+1]=c+encodeURI(this.diffs[b][1])+"\n"}return a.join("").replace(/%20/g," ")};
|
||||||
|
this.diff_match_patch=diff_match_patch;this.DIFF_DELETE=-1;this.DIFF_INSERT=1;this.DIFF_EQUAL=0;})()
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
.CodeMirror-merge {
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-merge, .CodeMirror-merge .CodeMirror {
|
||||||
|
height: 350px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-merge-2pane .CodeMirror-merge-pane { width: 47%; }
|
||||||
|
.CodeMirror-merge-2pane .CodeMirror-merge-gap { width: 6%; }
|
||||||
|
.CodeMirror-merge-3pane .CodeMirror-merge-pane { width: 31%; }
|
||||||
|
.CodeMirror-merge-3pane .CodeMirror-merge-gap { width: 3.5%; }
|
||||||
|
|
||||||
|
.CodeMirror-merge-pane {
|
||||||
|
display: inline-block;
|
||||||
|
white-space: normal;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.CodeMirror-merge-pane-rightmost {
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-merge-gap {
|
||||||
|
z-index: 2;
|
||||||
|
display: inline-block;
|
||||||
|
height: 100%;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow: hidden;
|
||||||
|
border-left: 1px solid #ddd;
|
||||||
|
border-right: 1px solid #ddd;
|
||||||
|
position: relative;
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-merge-scrolllock-wrap {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0; left: 50%;
|
||||||
|
}
|
||||||
|
.CodeMirror-merge-scrolllock {
|
||||||
|
position: relative;
|
||||||
|
left: -50%;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #555;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right {
|
||||||
|
position: absolute;
|
||||||
|
left: 0; top: 0;
|
||||||
|
right: 0; bottom: 0;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-merge-copy {
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #44c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy { left: 2px; }
|
||||||
|
.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy { right: 2px; }
|
||||||
|
|
||||||
|
.CodeMirror-merge-r-inserted, .CodeMirror-merge-l-inserted {
|
||||||
|
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);
|
||||||
|
background-position: bottom left;
|
||||||
|
background-repeat: repeat-x;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-merge-r-deleted, .CodeMirror-merge-l-deleted {
|
||||||
|
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==);
|
||||||
|
background-position: bottom left;
|
||||||
|
background-repeat: repeat-x;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-merge-r-chunk { background: #ffffe0; }
|
||||||
|
.CodeMirror-merge-r-chunk-start { border-top: 1px solid #ee8; }
|
||||||
|
.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #ee8; }
|
||||||
|
.CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #ee8; stroke-width: 1px; }
|
||||||
|
|
||||||
|
.CodeMirror-merge-l-chunk { background: #eef; }
|
||||||
|
.CodeMirror-merge-l-chunk-start { border-top: 1px solid #88e; }
|
||||||
|
.CodeMirror-merge-l-chunk-end { border-bottom: 1px solid #88e; }
|
||||||
|
.CodeMirror-merge-l-connect { fill: #eef; stroke: #88e; stroke-width: 1px; }
|
||||||
|
|
||||||
|
.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk { background: #dfd; }
|
||||||
|
.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start { border-top: 1px solid #4e4; }
|
||||||
|
.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #4e4; }
|
||||||
@@ -0,0 +1,474 @@
|
|||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
// declare global: diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL
|
||||||
|
|
||||||
|
var Pos = CodeMirror.Pos;
|
||||||
|
var svgNS = "http://www.w3.org/2000/svg";
|
||||||
|
|
||||||
|
function DiffView(mv, type) {
|
||||||
|
this.mv = mv;
|
||||||
|
this.type = type;
|
||||||
|
this.classes = type == "left"
|
||||||
|
? {chunk: "CodeMirror-merge-l-chunk",
|
||||||
|
start: "CodeMirror-merge-l-chunk-start",
|
||||||
|
end: "CodeMirror-merge-l-chunk-end",
|
||||||
|
insert: "CodeMirror-merge-l-inserted",
|
||||||
|
del: "CodeMirror-merge-l-deleted",
|
||||||
|
connect: "CodeMirror-merge-l-connect"}
|
||||||
|
: {chunk: "CodeMirror-merge-r-chunk",
|
||||||
|
start: "CodeMirror-merge-r-chunk-start",
|
||||||
|
end: "CodeMirror-merge-r-chunk-end",
|
||||||
|
insert: "CodeMirror-merge-r-inserted",
|
||||||
|
del: "CodeMirror-merge-r-deleted",
|
||||||
|
connect: "CodeMirror-merge-r-connect"};
|
||||||
|
}
|
||||||
|
|
||||||
|
DiffView.prototype = {
|
||||||
|
constructor: DiffView,
|
||||||
|
init: function(pane, orig, options) {
|
||||||
|
this.edit = this.mv.edit;
|
||||||
|
this.orig = CodeMirror(pane, copyObj({value: orig, readOnly: true}, copyObj(options)));
|
||||||
|
|
||||||
|
this.diff = getDiff(orig, options.value);
|
||||||
|
this.diffOutOfDate = false;
|
||||||
|
|
||||||
|
this.showDifferences = options.showDifferences !== false;
|
||||||
|
this.forceUpdate = registerUpdate(this);
|
||||||
|
setScrollLock(this, true, false);
|
||||||
|
registerScroll(this);
|
||||||
|
},
|
||||||
|
setShowDifferences: function(val) {
|
||||||
|
val = val !== false;
|
||||||
|
if (val != this.showDifferences) {
|
||||||
|
this.showDifferences = val;
|
||||||
|
this.forceUpdate("full");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function registerUpdate(dv) {
|
||||||
|
var edit = {from: 0, to: 0, marked: []};
|
||||||
|
var orig = {from: 0, to: 0, marked: []};
|
||||||
|
var debounceChange;
|
||||||
|
function update(mode) {
|
||||||
|
if (mode == "full") {
|
||||||
|
if (dv.svg) clear(dv.svg);
|
||||||
|
clear(dv.copyButtons);
|
||||||
|
clearMarks(dv.edit, edit.marked, dv.classes);
|
||||||
|
clearMarks(dv.orig, orig.marked, dv.classes);
|
||||||
|
edit.from = edit.to = orig.from = orig.to = 0;
|
||||||
|
}
|
||||||
|
if (dv.diffOutOfDate) {
|
||||||
|
dv.diff = getDiff(dv.orig.getValue(), dv.edit.getValue());
|
||||||
|
dv.diffOutOfDate = false;
|
||||||
|
CodeMirror.signal(dv.edit, "updateDiff", dv.diff);
|
||||||
|
}
|
||||||
|
if (dv.showDifferences) {
|
||||||
|
updateMarks(dv.edit, dv.diff, edit, DIFF_INSERT, dv.classes);
|
||||||
|
updateMarks(dv.orig, dv.diff, orig, DIFF_DELETE, dv.classes);
|
||||||
|
}
|
||||||
|
drawConnectors(dv);
|
||||||
|
}
|
||||||
|
function set(slow) {
|
||||||
|
clearTimeout(debounceChange);
|
||||||
|
debounceChange = setTimeout(update, slow == true ? 250 : 100);
|
||||||
|
}
|
||||||
|
function change() {
|
||||||
|
if (!dv.diffOutOfDate) {
|
||||||
|
dv.diffOutOfDate = true;
|
||||||
|
edit.from = edit.to = orig.from = orig.to = 0;
|
||||||
|
}
|
||||||
|
set(true);
|
||||||
|
}
|
||||||
|
dv.edit.on("change", change);
|
||||||
|
dv.orig.on("change", change);
|
||||||
|
dv.edit.on("viewportChange", set);
|
||||||
|
dv.orig.on("viewportChange", set);
|
||||||
|
update();
|
||||||
|
return update;
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerScroll(dv) {
|
||||||
|
dv.edit.on("scroll", function() {
|
||||||
|
syncScroll(dv, DIFF_INSERT) && drawConnectors(dv);
|
||||||
|
});
|
||||||
|
dv.orig.on("scroll", function() {
|
||||||
|
syncScroll(dv, DIFF_DELETE) && drawConnectors(dv);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncScroll(dv, type) {
|
||||||
|
// Change handler will do a refresh after a timeout when diff is out of date
|
||||||
|
if (dv.diffOutOfDate) return false;
|
||||||
|
if (!dv.lockScroll) return true;
|
||||||
|
var editor, other, now = +new Date;
|
||||||
|
if (type == DIFF_INSERT) { editor = dv.edit; other = dv.orig; }
|
||||||
|
else { editor = dv.orig; other = dv.edit; }
|
||||||
|
// Don't take action if the position of this editor was recently set
|
||||||
|
// (to prevent feedback loops)
|
||||||
|
if (editor.state.scrollSetBy == dv && (editor.state.scrollSetAt || 0) + 50 > now) return false;
|
||||||
|
|
||||||
|
var sInfo = editor.getScrollInfo(), halfScreen = .5 * sInfo.clientHeight, midY = sInfo.top + halfScreen;
|
||||||
|
var mid = editor.lineAtHeight(midY, "local");
|
||||||
|
var around = chunkBoundariesAround(dv.diff, mid, type == DIFF_INSERT);
|
||||||
|
var off = getOffsets(editor, type == DIFF_INSERT ? around.edit : around.orig);
|
||||||
|
var offOther = getOffsets(other, type == DIFF_INSERT ? around.orig : around.edit);
|
||||||
|
var ratio = (midY - off.top) / (off.bot - off.top);
|
||||||
|
var targetPos = (offOther.top - halfScreen) + ratio * (offOther.bot - offOther.top);
|
||||||
|
|
||||||
|
var botDist, mix;
|
||||||
|
// Some careful tweaking to make sure no space is left out of view
|
||||||
|
// when scrolling to top or bottom.
|
||||||
|
if (targetPos > sInfo.top && (mix = sInfo.top / halfScreen) < 1) {
|
||||||
|
targetPos = targetPos * mix + sInfo.top * (1 - mix);
|
||||||
|
} else if ((botDist = sInfo.height - sInfo.clientHeight - sInfo.top) < halfScreen) {
|
||||||
|
var otherInfo = other.getScrollInfo();
|
||||||
|
var botDistOther = otherInfo.height - otherInfo.clientHeight - targetPos;
|
||||||
|
if (botDistOther > botDist && (mix = botDist / halfScreen) < 1)
|
||||||
|
targetPos = targetPos * mix + (otherInfo.height - otherInfo.clientHeight - botDist) * (1 - mix);
|
||||||
|
}
|
||||||
|
|
||||||
|
other.scrollTo(sInfo.left, targetPos);
|
||||||
|
other.state.scrollSetAt = now;
|
||||||
|
other.state.scrollSetBy = dv;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getOffsets(editor, around) {
|
||||||
|
var bot = around.after;
|
||||||
|
if (bot == null) bot = editor.lastLine() + 1;
|
||||||
|
return {top: editor.heightAtLine(around.before || 0, "local"),
|
||||||
|
bot: editor.heightAtLine(bot, "local")};
|
||||||
|
}
|
||||||
|
|
||||||
|
function setScrollLock(dv, val, action) {
|
||||||
|
dv.lockScroll = val;
|
||||||
|
if (val && action != false) syncScroll(dv, DIFF_INSERT) && drawConnectors(dv);
|
||||||
|
dv.lockButton.innerHTML = val ? "\u21db\u21da" : "\u21db \u21da";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Updating the marks for editor content
|
||||||
|
|
||||||
|
function clearMarks(editor, arr, classes) {
|
||||||
|
for (var i = 0; i < arr.length; ++i) {
|
||||||
|
var mark = arr[i];
|
||||||
|
if (mark instanceof CodeMirror.TextMarker) {
|
||||||
|
mark.clear();
|
||||||
|
} else {
|
||||||
|
editor.removeLineClass(mark, "background", classes.chunk);
|
||||||
|
editor.removeLineClass(mark, "background", classes.start);
|
||||||
|
editor.removeLineClass(mark, "background", classes.end);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
arr.length = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME maybe add a margin around viewport to prevent too many updates
|
||||||
|
function updateMarks(editor, diff, state, type, classes) {
|
||||||
|
var vp = editor.getViewport();
|
||||||
|
editor.operation(function() {
|
||||||
|
if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
|
||||||
|
clearMarks(editor, state.marked, classes);
|
||||||
|
markChanges(editor, diff, type, state.marked, vp.from, vp.to, classes);
|
||||||
|
state.from = vp.from; state.to = vp.to;
|
||||||
|
} else {
|
||||||
|
if (vp.from < state.from) {
|
||||||
|
markChanges(editor, diff, type, state.marked, vp.from, state.from, classes);
|
||||||
|
state.from = vp.from;
|
||||||
|
}
|
||||||
|
if (vp.to > state.to) {
|
||||||
|
markChanges(editor, diff, type, state.marked, state.to, vp.to, classes);
|
||||||
|
state.to = vp.to;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function markChanges(editor, diff, type, marks, from, to, classes) {
|
||||||
|
var pos = Pos(0, 0);
|
||||||
|
var top = Pos(from, 0), bot = editor.clipPos(Pos(to - 1));
|
||||||
|
var cls = type == DIFF_DELETE ? classes.del : classes.insert;
|
||||||
|
function markChunk(start, end) {
|
||||||
|
var bfrom = Math.max(from, start), bto = Math.min(to, end);
|
||||||
|
for (var i = bfrom; i < bto; ++i) {
|
||||||
|
var line = editor.addLineClass(i, "background", classes.chunk);
|
||||||
|
if (i == start) editor.addLineClass(line, "background", classes.start);
|
||||||
|
if (i == end - 1) editor.addLineClass(line, "background", classes.end);
|
||||||
|
marks.push(line);
|
||||||
|
}
|
||||||
|
// When the chunk is empty, make sure a horizontal line shows up
|
||||||
|
if (start == end && bfrom == end && bto == end) {
|
||||||
|
if (bfrom)
|
||||||
|
marks.push(editor.addLineClass(bfrom - 1, "background", classes.end));
|
||||||
|
else
|
||||||
|
marks.push(editor.addLineClass(bfrom, "background", classes.start));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var chunkStart = 0;
|
||||||
|
for (var i = 0; i < diff.length; ++i) {
|
||||||
|
var part = diff[i], tp = part[0], str = part[1];
|
||||||
|
if (tp == DIFF_EQUAL) {
|
||||||
|
var cleanFrom = pos.line + (startOfLineClean(diff, i) ? 0 : 1);
|
||||||
|
moveOver(pos, str);
|
||||||
|
var cleanTo = pos.line + (endOfLineClean(diff, i) ? 1 : 0);
|
||||||
|
if (cleanTo > cleanFrom) {
|
||||||
|
if (i) markChunk(chunkStart, cleanFrom);
|
||||||
|
chunkStart = cleanTo;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (tp == type) {
|
||||||
|
var end = moveOver(pos, str, true);
|
||||||
|
var a = posMax(top, pos), b = posMin(bot, end);
|
||||||
|
if (!posEq(a, b))
|
||||||
|
marks.push(editor.markText(a, b, {className: cls}));
|
||||||
|
pos = end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (chunkStart <= pos.line) markChunk(chunkStart, pos.line + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Updating the gap between editor and original
|
||||||
|
|
||||||
|
function drawConnectors(dv) {
|
||||||
|
if (!dv.showDifferences) return;
|
||||||
|
|
||||||
|
if (dv.svg) {
|
||||||
|
clear(dv.svg);
|
||||||
|
var w = dv.gap.offsetWidth;
|
||||||
|
attrs(dv.svg, "width", w, "height", dv.gap.offsetHeight);
|
||||||
|
}
|
||||||
|
clear(dv.copyButtons);
|
||||||
|
|
||||||
|
var flip = dv.type == "left";
|
||||||
|
var vpEdit = dv.edit.getViewport(), vpOrig = dv.orig.getViewport();
|
||||||
|
var sTopEdit = dv.edit.getScrollInfo().top, sTopOrig = dv.orig.getScrollInfo().top;
|
||||||
|
iterateChunks(dv.diff, function(topOrig, botOrig, topEdit, botEdit) {
|
||||||
|
if (topEdit > vpEdit.to || botEdit < vpEdit.from ||
|
||||||
|
topOrig > vpOrig.to || botOrig < vpOrig.from)
|
||||||
|
return;
|
||||||
|
var topLpx = dv.orig.heightAtLine(topOrig, "local") - sTopOrig, top = topLpx;
|
||||||
|
if (dv.svg) {
|
||||||
|
var topRpx = dv.edit.heightAtLine(topEdit, "local") - sTopEdit;
|
||||||
|
if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; }
|
||||||
|
var botLpx = dv.orig.heightAtLine(botOrig, "local") - sTopOrig;
|
||||||
|
var botRpx = dv.edit.heightAtLine(botEdit, "local") - sTopEdit;
|
||||||
|
if (flip) { var tmp = botLpx; botLpx = botRpx; botRpx = tmp; }
|
||||||
|
var curveTop = " C " + w/2 + " " + topRpx + " " + w/2 + " " + topLpx + " " + (w + 2) + " " + topLpx;
|
||||||
|
var curveBot = " C " + w/2 + " " + botLpx + " " + w/2 + " " + botRpx + " -1 " + botRpx;
|
||||||
|
attrs(dv.svg.appendChild(document.createElementNS(svgNS, "path")),
|
||||||
|
"d", "M -1 " + topRpx + curveTop + " L " + (w + 2) + " " + botLpx + curveBot + " z",
|
||||||
|
"class", dv.classes.connect);
|
||||||
|
}
|
||||||
|
var copy = dv.copyButtons.appendChild(elt("div", dv.type == "left" ? "\u21dd" : "\u21dc",
|
||||||
|
"CodeMirror-merge-copy"));
|
||||||
|
copy.title = "Revert chunk";
|
||||||
|
copy.chunk = {topEdit: topEdit, botEdit: botEdit, topOrig: topOrig, botOrig: botOrig};
|
||||||
|
copy.style.top = top + "px";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyChunk(dv, chunk) {
|
||||||
|
if (dv.diffOutOfDate) return;
|
||||||
|
dv.edit.replaceRange(dv.orig.getRange(Pos(chunk.topOrig, 0), Pos(chunk.botOrig, 0)),
|
||||||
|
Pos(chunk.topEdit, 0), Pos(chunk.botEdit, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Merge view, containing 0, 1, or 2 diff views.
|
||||||
|
|
||||||
|
var MergeView = CodeMirror.MergeView = function(node, options) {
|
||||||
|
if (!(this instanceof MergeView)) return new MergeView(node, options);
|
||||||
|
|
||||||
|
var origLeft = options.origLeft, origRight = options.origRight == null ? options.orig : options.origRight;
|
||||||
|
var hasLeft = origLeft != null, hasRight = origRight != null;
|
||||||
|
var panes = 1 + (hasLeft ? 1 : 0) + (hasRight ? 1 : 0);
|
||||||
|
var wrap = [], left = this.left = null, right = this.right = null;
|
||||||
|
|
||||||
|
if (hasLeft) {
|
||||||
|
left = this.left = new DiffView(this, "left");
|
||||||
|
var leftPane = elt("div", null, "CodeMirror-merge-pane");
|
||||||
|
wrap.push(leftPane);
|
||||||
|
wrap.push(buildGap(left));
|
||||||
|
}
|
||||||
|
|
||||||
|
var editPane = elt("div", null, "CodeMirror-merge-pane");
|
||||||
|
wrap.push(editPane);
|
||||||
|
|
||||||
|
if (hasRight) {
|
||||||
|
right = this.right = new DiffView(this, "right");
|
||||||
|
wrap.push(buildGap(right));
|
||||||
|
var rightPane = elt("div", null, "CodeMirror-merge-pane");
|
||||||
|
wrap.push(rightPane);
|
||||||
|
}
|
||||||
|
|
||||||
|
(hasRight ? rightPane : editPane).className += " CodeMirror-merge-pane-rightmost";
|
||||||
|
|
||||||
|
wrap.push(elt("div", null, null, "height: 0; clear: both;"));
|
||||||
|
var wrapElt = this.wrap = node.appendChild(elt("div", wrap, "CodeMirror-merge CodeMirror-merge-" + panes + "pane"));
|
||||||
|
this.edit = CodeMirror(editPane, copyObj(options));
|
||||||
|
|
||||||
|
if (left) left.init(leftPane, origLeft, options);
|
||||||
|
if (right) right.init(rightPane, origRight, options);
|
||||||
|
|
||||||
|
var onResize = function() {
|
||||||
|
if (left) drawConnectors(left);
|
||||||
|
if (right) drawConnectors(right);
|
||||||
|
};
|
||||||
|
CodeMirror.on(window, "resize", onResize);
|
||||||
|
var resizeInterval = setInterval(function() {
|
||||||
|
for (var p = wrapElt.parentNode; p && p != document.body; p = p.parentNode) {}
|
||||||
|
if (!p) { clearInterval(resizeInterval); CodeMirror.off(window, "resize", onResize); }
|
||||||
|
}, 5000);
|
||||||
|
};
|
||||||
|
|
||||||
|
function buildGap(dv) {
|
||||||
|
var lock = dv.lockButton = elt("div", null, "CodeMirror-merge-scrolllock");
|
||||||
|
lock.title = "Toggle locked scrolling";
|
||||||
|
var lockWrap = elt("div", [lock], "CodeMirror-merge-scrolllock-wrap");
|
||||||
|
CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); });
|
||||||
|
dv.copyButtons = elt("div", null, "CodeMirror-merge-copybuttons-" + dv.type);
|
||||||
|
CodeMirror.on(dv.copyButtons, "click", function(e) {
|
||||||
|
var node = e.target || e.srcElement;
|
||||||
|
if (node.chunk) copyChunk(dv, node.chunk);
|
||||||
|
});
|
||||||
|
var gapElts = [dv.copyButtons, lockWrap];
|
||||||
|
var svg = document.createElementNS && document.createElementNS(svgNS, "svg");
|
||||||
|
if (svg && !svg.createSVGRect) svg = null;
|
||||||
|
dv.svg = svg;
|
||||||
|
if (svg) gapElts.push(svg);
|
||||||
|
|
||||||
|
return dv.gap = elt("div", gapElts, "CodeMirror-merge-gap");
|
||||||
|
}
|
||||||
|
|
||||||
|
MergeView.prototype = {
|
||||||
|
constuctor: MergeView,
|
||||||
|
editor: function() { return this.edit; },
|
||||||
|
rightOriginal: function() { return this.right && this.right.orig; },
|
||||||
|
leftOriginal: function() { return this.left && this.left.orig; },
|
||||||
|
setShowDifferences: function(val) {
|
||||||
|
if (this.right) this.right.setShowDifferences(val);
|
||||||
|
if (this.left) this.left.setShowDifferences(val);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Operations on diffs
|
||||||
|
|
||||||
|
var dmp = new diff_match_patch();
|
||||||
|
function getDiff(a, b) {
|
||||||
|
var diff = dmp.diff_main(a, b);
|
||||||
|
dmp.diff_cleanupSemantic(diff);
|
||||||
|
// The library sometimes leaves in empty parts, which confuse the algorithm
|
||||||
|
for (var i = 0; i < diff.length; ++i) {
|
||||||
|
var part = diff[i];
|
||||||
|
if (!part[1]) {
|
||||||
|
diff.splice(i--, 1);
|
||||||
|
} else if (i && diff[i - 1][0] == part[0]) {
|
||||||
|
diff.splice(i--, 1);
|
||||||
|
diff[i][1] += part[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return diff;
|
||||||
|
}
|
||||||
|
|
||||||
|
function iterateChunks(diff, f) {
|
||||||
|
var startEdit = 0, startOrig = 0;
|
||||||
|
var edit = Pos(0, 0), orig = Pos(0, 0);
|
||||||
|
for (var i = 0; i < diff.length; ++i) {
|
||||||
|
var part = diff[i], tp = part[0];
|
||||||
|
if (tp == DIFF_EQUAL) {
|
||||||
|
var startOff = startOfLineClean(diff, i) ? 0 : 1;
|
||||||
|
var cleanFromEdit = edit.line + startOff, cleanFromOrig = orig.line + startOff;
|
||||||
|
moveOver(edit, part[1], null, orig);
|
||||||
|
var endOff = endOfLineClean(diff, i) ? 1 : 0;
|
||||||
|
var cleanToEdit = edit.line + endOff, cleanToOrig = orig.line + endOff;
|
||||||
|
if (cleanToEdit > cleanFromEdit) {
|
||||||
|
if (i) f(startOrig, cleanFromOrig, startEdit, cleanFromEdit);
|
||||||
|
startEdit = cleanToEdit; startOrig = cleanToOrig;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
moveOver(tp == DIFF_INSERT ? edit : orig, part[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (startEdit <= edit.line || startOrig <= orig.line)
|
||||||
|
f(startOrig, orig.line + 1, startEdit, edit.line + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
function endOfLineClean(diff, i) {
|
||||||
|
if (i == diff.length - 1) return true;
|
||||||
|
var next = diff[i + 1][1];
|
||||||
|
if (next.length == 1 || next.charCodeAt(0) != 10) return false;
|
||||||
|
if (i == diff.length - 2) return true;
|
||||||
|
next = diff[i + 2][1];
|
||||||
|
return next.length > 1 && next.charCodeAt(0) == 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
function startOfLineClean(diff, i) {
|
||||||
|
if (i == 0) return true;
|
||||||
|
var last = diff[i - 1][1];
|
||||||
|
if (last.charCodeAt(last.length - 1) != 10) return false;
|
||||||
|
if (i == 1) return true;
|
||||||
|
last = diff[i - 2][1];
|
||||||
|
return last.charCodeAt(last.length - 1) == 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
function chunkBoundariesAround(diff, n, nInEdit) {
|
||||||
|
var beforeE, afterE, beforeO, afterO;
|
||||||
|
iterateChunks(diff, function(fromOrig, toOrig, fromEdit, toEdit) {
|
||||||
|
var fromLocal = nInEdit ? fromEdit : fromOrig;
|
||||||
|
var toLocal = nInEdit ? toEdit : toOrig;
|
||||||
|
if (afterE == null) {
|
||||||
|
if (fromLocal > n) { afterE = fromEdit; afterO = fromOrig; }
|
||||||
|
else if (toLocal > n) { afterE = toEdit; afterO = toOrig; }
|
||||||
|
}
|
||||||
|
if (toLocal <= n) { beforeE = toEdit; beforeO = toOrig; }
|
||||||
|
else if (fromLocal <= n) { beforeE = fromEdit; beforeO = fromOrig; }
|
||||||
|
});
|
||||||
|
return {edit: {before: beforeE, after: afterE}, orig: {before: beforeO, after: afterO}};
|
||||||
|
}
|
||||||
|
|
||||||
|
// General utilities
|
||||||
|
|
||||||
|
function elt(tag, content, className, style) {
|
||||||
|
var e = document.createElement(tag);
|
||||||
|
if (className) e.className = className;
|
||||||
|
if (style) e.style.cssText = style;
|
||||||
|
if (typeof content == "string") e.appendChild(document.createTextNode(content));
|
||||||
|
else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
function clear(node) {
|
||||||
|
for (var count = node.childNodes.length; count > 0; --count)
|
||||||
|
node.removeChild(node.firstChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
function attrs(elt) {
|
||||||
|
for (var i = 1; i < arguments.length; i += 2)
|
||||||
|
elt.setAttribute(arguments[i], arguments[i+1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyObj(obj, target) {
|
||||||
|
if (!target) target = {};
|
||||||
|
for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop];
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
function moveOver(pos, str, copy, other) {
|
||||||
|
var out = copy ? Pos(pos.line, pos.ch) : pos, at = 0;
|
||||||
|
for (;;) {
|
||||||
|
var nl = str.indexOf("\n", at);
|
||||||
|
if (nl == -1) break;
|
||||||
|
++out.line;
|
||||||
|
if (other) ++other.line;
|
||||||
|
at = nl + 1;
|
||||||
|
}
|
||||||
|
out.ch = (at ? 0 : out.ch) + (str.length - at);
|
||||||
|
if (other) other.ch = (at ? 0 : other.ch) + (str.length - at);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
function posMin(a, b) { return (a.line - b.line || a.ch - b.ch) < 0 ? a : b; }
|
||||||
|
function posMax(a, b) { return (a.line - b.line || a.ch - b.ch) > 0 ? a : b; }
|
||||||
|
function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
|
||||||
|
})();
|
||||||
+28
-8
@@ -1,5 +1,5 @@
|
|||||||
CodeMirror.multiplexingMode = function(outer /*, others */) {
|
CodeMirror.multiplexingMode = function(outer /*, others */) {
|
||||||
// Others should be {open, close, mode [, delimStyle]} objects
|
// Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects
|
||||||
var others = Array.prototype.slice.call(arguments, 1);
|
var others = Array.prototype.slice.call(arguments, 1);
|
||||||
var n_others = others.length;
|
var n_others = others.length;
|
||||||
|
|
||||||
@@ -58,6 +58,12 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
|
|||||||
if (found > -1) stream.string = oldContent;
|
if (found > -1) stream.string = oldContent;
|
||||||
var cur = stream.current(), found = cur.indexOf(curInner.close);
|
var cur = stream.current(), found = cur.indexOf(curInner.close);
|
||||||
if (found > -1) stream.backUp(cur.length - found);
|
if (found > -1) stream.backUp(cur.length - found);
|
||||||
|
|
||||||
|
if (curInner.innerStyle) {
|
||||||
|
if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle;
|
||||||
|
else innerToken = curInner.innerStyle;
|
||||||
|
}
|
||||||
|
|
||||||
return innerToken;
|
return innerToken;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -68,14 +74,28 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
|
|||||||
return mode.indent(state.innerActive ? state.inner : state.outer, textAfter);
|
return mode.indent(state.innerActive ? state.inner : state.outer, textAfter);
|
||||||
},
|
},
|
||||||
|
|
||||||
compareStates: function(a, b) {
|
blankLine: function(state) {
|
||||||
if (a.innerActive != b.innerActive) return false;
|
var mode = state.innerActive ? state.innerActive.mode : outer;
|
||||||
var mode = a.innerActive || outer;
|
if (mode.blankLine) {
|
||||||
if (!mode.compareStates) return CodeMirror.Pass;
|
mode.blankLine(state.innerActive ? state.inner : state.outer);
|
||||||
return mode.compareStates(a.innerActive ? a.inner : a.outer,
|
}
|
||||||
b.innerActive ? b.inner : b.outer);
|
if (!state.innerActive) {
|
||||||
|
for (var i = 0; i < n_others; ++i) {
|
||||||
|
var other = others[i];
|
||||||
|
if (other.open === "\n") {
|
||||||
|
state.innerActive = other;
|
||||||
|
state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (state.innerActive.close === "\n") {
|
||||||
|
state.innerActive = state.inner = null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
electricChars: outer.electricChars
|
electricChars: outer.electricChars,
|
||||||
|
|
||||||
|
innerMode: function(state) {
|
||||||
|
return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
(function() {
|
||||||
|
CodeMirror.defineMode("markdown_with_stex", function(){
|
||||||
|
var inner = CodeMirror.getMode({}, "stex");
|
||||||
|
var outer = CodeMirror.getMode({}, "markdown");
|
||||||
|
|
||||||
|
var innerOptions = {
|
||||||
|
open: '$',
|
||||||
|
close: '$',
|
||||||
|
mode: inner,
|
||||||
|
delimStyle: 'delim',
|
||||||
|
innerStyle: 'inner'
|
||||||
|
};
|
||||||
|
|
||||||
|
return CodeMirror.multiplexingMode(outer, innerOptions);
|
||||||
|
});
|
||||||
|
|
||||||
|
var mode = CodeMirror.getMode({}, "markdown_with_stex");
|
||||||
|
|
||||||
|
function MT(name) {
|
||||||
|
test.mode(
|
||||||
|
name,
|
||||||
|
mode,
|
||||||
|
Array.prototype.slice.call(arguments, 1),
|
||||||
|
'multiplexing');
|
||||||
|
}
|
||||||
|
|
||||||
|
MT(
|
||||||
|
"stexInsideMarkdown",
|
||||||
|
"[strong **Equation:**] [delim $][inner&tag \\pi][delim $]");
|
||||||
|
})();
|
||||||
+8
-1
@@ -47,6 +47,13 @@ CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, comb
|
|||||||
indent: base.indent && function(state, textAfter) {
|
indent: base.indent && function(state, textAfter) {
|
||||||
return base.indent(state.base, textAfter);
|
return base.indent(state.base, textAfter);
|
||||||
},
|
},
|
||||||
electricChars: base.electricChars
|
electricChars: base.electricChars,
|
||||||
|
|
||||||
|
innerMode: function(state) { return {state: state.base, mode: base}; },
|
||||||
|
|
||||||
|
blankLine: function(state) {
|
||||||
|
if (base.blankLine) base.blankLine(state.base);
|
||||||
|
if (overlay.blankLine) overlay.blankLine(state.overlay);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
CodeMirror.colorize = (function() {
|
||||||
|
|
||||||
|
var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/;
|
||||||
|
|
||||||
|
function textContent(node, out) {
|
||||||
|
if (node.nodeType == 3) return out.push(node.nodeValue);
|
||||||
|
for (var ch = node.firstChild; ch; ch = ch.nextSibling) {
|
||||||
|
textContent(ch, out);
|
||||||
|
if (isBlock.test(node.nodeType)) out.push("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return function(collection, defaultMode) {
|
||||||
|
if (!collection) collection = document.body.getElementsByTagName("pre");
|
||||||
|
|
||||||
|
for (var i = 0; i < collection.length; ++i) {
|
||||||
|
var node = collection[i];
|
||||||
|
var mode = node.getAttribute("data-lang") || defaultMode;
|
||||||
|
if (!mode) continue;
|
||||||
|
|
||||||
|
var text = [];
|
||||||
|
textContent(node, text);
|
||||||
|
node.innerHTML = "";
|
||||||
|
CodeMirror.runMode(text.join(""), mode, node);
|
||||||
|
|
||||||
|
node.className += " cm-s-default";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})();
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
/* Just enough of CodeMirror to run runMode under node.js */
|
||||||
|
|
||||||
|
window.CodeMirror = {};
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function splitLines(string){ return string.split(/\r?\n|\r/); };
|
||||||
|
|
||||||
|
function StringStream(string) {
|
||||||
|
this.pos = this.start = 0;
|
||||||
|
this.string = string;
|
||||||
|
}
|
||||||
|
StringStream.prototype = {
|
||||||
|
eol: function() {return this.pos >= this.string.length;},
|
||||||
|
sol: function() {return this.pos == 0;},
|
||||||
|
peek: function() {return this.string.charAt(this.pos) || null;},
|
||||||
|
next: function() {
|
||||||
|
if (this.pos < this.string.length)
|
||||||
|
return this.string.charAt(this.pos++);
|
||||||
|
},
|
||||||
|
eat: function(match) {
|
||||||
|
var ch = this.string.charAt(this.pos);
|
||||||
|
if (typeof match == "string") var ok = ch == match;
|
||||||
|
else var ok = ch && (match.test ? match.test(ch) : match(ch));
|
||||||
|
if (ok) {++this.pos; return ch;}
|
||||||
|
},
|
||||||
|
eatWhile: function(match) {
|
||||||
|
var start = this.pos;
|
||||||
|
while (this.eat(match)){}
|
||||||
|
return this.pos > start;
|
||||||
|
},
|
||||||
|
eatSpace: function() {
|
||||||
|
var start = this.pos;
|
||||||
|
while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
|
||||||
|
return this.pos > start;
|
||||||
|
},
|
||||||
|
skipToEnd: function() {this.pos = this.string.length;},
|
||||||
|
skipTo: function(ch) {
|
||||||
|
var found = this.string.indexOf(ch, this.pos);
|
||||||
|
if (found > -1) {this.pos = found; return true;}
|
||||||
|
},
|
||||||
|
backUp: function(n) {this.pos -= n;},
|
||||||
|
column: function() {return this.start;},
|
||||||
|
indentation: function() {return 0;},
|
||||||
|
match: function(pattern, consume, caseInsensitive) {
|
||||||
|
if (typeof pattern == "string") {
|
||||||
|
var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
|
||||||
|
var substr = this.string.substr(this.pos, pattern.length);
|
||||||
|
if (cased(substr) == cased(pattern)) {
|
||||||
|
if (consume !== false) this.pos += pattern.length;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var match = this.string.slice(this.pos).match(pattern);
|
||||||
|
if (match && match.index > 0) return null;
|
||||||
|
if (match && consume !== false) this.pos += match[0].length;
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
current: function(){return this.string.slice(this.start, this.pos);}
|
||||||
|
};
|
||||||
|
CodeMirror.StringStream = StringStream;
|
||||||
|
|
||||||
|
CodeMirror.startState = function (mode, a1, a2) {
|
||||||
|
return mode.startState ? mode.startState(a1, a2) : true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};
|
||||||
|
CodeMirror.defineMode = function (name, mode) { modes[name] = mode; };
|
||||||
|
CodeMirror.defineMIME = function (mime, spec) { mimeModes[mime] = spec; };
|
||||||
|
CodeMirror.getMode = function (options, spec) {
|
||||||
|
if (typeof spec == "string" && mimeModes.hasOwnProperty(spec))
|
||||||
|
spec = mimeModes[spec];
|
||||||
|
if (typeof spec == "string")
|
||||||
|
var mname = spec, config = {};
|
||||||
|
else if (spec != null)
|
||||||
|
var mname = spec.name, config = spec;
|
||||||
|
var mfactory = modes[mname];
|
||||||
|
if (!mfactory) throw new Error("Unknown mode: " + spec);
|
||||||
|
return mfactory(options, config || {});
|
||||||
|
};
|
||||||
|
|
||||||
|
CodeMirror.runMode = function (string, modespec, callback, options) {
|
||||||
|
var mode = CodeMirror.getMode({ indentUnit: 2 }, modespec);
|
||||||
|
|
||||||
|
if (callback.nodeType == 1) {
|
||||||
|
var tabSize = (options && options.tabSize) || 4;
|
||||||
|
var node = callback, col = 0;
|
||||||
|
node.innerHTML = "";
|
||||||
|
callback = function (text, style) {
|
||||||
|
if (text == "\n") {
|
||||||
|
node.appendChild(document.createElement("br"));
|
||||||
|
col = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var content = "";
|
||||||
|
// replace tabs
|
||||||
|
for (var pos = 0; ;) {
|
||||||
|
var idx = text.indexOf("\t", pos);
|
||||||
|
if (idx == -1) {
|
||||||
|
content += text.slice(pos);
|
||||||
|
col += text.length - pos;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
col += idx - pos;
|
||||||
|
content += text.slice(pos, idx);
|
||||||
|
var size = tabSize - col % tabSize;
|
||||||
|
col += size;
|
||||||
|
for (var i = 0; i < size; ++i) content += " ";
|
||||||
|
pos = idx + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (style) {
|
||||||
|
var sp = node.appendChild(document.createElement("span"));
|
||||||
|
sp.className = "cm-" + style.replace(/ +/g, " cm-");
|
||||||
|
sp.appendChild(document.createTextNode(content));
|
||||||
|
} else {
|
||||||
|
node.appendChild(document.createTextNode(content));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var lines = splitLines(string), state = CodeMirror.startState(mode);
|
||||||
|
for (var i = 0, e = lines.length; i < e; ++i) {
|
||||||
|
if (i) callback("\n");
|
||||||
|
var stream = new CodeMirror.StringStream(lines[i]);
|
||||||
|
while (!stream.eol()) {
|
||||||
|
var style = mode.token(stream, state);
|
||||||
|
callback(stream.current(), style, i, stream.start, state);
|
||||||
|
stream.start = stream.pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})();
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
CodeMirror.runMode = function(string, modespec, callback, options) {
|
||||||
|
var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
|
||||||
|
var ie = /MSIE \d/.test(navigator.userAgent);
|
||||||
|
var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
|
||||||
|
|
||||||
|
if (callback.nodeType == 1) {
|
||||||
|
var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
|
||||||
|
var node = callback, col = 0;
|
||||||
|
node.innerHTML = "";
|
||||||
|
callback = function(text, style) {
|
||||||
|
if (text == "\n") {
|
||||||
|
// Emitting LF or CRLF on IE8 or earlier results in an incorrect display.
|
||||||
|
// Emitting a carriage return makes everything ok.
|
||||||
|
node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text));
|
||||||
|
col = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var content = "";
|
||||||
|
// replace tabs
|
||||||
|
for (var pos = 0;;) {
|
||||||
|
var idx = text.indexOf("\t", pos);
|
||||||
|
if (idx == -1) {
|
||||||
|
content += text.slice(pos);
|
||||||
|
col += text.length - pos;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
col += idx - pos;
|
||||||
|
content += text.slice(pos, idx);
|
||||||
|
var size = tabSize - col % tabSize;
|
||||||
|
col += size;
|
||||||
|
for (var i = 0; i < size; ++i) content += " ";
|
||||||
|
pos = idx + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (style) {
|
||||||
|
var sp = node.appendChild(document.createElement("span"));
|
||||||
|
sp.className = "cm-" + style.replace(/ +/g, " cm-");
|
||||||
|
sp.appendChild(document.createTextNode(content));
|
||||||
|
} else {
|
||||||
|
node.appendChild(document.createTextNode(content));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
|
||||||
|
for (var i = 0, e = lines.length; i < e; ++i) {
|
||||||
|
if (i) callback("\n");
|
||||||
|
var stream = new CodeMirror.StringStream(lines[i]);
|
||||||
|
while (!stream.eol()) {
|
||||||
|
var style = mode.token(stream, state);
|
||||||
|
callback(stream.current(), style, i, stream.start, state);
|
||||||
|
stream.start = stream.pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
/* Just enough of CodeMirror to run runMode under node.js */
|
||||||
|
|
||||||
|
function splitLines(string){ return string.split(/\r?\n|\r/); };
|
||||||
|
|
||||||
|
function StringStream(string) {
|
||||||
|
this.pos = this.start = 0;
|
||||||
|
this.string = string;
|
||||||
|
}
|
||||||
|
StringStream.prototype = {
|
||||||
|
eol: function() {return this.pos >= this.string.length;},
|
||||||
|
sol: function() {return this.pos == 0;},
|
||||||
|
peek: function() {return this.string.charAt(this.pos) || null;},
|
||||||
|
next: function() {
|
||||||
|
if (this.pos < this.string.length)
|
||||||
|
return this.string.charAt(this.pos++);
|
||||||
|
},
|
||||||
|
eat: function(match) {
|
||||||
|
var ch = this.string.charAt(this.pos);
|
||||||
|
if (typeof match == "string") var ok = ch == match;
|
||||||
|
else var ok = ch && (match.test ? match.test(ch) : match(ch));
|
||||||
|
if (ok) {++this.pos; return ch;}
|
||||||
|
},
|
||||||
|
eatWhile: function(match) {
|
||||||
|
var start = this.pos;
|
||||||
|
while (this.eat(match)){}
|
||||||
|
return this.pos > start;
|
||||||
|
},
|
||||||
|
eatSpace: function() {
|
||||||
|
var start = this.pos;
|
||||||
|
while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
|
||||||
|
return this.pos > start;
|
||||||
|
},
|
||||||
|
skipToEnd: function() {this.pos = this.string.length;},
|
||||||
|
skipTo: function(ch) {
|
||||||
|
var found = this.string.indexOf(ch, this.pos);
|
||||||
|
if (found > -1) {this.pos = found; return true;}
|
||||||
|
},
|
||||||
|
backUp: function(n) {this.pos -= n;},
|
||||||
|
column: function() {return this.start;},
|
||||||
|
indentation: function() {return 0;},
|
||||||
|
match: function(pattern, consume, caseInsensitive) {
|
||||||
|
if (typeof pattern == "string") {
|
||||||
|
var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
|
||||||
|
var substr = this.string.substr(this.pos, pattern.length);
|
||||||
|
if (cased(substr) == cased(pattern)) {
|
||||||
|
if (consume !== false) this.pos += pattern.length;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var match = this.string.slice(this.pos).match(pattern);
|
||||||
|
if (match && match.index > 0) return null;
|
||||||
|
if (match && consume !== false) this.pos += match[0].length;
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
current: function(){return this.string.slice(this.start, this.pos);}
|
||||||
|
};
|
||||||
|
exports.StringStream = StringStream;
|
||||||
|
|
||||||
|
exports.startState = function(mode, a1, a2) {
|
||||||
|
return mode.startState ? mode.startState(a1, a2) : true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var modes = exports.modes = {}, mimeModes = exports.mimeModes = {};
|
||||||
|
exports.defineMode = function(name, mode) {
|
||||||
|
if (arguments.length > 2) {
|
||||||
|
mode.dependencies = [];
|
||||||
|
for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]);
|
||||||
|
}
|
||||||
|
modes[name] = mode;
|
||||||
|
};
|
||||||
|
exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; };
|
||||||
|
|
||||||
|
exports.defineMode("null", function() {
|
||||||
|
return {token: function(stream) {stream.skipToEnd();}};
|
||||||
|
});
|
||||||
|
exports.defineMIME("text/plain", "null");
|
||||||
|
|
||||||
|
exports.getMode = function(options, spec) {
|
||||||
|
if (typeof spec == "string" && mimeModes.hasOwnProperty(spec))
|
||||||
|
spec = mimeModes[spec];
|
||||||
|
if (typeof spec == "string")
|
||||||
|
var mname = spec, config = {};
|
||||||
|
else if (spec != null)
|
||||||
|
var mname = spec.name, config = spec;
|
||||||
|
var mfactory = modes[mname];
|
||||||
|
if (!mfactory) throw new Error("Unknown mode: " + spec);
|
||||||
|
return mfactory(options, config || {});
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.runMode = function(string, modespec, callback) {
|
||||||
|
var mode = exports.getMode({indentUnit: 2}, modespec);
|
||||||
|
var lines = splitLines(string), state = exports.startState(mode);
|
||||||
|
for (var i = 0, e = lines.length; i < e; ++i) {
|
||||||
|
if (i) callback("\n");
|
||||||
|
var stream = new exports.StringStream(lines[i]);
|
||||||
|
while (!stream.eol()) {
|
||||||
|
var style = mode.token(stream, state);
|
||||||
|
callback(stream.current(), style, i, stream.start, state);
|
||||||
|
stream.start = stream.pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
// Highlighting text that matches the selection
|
||||||
|
//
|
||||||
|
// Defines an option highlightSelectionMatches, which, when enabled,
|
||||||
|
// will style strings that match the selection throughout the
|
||||||
|
// document.
|
||||||
|
//
|
||||||
|
// The option can be set to true to simply enable it, or to a
|
||||||
|
// {minChars, style, showToken} object to explicitly configure it.
|
||||||
|
// minChars is the minimum amount of characters that should be
|
||||||
|
// selected for the behavior to occur, and style is the token style to
|
||||||
|
// apply to the matches. This will be prefixed by "cm-" to create an
|
||||||
|
// actual CSS class name. showToken, when enabled, will cause the
|
||||||
|
// current token to be highlighted when nothing is selected.
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var DEFAULT_MIN_CHARS = 2;
|
||||||
|
var DEFAULT_TOKEN_STYLE = "matchhighlight";
|
||||||
|
var DEFAULT_DELAY = 100;
|
||||||
|
|
||||||
|
function State(options) {
|
||||||
|
if (typeof options == "object") {
|
||||||
|
this.minChars = options.minChars;
|
||||||
|
this.style = options.style;
|
||||||
|
this.showToken = options.showToken;
|
||||||
|
this.delay = options.delay;
|
||||||
|
}
|
||||||
|
if (this.style == null) this.style = DEFAULT_TOKEN_STYLE;
|
||||||
|
if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS;
|
||||||
|
if (this.delay == null) this.delay = DEFAULT_DELAY;
|
||||||
|
this.overlay = this.timeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
|
||||||
|
if (old && old != CodeMirror.Init) {
|
||||||
|
var over = cm.state.matchHighlighter.overlay;
|
||||||
|
if (over) cm.removeOverlay(over);
|
||||||
|
clearTimeout(cm.state.matchHighlighter.timeout);
|
||||||
|
cm.state.matchHighlighter = null;
|
||||||
|
cm.off("cursorActivity", cursorActivity);
|
||||||
|
}
|
||||||
|
if (val) {
|
||||||
|
cm.state.matchHighlighter = new State(val);
|
||||||
|
highlightMatches(cm);
|
||||||
|
cm.on("cursorActivity", cursorActivity);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function cursorActivity(cm) {
|
||||||
|
var state = cm.state.matchHighlighter;
|
||||||
|
clearTimeout(state.timeout);
|
||||||
|
state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
function highlightMatches(cm) {
|
||||||
|
cm.operation(function() {
|
||||||
|
var state = cm.state.matchHighlighter;
|
||||||
|
if (state.overlay) {
|
||||||
|
cm.removeOverlay(state.overlay);
|
||||||
|
state.overlay = null;
|
||||||
|
}
|
||||||
|
if (!cm.somethingSelected() && state.showToken) {
|
||||||
|
var re = state.showToken === true ? /[\w$]/ : state.showToken;
|
||||||
|
var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
|
||||||
|
while (start && re.test(line.charAt(start - 1))) --start;
|
||||||
|
while (end < line.length && re.test(line.charAt(end))) ++end;
|
||||||
|
if (start < end)
|
||||||
|
cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (cm.getCursor("head").line != cm.getCursor("anchor").line) return;
|
||||||
|
var selection = cm.getSelection().replace(/^\s+|\s+$/g, "");
|
||||||
|
if (selection.length >= state.minChars)
|
||||||
|
cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function boundariesAround(stream, re) {
|
||||||
|
return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) &&
|
||||||
|
(stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos)));
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeOverlay(query, hasBoundary, style) {
|
||||||
|
return {token: function(stream) {
|
||||||
|
if (stream.match(query) &&
|
||||||
|
(!hasBoundary || boundariesAround(stream, hasBoundary)))
|
||||||
|
return style;
|
||||||
|
stream.next();
|
||||||
|
stream.skipTo(query.charAt(0)) || stream.skipToEnd();
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
})();
|
||||||
+30
-17
@@ -7,12 +7,27 @@
|
|||||||
// Ctrl-G.
|
// Ctrl-G.
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
function searchOverlay(query) {
|
||||||
|
if (typeof query == "string") return {token: function(stream) {
|
||||||
|
if (stream.match(query)) return "searching";
|
||||||
|
stream.next();
|
||||||
|
stream.skipTo(query.charAt(0)) || stream.skipToEnd();
|
||||||
|
}};
|
||||||
|
return {token: function(stream) {
|
||||||
|
if (stream.match(query)) return "searching";
|
||||||
|
while (!stream.eol()) {
|
||||||
|
stream.next();
|
||||||
|
if (stream.match(query, false)) break;
|
||||||
|
}
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
function SearchState() {
|
function SearchState() {
|
||||||
this.posFrom = this.posTo = this.query = null;
|
this.posFrom = this.posTo = this.query = null;
|
||||||
this.marked = [];
|
this.overlay = null;
|
||||||
}
|
}
|
||||||
function getSearchState(cm) {
|
function getSearchState(cm) {
|
||||||
return cm._searchState || (cm._searchState = new SearchState());
|
return cm.state.search || (cm.state.search = new SearchState());
|
||||||
}
|
}
|
||||||
function getSearchCursor(cm, query, pos) {
|
function getSearchCursor(cm, query, pos) {
|
||||||
// Heuristic: if the query string is all lowercase, do a case insensitive search.
|
// Heuristic: if the query string is all lowercase, do a case insensitive search.
|
||||||
@@ -39,10 +54,9 @@
|
|||||||
cm.operation(function() {
|
cm.operation(function() {
|
||||||
if (!query || state.query) return;
|
if (!query || state.query) return;
|
||||||
state.query = parseQuery(query);
|
state.query = parseQuery(query);
|
||||||
if (cm.lineCount() < 2000) { // This is too expensive on big documents.
|
cm.removeOverlay(state.overlay);
|
||||||
for (var cursor = getSearchCursor(cm, state.query); cursor.findNext();)
|
state.overlay = searchOverlay(state.query);
|
||||||
state.marked.push(cm.markText(cursor.from(), cursor.to(), "CodeMirror-searching"));
|
cm.addOverlay(state.overlay);
|
||||||
}
|
|
||||||
state.posFrom = state.posTo = cm.getCursor();
|
state.posFrom = state.posTo = cm.getCursor();
|
||||||
findNext(cm, rev);
|
findNext(cm, rev);
|
||||||
});
|
});
|
||||||
@@ -52,7 +66,7 @@
|
|||||||
var state = getSearchState(cm);
|
var state = getSearchState(cm);
|
||||||
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
|
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
|
||||||
if (!cursor.find(rev)) {
|
if (!cursor.find(rev)) {
|
||||||
cursor = getSearchCursor(cm, state.query, rev ? {line: cm.lineCount() - 1} : {line: 0, ch: 0});
|
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
|
||||||
if (!cursor.find(rev)) return;
|
if (!cursor.find(rev)) return;
|
||||||
}
|
}
|
||||||
cm.setSelection(cursor.from(), cursor.to());
|
cm.setSelection(cursor.from(), cursor.to());
|
||||||
@@ -62,8 +76,7 @@
|
|||||||
var state = getSearchState(cm);
|
var state = getSearchState(cm);
|
||||||
if (!state.query) return;
|
if (!state.query) return;
|
||||||
state.query = null;
|
state.query = null;
|
||||||
for (var i = 0; i < state.marked.length; ++i) state.marked[i].clear();
|
cm.removeOverlay(state.overlay);
|
||||||
state.marked.length = 0;
|
|
||||||
});}
|
});}
|
||||||
|
|
||||||
var replaceQueryDialog =
|
var replaceQueryDialog =
|
||||||
@@ -76,18 +89,18 @@
|
|||||||
query = parseQuery(query);
|
query = parseQuery(query);
|
||||||
dialog(cm, replacementQueryDialog, "Replace with:", function(text) {
|
dialog(cm, replacementQueryDialog, "Replace with:", function(text) {
|
||||||
if (all) {
|
if (all) {
|
||||||
cm.compoundChange(function() { cm.operation(function() {
|
cm.operation(function() {
|
||||||
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
|
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
|
||||||
if (typeof query != "string") {
|
if (typeof query != "string") {
|
||||||
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
|
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
|
||||||
cursor.replace(text.replace(/\$(\d)/, function(w, i) {return match[i];}));
|
cursor.replace(text.replace(/\$(\d)/, function(_, i) {return match[i];}));
|
||||||
} else cursor.replace(text);
|
} else cursor.replace(text);
|
||||||
}
|
}
|
||||||
});});
|
});
|
||||||
} else {
|
} else {
|
||||||
clearSearch(cm);
|
clearSearch(cm);
|
||||||
var cursor = getSearchCursor(cm, query, cm.getCursor());
|
var cursor = getSearchCursor(cm, query, cm.getCursor());
|
||||||
function advance() {
|
var advance = function() {
|
||||||
var start = cursor.from(), match;
|
var start = cursor.from(), match;
|
||||||
if (!(match = cursor.findNext())) {
|
if (!(match = cursor.findNext())) {
|
||||||
cursor = getSearchCursor(cm, query);
|
cursor = getSearchCursor(cm, query);
|
||||||
@@ -97,12 +110,12 @@
|
|||||||
cm.setSelection(cursor.from(), cursor.to());
|
cm.setSelection(cursor.from(), cursor.to());
|
||||||
confirmDialog(cm, doReplaceConfirm, "Replace?",
|
confirmDialog(cm, doReplaceConfirm, "Replace?",
|
||||||
[function() {doReplace(match);}, advance]);
|
[function() {doReplace(match);}, advance]);
|
||||||
}
|
};
|
||||||
function doReplace(match) {
|
var doReplace = function(match) {
|
||||||
cursor.replace(typeof query == "string" ? text :
|
cursor.replace(typeof query == "string" ? text :
|
||||||
text.replace(/\$(\d)/, function(w, i) {return match[i];}));
|
text.replace(/\$(\d)/, function(_, i) {return match[i];}));
|
||||||
advance();
|
advance();
|
||||||
}
|
};
|
||||||
advance();
|
advance();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
(function(){
|
||||||
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
|
function SearchCursor(doc, query, pos, caseFold) {
|
||||||
|
this.atOccurrence = false; this.doc = doc;
|
||||||
|
if (caseFold == null && typeof query == "string") caseFold = false;
|
||||||
|
|
||||||
|
pos = pos ? doc.clipPos(pos) : Pos(0, 0);
|
||||||
|
this.pos = {from: pos, to: pos};
|
||||||
|
|
||||||
|
// The matches method is filled in based on the type of query.
|
||||||
|
// It takes a position and a direction, and returns an object
|
||||||
|
// describing the next occurrence of the query, or null if no
|
||||||
|
// more matches were found.
|
||||||
|
if (typeof query != "string") { // Regexp match
|
||||||
|
if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
|
||||||
|
this.matches = function(reverse, pos) {
|
||||||
|
if (reverse) {
|
||||||
|
query.lastIndex = 0;
|
||||||
|
var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;
|
||||||
|
for (;;) {
|
||||||
|
query.lastIndex = cutOff;
|
||||||
|
var newMatch = query.exec(line);
|
||||||
|
if (!newMatch) break;
|
||||||
|
match = newMatch;
|
||||||
|
start = match.index;
|
||||||
|
cutOff = match.index + (match[0].length || 1);
|
||||||
|
if (cutOff == line.length) break;
|
||||||
|
}
|
||||||
|
var matchLen = (match && match[0].length) || 0;
|
||||||
|
if (!matchLen) {
|
||||||
|
if (start == 0 && line.length == 0) {match = undefined;}
|
||||||
|
else if (start != doc.getLine(pos.line).length) {
|
||||||
|
matchLen++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
query.lastIndex = pos.ch;
|
||||||
|
var line = doc.getLine(pos.line), match = query.exec(line);
|
||||||
|
var matchLen = (match && match[0].length) || 0;
|
||||||
|
var start = match && match.index;
|
||||||
|
if (start + matchLen != line.length && !matchLen) matchLen = 1;
|
||||||
|
}
|
||||||
|
if (match && matchLen)
|
||||||
|
return {from: Pos(pos.line, start),
|
||||||
|
to: Pos(pos.line, start + matchLen),
|
||||||
|
match: match};
|
||||||
|
};
|
||||||
|
} else { // String query
|
||||||
|
if (caseFold) query = query.toLowerCase();
|
||||||
|
var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
|
||||||
|
var target = query.split("\n");
|
||||||
|
// Different methods for single-line and multi-line queries
|
||||||
|
if (target.length == 1) {
|
||||||
|
if (!query.length) {
|
||||||
|
// Empty string would match anything and never progress, so
|
||||||
|
// we define it to match nothing instead.
|
||||||
|
this.matches = function() {};
|
||||||
|
} else {
|
||||||
|
this.matches = function(reverse, pos) {
|
||||||
|
var line = fold(doc.getLine(pos.line)), len = query.length, match;
|
||||||
|
if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1)
|
||||||
|
: (match = line.indexOf(query, pos.ch)) != -1)
|
||||||
|
return {from: Pos(pos.line, match),
|
||||||
|
to: Pos(pos.line, match + len)};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.matches = function(reverse, pos) {
|
||||||
|
var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(doc.getLine(ln));
|
||||||
|
var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match));
|
||||||
|
if (reverse ? offsetA > pos.ch || offsetA != match.length
|
||||||
|
: offsetA < pos.ch || offsetA != line.length - match.length)
|
||||||
|
return;
|
||||||
|
for (;;) {
|
||||||
|
if (reverse ? !ln : ln == doc.lineCount() - 1) return;
|
||||||
|
line = fold(doc.getLine(ln += reverse ? -1 : 1));
|
||||||
|
match = target[reverse ? --idx : ++idx];
|
||||||
|
if (idx > 0 && idx < target.length - 1) {
|
||||||
|
if (line != match) return;
|
||||||
|
else continue;
|
||||||
|
}
|
||||||
|
var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length);
|
||||||
|
if (reverse ? offsetB != line.length - match.length : offsetB != match.length)
|
||||||
|
return;
|
||||||
|
var start = Pos(pos.line, offsetA), end = Pos(ln, offsetB);
|
||||||
|
return {from: reverse ? end : start, to: reverse ? start : end};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchCursor.prototype = {
|
||||||
|
findNext: function() {return this.find(false);},
|
||||||
|
findPrevious: function() {return this.find(true);},
|
||||||
|
|
||||||
|
find: function(reverse) {
|
||||||
|
var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
|
||||||
|
function savePosAndFail(line) {
|
||||||
|
var pos = Pos(line, 0);
|
||||||
|
self.pos = {from: pos, to: pos};
|
||||||
|
self.atOccurrence = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
if (this.pos = this.matches(reverse, pos)) {
|
||||||
|
if (!this.pos.from || !this.pos.to) { console.log(this.matches, this.pos); }
|
||||||
|
this.atOccurrence = true;
|
||||||
|
return this.pos.match || true;
|
||||||
|
}
|
||||||
|
if (reverse) {
|
||||||
|
if (!pos.line) return savePosAndFail(0);
|
||||||
|
pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var maxLine = this.doc.lineCount();
|
||||||
|
if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
|
||||||
|
pos = Pos(pos.line + 1, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
from: function() {if (this.atOccurrence) return this.pos.from;},
|
||||||
|
to: function() {if (this.atOccurrence) return this.pos.to;},
|
||||||
|
|
||||||
|
replace: function(newText) {
|
||||||
|
if (!this.atOccurrence) return;
|
||||||
|
var lines = CodeMirror.splitLines(newText);
|
||||||
|
this.doc.replaceRange(lines, this.pos.from, this.pos.to);
|
||||||
|
this.pos.to = Pos(this.pos.from.line + lines.length - 1,
|
||||||
|
lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
|
||||||
|
return new SearchCursor(this.doc, query, pos, caseFold);
|
||||||
|
});
|
||||||
|
CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {
|
||||||
|
return new SearchCursor(this, query, pos, caseFold);
|
||||||
|
});
|
||||||
|
})();
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
// Because sometimes you need to style the cursor's line.
|
||||||
|
//
|
||||||
|
// Adds an option 'styleActiveLine' which, when enabled, gives the
|
||||||
|
// active line's wrapping <div> the CSS class "CodeMirror-activeline",
|
||||||
|
// and gives its background <div> the class "CodeMirror-activeline-background".
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
var WRAP_CLASS = "CodeMirror-activeline";
|
||||||
|
var BACK_CLASS = "CodeMirror-activeline-background";
|
||||||
|
|
||||||
|
CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {
|
||||||
|
var prev = old && old != CodeMirror.Init;
|
||||||
|
if (val && !prev) {
|
||||||
|
updateActiveLine(cm);
|
||||||
|
cm.on("cursorActivity", updateActiveLine);
|
||||||
|
} else if (!val && prev) {
|
||||||
|
cm.off("cursorActivity", updateActiveLine);
|
||||||
|
clearActiveLine(cm);
|
||||||
|
delete cm.state.activeLine;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function clearActiveLine(cm) {
|
||||||
|
if ("activeLine" in cm.state) {
|
||||||
|
cm.removeLineClass(cm.state.activeLine, "wrap", WRAP_CLASS);
|
||||||
|
cm.removeLineClass(cm.state.activeLine, "background", BACK_CLASS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateActiveLine(cm) {
|
||||||
|
var line = cm.getLineHandleVisualStart(cm.getCursor().line);
|
||||||
|
if (cm.state.activeLine == line) return;
|
||||||
|
clearActiveLine(cm);
|
||||||
|
cm.addLineClass(line, "wrap", WRAP_CLASS);
|
||||||
|
cm.addLineClass(line, "background", BACK_CLASS);
|
||||||
|
cm.state.activeLine = line;
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
// Because sometimes you need to mark the selected *text*.
|
||||||
|
//
|
||||||
|
// Adds an option 'styleSelectedText' which, when enabled, gives
|
||||||
|
// selected text the CSS class given as option value, or
|
||||||
|
// "CodeMirror-selectedtext" when the value is not a string.
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
CodeMirror.defineOption("styleSelectedText", false, function(cm, val, old) {
|
||||||
|
var prev = old && old != CodeMirror.Init;
|
||||||
|
if (val && !prev) {
|
||||||
|
cm.state.markedSelection = [];
|
||||||
|
cm.state.markedSelectionStyle = typeof val == "string" ? val : "CodeMirror-selectedtext";
|
||||||
|
reset(cm);
|
||||||
|
cm.on("cursorActivity", onCursorActivity);
|
||||||
|
cm.on("change", onChange);
|
||||||
|
} else if (!val && prev) {
|
||||||
|
cm.off("cursorActivity", onCursorActivity);
|
||||||
|
cm.off("change", onChange);
|
||||||
|
clear(cm);
|
||||||
|
cm.state.markedSelection = cm.state.markedSelectionStyle = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function onCursorActivity(cm) {
|
||||||
|
cm.operation(function() { update(cm); });
|
||||||
|
}
|
||||||
|
|
||||||
|
function onChange(cm) {
|
||||||
|
if (cm.state.markedSelection.length)
|
||||||
|
cm.operation(function() { clear(cm); });
|
||||||
|
}
|
||||||
|
|
||||||
|
var CHUNK_SIZE = 8;
|
||||||
|
var Pos = CodeMirror.Pos;
|
||||||
|
|
||||||
|
function cmp(pos1, pos2) {
|
||||||
|
return pos1.line - pos2.line || pos1.ch - pos2.ch;
|
||||||
|
}
|
||||||
|
|
||||||
|
function coverRange(cm, from, to, addAt) {
|
||||||
|
if (cmp(from, to) == 0) return;
|
||||||
|
var array = cm.state.markedSelection;
|
||||||
|
var cls = cm.state.markedSelectionStyle;
|
||||||
|
for (var line = from.line;;) {
|
||||||
|
var start = line == from.line ? from : Pos(line, 0);
|
||||||
|
var endLine = line + CHUNK_SIZE, atEnd = endLine >= to.line;
|
||||||
|
var end = atEnd ? to : Pos(endLine, 0);
|
||||||
|
var mark = cm.markText(start, end, {className: cls});
|
||||||
|
if (addAt == null) array.push(mark);
|
||||||
|
else array.splice(addAt++, 0, mark);
|
||||||
|
if (atEnd) break;
|
||||||
|
line = endLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function clear(cm) {
|
||||||
|
var array = cm.state.markedSelection;
|
||||||
|
for (var i = 0; i < array.length; ++i) array[i].clear();
|
||||||
|
array.length = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset(cm) {
|
||||||
|
clear(cm);
|
||||||
|
var from = cm.getCursor("start"), to = cm.getCursor("end");
|
||||||
|
coverRange(cm, from, to);
|
||||||
|
}
|
||||||
|
|
||||||
|
function update(cm) {
|
||||||
|
var from = cm.getCursor("start"), to = cm.getCursor("end");
|
||||||
|
if (cmp(from, to) == 0) return clear(cm);
|
||||||
|
|
||||||
|
var array = cm.state.markedSelection;
|
||||||
|
if (!array.length) return coverRange(cm, from, to);
|
||||||
|
|
||||||
|
var coverStart = array[0].find(), coverEnd = array[array.length - 1].find();
|
||||||
|
if (!coverStart || !coverEnd || to.line - from.line < CHUNK_SIZE ||
|
||||||
|
cmp(from, coverEnd.to) >= 0 || cmp(to, coverStart.from) <= 0)
|
||||||
|
return reset(cm);
|
||||||
|
|
||||||
|
while (cmp(from, coverStart.from) > 0) {
|
||||||
|
array.shift().clear();
|
||||||
|
coverStart = array[0].find();
|
||||||
|
}
|
||||||
|
if (cmp(from, coverStart.from) < 0) {
|
||||||
|
if (coverStart.to.line - from.line < CHUNK_SIZE) {
|
||||||
|
array.shift().clear();
|
||||||
|
coverRange(cm, from, coverStart.to, 0);
|
||||||
|
} else {
|
||||||
|
coverRange(cm, from, coverStart.from, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (cmp(to, coverEnd.to) < 0) {
|
||||||
|
array.pop().clear();
|
||||||
|
coverEnd = array[array.length - 1].find();
|
||||||
|
}
|
||||||
|
if (cmp(to, coverEnd.to) > 0) {
|
||||||
|
if (to.line - coverEnd.from.line < CHUNK_SIZE) {
|
||||||
|
array.pop().clear();
|
||||||
|
coverRange(cm, coverEnd.from, to);
|
||||||
|
} else {
|
||||||
|
coverRange(cm, coverEnd.to, to);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
+92
@@ -0,0 +1,92 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
// Compression helper for CodeMirror
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
//
|
||||||
|
// bin/compress codemirror runmode javascript xml
|
||||||
|
//
|
||||||
|
// Will take lib/codemirror.js, addon/runmode/runmode.js,
|
||||||
|
// mode/javascript/javascript.js, and mode/xml/xml.js, run them though
|
||||||
|
// the online minifier at http://marijnhaverbeke.nl/uglifyjs, and spit
|
||||||
|
// out the result.
|
||||||
|
//
|
||||||
|
// bin/compress codemirror --local /path/to/bin/UglifyJS
|
||||||
|
//
|
||||||
|
// Will use a local minifier instead of the online default one.
|
||||||
|
//
|
||||||
|
// Script files are specified without .js ending. Prefixing them with
|
||||||
|
// their full (local) path is optional. So you may say lib/codemirror
|
||||||
|
// or mode/xml/xml to be more precise. In fact, even the .js suffix
|
||||||
|
// may be speficied, if wanted.
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var fs = require("fs");
|
||||||
|
|
||||||
|
function help(ok) {
|
||||||
|
console.log("usage: " + process.argv[1] + " [--local /path/to/uglifyjs] files...");
|
||||||
|
process.exit(ok ? 0 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var local = null, args = [], extraArgs = null, files = [], blob = "";
|
||||||
|
|
||||||
|
for (var i = 2; i < process.argv.length; ++i) {
|
||||||
|
var arg = process.argv[i];
|
||||||
|
if (arg == "--local" && i + 1 < process.argv.length) {
|
||||||
|
var parts = process.argv[++i].split(/\s+/);
|
||||||
|
local = parts[0];
|
||||||
|
extraArgs = parts.slice(1);
|
||||||
|
if (!extraArgs.length) extraArgs = ["-c", "-m"];
|
||||||
|
} else if (arg == "--help") {
|
||||||
|
help(true);
|
||||||
|
} else if (arg[0] != "-") {
|
||||||
|
files.push({name: arg, re: new RegExp("(?:\\/|^)" + arg + (/\.js$/.test(arg) ? "$" : "\\.js$"))});
|
||||||
|
} else help(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function walk(dir) {
|
||||||
|
fs.readdirSync(dir).forEach(function(fname) {
|
||||||
|
if (/^[_\.]/.test(fname)) return;
|
||||||
|
var file = dir + fname;
|
||||||
|
if (fs.statSync(file).isDirectory()) return walk(file + "/");
|
||||||
|
if (files.some(function(spec, i) {
|
||||||
|
var match = spec.re.test(file);
|
||||||
|
if (match) files.splice(i, 1);
|
||||||
|
return match;
|
||||||
|
})) {
|
||||||
|
if (local) args.push(file);
|
||||||
|
else blob += fs.readFileSync(file, "utf8");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
walk("lib/");
|
||||||
|
walk("addon/");
|
||||||
|
walk("mode/");
|
||||||
|
|
||||||
|
if (!local && !blob) help(false);
|
||||||
|
|
||||||
|
if (files.length) {
|
||||||
|
console.log("Some speficied files were not found: " +
|
||||||
|
files.map(function(a){return a.name;}).join(", "));
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (local) {
|
||||||
|
require("child_process").spawn(local, args.concat(extraArgs), {stdio: ["ignore", process.stdout, process.stderr]});
|
||||||
|
} else {
|
||||||
|
var data = new Buffer("js_code=" + require("querystring").escape(blob), "utf8");
|
||||||
|
var req = require("http").request({
|
||||||
|
host: "marijnhaverbeke.nl",
|
||||||
|
port: 80,
|
||||||
|
method: "POST",
|
||||||
|
path: "/uglifyjs",
|
||||||
|
headers: {"content-type": "application/x-www-form-urlencoded",
|
||||||
|
"content-length": data.length}
|
||||||
|
});
|
||||||
|
req.on("response", function(resp) {
|
||||||
|
resp.on("data", function (chunk) { process.stdout.write(chunk); });
|
||||||
|
});
|
||||||
|
req.end(data);
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var lint = require("../test/lint/lint"),
|
||||||
|
path = require("path");
|
||||||
|
|
||||||
|
if (process.argv.length > 2) {
|
||||||
|
lint.checkDir(process.argv[2]);
|
||||||
|
} else {
|
||||||
|
process.chdir(path.resolve(__dirname, ".."));
|
||||||
|
lint.checkDir("lib");
|
||||||
|
lint.checkDir("mode");
|
||||||
|
lint.checkDir("addon");
|
||||||
|
lint.checkDir("keymap");
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(lint.success() ? 0 : 1);
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
// Simple command-line code highlighting tool. Reads code from stdin,
|
||||||
|
// spits html to stdout. For example:
|
||||||
|
//
|
||||||
|
// echo 'function foo(a) { return a; }' | bin/source-highlight -s javascript
|
||||||
|
// bin/source-highlight -s
|
||||||
|
|
||||||
|
var fs = require("fs");
|
||||||
|
|
||||||
|
CodeMirror = require("../addon/runmode/runmode.node.js");
|
||||||
|
require("../mode/meta.js");
|
||||||
|
|
||||||
|
var sPos = process.argv.indexOf("-s");
|
||||||
|
if (sPos == -1 || sPos == process.argv.length - 1) {
|
||||||
|
console.error("Usage: source-highlight -s language");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang;
|
||||||
|
CodeMirror.modeInfo.forEach(function(info) {
|
||||||
|
if (info.mime == lang) {
|
||||||
|
modeName = info.mode;
|
||||||
|
} else if (info.name.toLowerCase() == lang) {
|
||||||
|
modeName = info.mode;
|
||||||
|
lang = info.mime;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function ensureMode(name) {
|
||||||
|
if (CodeMirror.modes[name] || name == "null") return;
|
||||||
|
try {
|
||||||
|
require("../mode/" + name + "/" + name + ".js");
|
||||||
|
} catch(e) {
|
||||||
|
console.error("Could not load mode " + name + ".");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
var obj = CodeMirror.modes[name];
|
||||||
|
if (obj.dependencies) obj.dependencies.forEach(ensureMode);
|
||||||
|
}
|
||||||
|
ensureMode(modeName);
|
||||||
|
|
||||||
|
function esc(str) {
|
||||||
|
return str.replace(/[<&]/, function(ch) { return ch == "&" ? "&" : "<"; });
|
||||||
|
}
|
||||||
|
|
||||||
|
var code = fs.readFileSync("/dev/stdin", "utf8");
|
||||||
|
var curStyle = null, accum = "";
|
||||||
|
function flush() {
|
||||||
|
if (curStyle) process.stdout.write("<span class=\"" + curStyle.replace(/(^|\s+)/g, "$1cm-") + "\">" + esc(accum) + "</span>");
|
||||||
|
else process.stdout.write(esc(accum));
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeMirror.runMode(code, lang, function(text, style) {
|
||||||
|
if (style != curStyle) {
|
||||||
|
flush();
|
||||||
|
curStyle = style; accum = text;
|
||||||
|
} else {
|
||||||
|
accum += text;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
flush();
|
||||||
+293
-273
@@ -1,284 +1,304 @@
|
|||||||
/* from http://code.google.com/p/zen-coding/ MIT license */
|
var _=function(){function h(a,b,c){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;if(a._chain)a=a._wrapped;if(b._chain)b=b._wrapped;if(a.isEqual&&k.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&k.isFunction(b.isEqual))return b.isEqual(a);var e=g.call(a);if(e!=g.call(b))return!1;switch(e){case "[object String]":return a==String(b);case "[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case "[object Date]":case "[object Boolean]":return+a==+b;case "[object RegExp]":return a.source==
|
||||||
var _=function(){function h(a,b,d){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;if(a._chain)a=a._wrapped;if(b._chain)b=b._wrapped;if(a.isEqual&&k.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&k.isFunction(b.isEqual))return b.isEqual(a);var c=i.call(a);if(c!=i.call(b))return!1;switch(c){case "[object String]":return a==String(b);case "[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case "[object Date]":case "[object Boolean]":return+a==+b;case "[object RegExp]":return a.source==
|
b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return!1;for(var d=c.length;d--;)if(c[d]==a)return!0;c.push(a);var d=0,j=!0;if(e=="[object Array]"){if(d=a.length,j=d==b.length)for(;d--;)if(!(j=d in a==d in b&&h(a[d],b[d],c)))break}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return!1;for(var f in a)if(k.has(a,f)&&(d++,!(j=k.has(b,f)&&h(a[f],b[f],c))))break;if(j){for(f in b)if(k.has(b,f)&&!d--)break;
|
||||||
b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return!1;for(var e=d.length;e--;)if(d[e]==a)return!0;d.push(a);var e=0,f=!0;if(c=="[object Array]"){if(e=a.length,f=e==b.length)for(;e--;)if(!(f=e in a==e in b&&h(a[e],b[e],d)))break}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return!1;for(var j in a)if(k.has(a,j)&&(e++,!(f=k.has(b,j)&&h(a[j],b[j],d))))break;if(f){for(j in b)if(k.has(b,j)&&!e--)break;
|
j=!d}}c.pop();return j}var d=this,f=d._,i={},b=Array.prototype,c=Object.prototype,a=b.slice,e=b.unshift,g=c.toString,j=c.hasOwnProperty,l=b.forEach,m=b.map,n=b.reduce,o=b.reduceRight,q=b.filter,s=b.every,r=b.some,u=b.indexOf,p=b.lastIndexOf,c=Array.isArray,v=Object.keys,w=Function.prototype.bind,k=function(a){return new y(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=k;exports._=k}else d._=k;k.VERSION="1.3.3";var t=k.each=k.forEach=function(a,
|
||||||
f=!e}}d.pop();return f}var e=this,g=e._,f={},c=Array.prototype,b=Object.prototype,a=c.slice,d=c.unshift,i=b.toString,j=b.hasOwnProperty,l=c.forEach,n=c.map,m=c.reduce,o=c.reduceRight,q=c.filter,r=c.every,t=c.some,x=c.indexOf,u=c.lastIndexOf,b=Array.isArray,z=Object.keys,A=Function.prototype.bind,k=function(a){return new B(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=k;exports._=k}else e._=k;k.VERSION="1.3.3";var v=k.each=k.forEach=function(a,
|
b,c){if(a!=null)if(l&&a.forEach===l)a.forEach(b,c);else if(a.length===+a.length)for(var g=0,e=a.length;g<e;g++){if(g in a&&b.call(c,a[g],g,a)===i)break}else for(g in a)if(k.has(a,g)&&b.call(c,a[g],g,a)===i)break};k.map=k.collect=function(a,b,c){var g=[];if(a==null)return g;if(m&&a.map===m)return a.map(b,c);t(a,function(a,e,d){g[g.length]=b.call(c,a,e,d)});if(a.length===+a.length)g.length=a.length;return g};k.reduce=k.foldl=k.inject=function(a,b,c,g){var e=arguments.length>2;a==null&&(a=[]);if(n&&
|
||||||
b,d){if(a!=null)if(l&&a.forEach===l)a.forEach(b,d);else if(a.length===+a.length)for(var c=0,e=a.length;c<e;c++){if(c in a&&b.call(d,a[c],c,a)===f)break}else for(c in a)if(k.has(a,c)&&b.call(d,a[c],c,a)===f)break};k.map=k.collect=function(a,b,c){var d=[];if(a==null)return d;if(n&&a.map===n)return a.map(b,c);v(a,function(a,e,i){d[d.length]=b.call(c,a,e,i)});if(a.length===+a.length)d.length=a.length;return d};k.reduce=k.foldl=k.inject=function(a,b,d,c){var e=arguments.length>2;a==null&&(a=[]);if(m&&
|
a.reduce===n)return g&&(b=k.bind(b,g)),e?a.reduce(b,c):a.reduce(b);t(a,function(a,d,j){e?c=b.call(g,c,a,d,j):(c=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c};k.reduceRight=k.foldr=function(a,b,c,g){var e=arguments.length>2;a==null&&(a=[]);if(o&&a.reduceRight===o)return g&&(b=k.bind(b,g)),e?a.reduceRight(b,c):a.reduceRight(b);var d=k.toArray(a).reverse();g&&!e&&(b=k.bind(b,g));return e?k.reduce(d,b,c,g):k.reduce(d,b)};k.find=k.detect=function(a,b,c){var g;
|
||||||
a.reduce===m)return c&&(b=k.bind(b,c)),e?a.reduce(b,d):a.reduce(b);v(a,function(a,i,f){e?d=b.call(c,d,a,i,f):(d=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return d};k.reduceRight=k.foldr=function(a,b,d,c){var e=arguments.length>2;a==null&&(a=[]);if(o&&a.reduceRight===o)return c&&(b=k.bind(b,c)),e?a.reduceRight(b,d):a.reduceRight(b);var i=k.toArray(a).reverse();c&&!e&&(b=k.bind(b,c));return e?k.reduce(i,b,d,c):k.reduce(i,b)};k.find=k.detect=function(a,b,d){var c;
|
z(a,function(a,e,d){if(b.call(c,a,e,d))return g=a,!0});return g};k.filter=k.select=function(a,b,c){var g=[];if(a==null)return g;if(q&&a.filter===q)return a.filter(b,c);t(a,function(a,e,d){b.call(c,a,e,d)&&(g[g.length]=a)});return g};k.reject=function(a,b,c){var g=[];if(a==null)return g;t(a,function(a,e,d){b.call(c,a,e,d)||(g[g.length]=a)});return g};k.every=k.all=function(a,b,c){var g=!0;if(a==null)return g;if(s&&a.every===s)return a.every(b,c);t(a,function(a,e,d){if(!(g=g&&b.call(c,a,e,d)))return i});
|
||||||
F(a,function(a,e,i){if(b.call(d,a,e,i))return c=a,!0});return c};k.filter=k.select=function(a,b,d){var c=[];if(a==null)return c;if(q&&a.filter===q)return a.filter(b,d);v(a,function(a,e,i){b.call(d,a,e,i)&&(c[c.length]=a)});return c};k.reject=function(a,b,c){var d=[];if(a==null)return d;v(a,function(a,e,i){b.call(c,a,e,i)||(d[d.length]=a)});return d};k.every=k.all=function(a,b,d){var c=!0;if(a==null)return c;if(r&&a.every===r)return a.every(b,d);v(a,function(a,e,i){if(!(c=c&&b.call(d,a,e,i)))return f});
|
return!!g};var z=k.some=k.any=function(a,b,c){b||(b=k.identity);var g=!1;if(a==null)return g;if(r&&a.some===r)return a.some(b,c);t(a,function(a,e,d){if(g||(g=b.call(c,a,e,d)))return i});return!!g};k.include=k.contains=function(a,b){var c=!1;return a==null?c:u&&a.indexOf===u?a.indexOf(b)!=-1:c=z(a,function(a){return a===b})};k.invoke=function(b,c){var g=a.call(arguments,2);return k.map(b,function(a){return(k.isFunction(c)?c||a:a[c]).apply(a,g)})};k.pluck=function(a,b){return k.map(a,function(a){return a[b]})};
|
||||||
return!!c};var F=k.some=k.any=function(a,b,c){b||(b=k.identity);var d=!1;if(a==null)return d;if(t&&a.some===t)return a.some(b,c);v(a,function(a,e,i){if(d||(d=b.call(c,a,e,i)))return f});return!!d};k.include=k.contains=function(a,b){var d=!1;return a==null?d:x&&a.indexOf===x?a.indexOf(b)!=-1:d=F(a,function(a){return a===b})};k.invoke=function(b,d){var c=a.call(arguments,2);return k.map(b,function(a){return(k.isFunction(d)?d||a:a[d]).apply(a,c)})};k.pluck=function(a,b){return k.map(a,function(a){return a[b]})};
|
k.max=function(a,b,c){if(!b&&k.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!b&&k.isEmpty(a))return-Infinity;var g={computed:-Infinity};t(a,function(a,e,d){e=b?b.call(c,a,e,d):a;e>=g.computed&&(g={value:a,computed:e})});return g.value};k.min=function(a,b,c){if(!b&&k.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!b&&k.isEmpty(a))return Infinity;var g={computed:Infinity};t(a,function(a,e,d){e=b?b.call(c,a,e,d):a;e<g.computed&&(g={value:a,computed:e})});return g.value};k.shuffle=
|
||||||
k.max=function(a,b,d){if(!b&&k.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!b&&k.isEmpty(a))return-Infinity;var c={computed:-Infinity};v(a,function(a,e,i){e=b?b.call(d,a,e,i):a;e>=c.computed&&(c={value:a,computed:e})});return c.value};k.min=function(a,b,d){if(!b&&k.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!b&&k.isEmpty(a))return Infinity;var c={computed:Infinity};v(a,function(a,e,i){e=b?b.call(d,a,e,i):a;e<c.computed&&(c={value:a,computed:e})});return c.value};k.shuffle=
|
function(a){var b=[],c;t(a,function(a,g){c=Math.floor(Math.random()*(g+1));b[g]=b[c];b[c]=a});return b};k.sortBy=function(a,b,c){var g=k.isFunction(b)?b:function(a){return a[b]};return k.pluck(k.map(a,function(a,b,e){return{value:a,criteria:g.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,g=b.criteria;return c===void 0?1:g===void 0?-1:c<g?-1:c>g?1:0}),"value")};k.groupBy=function(a,b){var c={},g=k.isFunction(b)?b:function(a){return a[b]};t(a,function(a,b){var e=g(a,b);(c[e]||(c[e]=[])).push(a)});
|
||||||
function(a){var b=[],d;v(a,function(a,c){d=Math.floor(Math.random()*(c+1));b[c]=b[d];b[d]=a});return b};k.sortBy=function(a,b,d){var c=k.isFunction(b)?b:function(a){return a[b]};return k.pluck(k.map(a,function(a,b,e){return{value:a,criteria:c.call(d,a,b,e)}}).sort(function(a,b){var d=a.criteria,c=b.criteria;return d===void 0?1:c===void 0?-1:d<c?-1:d>c?1:0}),"value")};k.groupBy=function(a,b){var d={},c=k.isFunction(b)?b:function(a){return a[b]};v(a,function(a,b){var e=c(a,b);(d[e]||(d[e]=[])).push(a)});
|
return c};k.sortedIndex=function(a,b,c){c||(c=k.identity);for(var g=0,e=a.length;g<e;){var d=g+e>>1;c(a[d])<c(b)?g=d+1:e=d}return g};k.toArray=function(b){return!b?[]:k.isArray(b)?a.call(b):k.isArguments(b)?a.call(b):b.toArray&&k.isFunction(b.toArray)?b.toArray():k.values(b)};k.size=function(a){return k.isArray(a)?a.length:k.keys(a).length};k.first=k.head=k.take=function(b,c,g){return c!=null&&!g?a.call(b,0,c):b[0]};k.initial=function(b,c,g){return a.call(b,0,b.length-(c==null||g?1:c))};k.last=function(b,
|
||||||
return d};k.sortedIndex=function(a,b,d){d||(d=k.identity);for(var c=0,e=a.length;c<e;){var i=c+e>>1;d(a[i])<d(b)?c=i+1:e=i}return c};k.toArray=function(b){return!b?[]:k.isArray(b)?a.call(b):k.isArguments(b)?a.call(b):b.toArray&&k.isFunction(b.toArray)?b.toArray():k.values(b)};k.size=function(a){return k.isArray(a)?a.length:k.keys(a).length};k.first=k.head=k.take=function(b,d,c){return d!=null&&!c?a.call(b,0,d):b[0]};k.initial=function(b,d,c){return a.call(b,0,b.length-(d==null||c?1:d))};k.last=function(b,
|
c,g){return c!=null&&!g?a.call(b,Math.max(b.length-c,0)):b[b.length-1]};k.rest=k.tail=function(b,c,g){return a.call(b,c==null||g?1:c)};k.compact=function(a){return k.filter(a,function(a){return!!a})};k.flatten=function(a,b){return k.reduce(a,function(a,c){if(k.isArray(c))return a.concat(b?c:k.flatten(c));a[a.length]=c;return a},[])};k.without=function(b){return k.difference(b,a.call(arguments,1))};k.uniq=k.unique=function(a,b,c){var c=c?k.map(a,c):a,g=[];a.length<3&&(b=!0);k.reduce(c,function(c,e,
|
||||||
d,c){return d!=null&&!c?a.call(b,Math.max(b.length-d,0)):b[b.length-1]};k.rest=k.tail=function(b,d,c){return a.call(b,d==null||c?1:d)};k.compact=function(a){return k.filter(a,function(a){return!!a})};k.flatten=function(a,b){return k.reduce(a,function(a,d){if(k.isArray(d))return a.concat(b?d:k.flatten(d));a[a.length]=d;return a},[])};k.without=function(b){return k.difference(b,a.call(arguments,1))};k.uniq=k.unique=function(a,b,d){var d=d?k.map(a,d):a,c=[];a.length<3&&(b=!0);k.reduce(d,function(d,e,
|
d){if(b?k.last(c)!==e||!c.length:!k.include(c,e))c.push(e),g.push(a[d]);return c},[]);return g};k.union=function(){return k.uniq(k.flatten(arguments,!0))};k.intersection=k.intersect=function(b){var c=a.call(arguments,1);return k.filter(k.uniq(b),function(a){return k.every(c,function(b){return k.indexOf(b,a)>=0})})};k.difference=function(b){var c=k.flatten(a.call(arguments,1),!0);return k.filter(b,function(a){return!k.include(c,a)})};k.zip=function(){for(var b=a.call(arguments),c=k.max(k.pluck(b,"length")),
|
||||||
i){if(b?k.last(d)!==e||!d.length:!k.include(d,e))d.push(e),c.push(a[i]);return d},[]);return c};k.union=function(){return k.uniq(k.flatten(arguments,!0))};k.intersection=k.intersect=function(b){var d=a.call(arguments,1);return k.filter(k.uniq(b),function(a){return k.every(d,function(b){return k.indexOf(b,a)>=0})})};k.difference=function(b){var d=k.flatten(a.call(arguments,1),!0);return k.filter(b,function(a){return!k.include(d,a)})};k.zip=function(){for(var b=a.call(arguments),d=k.max(k.pluck(b,"length")),
|
g=Array(c),e=0;e<c;e++)g[e]=k.pluck(b,""+e);return g};k.indexOf=function(a,b,c){if(a==null)return-1;var g;if(c)return c=k.sortedIndex(a,b),a[c]===b?c:-1;if(u&&a.indexOf===u)return a.indexOf(b);c=0;for(g=a.length;c<g;c++)if(c in a&&a[c]===b)return c;return-1};k.lastIndexOf=function(a,b){if(a==null)return-1;if(p&&a.lastIndexOf===p)return a.lastIndexOf(b);for(var c=a.length;c--;)if(c in a&&a[c]===b)return c;return-1};k.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0);for(var c=arguments[2]||1,
|
||||||
c=Array(d),e=0;e<d;e++)c[e]=k.pluck(b,""+e);return c};k.indexOf=function(a,b,d){if(a==null)return-1;var c;if(d)return d=k.sortedIndex(a,b),a[d]===b?d:-1;if(x&&a.indexOf===x)return a.indexOf(b);d=0;for(c=a.length;d<c;d++)if(d in a&&a[d]===b)return d;return-1};k.lastIndexOf=function(a,b){if(a==null)return-1;if(u&&a.lastIndexOf===u)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};k.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);for(var d=arguments[2]||1,
|
g=Math.max(Math.ceil((b-a)/c),0),e=0,d=Array(g);e<g;)d[e++]=a,a+=c;return d};var x=function(){};k.bind=function(b,c){var g,e;if(b.bind===w&&w)return w.apply(b,a.call(arguments,1));if(!k.isFunction(b))throw new TypeError;e=a.call(arguments,2);return g=function(){if(!(this instanceof g))return b.apply(c,e.concat(a.call(arguments)));x.prototype=b.prototype;var d=new x,j=b.apply(d,e.concat(a.call(arguments)));return Object(j)===j?j:d}};k.bindAll=function(b){var c=a.call(arguments,1);c.length==0&&(c=k.functions(b));
|
||||||
c=Math.max(Math.ceil((b-a)/d),0),e=0,i=Array(c);e<c;)i[e++]=a,a+=d;return i};var G=function(){};k.bind=function(b,d){var c,e;if(b.bind===A&&A)return A.apply(b,a.call(arguments,1));if(!k.isFunction(b))throw new TypeError;e=a.call(arguments,2);return c=function(){if(!(this instanceof c))return b.apply(d,e.concat(a.call(arguments)));G.prototype=b.prototype;var i=new G,f=b.apply(i,e.concat(a.call(arguments)));return Object(f)===f?f:i}};k.bindAll=function(b){var d=a.call(arguments,1);d.length==0&&(d=k.functions(b));
|
t(c,function(a){b[a]=k.bind(b[a],b)});return b};k.memoize=function(a,b){var c={};b||(b=k.identity);return function(){var g=b.apply(this,arguments);return k.has(c,g)?c[g]:c[g]=a.apply(this,arguments)}};k.delay=function(b,c){var g=a.call(arguments,2);return setTimeout(function(){return b.apply(null,g)},c)};k.defer=function(b){return k.delay.apply(k,[b,1].concat(a.call(arguments,1)))};k.throttle=function(a,b){var c,g,e,d,j,f,h=k.debounce(function(){j=d=!1},b);return function(){c=this;g=arguments;var k;
|
||||||
v(d,function(a){b[a]=k.bind(b[a],b)});return b};k.memoize=function(a,b){var d={};b||(b=k.identity);return function(){var c=b.apply(this,arguments);return k.has(d,c)?d[c]:d[c]=a.apply(this,arguments)}};k.delay=function(b,d){var c=a.call(arguments,2);return setTimeout(function(){return b.apply(null,c)},d)};k.defer=function(b){return k.delay.apply(k,[b,1].concat(a.call(arguments,1)))};k.throttle=function(a,b){var d,c,e,i,f,j,g=k.debounce(function(){f=i=!1},b);return function(){d=this;c=arguments;var k;
|
e||(e=setTimeout(function(){e=null;j&&a.apply(c,g);h()},b));d?j=!0:f=a.apply(c,g);h();d=!0;return f}};k.debounce=function(a,b,c){var g;return function(){var e=this,d=arguments;c&&!g&&a.apply(e,d);clearTimeout(g);g=setTimeout(function(){g=null;c||a.apply(e,d)},b)}};k.once=function(a){var b=!1,c;return function(){if(b)return c;b=!0;return c=a.apply(this,arguments)}};k.wrap=function(b,c){return function(){var g=[b].concat(a.call(arguments,0));return c.apply(this,g)}};k.compose=function(){var a=arguments;
|
||||||
e||(e=setTimeout(function(){e=null;f&&a.apply(d,c);g()},b));i?f=!0:j=a.apply(d,c);g();i=!0;return j}};k.debounce=function(a,b,d){var c;return function(){var e=this,i=arguments;d&&!c&&a.apply(e,i);clearTimeout(c);c=setTimeout(function(){c=null;d||a.apply(e,i)},b)}};k.once=function(a){var b=!1,d;return function(){if(b)return d;b=!0;return d=a.apply(this,arguments)}};k.wrap=function(b,d){return function(){var c=[b].concat(a.call(arguments,0));return d.apply(this,c)}};k.compose=function(){var a=arguments;
|
return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}};k.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};k.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],c;for(c in a)k.has(a,c)&&(b[b.length]=c);return b};k.values=function(a){return k.map(a,k.identity)};k.functions=k.methods=function(a){var b=[],c;for(c in a)k.isFunction(a[c])&&b.push(c);return b.sort()};k.extend=function(b){t(a.call(arguments,
|
||||||
return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};k.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};k.keys=z||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],d;for(d in a)k.has(a,d)&&(b[b.length]=d);return b};k.values=function(a){return k.map(a,k.identity)};k.functions=k.methods=function(a){var b=[],d;for(d in a)k.isFunction(a[d])&&b.push(d);return b.sort()};k.extend=function(b){v(a.call(arguments,
|
1),function(a){for(var c in a)b[c]=a[c]});return b};k.pick=function(b){var c={};t(k.flatten(a.call(arguments,1)),function(a){a in b&&(c[a]=b[a])});return c};k.defaults=function(b){t(a.call(arguments,1),function(a){for(var c in a)b[c]==null&&(b[c]=a[c])});return b};k.clone=function(a){return!k.isObject(a)?a:k.isArray(a)?a.slice():k.extend({},a)};k.tap=function(a,b){b(a);return a};k.isEqual=function(a,b){return h(a,b,[])};k.isEmpty=function(a){if(a==null)return!0;if(k.isArray(a)||k.isString(a))return a.length===
|
||||||
1),function(a){for(var d in a)b[d]=a[d]});return b};k.pick=function(b){var d={};v(k.flatten(a.call(arguments,1)),function(a){a in b&&(d[a]=b[a])});return d};k.defaults=function(b){v(a.call(arguments,1),function(a){for(var d in a)b[d]==null&&(b[d]=a[d])});return b};k.clone=function(a){return!k.isObject(a)?a:k.isArray(a)?a.slice():k.extend({},a)};k.tap=function(a,b){b(a);return a};k.isEqual=function(a,b){return h(a,b,[])};k.isEmpty=function(a){if(a==null)return!0;if(k.isArray(a)||k.isString(a))return a.length===
|
0;for(var b in a)if(k.has(a,b))return!1;return!0};k.isElement=function(a){return!!(a&&a.nodeType==1)};k.isArray=c||function(a){return g.call(a)=="[object Array]"};k.isObject=function(a){return a===Object(a)};k.isArguments=function(a){return g.call(a)=="[object Arguments]"};if(!k.isArguments(arguments))k.isArguments=function(a){return!(!a||!k.has(a,"callee"))};k.isFunction=function(a){return g.call(a)=="[object Function]"};k.isString=function(a){return g.call(a)=="[object String]"};k.isNumber=function(a){return g.call(a)==
|
||||||
0;for(var b in a)if(k.has(a,b))return!1;return!0};k.isElement=function(a){return!!(a&&a.nodeType==1)};k.isArray=b||function(a){return i.call(a)=="[object Array]"};k.isObject=function(a){return a===Object(a)};k.isArguments=function(a){return i.call(a)=="[object Arguments]"};if(!k.isArguments(arguments))k.isArguments=function(a){return!(!a||!k.has(a,"callee"))};k.isFunction=function(a){return i.call(a)=="[object Function]"};k.isString=function(a){return i.call(a)=="[object String]"};k.isNumber=function(a){return i.call(a)==
|
"[object Number]"};k.isFinite=function(a){return k.isNumber(a)&&isFinite(a)};k.isNaN=function(a){return a!==a};k.isBoolean=function(a){return a===!0||a===!1||g.call(a)=="[object Boolean]"};k.isDate=function(a){return g.call(a)=="[object Date]"};k.isRegExp=function(a){return g.call(a)=="[object RegExp]"};k.isNull=function(a){return a===null};k.isUndefined=function(a){return a===void 0};k.has=function(a,b){return j.call(a,b)};k.noConflict=function(){d._=f;return this};k.identity=function(a){return a};
|
||||||
"[object Number]"};k.isFinite=function(a){return k.isNumber(a)&&isFinite(a)};k.isNaN=function(a){return a!==a};k.isBoolean=function(a){return a===!0||a===!1||i.call(a)=="[object Boolean]"};k.isDate=function(a){return i.call(a)=="[object Date]"};k.isRegExp=function(a){return i.call(a)=="[object RegExp]"};k.isNull=function(a){return a===null};k.isUndefined=function(a){return a===void 0};k.has=function(a,b){return j.call(a,b)};k.noConflict=function(){e._=g;return this};k.identity=function(a){return a};
|
k.times=function(a,b,c){for(var g=0;g<a;g++)b.call(c,g)};k.escape=function(a){return(""+a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};k.result=function(a,b){if(a==null)return null;var c=a[b];return k.isFunction(c)?c.call(a):c};k.mixin=function(a){t(k.functions(a),function(b){F(b,k[b]=a[b])})};var G=0;k.uniqueId=function(a){var b=G++;return a?a+b:b};k.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,
|
||||||
k.times=function(a,b,d){for(var c=0;c<a;c++)b.call(d,c)};k.escape=function(a){return(""+a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};k.result=function(a,b){if(a==null)return null;var d=a[b];return k.isFunction(d)?d.call(a):d};k.mixin=function(a){v(k.functions(a),function(b){H(b,k[b]=a[b])})};var s=0;k.uniqueId=function(a){var b=s++;return a?a+b:b};k.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,
|
escape:/<%-([\s\S]+?)%>/g};var B=/.^/,A={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"},C;for(C in A)A[A[C]]=C;var H=/\\|'|\r|\n|\t|\u2028|\u2029/g,I=/\\(\\|'|r|n|t|u2028|u2029)/g,D=function(a){return a.replace(I,function(a,b){return A[b]})};k.template=function(a,b,c){c=k.defaults(c||{},k.templateSettings);a="__p+='"+a.replace(H,function(a){return"\\"+A[a]}).replace(c.escape||B,function(a,b){return"'+\n_.escape("+D(b)+")+\n'"}).replace(c.interpolate||B,function(a,b){return"'+\n("+
|
||||||
escape:/<%-([\s\S]+?)%>/g};var w=/.^/,y={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"},C;for(C in y)y[y[C]]=C;var I=/\\|'|\r|\n|\t|\u2028|\u2029/g,J=/\\(\\|'|r|n|t|u2028|u2029)/g,D=function(a){return a.replace(J,function(a,b){return y[b]})};k.template=function(a,b,d){d=k.defaults(d||{},k.templateSettings);a="__p+='"+a.replace(I,function(a){return"\\"+y[a]}).replace(d.escape||w,function(a,b){return"'+\n_.escape("+D(b)+")+\n'"}).replace(d.interpolate||w,function(a,b){return"'+\n("+
|
D(b)+")+\n'"}).replace(c.evaluate||B,function(a,b){return"';\n"+D(b)+"\n;__p+='"})+"';\n";c.variable||(a="with(obj||{}){\n"+a+"}\n");var a="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+a+"return __p;\n",g=new Function(c.variable||"obj","_",a);if(b)return g(b,k);b=function(a){return g.call(this,a,k)};b.source="function("+(c.variable||"obj")+"){\n"+a+"}";return b};k.chain=function(a){return k(a).chain()};var y=function(a){this._wrapped=a};k.prototype=y.prototype;
|
||||||
D(b)+")+\n'"}).replace(d.evaluate||w,function(a,b){return"';\n"+D(b)+"\n;__p+='"})+"';\n";d.variable||(a="with(obj||{}){\n"+a+"}\n");var a="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+a+"return __p;\n",c=new Function(d.variable||"obj","_",a);if(b)return c(b,k);b=function(a){return c.call(this,a,k)};b.source="function("+(d.variable||"obj")+"){\n"+a+"}";return b};k.chain=function(a){return k(a).chain()};var B=function(a){this._wrapped=a};k.prototype=B.prototype;
|
var E=function(a,b){return b?k(a).chain():a},F=function(b,c){y.prototype[b]=function(){var b=a.call(arguments);e.call(b,this._wrapped);return E(c.apply(k,b),this._chain)}};k.mixin(k);t(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=b[a];y.prototype[a]=function(){var b=this._wrapped;c.apply(b,arguments);var g=b.length;(a=="shift"||a=="splice")&&g===0&&delete b[0];return E(b,this._chain)}});t(["concat","join","slice"],function(a){var c=b[a];y.prototype[a]=function(){return E(c.apply(this._wrapped,
|
||||||
var E=function(a,b){return b?k(a).chain():a},H=function(b,c){B.prototype[b]=function(){var b=a.call(arguments);d.call(b,this._wrapped);return E(c.apply(k,b),this._chain)}};k.mixin(k);v(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=c[a];B.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var c=d.length;(a=="shift"||a=="splice")&&c===0&&delete d[0];return E(d,this._chain)}});v(["concat","join","slice"],function(a){var b=c[a];B.prototype[a]=function(){return E(b.apply(this._wrapped,
|
arguments),this._chain)}});y.prototype.chain=function(){this._chain=!0;return this};y.prototype.value=function(){return this._wrapped};return k}.call({}),emmet=function(h){function d(a,b,d){var f;f=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};_.extend(f,a);c.prototype=a.prototype;f.prototype=new c;b&&_.extend(f.prototype,b);d&&_.extend(f,d);f.prototype.constructor=f;f.__super__=a.prototype;return f}function f(c){!(c in b)&&a&&a(c);return b[c]}if(typeof _=="undefined")try{_=
|
||||||
arguments),this._chain)}});B.prototype.chain=function(){this._chain=!0;return this};B.prototype.value=function(){return this._wrapped};return k}.call({}),emmet=function(h,e){function g(a,b,i){var f;f=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};e.extend(f,a);c.prototype=a.prototype;f.prototype=new c;b&&e.extend(f.prototype,b);i&&e.extend(f,i);f.prototype.constructor=f;f.__super__=a.prototype;return f}var f={_:e},c=function(){},b=null;return{define:function(a,
|
h.require("underscore")}catch(i){}if(typeof _=="undefined")throw"Cannot access to Underscore.js lib";var b={_:_},c=function(){},a=null;return{define:function(a,c){a in b||(b[a]=_.isFunction(c)?this.exec(c):c)},require:f,exec:function(a,b){return a.call(b||h,_.bind(f,this),_,this)},extend:function(a,b){var c=d(this,a,b);c.extend=this.extend;if(a.hasOwnProperty("toString"))c.prototype.toString=a.toString;return c},expandAbbreviation:function(a,b,c,d){if(!a)return"";var b=b||"html",h=f("filters"),i=
|
||||||
b){a in f||(f[a]=e.isFunction(b)?this.exec(b):b)},require:function(a){!(a in f)&&b&&b(a);return f[a]},exec:function(a,b){return a.call(b||h,e.bind(this.require,this),e,this)},extend:function(a,b){var c=g(this,a,b);c.extend=this.extend;if(a.hasOwnProperty("toString"))c.prototype.toString=a.toString;return c},expandAbbreviation:function(a,b,c,e){if(!a)return"";var b=b||"html",c=c||"plain",f=this.require("filters"),g=this.require("utils"),h=this.require("abbreviationParser"),c=this.require("profile").get(c,
|
f("abbreviationParser"),c=f("profile").get(c,b);f("tabStops").resetTabstopIndex();a=h.extractFromAbbreviation(a);d=i.parse(a[0],{syntax:b,contextNode:d});b=h.composeList(b,c,a[1]);h.apply(d,b,c);return d.toString()},defaultSyntax:function(){return"html"},defaultProfile:function(){return"plain"},log:function(){h.console&&h.console.log&&h.console.log.apply(h.console,arguments)},setModuleLoader:function(b){a=b}}}(this);
|
||||||
b);this.require("tabStops").resetTabstopIndex();a=f.extractFromAbbreviation(a);e=h.parse(a[0],{syntax:b,contextNode:e});b=f.composeList(b,c,a[1]);f.apply(e,b,c);return g.replaceVariables(e.toString())},defaultSyntax:function(){return"html"},defaultProfile:function(){return"plain"},log:function(){h.console&&h.console.log&&h.console.log.apply(h.console,arguments)},setModuleLoader:function(a){b=a}}}(this,_);
|
if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=emmet;exports.emmet=emmet}
|
||||||
emmet.define("abbreviationParser",function(h,e){function g(){this.parent=null;this.children=[];this._attributes=[];this.abbreviation="";this.counter=1;this._name=null;this._text="";this.repeatCount=1;this.hasImplicitRepeat=!1;this._data={};this.padding=this.content=this.end=this.start=""}function f(a){return a.substring(1,a.length-1)}function c(a){for(var a=h("utils").trim(a),b=new g,d=b.addChild(),i,j=h("stringStream").create(a),a=1E3,m;!j.eol()&&--a>0;)switch(i=j.peek(),i){case "(":j.start=j.pos;
|
emmet.define("abbreviationParser",function(h,d){function f(){this.parent=null;this.children=[];this._attributes=[];this.abbreviation="";this.counter=1;this._name=null;this._text="";this.repeatCount=1;this.hasImplicitRepeat=!1;this._data={};this.padding=this.content=this.end=this.start=""}function i(a){return a.substring(1,a.length-1)}function b(a){for(var a=h("utils").trim(a),c=new f,g=c.addChild(),e,j=h("stringStream").create(a),a=1E3,l;!j.eol()&&--a>0;)switch(e=j.peek(),e){case "(":j.start=j.pos;
|
||||||
if(j.skipToPair("(",")"))i=c(f(j.current())),(m=j.match(/^\*(\d+)?/,!0))&&d._setRepeat(m[1]),e.each(i.children,function(a){d.addChild(a)});else throw'Invalid abbreviation: mo matching ")" found for character at '+j.pos;break;case ">":d=d.addChild();j.next();break;case "+":d=d.parent.addChild();j.next();break;case "^":i=d.parent||d;d=(i.parent||i).addChild();j.next();break;default:j.start=j.pos,j.eatWhile(function(a){if(a=="["||a=="{"){if(j.skipToPair(a,q[a]))return j.backUp(1),!0;throw'Invalid abbreviation: mo matching "'+
|
if(j.skipToPair("(",")"))e=b(i(j.current())),(l=j.match(/^\*(\d+)?/,!0))&&g._setRepeat(l[1]),d.each(e.children,function(a){g.addChild(a)});else throw'Invalid abbreviation: mo matching ")" found for character at '+j.pos;break;case ">":g=g.addChild();j.next();break;case "+":g=g.parent.addChild();j.next();break;case "^":e=g.parent||g;g=(e.parent||e).addChild();j.next();break;default:j.start=j.pos,j.eatWhile(function(a){if(a=="["||a=="{"){if(j.skipToPair(a,q[a]))return j.backUp(1),!0;throw'Invalid abbreviation: mo matching "'+
|
||||||
q[a]+'" found for character at '+j.pos;}return a=="+"?(j.next(),a=j.eol()||~"+>^*".indexOf(j.peek()),j.backUp(1),a):a!="("&&n(a)}),d.setAbbreviation(j.current()),j.start=j.pos}if(a<1)throw"Endless loop detected";return b}function b(a){var a=h("utils").trim(a),b=[],a=h("stringStream").create(a);for(a.eatSpace();!a.eol();)if(a.start=a.pos,a.eatWhile(o)){var d=a.current(),c="";if(a.peek()=="="){a.next();a.start=a.pos;var e=a.peek();if(e=='"'||e=="'"){a.next();a:{for(var c=a,i=void 0;i=c.next();)if(i===
|
q[a]+'" found for character at '+j.pos;}return a=="+"?(j.next(),a=j.eol()||~"+>^*".indexOf(j.peek()),j.backUp(1),a):a!="("&&m(a)}),g.setAbbreviation(j.current()),j.start=j.pos}if(a<1)throw"Endless loop detected";return c}function c(a){var a=h("utils").trim(a),b=[],a=h("stringStream").create(a);for(a.eatSpace();!a.eol();)if(a.start=a.pos,a.eatWhile(o)){var c=a.current(),g="";if(a.peek()=="="){a.next();a.start=a.pos;var e=a.peek();if(e=='"'||e=="'"){a.next();a:{for(var g=a,d=void 0;d=g.next();)if(d===
|
||||||
e){c=!0;break a}c=!1}if(c)c=a.current(),c=c.substring(1,c.length-1);else throw"Invalid attribute value";}else if(a.eatWhile(/[^\s\]]/))c=a.current();else throw"Invalid attribute value";}b.push({name:d,value:c});a.eatSpace()}else break;return b}function a(a){for(var c=[],e={"#":"id",".":"class"},i=null,j=h("stringStream").create(a);!j.eol();)switch(j.peek()){case "#":case ".":if(i===null)i=j.pos;var g=e[j.peek()];j.next();j.start=j.pos;j.eatWhile(o);c.push({name:g,value:j.current()});break;case "[":if(i===
|
e){g=!0;break a}g=!1}if(g)g=a.current(),g=g.substring(1,g.length-1);else throw"Invalid attribute value";}else if(a.eatWhile(/[^\s\]]/))g=a.current();else throw"Invalid attribute value";}b.push({name:c,value:g});a.eatSpace()}else break;return b}function a(a){for(var b=[],g={"#":"id",".":"class"},d=null,j=h("stringStream").create(a);!j.eol();)switch(j.peek()){case "#":case ".":if(d===null)d=j.pos;var f=g[j.peek()];j.next();j.start=j.pos;j.eatWhile(o);b.push({name:f,value:j.current()});break;case "[":if(d===
|
||||||
null)i=j.pos;j.start=j.pos;if(!j.skipToPair("[","]"))throw"Invalid attribute set definition";c=c.concat(b(f(j.current())));break;default:j.next()}return!c.length?null:{element:a.substring(0,i),attributes:d(c)}}function d(a){var a=e.map(a,function(a){return e.clone(a)}),b={};return e.filter(a,function(a){if(!(a.name in b))return b[a.name]=a;var d=b[a.name];a.name.toLowerCase()=="class"?d.value+=(d.value.length?" ":"")+a.value:d.value=a.value;return!1})}function i(a){if(!~a.indexOf("{"))return null;
|
null)d=j.pos;j.start=j.pos;if(!j.skipToPair("[","]"))throw"Invalid attribute set definition";b=b.concat(c(i(j.current())));break;default:j.next()}return!b.length?null:{element:a.substring(0,d),attributes:e(b)}}function e(a){var a=d.map(a,function(a){return d.clone(a)}),b={};return d.filter(a,function(a){if(!(a.name in b))return b[a.name]=a;var c=b[a.name];a.name.toLowerCase()=="class"?c.value+=(c.value.length?" ":"")+a.value:c.value=a.value;return!1})}function g(a){if(!~a.indexOf("{"))return null;
|
||||||
for(var b=h("stringStream").create(a);!b.eol();)switch(b.peek()){case "[":case "(":b.skipToPair(b.peek(),q[b.peek()]);break;case "{":return b.start=b.pos,b.skipToPair("{","}"),{element:a.substring(0,b.start),text:f(b.current())};default:b.next()}}function j(a){for(var b=a.children.length-1,d,c;b>=0;b--)if(c=a.children[b],c.isRepeating()){d=c.repeatCount;c.repeatCount=1;for(c.updateProperty("counter",1);--d>0;)c.parent.addChild(c.clone(),b+1).updateProperty("counter",d+1)}e.each(a.children,j);return a}
|
for(var b=h("stringStream").create(a);!b.eol();)switch(b.peek()){case "[":case "(":b.skipToPair(b.peek(),q[b.peek()]);break;case "{":return b.start=b.pos,b.skipToPair("{","}"),{element:a.substring(0,b.start),text:i(b.current())};default:b.next()}}function j(a){for(var b=a.children.length-1,c,g;b>=0;b--)if(g=a.children[b],g.isRepeating()){c=g.repeatCount;g.repeatCount=1;for(g.updateProperty("counter",1);--c>0;)g.parent.addChild(g.clone(),b+1).updateProperty("counter",c+1)}d.each(a.children,j);return a}
|
||||||
function l(a){for(var b=a.children.length-1;b>=0;b--){var d=a.children[b];d.isGroup()?d.replace(l(d).children):d.isEmpty()&&d.remove()}e.each(a.children,l);return a}function n(a){var b=a.charCodeAt(0);return b>64&&b<91||b>96&&b<123||b>47&&b<58||"#.*:$-_!@|".indexOf(a)!=-1}var m=/^[\w\-\$\:@\!]+\+?$/i,o=/[\w\-:\$]/,q={"[":"]","(":")","{":"}"},r=Array.prototype.splice,t=[],x=[],u=[];g.prototype={addChild:function(a,b){a=a||new g;a.parent=this;e.isUndefined(b)?this.children.push(a):this.children.splice(b,
|
function l(a){for(var b=a.children.length-1;b>=0;b--){var c=a.children[b];c.isGroup()?c.replace(l(c).children):c.isEmpty()&&c.remove()}d.each(a.children,l);return a}function m(a){var b=a.charCodeAt(0);return b>64&&b<91||b>96&&b<123||b>47&&b<58||"#.*:$-_!@|%".indexOf(a)!=-1}var n=/^[\w\-\$\:@\!%]+\+?$/i,o=/[\w\-:\$]/,q={"[":"]","(":")","{":"}"},s=Array.prototype.splice,r=[],u=[],p=[];f.prototype={addChild:function(a,b){a=a||new f;a.parent=this;d.isUndefined(b)?this.children.push(a):this.children.splice(b,
|
||||||
0,a);return a},clone:function(){var a=new g;e.each(["abbreviation","counter","_name","_text","repeatCount","hasImplicitRepeat","start","end","content","padding"],function(b){a[b]=this[b]},this);a._attributes=e.map(this._attributes,function(a){return e.clone(a)});a._data=e.clone(this._data);a.children=e.map(this.children,function(b){b=b.clone();b.parent=a;return b});return a},remove:function(){if(this.parent)this.parent.children=e.without(this.parent.children,this);return this},replace:function(){var a=
|
0,a);return a},clone:function(){var a=new f;d.each(["abbreviation","counter","_name","_text","repeatCount","hasImplicitRepeat","start","end","content","padding"],function(b){a[b]=this[b]},this);a._attributes=d.map(this._attributes,function(a){return d.clone(a)});a._data=d.clone(this._data);a.children=d.map(this.children,function(b){b=b.clone();b.parent=a;return b});return a},remove:function(){if(this.parent)this.parent.children=d.without(this.parent.children,this);return this},replace:function(){var a=
|
||||||
this.parent,b=e.indexOf(a.children,this),d=e.flatten(arguments);r.apply(a.children,[b,1].concat(d));e.each(d,function(b){b.parent=a})},updateProperty:function(a,b){this[a]=b;e.each(this.children,function(d){d.updateProperty(a,b)})},find:function(a){return this.findAll(a)[0]},findAll:function(a){if(!e.isFunction(a))var b=a.toLowerCase(),a=function(a){return a.name().toLowerCase()==b};var d=[];e.each(this.children,function(b){a(b)&&d.push(b);d=d.concat(b.findAll(a))});return e.compact(d)},data:function(a,
|
this.parent,b=d.indexOf(a.children,this),c=d.flatten(arguments);s.apply(a.children,[b,1].concat(c));d.each(c,function(b){b.parent=a})},updateProperty:function(a,b){this[a]=b;d.each(this.children,function(c){c.updateProperty(a,b)})},find:function(a){return this.findAll(a)[0]},findAll:function(a){if(!d.isFunction(a))var b=a.toLowerCase(),a=function(a){return a.name().toLowerCase()==b};var c=[];d.each(this.children,function(b){a(b)&&c.push(b);c=c.concat(b.findAll(a))});return d.compact(c)},data:function(a,
|
||||||
b){if(arguments.length==2&&(this._data[a]=b,a=="resource"&&h("elements").is(b,"snippet")&&(this.content=b.data,this._text)))this.content=h("abbreviationUtils").insertChildContent(b.data,this._text);return this._data[a]},name:function(){var a=this.matchedResource();return h("elements").is(a,"element")?a.name:this._name},attributeList:function(){var a=[],b=this.matchedResource();h("elements").is(b,"element")&&e.isArray(b.attributes)&&(a=a.concat(b.attributes));return d(a.concat(this._attributes))},
|
b){if(arguments.length==2&&(this._data[a]=b,a=="resource"&&h("elements").is(b,"snippet")&&(this.content=b.data,this._text)))this.content=h("abbreviationUtils").insertChildContent(b.data,this._text);return this._data[a]},name:function(){var a=this.matchedResource();return h("elements").is(a,"element")?a.name:this._name},attributeList:function(){var a=[],b=this.matchedResource();h("elements").is(b,"element")&&d.isArray(b.attributes)&&(a=a.concat(b.attributes));return e(a.concat(this._attributes))},
|
||||||
attribute:function(a,b){if(arguments.length==2){var d=e.indexOf(e.pluck(this._attributes,"name"),a.toLowerCase());if(~d)this._attributes[d].value=b}return(e.find(this.attributeList(),function(b){return b.name==a})||{}).value},matchedResource:function(){return this.data("resource")},index:function(){return this.parent?e.indexOf(this.parent.children,this):-1},_setRepeat:function(a){a?this.repeatCount=parseInt(a,10)||1:this.hasImplicitRepeat=!0},setAbbreviation:function(b){var d=this;this.abbreviation=
|
attribute:function(a,b){if(arguments.length==2){var c=d.indexOf(d.pluck(this._attributes,"name"),a.toLowerCase());~c?this._attributes[c].value=b:this._attributes.push({name:a,value:b})}return(d.find(this.attributeList(),function(b){return b.name==a})||{}).value},matchedResource:function(){return this.data("resource")},index:function(){return this.parent?d.indexOf(this.parent.children,this):-1},_setRepeat:function(a){a?this.repeatCount=parseInt(a,10)||1:this.hasImplicitRepeat=!0},setAbbreviation:function(b){var c=
|
||||||
b=(b||"").replace(/\*(\d+)?$/,function(a,b){d._setRepeat(b);return""});var c=i(b);if(c)b=c.element,this.content=this._text=c.text;if(c=a(b))b=c.element,this._attributes=c.attributes;if((this._name=b)&&!m.test(this._name))throw"Invalid abbreviation";},toString:function(){var a=h("utils"),b=this.start,d=this.end,c=this.content,i=this;e.each(u,function(a){b=a(b,i,"start");c=a(c,i,"content");d=a(d,i,"end")});var j=e.map(this.children,function(a){return a.toString()}).join(""),c=h("abbreviationUtils").insertChildContent(c,
|
this;this.abbreviation=b=(b||"").replace(/\*(\d+)?$/,function(a,b){c._setRepeat(b);return""});var e=g(b);if(e)b=e.element,this.content=this._text=e.text;if(e=a(b))b=e.element,this._attributes=e.attributes;if((this._name=b)&&!n.test(this._name))throw"Invalid abbreviation";},toString:function(){var a=h("utils"),b=this.start,c=this.end,g=this.content,e=this;d.each(p,function(a){b=a(b,e,"start");g=a(g,e,"content");c=a(c,e,"end")});var j=d.map(this.children,function(a){return a.toString()}).join(""),g=
|
||||||
j,{keepVariable:!1});return b+a.padString(c,this.padding)+d},hasEmptyChildren:function(){return!!e.find(this.children,function(a){return a.isEmpty()})},hasImplicitName:function(){return!this._name&&!this.isTextNode()},isGroup:function(){return!this.abbreviation},isEmpty:function(){return!this.abbreviation&&!this.children.length},isRepeating:function(){return this.repeatCount>1||this.hasImplicitRepeat},isTextNode:function(){return!this.name()&&!this.attributeList().length},isElement:function(){return!this.isEmpty()&&
|
h("abbreviationUtils").insertChildContent(g,j,{keepVariable:!1});return b+a.padString(g,this.padding)+c},hasEmptyChildren:function(){return!!d.find(this.children,function(a){return a.isEmpty()})},hasImplicitName:function(){return!this._name&&!this.isTextNode()},isGroup:function(){return!this.abbreviation},isEmpty:function(){return!this.abbreviation&&!this.children.length},isRepeating:function(){return this.repeatCount>1||this.hasImplicitRepeat},isTextNode:function(){return!this.name()&&!this.attributeList().length},
|
||||||
!this.isTextNode()},deepestChild:function(){if(!this.children.length)return null;for(var a=this;a.children.length;)a=e.last(a.children);return a}};u.push(function(a,b){return h("utils").replaceCounter(a,b.counter)});return{parse:function(a,b){var b=b||{},d=c(a);if(b.contextNode){d._name=b.contextNode.name;var i={};e.each(d._attributes,function(a){i[a.name]=a});e.each(b.contextNode.attributes,function(a){a.name in i?i[a.name].value=a.value:(a=e.clone(a),d._attributes.push(a),i[a.name]=a)})}e.each(t,
|
isElement:function(){return!this.isEmpty()&&!this.isTextNode()},deepestChild:function(){if(!this.children.length)return null;for(var a=this;a.children.length;)a=d.last(a.children);return a}};p.push(function(a,b){return h("utils").replaceCounter(a,b.counter)});return{parse:function(a,c){var c=c||{},g=b(a);if(c.contextNode){g._name=c.contextNode.name;var e={};d.each(g._attributes,function(a){e[a.name]=a});d.each(c.contextNode.attributes,function(a){a.name in e?e[a.name].value=a.value:(a=d.clone(a),
|
||||||
function(a){a(d,b)});d=l(j(d));e.each(x,function(a){a(d,b)});return d},AbbreviationNode:g,addPreprocessor:function(a){e.include(t,a)||t.push(a)},removeFilter:function(a){preprocessor=e.without(t,a)},addPostprocessor:function(a){e.include(x,a)||x.push(a)},removePostprocessor:function(a){x=e.without(x,a)},addOutputProcessor:function(a){e.include(u,a)||u.push(a)},removeOutputProcessor:function(a){u=e.without(u,a)},isAllowedChar:function(a){a=String(a);return n(a)||~">+^[](){}".indexOf(a)}}});
|
g._attributes.push(a),e[a.name]=a)})}d.each(r,function(a){a(g,c)});g=l(j(g));d.each(u,function(a){a(g,c)});return g},AbbreviationNode:f,addPreprocessor:function(a){d.include(r,a)||r.push(a)},removeFilter:function(a){preprocessor=d.without(r,a)},addPostprocessor:function(a){d.include(u,a)||u.push(a)},removePostprocessor:function(a){u=d.without(u,a)},addOutputProcessor:function(a){d.include(p,a)||p.push(a)},removeOutputProcessor:function(a){p=d.without(p,a)},isAllowedChar:function(a){a=String(a);return m(a)||
|
||||||
emmet.exec(function(h,e){function g(f,c){var b=h("resources"),a=h("elements"),d=h("abbreviationParser");e.each(e.clone(f.children),function(i){var j=b.getMatchedResource(i,c);if(e.isString(j))i.data("resource",a.create("snippet",j));else if(a.is(j,"reference")){j=d.parse(j.data,{syntax:c});if(i.repeatCount>1){var f=j.findAll(function(a){return a.hasImplicitRepeat});e.each(f,function(a){a.repeatCount=i.repeatCount;a.hasImplicitRepeat=!1})}var h=j.deepestChild();h&&e.each(i.children,function(a){h.addChild(a)});
|
~">+^[](){}".indexOf(a)}}});
|
||||||
i.replace(j.children)}else i.data("resource",j);g(i,c)})}h("abbreviationParser").addPreprocessor(function(e,c){var b=c.syntax||emmet.defaultSyntax();g(e,b)})});
|
emmet.exec(function(h,d){function f(i,b){var c=h("resources"),a=h("elements"),e=h("abbreviationParser");d.each(d.clone(i.children),function(g){var j=c.getMatchedResource(g,b);if(d.isString(j))g.data("resource",a.create("snippet",j));else if(a.is(j,"reference")){j=e.parse(j.data,{syntax:b});if(g.repeatCount>1){var h=j.findAll(function(a){return a.hasImplicitRepeat});d.each(h,function(a){a.repeatCount=g.repeatCount;a.hasImplicitRepeat=!1})}var i=j.deepestChild();i&&d.each(g.children,function(a){i.addChild(a)});
|
||||||
emmet.exec(function(h,e){function g(a){for(var b=h("range"),c=[],a=h("stringStream").create(a);!a.eol();){if(a.peek()=="\\")a.next();else if(a.start=a.pos,a.match(d,!0)){c.push(b.create(a.start,d));continue}a.next()}return c}function f(a,b){var d=h("utils"),c=g(a);c.reverse();e.each(c,function(c){a=d.replaceSubstring(a,b,c)});return a}function c(a){return g(a.content).length?!0:!!e.find(a.attributeList(),function(a){return!!g(a.value).length})}function b(a,b){var d=a.findAll(function(a){return c(a)});
|
d.each(j.children,function(a){d.each(g.attributeList(),function(b){a.attribute(b.name,b.value)})});g.replace(j.children)}else g.data("resource",j);f(g,b)})}h("abbreviationParser").addPreprocessor(function(d,b){var c=b.syntax||emmet.defaultSyntax();f(d,c)})});
|
||||||
c(a)&&d.unshift(a);d.length?e.each(d,function(a){a.content=f(a.content,b);e.each(a._attributes,function(a){a.value=f(a.value,b)})}):(d=a.deepestChild()||a,d.content=h("abbreviationUtils").insertChildContent(d.content,b))}var a=h("abbreviationParser"),d="$#";a.addPreprocessor(function(a,b){if(b.pastedContent){var d=h("utils").splitByLines(b.pastedContent,!0);a.findAll(function(a){if(a.hasImplicitRepeat)return a.data("paste",d),a.repeatCount=d.length})}});a.addPostprocessor(function(a,d){!a.findAll(function(a){var d=
|
emmet.exec(function(h,d){function f(a){for(var b=h("range"),c=[],a=h("stringStream").create(a);!a.eol();){if(a.peek()=="\\")a.next();else if(a.start=a.pos,a.match(e,!0)){c.push(b.create(a.start,e));continue}a.next()}return c}function i(a,b){var c=h("utils"),e=f(a);e.reverse();d.each(e,function(e){a=c.replaceSubstring(a,b,e)});return a}function b(a){return f(a.content).length?!0:!!d.find(a.attributeList(),function(a){return!!f(a.value).length})}function c(a,c,e){var f=a.findAll(function(a){return b(a)});
|
||||||
a.data("paste"),c="";e.isArray(d)?c=d[a.counter-1]:e.isFunction(d)?c=d(a.counter-1,a.content):d&&(c=d);c&&b(a,c);a.data("paste",null);return!e.isUndefined(d)}).length&&d.pastedContent&&b(a,d.pastedContent)})});emmet.exec(function(h,e){function g(f){var c=h("tagName");e.each(f.children,function(b){if(b.hasImplicitName()||b.data("forceNameResolving"))b._name=c.resolve(b.parent.name());g(b)});return f}h("abbreviationParser").addPostprocessor(g)});
|
b(a)&&f.unshift(a);f.length?d.each(f,function(a){a.content=i(a.content,c);d.each(a._attributes,function(a){a.value=i(a.value,c)})}):(a=a.deepestChild()||a,a.content=e?c:h("abbreviationUtils").insertChildContent(a.content,c))}var a=h("abbreviationParser"),e="$#";a.addPreprocessor(function(a,b){if(b.pastedContent){var c=h("utils"),e=d.map(c.splitByLines(b.pastedContent,!0),c.trim);a.findAll(function(a){if(a.hasImplicitRepeat)return a.data("paste",e),a.repeatCount=e.length})}});a.addPostprocessor(function(a,
|
||||||
emmet.define("cssParser",function(h,e){function g(a){return typeof a!=="undefined"}function f(){return{"char":i.chnum,line:i.linenum}}function c(a,b,d){var c=i,d=d||{};j.push({charstart:g(d["char"])?d["char"]:c.chnum,charend:g(d.charend)?d.charend:c.chnum,linestart:g(d.line)?d.line:c.linenum,lineend:g(d.lineend)?d.lineend:c.linenum,value:a,type:b||a})}function b(a,b){var d=i,c=b||{},e=g(c["char"])?c["char"]:d.chnum,c=g(c.line)?c.line:d.linenum;return{name:"ParseError",message:a+" at line "+(c+1)+
|
b){!a.findAll(function(a){var b=a.data("paste"),g="";d.isArray(b)?g=b[a.counter-1]:d.isFunction(b)?g=b(a.counter-1,a.content):b&&(g=b);g&&c(a,g,!!a.data("pasteOverwrites"));a.data("paste",null);return!!b}).length&&b.pastedContent&&c(a,b.pastedContent)})});emmet.exec(function(h,d){function f(i){var b=h("tagName");d.each(i.children,function(c){if(c.hasImplicitName()||c.data("forceNameResolving"))c._name=b.resolve(c.parent.name());f(c)});return i}h("abbreviationParser").addPostprocessor(f)});
|
||||||
" char "+(e+1),walker:d,tokens:j}}function a(a){var b=i,d=b.ch,e=f(),j=a?a+d:d,d=b.nextChar();for(a&&(e["char"]-=a.length);n(d)||m(d);)j+=d,d=b.nextChar();c(j,"identifier",e)}function d(){var d=i.ch;if(d===" "||d==="\t"){for(var e=i.ch,j="",g=f();e===" "||e==="\t";)j+=e,e=i.nextChar();c(j,"white",g)}else{if(d==="/"){var e=i,d=g=e.ch,h,u=f();h=e.nextChar();if(h!=="*")u.charend=u["char"],u.lineend=u.line,j=c(d,d,u);else{for(;!(g==="*"&&h==="/");)d+=h,g=h,h=e.nextChar();d+=h;e.nextChar();c(d,"comment",
|
emmet.define("cssParser",function(h,d){function f(a){return typeof a!=="undefined"}function i(){return{"char":g.chnum,line:g.linenum}}function b(a,b,c){var e=g,c=c||{};j.push({charstart:f(c["char"])?c["char"]:e.chnum,charend:f(c.charend)?c.charend:e.chnum,linestart:f(c.line)?c.line:e.linenum,lineend:f(c.lineend)?c.lineend:e.linenum,value:a,type:b||a})}function c(a,b){var c=g,e=b||{},d=f(e["char"])?e["char"]:c.chnum,e=f(e.line)?e.line:c.linenum;return{name:"ParseError",message:a+" at line "+(e+1)+
|
||||||
u)}return j}if(d==='"'||d==="'"){e=i;d=g=j=e.ch;u=f();for(j=e.nextChar();j!==g;){if(j==="\n")if(h=e.nextChar(),h==="\\")d+=j+h;else throw b("Unterminated string",u);else d+=j==="\\"?j+e.nextChar():j;j=e.nextChar()}d+=j;e.nextChar();c(d,"string",u)}else if(d==="("){e=i;j=e.ch;g=0;d=j;h=f();for(j=e.nextChar();j!==")"&&!g;){if(j==="(")g++;else if(j===")")g--;else if(j===!1)throw b("Unterminated brace",h);d+=j;j=e.nextChar()}d+=j;e.nextChar();c(d,"brace",h)}else{if(d==="-"||d==="."||m(d)){j=i;g=j.ch;
|
" char "+(d+1),walker:c,tokens:j}}function a(a){var c=g,e=c.ch,d=i(),j=a?a+e:e,e=c.nextChar();for(a&&(d["char"]-=a.length);m(e)||n(e);)j+=e,e=c.nextChar();b(j,"identifier",d)}function e(){var e=g.ch;if(e===" "||e==="\t"){for(var d=g.ch,j="",f=i();d===" "||d==="\t";)j+=d,d=g.nextChar();b(j,"white",f)}else{if(e==="/"){var d=g,e=f=d.ch,h,p=i();h=d.nextChar();if(h!=="*")p.charend=p["char"],p.lineend=p.line,j=b(e,e,p);else{for(;!(f==="*"&&h==="/");)e+=h,f=h,h=d.nextChar();e+=h;d.nextChar();b(e,"comment",
|
||||||
d=f();h=g;var u=h===".",z,g=j.nextChar();z=!m(g);if(u&&z)d.charend=d["char"],d.lineend=d.line,e=c(h,".",d);else if(h==="-"&&z)e=a("-");else{for(;g!==!1&&(m(g)||!u&&g===".");)g==="."&&(u=!0),h+=g,g=j.nextChar();c(h,"number",d)}return e}if(n(d))return a();if(l(d))return e=i,d=e.ch,j=f(),h=e.nextChar(),h==="="&&l(d,!0)?(d+=h,c(d,"match",j),e.nextChar(),g=void 0):(j.charend=j["char"]+1,j.lineend=j.line,c(d,d,j)),g;if(d==="\n")c("line"),i.nextChar();else throw b("Unrecognized character");}}}var i,j=[],
|
p)}return j}if(e==='"'||e==="'"){d=g;e=f=j=d.ch;p=i();for(j=d.nextChar();j!==f;){if(j==="\n")if(h=d.nextChar(),h==="\\")e+=j+h;else throw c("Unterminated string",p);else e+=j==="\\"?j+d.nextChar():j;j=d.nextChar()}e+=j;d.nextChar();b(e,"string",p)}else if(e==="("){d=g;j=d.ch;f=0;e=j;h=i();for(j=d.nextChar();j!==")"&&!f;){if(j==="(")f++;else if(j===")")f--;else if(j===!1)throw c("Unterminated brace",h);e+=j;j=d.nextChar()}e+=j;d.nextChar();b(e,"brace",h)}else{if(e==="-"||e==="."||n(e)){j=g;f=j.ch;
|
||||||
l,n,m;i={lines:null,total_lines:0,linenum:-1,line:"",ch:"",chnum:-1,init:function(a){var b=i;b.lines=a.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n");b.total_lines=b.lines.length;b.chnum=-1;b.linenum=-1;b.ch="";b.line="";b.nextLine();b.nextChar()},nextLine:function(){this.linenum+=1;this.line=this.total_lines<=this.linenum?!1:this.lines[this.linenum];if(this.chnum!==-1)this.chnum=0;return this.line},nextChar:function(){for(this.chnum+=1;this.line.charAt(this.chnum)==="";){if(this.nextLine()===
|
e=i();h=f;var p=h===".",v,f=j.nextChar();v=!n(f);if(p&&v)e.charend=e["char"],e.lineend=e.line,d=b(h,".",e);else if(h==="-"&&v)d=a("-");else{for(;f!==!1&&(n(f)||!p&&f===".");)f==="."&&(p=!0),h+=f,f=j.nextChar();b(h,"number",e)}return d}if(m(e))return a();if(l(e))return d=g,e=d.ch,j=i(),h=d.nextChar(),h==="="&&l(e,!0)?(e+=h,b(e,"match",j),d.nextChar(),f=void 0):(j.charend=j["char"]+1,j.lineend=j.line,b(e,e,j)),f;if(e==="\n")b("line"),g.nextChar();else throw c("Unrecognized character");}}}var g,j=[],
|
||||||
!1)return this.ch=!1;this.chnum=-1;return this.ch="\n"}return this.ch=this.line.charAt(this.chnum)},peek:function(){return this.line.charAt(this.chnum+1)}};n=function(a){return a==="_"||a==="-"||a>="a"&&a<="z"||a>="A"&&a<="Z"};m=function(a){return a!==!1&&a>="0"&&a<="9"};l=function(){for(var a="{}[]()+*=.,;:>~|\\%$#@^!".split(""),b="*^|$~".split(""),d={},c={},e=0;e<a.length;e+=1)d[a[e]]=!0;for(e=0;e<b.length;e+=1)c[b[e]]=!0;return function(a,b){return b?!!c[a]:!!d[a]}}();return{lex:function(a){i.init(a);
|
l,m,n;g={lines:null,total_lines:0,linenum:-1,line:"",ch:"",chnum:-1,init:function(a){var b=g;b.lines=a.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n");b.total_lines=b.lines.length;b.chnum=-1;b.linenum=-1;b.ch="";b.line="";b.nextLine();b.nextChar()},nextLine:function(){this.linenum+=1;this.line=this.total_lines<=this.linenum?!1:this.lines[this.linenum];if(this.chnum!==-1)this.chnum=0;return this.line},nextChar:function(){for(this.chnum+=1;this.line.charAt(this.chnum)==="";){if(this.nextLine()===
|
||||||
for(j=[];i.ch!==!1;)d();return j},parse:function(a){var b=0;return e.map(this.lex(a),function(d){if(d.type=="line")d.value=a.charAt(b)=="\r"&&a.charAt(b+1)=="\n"?"\r\n":a.charAt(b);return{type:d.type,start:b,end:b+=d.value.length}})},toSource:function(a){for(var b=0,d=a.length,c,e="";b<d;b+=1)c=a[b],e+=c.type==="line"?"\n":c.value;return e}}});
|
!1)return this.ch=!1;this.chnum=-1;return this.ch="\n"}return this.ch=this.line.charAt(this.chnum)},peek:function(){return this.line.charAt(this.chnum+1)}};m=function(a){return a=="&"||a==="_"||a==="-"||a>="a"&&a<="z"||a>="A"&&a<="Z"};n=function(a){return a!==!1&&a>="0"&&a<="9"};l=function(){for(var a="{}[]()+*=.,;:>~|\\%$#@^!".split(""),b="*^|$~".split(""),c={},e={},g=0;g<a.length;g+=1)c[a[g]]=!0;for(g=0;g<b.length;g+=1)e[b[g]]=!0;return function(a,b){return b?!!e[a]:!!c[a]}}();return{lex:function(a){g.init(a);
|
||||||
emmet.define("xmlParser",function(h){function e(a,d){function e(b){d.tokenize=b;return b(a,d)}var i=a.next();if(i=="<")if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?e(c("atom","]]\>")):null:a.match("--")?e(c("comment","--\>")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),e(b(1))):null;else if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),d.tokenize=c("meta","?>"),"meta";else{A=a.eat("/")?"closeTag":"openTag";a.eatSpace();for(z="";i=a.eat(/[^\s\u00a0=<>\"\'\/?]/);)z+=i;d.tokenize=g;return"tag"}else return i==
|
for(j=[];g.ch!==!1;)e();return j},parse:function(a){var b=0;return d.map(this.lex(a),function(c){if(c.type=="line")c.value=a.charAt(b)=="\r"&&a.charAt(b+1)=="\n"?"\r\n":a.charAt(b);return{type:c.type,start:b,end:b+=c.value.length}})},toSource:function(a){for(var b=0,c=a.length,e,g="";b<c;b+=1)e=a[b],g+=e.type==="line"?"\n":e.value;return g}}});
|
||||||
"&"?(a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"))?"atom":"error":(a.eatWhile(/[^&<]/),"text")}function g(a,b){var d=a.next();return d==">"||d=="/"&&a.eat(">")?(b.tokenize=e,A=d==">"?"endTag":"selfcloseTag","tag"):d=="="?(A="equals",null):/[\'\"]/.test(d)?(b.tokenize=f(d),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function f(a){return function(b,d){for(;!b.eol();)if(b.next()==a){d.tokenize=g;break}return"string"}}
|
emmet.define("xmlParser",function(h){function d(a,e){function g(b){e.tokenize=b;return b(a,e)}var d=a.next();if(d=="<")if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?g(b("atom","]]\>")):null:a.match("--")?g(b("comment","--\>")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),g(c(1))):null;else if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),e.tokenize=b("meta","?>"),"meta";else{w=a.eat("/")?"closeTag":"openTag";a.eatSpace();for(v="";d=a.eat(/[^\s\u00a0=<>\"\'\/?]/);)v+=d;e.tokenize=f;return"tag"}else return d==
|
||||||
function c(a,b){return function(d,c){for(;!d.eol();){if(d.match(b)){c.tokenize=e;break}d.next()}return a}}function b(a){return function(d,c){for(var i;(i=d.next())!=null;)if(i=="<")return c.tokenize=b(a+1),c.tokenize(d,c);else if(i==">")if(a==1){c.tokenize=e;break}else return c.tokenize=b(a-1),c.tokenize(d,c);return"meta"}}function a(){for(var a=arguments.length-1;a>=0;a--)k.cc.push(arguments[a])}function d(){a.apply(null,arguments);return!0}function i(){if(k.context)k.context=k.context.prev}function j(a){if(a==
|
"&"?(a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"))?"atom":"error":(a.eatWhile(/[^&<]/),"text")}function f(a,b){var c=a.next();return c==">"||c=="/"&&a.eat(">")?(b.tokenize=d,w=c==">"?"endTag":"selfcloseTag","tag"):c=="="?(w="equals",null):/[\'\"]/.test(c)?(b.tokenize=i(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function i(a){return function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=f;break}return"string"}}
|
||||||
"openTag")return k.tagName=z,d(o,l(k.startOfLine));else if(a=="closeTag")return a=!1,k.context?k.context.tagName!=z&&(u.implicitlyClosed.hasOwnProperty(k.context.tagName.toLowerCase())&&i(),a=!k.context||k.context.tagName!=z):a=!0,a&&(v="error"),d(n(a));return d()}function l(a){return function(b){if(b=="selfcloseTag"||b=="endTag"&&u.autoSelfClosers.hasOwnProperty(k.tagName.toLowerCase()))return m(k.tagName.toLowerCase()),d();if(b=="endTag"){m(k.tagName.toLowerCase());var b=k.tagName,c=u.doNotIndent.hasOwnProperty(b)||
|
function b(a,b){return function(c,e){for(;!c.eol();){if(c.match(b)){e.tokenize=d;break}c.next()}return a}}function c(a){return function(b,e){for(var g;(g=b.next())!=null;)if(g=="<")return e.tokenize=c(a+1),e.tokenize(b,e);else if(g==">")if(a==1){e.tokenize=d;break}else return e.tokenize=c(a-1),e.tokenize(b,e);return"meta"}}function a(){for(var a=arguments.length-1;a>=0;a--)k.cc.push(arguments[a])}function e(){a.apply(null,arguments);return!0}function g(){if(k.context)k.context=k.context.prev}function j(a){if(a==
|
||||||
k.context&&k.context.noIndent;k.context={prev:k.context,tagName:b,indent:k.indented,startOfLine:a,noIndent:c}}return d()}}function n(a){return function(b){a&&(v="error");if(b=="endTag")return i(),d();v="error";return d(arguments.callee)}}function m(a){for(var b;;){if(!k.context)break;b=k.context.tagName.toLowerCase();if(!u.contextGrabbers.hasOwnProperty(b)||!u.contextGrabbers[b].hasOwnProperty(a))break;i()}}function o(b){if(b=="word")return v="attribute",d(q,o);if(b=="endTag"||b=="selfcloseTag")return a();
|
"openTag")return k.tagName=v,e(o,l(k.startOfLine));else if(a=="closeTag")return a=!1,k.context?k.context.tagName!=v&&(p.implicitlyClosed.hasOwnProperty(k.context.tagName.toLowerCase())&&g(),a=!k.context||k.context.tagName!=v):a=!0,a&&(t="error"),e(m(a));return e()}function l(a){return function(b){if(b=="selfcloseTag"||b=="endTag"&&p.autoSelfClosers.hasOwnProperty(k.tagName.toLowerCase()))return n(k.tagName.toLowerCase()),e();if(b=="endTag"){n(k.tagName.toLowerCase());var b=k.tagName,c=p.doNotIndent.hasOwnProperty(b)||
|
||||||
v="error";return d(o)}function q(b){if(b=="equals")return d(r,o);u.allowMissing||(v="error");return b=="endTag"||b=="selfcloseTag"?a():d()}function r(b){if(b=="string")return d(t);if(b=="word"&&u.allowUnquoted)return v="string",d();v="error";return b=="endTag"||b=="selfCloseTag"?a():d()}function t(b){return b=="string"?d(t):a()}function x(a,b){if(a.sol())b.startOfLine=!0,b.indented=0;if(a.eatSpace())return null;v=A=z=null;var d=b.tokenize(a,b);b.type=A;if((d||A)&&d!="comment")for(k=b;;)if((b.cc.pop()||
|
k.context&&k.context.noIndent;k.context={prev:k.context,tagName:b,indent:k.indented,startOfLine:a,noIndent:c}}return e()}}function m(a){return function(b){a&&(t="error");if(b=="endTag")return g(),e();t="error";return e(arguments.callee)}}function n(a){for(var b;;){if(!k.context)break;b=k.context.tagName.toLowerCase();if(!p.contextGrabbers.hasOwnProperty(b)||!p.contextGrabbers[b].hasOwnProperty(a))break;g()}}function o(b){if(b=="word")return t="attribute",e(q,o);if(b=="endTag"||b=="selfcloseTag")return a();
|
||||||
j)(A||d))break;b.startOfLine=!1;return v||d}var u={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!0,allowMissing:!0},z=null,A=null,k=null,v;return{parse:function(a,b){for(var b=b||0,d={tokenize:e,cc:[],indented:0,startOfLine:!0,tagName:null,context:null},c=h("stringStream").create(a),i=[];!c.eol();)i.push({type:x(c,d),start:c.start+b,end:c.pos+b}),c.start=c.pos;return i}}});
|
t="error";return e(o)}function q(b){if(b=="equals")return e(s,o);p.allowMissing||(t="error");return b=="endTag"||b=="selfcloseTag"?a():e()}function s(b){if(b=="string")return e(r);if(b=="word"&&p.allowUnquoted)return t="string",e();t="error";return b=="endTag"||b=="selfCloseTag"?a():e()}function r(b){return b=="string"?e(r):a()}function u(a,b){if(a.sol())b.startOfLine=!0,b.indented=0;if(a.eatSpace())return null;t=w=v=null;var c=b.tokenize(a,b);b.type=w;if((c||w)&&c!="comment")for(k=b;;)if((b.cc.pop()||
|
||||||
emmet.define("utils",function(h,e){function g(c){this._data=[];this.length=0;c&&this.append(c)}var f="${0}";g.prototype={append:function(c){this._data.push(c);this.length+=c.length},toString:function(){return this._data.join("")},valueOf:function(){return this.toString()}};return{reTag:/<\/?[\w:\-]+(?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*\s*(\/?)>$/,endsWithTag:function(c){return this.reTag.test(c)},isNumeric:function(c){typeof c=="string"&&(c=c.charCodeAt(0));return c&&c>47&&
|
j)(w||c))break;b.startOfLine=!1;return t||c}var p={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!0,allowMissing:!0},v=null,w=null,k=null,t;return{parse:function(a,b){for(var b=b||0,c={tokenize:d,cc:[],indented:0,startOfLine:!0,tagName:null,context:null},e=h("stringStream").create(a),g=[];!e.eol();)g.push({type:u(e,c),start:e.start+b,end:e.pos+b}),e.start=e.pos;return g}}});
|
||||||
c<58},trim:function(c){return(c||"").replace(/^\s+|\s+$/g,"")},getNewline:function(){var c=h("resources");if(!c)return"\n";c=c.getVariable("newline");return e.isString(c)?c:"\n"},setNewline:function(c){var b=h("resources");b.setVariable("newline",c);b.setVariable("nl",c)},splitByLines:function(c,b){var a=this.getNewline(),a=(c||"").replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").replace(/\r/g,"\n").replace(/\n/g,a).split(a);b&&(a=e.filter(a,function(a){return a.length&&!!this.trim(a)},this));return a},
|
emmet.define("string-score",function(){return{score:function(h,d,f){if(h==d)return 1;if(d=="")return 0;for(var i=0,b=d.length,c=h.length,a,e=1,g=0,j,l,m,n;g<b;++g){m=d.charAt(g);j=h.indexOf(m.toLowerCase());l=h.indexOf(m.toUpperCase());n=Math.min(j,l);l=n>-1?n:Math.max(j,l);if(l===-1)if(f){e+=1-f;continue}else return 0;else j=0.1;h[l]===m&&(j+=0.1);l===0?(j+=0.6,g===0&&(a=1)):h.charAt(l-1)===" "&&(j+=0.8);h=h.substring(l+1,c);i+=j}h=i/b;b=(h*(b/c)+h)/2;b/=e;a&&b+0.15<1&&(b+=0.15);return b}}});
|
||||||
normalizeNewline:function(c){return this.splitByLines(c).join(this.getNewline())},repeatString:function(c,b){for(var a=[],d=0;d<b;d++)a.push(c);return a.join("")},padString:function(c,b){var a=e.isNumber(b)?this.repeatString(h("resources").getVariable("indentation")||"\t",b):b,d=[],i=this.splitByLines(c),j=this.getNewline();d.push(i[0]);for(var f=1;f<i.length;f++)d.push(j+a+i[f]);return d.join("")},zeroPadString:function(c,b){for(var a="",d=c.length;b>d++;)a+="0";return a+c},unindentString:function(c,
|
emmet.define("utils",function(h,d){function f(b){this._data=[];this.length=0;b&&this.append(b)}var i="${0}";f.prototype={append:function(b){this._data.push(b);this.length+=b.length},toString:function(){return this._data.join("")},valueOf:function(){return this.toString()}};return{reTag:/<\/?[\w:\-]+(?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*\s*(\/?)>$/,endsWithTag:function(b){return this.reTag.test(b)},isNumeric:function(b){typeof b=="string"&&(b=b.charCodeAt(0));return b&&b>47&&
|
||||||
b){for(var a=this.splitByLines(c),d=0;d<a.length;d++)a[d].search(b)==0&&(a[d]=a[d].substr(b.length));return a.join(this.getNewline())},replaceUnescapedSymbol:function(c,b,a){for(var d=0,i=c.length,j=b.length,f=0;d<i;)if(c.charAt(d)=="\\")d+=j+1;else if(c.substr(d,j)==b){var g=j;f++;var h=a;if(e.isFunction(a))(h=a(c,b,d,f))?(g=h[0].length,h=h[1]):h=!1;h===!1?d++:(c=c.substring(0,d)+h+c.substring(d+g),i=c.length,d+=h.length)}else d++;return c},replaceVariables:function(c,b){var b=b||{},a=e.isFunction(b)?
|
b<58},trim:function(b){return(b||"").replace(/^\s+|\s+$/g,"")},getNewline:function(){var b=h("resources");if(!b)return"\n";b=b.getVariable("newline");return d.isString(b)?b:"\n"},setNewline:function(b){var c=h("resources");c.setVariable("newline",b);c.setVariable("nl",b)},splitByLines:function(b,c){var a=this.getNewline(),a=(b||"").replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").replace(/\r/g,"\n").replace(/\n/g,a).split(a);c&&(a=d.filter(a,function(a){return a.length&&!!this.trim(a)},this));return a},
|
||||||
b:function(a,d){return d in b?b[d]:null},d=h("resources");return h("tabStops").processText(c,{variable:function(b){var c=a(b.token,b.name,b);c===null&&(c=d.getVariable(b.name));if(c===null||e.isUndefined(c))c=b.token;return c}})},replaceCounter:function(c,b){var b=String(b),a=this;return this.replaceUnescapedSymbol(String(c),"$",function(d,c,e){if(d.charAt(e+1)=="{"||a.isNumeric(d.charAt(e+1)))return!1;for(c=e+1;d.charAt(c)=="$"&&d.charAt(c+1)!="{";)c++;return[d.substring(e,c),a.zeroPadString(b,c-
|
normalizeNewline:function(b){return this.splitByLines(b).join(this.getNewline())},repeatString:function(b,c){for(var a=[],e=0;e<c;e++)a.push(b);return a.join("")},padString:function(b,c){var a=d.isNumber(c)?this.repeatString(h("resources").getVariable("indentation")||"\t",c):c,e=[],g=this.splitByLines(b),j=this.getNewline();e.push(g[0]);for(var f=1;f<g.length;f++)e.push(j+a+g[f]);return e.join("")},zeroPadString:function(b,c){for(var a="",e=b.length;c>e++;)a+="0";return a+b},unindentString:function(b,
|
||||||
e)]})},matchesTag:function(c){return this.reTag.test(c||"")},escapeText:function(c){return c.replace(/([\$\\])/g,"\\$1")},unescapeText:function(c){return c.replace(/\\(.)/g,"$1")},getCaretPlaceholder:function(){return e.isFunction(f)?f.apply(this,arguments):f},setCaretPlaceholder:function(c){f=c},getLinePadding:function(c){return(c.match(/^(\s+)/)||[""])[0]},getLinePaddingFromPosition:function(c,b){return this.getLinePadding(this.findNewlineBounds(c,b).substring(c))},escapeForRegexp:function(c){return c.replace(RegExp("[.*+?|()\\[\\]{}\\\\]",
|
c){for(var a=this.splitByLines(b),e=0;e<a.length;e++)a[e].search(c)==0&&(a[e]=a[e].substr(c.length));return a.join(this.getNewline())},replaceUnescapedSymbol:function(b,c,a){for(var e=0,g=b.length,j=c.length,f=0;e<g;)if(b.charAt(e)=="\\")e+=j+1;else if(b.substr(e,j)==c){var h=j;f++;var i=a;if(d.isFunction(a))(i=a(b,c,e,f))?(h=i[0].length,i=i[1]):i=!1;i===!1?e++:(b=b.substring(0,e)+i+b.substring(e+h),g=b.length,e+=i.length)}else e++;return b},replaceVariables:function(b,c){var c=c||{},a=d.isFunction(c)?
|
||||||
"g"),"\\$&")},prettifyNumber:function(c,b){return c.toFixed(typeof b=="undefined"?2:b).replace(/\.?0+$/,"")},stringBuilder:function(c){return new g(c)},replaceSubstring:function(c,b,a,d){if(e.isObject(a)&&"end"in a)d=a.end,a=a.start;e.isString(d)&&(d=a+d.length);e.isUndefined(d)&&(d=a);return a<0||a>c.length?c:c.substring(0,a)+b+c.substring(d)},narrowToNonSpace:function(c,b,a){b=h("range").create(b,a);for(a=/[\s\n\r\u00a0]/;b.start<b.end;){if(!a.test(c.charAt(b.start)))break;b.start++}for(;b.end>
|
c:function(a,b){return b in c?c[b]:null},e=h("resources");return h("tabStops").processText(b,{variable:function(b){var c=a(b.token,b.name,b);c===null&&(c=e.getVariable(b.name));if(c===null||d.isUndefined(c))c=b.token;return c}})},replaceCounter:function(b,c){var c=String(c),a=this;return this.replaceUnescapedSymbol(String(b),"$",function(b,g,d){if(b.charAt(d+1)=="{"||a.isNumeric(b.charAt(d+1)))return!1;for(g=d+1;b.charAt(g)=="$"&&b.charAt(g+1)!="{";)g++;return[b.substring(d,g),a.zeroPadString(c,g-
|
||||||
b.start;)if(b.end--,!a.test(c.charAt(b.end))){b.end++;break}return b},findNewlineBounds:function(c,b){for(var a=c.length,d=0,e=a-1,j=b-1;j>0;j--){var f=c.charAt(j);if(f=="\n"||f=="\r"){d=j+1;break}}for(j=b;j<a;j++)if(f=c.charAt(j),f=="\n"||f=="\r"){e=j;break}return h("range").create(d,e-d)},deepMerge:function(){var c,b,a,d,i,f=arguments[0]||{},g=1,h=arguments.length;for(!e.isObject(f)&&!e.isFunction(f)&&(f={});g<h;g++)if((c=arguments[g])!=null)for(b in c)a=f[b],d=c[b],f!==d&&(d&&(e.isObject(d)||(i=
|
d)]})},matchesTag:function(b){return this.reTag.test(b||"")},escapeText:function(b){return b.replace(/([\$\\])/g,"\\$1")},unescapeText:function(b){return b.replace(/\\(.)/g,"$1")},getCaretPlaceholder:function(){return d.isFunction(i)?i.apply(this,arguments):i},setCaretPlaceholder:function(b){i=b},getLinePadding:function(b){return(b.match(/^(\s+)/)||[""])[0]},getLinePaddingFromPosition:function(b,c){return this.getLinePadding(this.findNewlineBounds(b,c).substring(b))},escapeForRegexp:function(b){return b.replace(RegExp("[.*+?|()\\[\\]{}\\\\]",
|
||||||
e.isArray(d)))?(i?(i=!1,a=a&&e.isArray(a)?a:[]):a=a&&e.isObject(a)?a:{},f[b]=this.deepMerge(a,d)):d!==void 0&&(f[b]=d));return f}}});
|
"g"),"\\$&")},prettifyNumber:function(b,c){return b.toFixed(typeof c=="undefined"?2:c).replace(/\.?0+$/,"")},stringBuilder:function(b){return new f(b)},replaceSubstring:function(b,c,a,e){if(d.isObject(a)&&"end"in a)e=a.end,a=a.start;d.isString(e)&&(e=a+e.length);d.isUndefined(e)&&(e=a);return a<0||a>b.length?b:b.substring(0,a)+c+b.substring(e)},narrowToNonSpace:function(b,c,a){c=h("range").create(c,a);for(a=/[\s\n\r\u00a0]/;c.start<c.end;){if(!a.test(b.charAt(c.start)))break;c.start++}for(;c.end>
|
||||||
emmet.define("range",function(h,e){function g(f,c){e.isObject(f)&&"start"in f?(this.start=Math.min(f.start,f.end),this.end=Math.max(f.start,f.end)):e.isArray(f)?(this.start=f[0],this.end=f[1]):(c=e.isString(c)?c.length:+c,this.start=f,this.end=f+c)}g.prototype={length:function(){return Math.abs(this.end-this.start)},equal:function(e){return this.start===e.start&&this.end===e.end},shift:function(e){this.start+=e;this.end+=e;return this},overlap:function(e){return e.start<=this.end&&e.end>=this.start},
|
c.start;)if(c.end--,!a.test(b.charAt(c.end))){c.end++;break}return c},findNewlineBounds:function(b,c){for(var a=b.length,e=0,g=a-1,d=c-1;d>0;d--){var f=b.charAt(d);if(f=="\n"||f=="\r"){e=d+1;break}}for(d=c;d<a;d++)if(f=b.charAt(d),f=="\n"||f=="\r"){g=d;break}return h("range").create(e,g-e)},deepMerge:function(){var b,c,a,e,g,j=arguments[0]||{},f=1,h=arguments.length;for(!d.isObject(j)&&!d.isFunction(j)&&(j={});f<h;f++)if((b=arguments[f])!=null)for(c in b)a=j[c],e=b[c],j!==e&&(e&&(d.isObject(e)||(g=
|
||||||
intersection:function(e){if(this.overlap(e)){var c=Math.max(e.start,this.start);return new g(c,Math.min(e.end,this.end)-c)}return null},union:function(e){if(this.overlap(e)){var c=Math.min(e.start,this.start);return new g(c,Math.max(e.end,this.end)-c)}return null},inside:function(e){return this.start<=e&&this.end>e},include:function(e){return this.start<=e.start&&this.end>=e.end},substring:function(e){return this.length()>0?e.substring(this.start,this.end):""},clone:function(){return new g(this.start,
|
d.isArray(e)))?(g?(g=!1,a=a&&d.isArray(a)?a:[]):a=a&&d.isObject(a)?a:{},j[c]=this.deepMerge(a,e)):e!==void 0&&(j[c]=e));return j}}});
|
||||||
this.length())},toArray:function(){return[this.start,this.end]},toString:function(){return"{"+this.start+", "+this.length()+"}"}};return{create:function(f,c){return e.isUndefined(f)||f===null?null:f instanceof g?f:new g(f,c)},create2:function(f,c){e.isNumber(f)&&e.isNumber(c)&&(c-=f);return this.create(f,c)}}});
|
emmet.define("range",function(h,d){function f(b,c,a){switch(a){case "eq":case "==":return b===c;case "lt":case "<":return b<c;case "lte":case "<=":return b<=c;case "gt":case ">":return b>c;case "gte":case ">=":return b>=c}}function i(b,c){d.isObject(b)&&"start"in b?(this.start=Math.min(b.start,b.end),this.end=Math.max(b.start,b.end)):d.isArray(b)?(this.start=b[0],this.end=b[1]):(c=d.isString(c)?c.length:+c,this.start=b,this.end=b+c)}i.prototype={length:function(){return Math.abs(this.end-this.start)},
|
||||||
emmet.define("handlerList",function(h,e){function g(){this._list=[]}g.prototype={add:function(f,c){this._list.push(e.extend({order:0},c||{},{fn:f}))},remove:function(f){this._list=e.without(this._list,e.find(this._list,function(c){return c.fn===f}))},list:function(){return e.sortBy(this._list,"order").reverse()},listFn:function(){return e.pluck(this.list(),"fn")},exec:function(f,c){var c=c||[],b=null;e.find(this.list(),function(a){b=a.fn.apply(a,c);if(b!==f)return!0});return b}};return{create:function(){return new g}}});
|
equal:function(b){return this.cmp(b,"eq","eq")},shift:function(b){this.start+=b;this.end+=b;return this},overlap:function(b){return b.start<=this.end&&b.end>=this.start},intersection:function(b){if(this.overlap(b)){var c=Math.max(b.start,this.start);return new i(c,Math.min(b.end,this.end)-c)}return null},union:function(b){if(this.overlap(b)){var c=Math.min(b.start,this.start);return new i(c,Math.max(b.end,this.end)-c)}return null},inside:function(b){return this.cmp(b,"lte","gt")},contains:function(b){return this.cmp(b,
|
||||||
emmet.define("tokenIterator",function(h,e){function g(e){this.tokens=e;this._position=0;this.reset()}g.prototype={next:function(){if(this.hasNext()){var e=this.tokens[++this._i];this._position=e.start;return e}return null},current:function(){return this.tokens[this._i]},position:function(){return this._position},hasNext:function(){return this._i<this._il-1},reset:function(){this._i=-1;this._il=this.tokens.length},item:function(){return this.tokens[this._i]},itemNext:function(){return this.tokens[this._i+
|
"lt","gt")},include:function(){return this.cmp(loc,"lte","gte")},cmp:function(b,c,a){var e;b instanceof i?(e=b.start,b=b.end):e=b;return f(this.start,e,c||"<=")&&f(this.end,b,a||">")},substring:function(b){return this.length()>0?b.substring(this.start,this.end):""},clone:function(){return new i(this.start,this.length())},toArray:function(){return[this.start,this.end]},toString:function(){return"{"+this.start+", "+this.length()+"}"}};return{create:function(b,c){if(d.isUndefined(b)||b===null)return null;
|
||||||
1]},itemPrev:function(){return this.tokens[this._i-1]},nextUntil:function(f,c){for(var b,a=e.isString(f)?function(a){return a.type==f}:f;b=this.next();)if(c&&c.call(this,b),a.call(this,b))break}};return{create:function(e){return new g(e)}}});
|
if(b instanceof i)return b;if(d.isObject(b)&&"start"in b&&"end"in b)c=b.end-b.start,b=b.start;return new i(b,c)},create2:function(b,c){d.isNumber(b)&&d.isNumber(c)&&(c-=b);return this.create(b,c)}}});
|
||||||
emmet.define("stringStream",function(){function h(e){this.pos=this.start=0;this.string=e}h.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var g=this.string.charAt(this.pos);if(typeof e=="string"?g==e:g&&(e.test?e.test(g):e(g)))return++this.pos,g},eatWhile:function(e){for(var g=this.pos;this.eat(e););
|
emmet.define("handlerList",function(h,d){function f(){this._list=[]}f.prototype={add:function(f,b){this._list.push(d.extend({order:0},b||{},{fn:f}))},remove:function(f){this._list=d.without(this._list,d.find(this._list,function(b){return b.fn===f}))},list:function(){return d.sortBy(this._list,"order").reverse()},listFn:function(){return d.pluck(this.list(),"fn")},exec:function(f,b){var b=b||[],c=null;d.find(this.list(),function(a){c=a.fn.apply(a,b);if(c!==f)return!0});return c}};return{create:function(){return new f}}});
|
||||||
return this.pos>g},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){e=this.string.indexOf(e,this.pos);if(e>-1)return this.pos=e,!0},skipToPair:function(e,g){for(var f=0,c,b=this.pos,a=this.string.length;b<a;)if(c=this.string.charAt(b++),c==e)f++;else if(c==g&&(f--,f<1))return this.pos=b,!0;return!1},backUp:function(e){this.pos-=e},match:function(e,g,f){if(typeof e==
|
emmet.define("tokenIterator",function(h,d){function f(d){this.tokens=d;this._position=0;this.reset()}f.prototype={next:function(){if(this.hasNext()){var d=this.tokens[++this._i];this._position=d.start;return d}return null},current:function(){return this.tokens[this._i]},position:function(){return this._position},hasNext:function(){return this._i<this._il-1},reset:function(){this._i=-1;this._il=this.tokens.length},item:function(){return this.tokens[this._i]},itemNext:function(){return this.tokens[this._i+
|
||||||
"string"){if(f=f?function(c){return c.toLowerCase()}:function(c){return c},f(this.string).indexOf(f(e),this.pos)==this.pos)return g!==!1&&(this.pos+=e.length),!0}else return(e=this.string.slice(this.pos).match(e))&&g!==!1&&(this.pos+=e[0].length),e},current:function(){return this.string.slice(this.start,this.pos)}};return{create:function(e){return new h(e)}}});
|
1]},itemPrev:function(){return this.tokens[this._i-1]},nextUntil:function(f,b){for(var c,a=d.isString(f)?function(a){return a.type==f}:f;c=this.next();)if(b&&b.call(this,c),a.call(this,c))break}};return{create:function(d){return new f(d)}}});
|
||||||
emmet.define("resources",function(h,e){function g(a){return a==b?i:j}function f(b,d,c){var e=g(b),j=[],f=null;e&&d in e&&(f=e[d],c in f&&j.push(f[c]));var l=null;f&&"extends"in f?l=f:b==a&&d in i&&"extends"in i[d]&&(l=i[d]);if(l){if(!l["extends"]||!l["extends"].__emmet_parsed__){d=l["extends"].split(",");f=h("utils");for(b=0;b<d.length;b++)d[b]=f.trim(d[b]);l["extends"]=d;l["extends"].__emmet_parsed__=!0}for(b=0;b<l["extends"].length;b++)d=l["extends"][b],e[d]&&e[d][c]&&j.push(e[d][c])}return j}function c(a,
|
emmet.define("stringStream",function(){function h(d){this.pos=this.start=0;this.string=d}h.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(d){var f=this.string.charAt(this.pos);if(typeof d=="string"?f==d:f&&(d.test?d.test(f):d(f)))return++this.pos,f},eatWhile:function(d){for(var f=this.pos;this.eat(d););
|
||||||
b,c,e){for(var b=f(a,b,c),i=null,j=h("elements"),g=0,l=b.length;g<l;g++)if(a=b[g],e in a){if(!a[e]||!a[e].__emmet_parsed__){b=a[e];i=h("utils");b=i.replaceUnescapedSymbol(b,"|",i.getCaretPlaceholder());switch(c){case "abbreviations":c=a;g=j=e;i=b;h("utils").trim(g);l=h("elements");g=void 0;i=(g=d.exec(i))?l.create("element",g[1],g[2],g[4]=="/"):l.create("reference",i);c[j]=i;a[e].__ref=b;break;case "snippets":a[e]=j.create("snippet",b)}a[e].__emmet_parsed__=!0}i=a[e];break}return i}var b="system",
|
return this.pos>f},eatSpace:function(){for(var d=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>d},skipToEnd:function(){this.pos=this.string.length},skipTo:function(d){d=this.string.indexOf(d,this.pos);if(d>-1)return this.pos=d,!0},skipToPair:function(d,f){for(var h=0,b,c=this.pos,a=this.string.length;c<a;)if(b=this.string.charAt(c++),b==d)h++;else if(b==f&&(h--,h<1))return this.pos=c,!0;return!1},backUp:function(d){this.pos-=d},match:function(d,f,h){if(typeof d==
|
||||||
a="user",d=/^<(\w+\:?[\w\-]*)((?:\s+[\w\:\-]+\s*=\s*(['"]).*?\3)*)\s*(\/?)>/,i={},j={},l=h("handlerList").create();return{setVocabulary:function(a,d){d==b?i=a:j=a},getVocabulary:g,getResource:function(d,e,i){return c(a,d,e,i)||c(b,d,e,i)},getAbbreviation:function(a,b){b=b||"";return this.getResource(a,"abbreviations",b)||this.getResource(a,"abbreviations",b.replace(/\-/g,":"))},getSnippet:function(a,b){b=b||"";return this.getResource(a,"snippets",b)||this.getResource(a,"snippets",b.replace(/\-/g,
|
"string"){if(h=h?function(b){return b.toLowerCase()}:function(b){return b},h(this.string).indexOf(h(d),this.pos)==this.pos)return f!==!1&&(this.pos+=d.length),!0}else return(d=this.string.slice(this.pos).match(d))&&f!==!1&&(this.pos+=d[0].length),d},current:function(){return this.string.slice(this.start,this.pos)}};return{create:function(d){return new h(d)}}});
|
||||||
":"))},getMatchedResource:function(a,b){return l.exec(null,e.toArray(arguments))||this.getAbbreviation(b,a.name())||this.getSnippet(b,a.name())},getVariable:function(d){return f(a,"variables",d)[0]||f(b,"variables",d)[0]},setVariable:function(a,b){var d=g("user")||{};if(!("variables"in d))d.variables={};d.variables[a]=b;this.setVocabulary(d,"user")},getSubset:function(d,c){return f(a,d,c)[0]||f(b,d,c)[0]},hasSyntax:function(d){return d in g(a)||d in g(b)},addResolver:function(a,b){l.add(a,b)},removeResolver:function(a){l.remove(a)}}});
|
emmet.define("resources",function(h,d){function f(a,c,e){var d=h("utils"),c=d.replaceUnescapedSymbol(c,"|",d.getCaretPlaceholder());if(e=="snippets")return h("elements").create("snippet",c);if(e=="abbreviations"){e=c;h("utils").trim(a);var a=h("elements"),f;return(f=b.exec(e))?a.create("element",f[1],f[2],f[4]=="/"):a.create("reference",e)}}var i={},b=/^<(\w+\:?[\w\-]*)((?:\s+[\w\:\-]+\s*=\s*(['"]).*?\3)*)\s*(\/?)>/,c={},a={},e=h("handlerList").create();return{setVocabulary:function(b,e){i={};e==
|
||||||
emmet.define("actions",function(h,e){function g(c){return h("utils").trim(c.charAt(0).toUpperCase()+c.substring(1).replace(/_[a-z]/g,function(b){return" "+b.charAt(1).toUpperCase()}))}var f={};return{add:function(c,b,a){c=c.toLowerCase();a=a||{};if(!a.label)a.label=g(c);f[c]={name:c,fn:b,options:a}},get:function(c){return f[c.toLowerCase()]},run:function(c,b){e.isArray(b)||(b=e.rest(arguments));var a=this.get(c);return a?a.fn.apply(emmet,b):(emmet.log('Action "%s" is not defined',c),!1)},getAll:function(){return f},
|
"system"?c=b:a=b},getVocabulary:function(b){return b=="system"?c:a},getMatchedResource:function(a,b){return e.exec(null,d.toArray(arguments))||this.findSnippet(b,a.name())},getVariable:function(a){return(this.getSection("variables")||{})[a]},setVariable:function(a,b){var c=this.getVocabulary("user")||{};if(!("variables"in c))c.variables={};c.variables[a]=b;this.setVocabulary(c,"user")},hasSyntax:function(a){return a in this.getVocabulary("user")||a in this.getVocabulary("system")},addResolver:function(a,
|
||||||
getList:function(){return e.values(this.getAll())},getMenu:function(c){var b=[],c=c||[];e.each(this.getList(),function(a){if(!a.options.hidden&&!e.include(c,a.name)){var d=g(a.name),i=b;if(a.options.label)for(var j=a.options.label.split("/"),d=j.pop(),f,h;f=j.shift();)h=e.find(i,function(a){return a.type=="submenu"&&a.name==f}),h||(h={name:f,type:"submenu",items:[]},i.push(h)),i=h.items;i.push({type:"action",name:a.name,label:d})}});return b},getActionNameForMenuTitle:function(c,b){var a=null;e.find(b||
|
b){e.add(a,b)},removeResolver:function(a){e.remove(a)},getSection:function(b){if(!b)return null;b in i||(i[b]=h("utils").deepMerge({},c[b],a[b]));for(var e=i[b],f=d.rest(arguments),m;e&&(m=f.shift());)if(m in e)e=e[m];else return null;return e},findItem:function(a,b){for(var c=this.getSection(a);c;){if(b in c)return c[b];c=this.getSection(c["extends"])}},findSnippet:function(a,b,c){if(!a||!b)return null;var c=c||[],e=[b];~b.indexOf("-")&&e.push(b.replace(/\-/g,":"));var h=this.getSection(a),i=null;
|
||||||
this.getMenu(),function(b){if(b.type=="action"){if(b.label==c||b.name==c)return a=b.name}else return a=this.getActionNameForMenuTitle(c,b.items)},this);return a||null}}});
|
d.find(["snippets","abbreviations"],function(b){var c=this.getSection(a,b);if(c)return d.find(e,function(a){if(c[a])return i=f(a,c[a],b)})},this);c.push(a);return!i&&h["extends"]&&!d.include(c,h["extends"])?this.findSnippet(h["extends"],b,c):i},fuzzyFindSnippet:function(a,b,c){var c=c||0.3,a=this.getAllSnippets(a),e=h("string-score"),b=b.replace(/:$/,"").replace(/:/g,"-"),f=d.map(a,function(a,c){return{key:c,score:e.score(a.nk,b,0.1)}});if((f=d.last(d.sortBy(f,"score")))&&f.score>=c)return a[f.key].parsedValue},
|
||||||
emmet.define("profile",function(h,e){function g(b){e.extend(this,a,b)}function f(a,b){switch(String(b||"").toLowerCase()){case "lower":return a.toLowerCase();case "upper":return a.toUpperCase()}return a}function c(a,c){return b[a.toLowerCase()]=new g(c)}var b={},a={tag_case:"asis",attr_case:"asis",attr_quotes:"double",tag_nl:"decide",tag_nl_leaf:!1,place_cursor:!0,indent:!0,inline_break:3,self_closing_tag:"xhtml",filters:""};g.prototype={tagName:function(a){return f(a,this.tag_case)},attributeName:function(a){return f(a,
|
getAllSnippets:function(a){var b="all-"+a;if(!i[b]){var c=[],e=[];do{var h=this.getSection(a);if(!h)break;d.each(["snippets","abbreviations"],function(a){var b={};d.each(h[a]||null,function(c,e){b[e]={nk:e.replace(/:$/,"").replace(/:/g,"-"),value:c,parsedValue:f(e,c,a),type:a}});c.push(b)});e.push(a);a=h["extends"]}while(a&&!d.include(e,a));i[b]=d.extend.apply(d,c.reverse())}return i[b]}}});
|
||||||
this.attr_case)},attributeQuote:function(){return this.attr_quotes=="single"?"'":'"'},selfClosing:function(){return this.self_closing_tag=="xhtml"?" /":this.self_closing_tag===!0?"/":""},cursor:function(){return this.place_cursor?h("utils").getCaretPlaceholder():""}};c("xhtml");c("html",{self_closing_tag:!1});c("xml",{self_closing_tag:!0,tag_nl:!0});c("plain",{tag_nl:!1,indent:!1,place_cursor:!1});c("line",{tag_nl:!1,indent:!1});return{create:function(b,i){return arguments.length==2?c(b,i):new g(e.defaults(b||
|
emmet.define("actions",function(h,d){function f(b){return h("utils").trim(b.charAt(0).toUpperCase()+b.substring(1).replace(/_[a-z]/g,function(b){return" "+b.charAt(1).toUpperCase()}))}var i={};return{add:function(b,c,a){b=b.toLowerCase();a=a||{};if(!a.label)a.label=f(b);i[b]={name:b,fn:c,options:a}},get:function(b){return i[b.toLowerCase()]},run:function(b,c){d.isArray(c)||(c=d.rest(arguments));var a=this.get(b);return a?a.fn.apply(emmet,c):(emmet.log('Action "%s" is not defined',b),!1)},getAll:function(){return i},
|
||||||
{},a))},get:function(a,c){if(c&&e.isString(a)){var j=h("resources").getSubset(c,"profile");j&&(a=j)}return!a?b.plain:a instanceof g?a:e.isString(a)&&a.toLowerCase()in b?b[a.toLowerCase()]:this.create(a)},remove:function(a){a=(a||"").toLowerCase();a in b&&delete b[a]},stringCase:f}});
|
getList:function(){return d.values(this.getAll())},getMenu:function(b){var c=[],b=b||[];d.each(this.getList(),function(a){if(!a.options.hidden&&!d.include(b,a.name)){var e=f(a.name),g=c;if(a.options.label)for(var j=a.options.label.split("/"),e=j.pop(),h,i;h=j.shift();)i=d.find(g,function(a){return a.type=="submenu"&&a.name==h}),i||(i={name:h,type:"submenu",items:[]},g.push(i)),g=i.items;g.push({type:"action",name:a.name,label:e})}});return c},getActionNameForMenuTitle:function(b,c){var a=null;d.find(c||
|
||||||
emmet.define("editorUtils",function(h){return{isInsideTag:function(e,g){for(var f=/^<\/?\w[\w\:\-]*.*?>/,c=g;c>-1;){if(e.charAt(c)=="<")break;c--}return c!=-1&&(f=f.exec(e.substring(c)))&&g>c&&g<c+f[0].length?!0:!1},outputInfo:function(e,g,f){return{syntax:String(g||e.getSyntax()),profile:String(f||e.getProfileName()),content:String(e.getContent())}},unindent:function(e,g){return h("utils").unindentString(g,this.getCurrentLinePadding(e))},getCurrentLinePadding:function(e){return h("utils").getLinePadding(e.getCurrentLine())}}});
|
this.getMenu(),function(c){if(c.type=="action"){if(c.label==b||c.name==b)return a=c.name}else return a=this.getActionNameForMenuTitle(b,c.items)},this);return a||null}}});
|
||||||
emmet.define("actionUtils",function(h){return{mimeTypes:{gif:"image/gif",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",svg:"image/svg+xml",html:"text/html",htm:"text/html"},extractAbbreviation:function(e){for(var g=e.length,f=-1,c=0,b=0,a=0,d=h("utils"),i=h("abbreviationParser");;){g--;if(g<0){f=0;break}var j=e.charAt(g);if(j=="]")b++;else if(j=="["){if(!b){f=g+1;break}b--}else if(j=="}")a++;else if(j=="{"){if(!a){f=g+1;break}a--}else if(j==")")c++;else if(j=="("){if(!c){f=g+1;break}c--}else if(!b&&
|
emmet.define("profile",function(h,d){function f(a){d.extend(this,e,a)}function i(a,b){switch(String(b||"").toLowerCase()){case "lower":return a.toLowerCase();case "upper":return a.toUpperCase()}return a}function b(b,c){return a[b.toLowerCase()]=new f(c)}function c(){b("xhtml");b("html",{self_closing_tag:!1});b("xml",{self_closing_tag:!0,tag_nl:!0});b("plain",{tag_nl:!1,indent:!1,place_cursor:!1});b("line",{tag_nl:!1,indent:!1,extraFilters:"s"})}var a={},e={tag_case:"asis",attr_case:"asis",attr_quotes:"double",
|
||||||
!a&&(!i.isAllowedChar(j)||j==">"&&d.endsWithTag(e.substring(0,g+1)))){f=g+1;break}}return f!=-1&&!a&&!b&&!c?e.substring(f):""},getImageSize:function(e){var g=function(){return e.charCodeAt(f++)};if(e.substr(0,8)==="\u0089PNG\r\n\u001a\n"){var f=e.indexOf("IHDR")+4;return{width:g()<<24|g()<<16|g()<<8|g(),height:g()<<24|g()<<16|g()<<8|g()}}else if(e.substr(0,4)==="GIF8")return f=6,{width:g()|g()<<8,height:g()|g()<<8};else if(e.substr(0,2)==="\u00ff\u00d8")for(var f=2,c=e.length;f<c;){if(g()!=255)break;
|
tag_nl:"decide",tag_nl_leaf:!1,place_cursor:!0,indent:!0,inline_break:3,self_closing_tag:"xhtml",filters:"",extraFilters:""};f.prototype={tagName:function(a){return i(a,this.tag_case)},attributeName:function(a){return i(a,this.attr_case)},attributeQuote:function(){return this.attr_quotes=="single"?"'":'"'},selfClosing:function(){return this.self_closing_tag=="xhtml"?" /":this.self_closing_tag===!0?"/":""},cursor:function(){return this.place_cursor?h("utils").getCaretPlaceholder():""}};c();return{create:function(a,
|
||||||
var b=g();if(b==218)break;var a=g()<<8|g();if(b>=192&&b<=207&&!(b&4)&&!(b&8))return f+=1,{height:g()<<8|g(),width:g()<<8|g()};else f+=a-2}},captureContext:function(e){if(String(e.getSyntax())in{html:1,xml:1,xsl:1}){var g=h("html_matcher").getTags(String(e.getContent()),e.getCaretPos(),String(e.getProfileName()));if(g&&g[0]&&g[0].type=="tag"){for(var e=/([\w\-:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,f=g[0],g=f.full_tag.replace(/^<[\w\-\:]+/,""),f={name:f.name,attributes:[]},
|
c){return arguments.length==2?b(a,c):new f(d.defaults(a||{},e))},get:function(b,c){if(!b&&c){var e=h("resources").findItem(c,"profile");e&&(b=e)}return!b?a.plain:b instanceof f?b:d.isString(b)&&b.toLowerCase()in a?a[b.toLowerCase()]:this.create(b)},remove:function(b){b=(b||"").toLowerCase();b in a&&delete a[b]},reset:function(){a={};c()},stringCase:i}});
|
||||||
c;c=e.exec(g);)f.attributes.push({name:c[1],value:c[2]});return f}}return null},findExpressionBounds:function(e,g){for(var f=String(e.getContent()),c=f.length,b=e.getCaretPos()-1,a=b+1;b>=0&&g(f.charAt(b),b,f);)b--;for(;a<c&&g(f.charAt(a),a,f);)a++;if(a>b)return h("range").create([++b,a])},compoundUpdate:function(e,g){if(g){var f=e.getSelectionRange();e.replaceContent(g.data,g.start,g.end,!0);e.createSelection(g.caret,g.caret+f.end-f.start);return!0}return!1}}});
|
emmet.define("editorUtils",function(h){return{isInsideTag:function(d,f){for(var h=/^<\/?\w[\w\:\-]*.*?>/,b=f;b>-1;){if(d.charAt(b)=="<")break;b--}return b!=-1&&(h=h.exec(d.substring(b)))&&f>b&&f<b+h[0].length?!0:!1},outputInfo:function(d,f,h){h=h||d.getProfileName();return{syntax:String(f||d.getSyntax()),profile:h?String(h):null,content:String(d.getContent())}},unindent:function(d,f){return h("utils").unindentString(f,this.getCurrentLinePadding(d))},getCurrentLinePadding:function(d){return h("utils").getLinePadding(d.getCurrentLine())}}});
|
||||||
emmet.define("abbreviationUtils",function(h,e){return{isSnippet:function(e){return h("elements").is(e.matchedResource(),"snippet")},isUnary:function(e){var f=e.matchedResource();return e.children.length||this.isSnippet(e)?!1:f&&f.is_empty||h("tagName").isEmptyElement(e.name())},isInline:function(e){return e.isTextNode()||!e.name()||h("tagName").isInlineLevel(e.name())},isBlock:function(e){return h("elements").is(e.matchedResource(),"snippet")||!this.isInline(e)},hasTagsInContent:function(e){return h("utils").matchesTag(e.content)},
|
emmet.define("actionUtils",function(h){return{mimeTypes:{gif:"image/gif",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",svg:"image/svg+xml",html:"text/html",htm:"text/html"},extractAbbreviation:function(d){for(var f=d.length,i=-1,b=0,c=0,a=0,e=h("utils"),g=h("abbreviationParser");;){f--;if(f<0){i=0;break}var j=d.charAt(f);if(j=="]")c++;else if(j=="["){if(!c){i=f+1;break}c--}else if(j=="}")a++;else if(j=="{"){if(!a){i=f+1;break}a--}else if(j==")")b++;else if(j=="("){if(!b){i=f+1;break}b--}else if(!c&&
|
||||||
hasBlockChildren:function(h){return this.hasTagsInContent(h)&&this.isBlock(h)||e.any(h.children,function(e){return this.isBlock(e)},this)},insertChildContent:function(g,f,c){var c=e.extend({keepVariable:!0,appendIfNoChild:!0},c||{}),b=!1,a=h("utils"),g=a.replaceVariables(g,function(d,e,j){var h=d;e=="child"&&(h=a.padString(f,a.getLinePaddingFromPosition(g,j.start)),b=!0,c.keepVariable&&(h+=d));return h});!b&&c.appendIfNoChild&&(g+=f);return g}}});
|
!a&&(!g.isAllowedChar(j)||j==">"&&e.endsWithTag(d.substring(0,f+1)))){i=f+1;break}}return i!=-1&&!a&&!c&&!b?d.substring(i).replace(/^[\*\+\>\^]+/,""):""},getImageSize:function(d){var f=function(){return d.charCodeAt(h++)};if(d.substr(0,8)==="\u0089PNG\r\n\u001a\n"){var h=d.indexOf("IHDR")+4;return{width:f()<<24|f()<<16|f()<<8|f(),height:f()<<24|f()<<16|f()<<8|f()}}else if(d.substr(0,4)==="GIF8")return h=6,{width:f()|f()<<8,height:f()|f()<<8};else if(d.substr(0,2)==="\u00ff\u00d8")for(var h=2,b=d.length;h<
|
||||||
emmet.define("base64",function(){return{encode:function(h){for(var e=[],g,f,c,b,a,d,i=0,j=h.length;i<j;)b=h.charCodeAt(i++),a=h.charCodeAt(i++),d=h.charCodeAt(i++),g=b&255,f=a&255,c=d&255,b=g>>2,g=(g&3)<<4|f>>4,f=(f&15)<<2|c>>6,c&=63,isNaN(a)?f=c=64:isNaN(d)&&(c=64),e.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+
|
b;){if(f()!=255)break;var c=f();if(c==218)break;var a=f()<<8|f();if(c>=192&&c<=207&&!(c&4)&&!(c&8))return h+=1,{height:f()<<8|f(),width:f()<<8|f()};else h+=a-2}},captureContext:function(d){if(String(d.getSyntax())in{html:1,xml:1,xsl:1}){var f=String(d.getContent()),i=h("htmlMatcher").find(f,d.getCaretPos());if(i&&i.type=="tag"){for(var d=/([\w\-:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,i=i.open,f=i.range.substring(f).replace(/^<[\w\-\:]+/,""),i={name:i.name,attributes:[]},
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c));return e.join("")},decode:function(h){var e,g,f,c,b,a=0,d=0,i=[],j=h.length;if(!h)return h;h+="";do e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),
|
b;b=d.exec(f);)i.attributes.push({name:b[1],value:b[2]});return i}}return null},findExpressionBounds:function(d,f){for(var i=String(d.getContent()),b=i.length,c=d.getCaretPos()-1,a=c+1;c>=0&&f(i.charAt(c),c,i);)c--;for(;a<b&&f(i.charAt(a),a,i);)a++;if(a>c)return h("range").create([++c,a])},compoundUpdate:function(d,f){if(f){var h=d.getSelectionRange();d.replaceContent(f.data,f.start,f.end,!0);d.createSelection(f.caret,f.caret+h.end-h.start);return!0}return!1},detectSyntax:function(d,f){var i=f||"html";
|
||||||
f=e<<18|g<<12|c<<6|b,e=f>>16&255,g=f>>8&255,f&=255,c==64?i[d++]=String.fromCharCode(e):b==64?i[d++]=String.fromCharCode(e,g):i[d++]=String.fromCharCode(e,g,f);while(a<j);return i.join("")}}});
|
h("resources").hasSyntax(i)||(i="html");if(i=="html"&&(this.isStyle(d)||this.isInlineCSS(d)))i="css";return i},detectProfile:function(d){var f=d.getSyntax(),i=h("resources").findItem(f,"profile");if(i)return i;switch(f){case "xml":case "xsl":return"xml";case "css":if(this.isInlineCSS(d))return"line";break;case "html":return(i=h("resources").getVariable("profile"))||(i=this.isXHTML(d)?"xhtml":"html"),i}return"xhtml"},isXHTML:function(d){return d.getContent().search(/<!DOCTYPE[^>]+XHTML/i)!=-1},isStyle:function(d){var f=
|
||||||
(function(){function h(a){if(!a||a!="html")a="xhtml";n=a}function e(a,b){var d=a[1].toLowerCase();return{name:d,full_tag:a[0],start:b,end:b+a[0].length,unary:Boolean(a[3])||d in j&&n=="html",has_close:Boolean(a[3]),type:"tag",close_self:d in l&&n=="html"}}function g(a,b){return{start:a,end:b,type:"comment"}}function f(a){for(var b={},a=a.split(","),d=0;d<a.length;d++)b[a[d]]=!0;return b}function c(a,b,d){var d=d||0,c=-1,e=-1;if(a&&!b)c=a.start,e=a.end;else if(a&&b)a.start<d&&a.end>d||b.start<=d&&
|
String(d.getContent()),d=d.getCaretPos();return(f=h("htmlMatcher").tag(f,d))&&f.open.name.toLowerCase()=="style"&&f.innerRange.cmp(d,"lte","gte")},isInlineCSS:function(d){var f=String(d.getContent()),d=d.getCaretPos();return(f=h("xmlEditTree").parseFromPosition(f,d,!0))?(f=f.itemFromPosition(d,!0))&&f.name().toLowerCase()=="style"&&f.valueRange(!0).cmp(d,"lte","gte"):!1}}});
|
||||||
b.end>d?(c=a.start,e=b.end):(c=a.end,e=b.start);return[c,e]}function b(a,b,d){m.opening_tag=a;m.closing_tag=b;a=c(a,b,d||0);m.start_ix=a[0];m.end_ix=a[1];return m.start_ix!=-1?[m.start_ix,m.end_ix]:null}function a(a,b,j,f){function n(b,d){arguments.length==1&&(d=w);return a.substr(d,b.length)==b}function m(b){for(;b--;)if(a.charAt(b)=="<"&&n("<\!--",b))break;return b}f=f||c;h(j);var j=[],k=[],l=null,q=null,o=a.length,s,w;j.last=k.last=function(){return this[this.length-1]};for(w=b;w--&&w>=0;)if(s=
|
emmet.define("abbreviationUtils",function(h,d){return{isSnippet:function(d){return h("elements").is(d.matchedResource(),"snippet")},isUnary:function(d){var i=d.matchedResource();return d.children.length||this.isSnippet(d)?!1:i&&i.is_empty||h("tagName").isEmptyElement(d.name())},isInline:function(d){return d.isTextNode()||!d.name()||h("tagName").isInlineLevel(d.name())},isBlock:function(d){return this.isSnippet(d)||!this.isInline(d)},isSnippet:function(d){return h("elements").is(d.matchedResource(),
|
||||||
a.charAt(w),s=="<"){var y=a.substring(w,o);if(s=y.match(i))s=e(s,w),s.start<b&&s.end>b?q=s:k.push(s);else if(s=y.match(d))if(s=e(s,w),s.unary){if(s.start<b&&s.end>b)return f(s,null,b)}else if(k.last()&&k.last().name==s.name)k.pop();else{l=s;break}else if(y.indexOf("<\!--")==0&&(s=y.search("--\>")+w+3,w<b&&s>=b))return f(g(w,s))}else s=="-"&&n("--\>")&&(w=m(w));if(!l)return f(null);if(!q)for(w=b;w<o;w++)if(s=a.charAt(w),s=="<")if(y=a.substring(w,o),s=y.match(d))s=e(s,w),s.unary||j.push(s);else if(s=
|
"snippet")},hasTagsInContent:function(d){return h("utils").matchesTag(d.content)},hasBlockChildren:function(h){return this.hasTagsInContent(h)&&this.isBlock(h)||d.any(h.children,function(d){return this.isBlock(d)},this)},insertChildContent:function(f,i,b){var b=d.extend({keepVariable:!0,appendIfNoChild:!0},b||{}),c=!1,a=h("utils"),f=a.replaceVariables(f,function(e,d,h){var l=e;d=="child"&&(l=a.padString(i,a.getLinePaddingFromPosition(f,h.start)),c=!0,b.keepVariable&&(l+=e));return l});!c&&b.appendIfNoChild&&
|
||||||
y.match(i))if(s=e(s,w),j.last()&&j.last().name==s.name)j.pop();else{q=s;break}else n("<\!--")&&(w+=y.search("--\>")+2);else if(s=="-"&&n("--\>")&&(!j.last()||j.last().type!="comment"))return s=w+3,f(g(m(w),s));return f(l,q,b)}var d=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,i=/^<\/([\w\:\-]+)[^>]*>/,j=f("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed");f("address,applet,blockquote,button,center,dd,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul");
|
(f+=i);return f}}});
|
||||||
f("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");var l=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),n="xhtml",m={opening_tag:null,closing_tag:null,start_ix:-1,end_ix:-1},o=function(d,c,e){return a(d,c,e,b)};o.start_tag=d;o.end_tag=i;o.find=function(b,d,c){return a(b,d,c)};o.getTags=function(b,d,c){return a(b,d,c,function(a,b){return[a,b]})};o.last_match=
|
emmet.define("base64",function(){return{encode:function(h){for(var d=[],f,i,b,c,a,e,g=0,j=h.length;g<j;)c=h.charCodeAt(g++),a=h.charCodeAt(g++),e=h.charCodeAt(g++),f=c&255,i=a&255,b=e&255,c=f>>2,f=(f&3)<<4|i>>4,i=(i&15)<<2|b>>6,b&=63,isNaN(a)?i=b=64:isNaN(e)&&(b=64),d.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(i)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b));
|
||||||
m;try{emmet.define("html_matcher",function(){return o})}catch(q){}})();
|
return d.join("")},decode:function(h){var d,f,i,b,c,a=0,e=0,g=[],j=h.length;if(!h)return h;h+="";do d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),i=d<<18|f<<12|b<<6|c,d=i>>16&
|
||||||
emmet.define("tabStops",function(h,e){var g=100,f=0,c={replaceCarets:!1,escape:function(b){return"\\"+b},tabstop:function(b){return b.token},variable:function(b){return b.token}};h("abbreviationParser").addOutputProcessor(function(b,a){var d=0,c=h("tabStops"),e=h("utils"),b=c.processText(b,{tabstop:function(a){var b=parseInt(a.group);if(b==0)return"${0}";b>d&&(d=b);return a.placeholder?"${"+(b+f)+":"+a.placeholder+"}":"${"+(b+f)+"}"}}),b=e.replaceVariables(b,c.variablesResolver(a));f+=d+1;return b});
|
255,f=i>>8&255,i&=255,b==64?g[e++]=String.fromCharCode(d):c==64?g[e++]=String.fromCharCode(d,f):g[e++]=String.fromCharCode(d,f,i);while(a<j);return g.join("")}}});
|
||||||
return{extract:function(b,a){var d=h("utils"),i={carets:""},j=[],a=e.extend({},c,a,{tabstop:function(a){var b=a.token,d="";if(a.placeholder=="cursor")j.push({start:a.start,end:a.start+b.length,group:"carets",value:""});else{if("placeholder"in a)i[a.group]=a.placeholder;a.group in i&&(d=i[a.group]);j.push({start:a.start,end:a.start+b.length,group:a.group,value:d})}return b}});a.replaceCarets&&(b=b.replace(RegExp(d.escapeForRegexp(d.getCaretPlaceholder()),"g"),"${0:cursor}"));var b=this.processText(b,
|
emmet.define("htmlMatcher",function(h,d){function f(b){var d={},j;return{open:function(a){return(a=this.matches(a))&&a.type=="open"?a:null},close:function(a){return(a=this.matches(a))&&a.type=="close"?a:null},matches:function(f){var i="p"+f;if(!(i in d)&&b.charAt(f)=="<"){var n=b.slice(f);d[i]=(j=n.match(c))?{name:j[1],selfClose:!!j[3],range:h("range").create(f,j[0]),type:"open"}:(j=n.match(a))?{name:j[1],range:h("range").create(f,j[0]),type:"close"}:!1}return d[i]},text:function(){return b}}}function i(a,
|
||||||
a),f=d.stringBuilder(),g=0,d=e.map(j,function(a){f.append(b.substring(g,a.start));var d=f.length,c=i[a.group]||"";f.append(c);g=a.end;return{group:a.group,start:d,end:d+c.length}});f.append(b.substring(g));return{text:f.toString(),tabstops:e.sortBy(d,"start")}},processText:function(b,a){for(var a=e.extend({},c,a),d=h("utils").stringBuilder(),i=h("stringStream").create(b),j,f;j=i.next();)if(j=="\\"&&!i.eol())d.append(a.escape(i.next()));else{f=j;if(j=="$")if(i.start=i.pos-1,i.match(/^[0-9]+/))f=a.tabstop({start:d.length,
|
b,c){return a.substring(b,b+c.length)==c}function b(a,b){for(var c=[],h=null,f=b.text(),n=a.range.end,o=f.length;n<o;n++){if(i(f,n,"<\!--"))for(h=n;h<o;h++)if(i(f,h,"--\>")){n=h+3;break}if(h=b.matches(n))if(h.type=="open"&&!h.selfClose)c.push(h.name);else if(h.type=="close"){if(!c.length)return h.name==a.name?h:null;if(d.last(c)==h.name)c.pop();else{for(var q=!1;c.length&&!q;)c.pop()==h.name&&(q=!0);if(!c.length&&!q)return h.name==a.name?h:null}}}}var c=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
|
||||||
group:i.current().substr(1),token:i.current()});else if(j=i.match(/^\{([a-z_\-][\w\-]*)\}/))f=a.variable({start:d.length,name:j[1],token:i.current()});else if(j=i.match(/^\{([0-9]+)(:.+?)?\}/)){f={start:d.length,group:j[1],token:i.current()};if(j[2])f.placeholder=j[2].substr(1);f=a.tabstop(f)}d.append(f)}return d.toString()},upgrade:function(b,a){var d=0,c={tabstop:function(b){var c=parseInt(b.group);c>d&&(d=c);return b.placeholder?"${"+(c+a)+":"+b.placeholder+"}":"${"+(c+a)+"}"}};e.each(["start",
|
a=/^<\/([\w\:\-]+)[^>]*>/;return{find:function(a,c){for(var j=h("range"),l=f(a),m=null,n=null,o=c;o>=0;o--)if(m=l.open(o)){if(m.selfClose&&m.range.cmp(c,"lt","gt"))break;if(n=b(m,l)){if(j.create2(m.range.start,n.range.end).contains(c))break}else if(m.range.contains(c))break;m=null}else if(i(a,o,"--\>"))for(var q=o-1;q>=0;q--)if(i(a,q,"--\>"))break;else{if(i(a,q,"<\!--")){o=q;break}}else if(i(a,o,"<\!--")){q=o+4;for(m=a.length;q<m;q++)if(i(a,q,"--\>")){q+=3;break}m={range:h("range").create(o,d.isNumber(q)?
|
||||||
"end","content"],function(a){b[a]=this.processText(b[a],c)},this);return d},variablesResolver:function(b){var a={},d=h("resources");return function(c,f){if(f=="child")return c;if(f=="cursor")return h("utils").getCaretPlaceholder();var l=b.attribute(f);if(!e.isUndefined(l))return l;if(l=d.getVariable(f))return l;a[f]||(a[f]=g++);return"${"+a[f]+":"+f+"}"}},resetPlaceholderCounter:function(){console.log("deprecated");g=100},resetTabstopIndex:function(){f=0;g=100}}});
|
q-o:q[0]),type:"comment"};break}if(m)return q=o=null,n?(o=j.create2(m.range.start,n.range.end),q=j.create2(m.range.end,n.range.start)):o=q=j.create2(m.range.start,m.range.end),m.type=="comment"&&(j=o.substring(a),q.start+=j.length-j.replace(/^<\!--\s*/,"").length,q.end-=j.length-j.replace(/\s*--\>$/,"").length),{open:m,close:n,type:m.type=="comment"?"comment":"tag",innerRange:q,innerContent:function(){return this.innerRange.substring(a)},outerRange:o,outerContent:function(){return this.outerRange.substring(a)},
|
||||||
emmet.define("preferences",function(h,e){var g={},f={},c=null,b=null;return{define:function(a,b,c){var j=a;e.isString(a)&&(j={},j[a]={value:b,description:c});e.each(j,function(a,b){f[b]=e.isObject(a)&&"value"in a&&e.keys(a).length<3?a:{value:a}})},set:function(a,b){var c=a;e.isString(a)&&(c={},c[a]=b);e.each(c,function(a,b){if(!(b in f))throw'Property "'+b+'" is not defined. You should define it first with `define` method of current module';if(a!==f[b].value){switch(typeof f[b].value){case "boolean":var d=
|
range:!q.length()||!q.cmp(c,"lte","gte")?o:q,content:function(){return this.range.substring(a)},source:a}},tag:function(a,b){var c=this.find(a,b);if(c&&c.type=="tag")return c}}});
|
||||||
a;e.isString(d)?(d=d.toLowerCase(),a=d=="yes"||d=="true"||d=="1"):a=!!d;break;case "number":a=parseInt(a+"",10)||0;break;default:a+=""}g[b]=a}else b in g&&delete g[p]})},get:function(a){if(a in g)return g[a];if(a in f)return f[a].value},getArray:function(a){a=this.get(a);e.isUndefined(a)||(a=e.map(a.split(","),h("utils").trim),a.length||(a=null));return a},description:function(a){return a in f?f[a].description:void 0},remove:function(a){e.isArray(a)||(a=[a]);e.each(a,function(a){a in g&&delete g[a];
|
emmet.define("tabStops",function(h,d){var f=100,i=0,b={replaceCarets:!1,escape:function(b){return"\\"+b},tabstop:function(b){return b.token},variable:function(b){return b.token}};h("abbreviationParser").addOutputProcessor(function(b,a){var e=0,d=h("tabStops"),f=h("utils"),l={tabstop:function(a){var b=parseInt(a.group);if(b==0)return"${0}";b>e&&(e=b);return a.placeholder?(b+=i,a=d.processText(a.placeholder,l),"${"+b+":"+a+"}"):"${"+(b+i)+"}"}},b=d.processText(b,l),b=f.replaceVariables(b,d.variablesResolver(a));
|
||||||
a in f&&delete f[a]})},list:function(){return e.map(e.keys(f).sort(),function(a){return{name:a,value:this.get(a),type:typeof f[a].value,description:f[a].description}},this)},load:function(a){e.each(a,function(a,b){this.set(b,a)},this)},exportModified:function(){return e.clone(g)},reset:function(){g={}},_startTest:function(){c=f;b=g;f={};g={}},_stopTest:function(){f=c;g=b}}});
|
i+=e+1;return b});return{extract:function(c,a){var e=h("utils"),g={carets:""},f=[],a=d.extend({},b,a,{tabstop:function(a){var b=a.token,c="";if(a.placeholder=="cursor")f.push({start:a.start,end:a.start+b.length,group:"carets",value:""});else{if("placeholder"in a)g[a.group]=a.placeholder;a.group in g&&(c=g[a.group]);f.push({start:a.start,end:a.start+b.length,group:a.group,value:c})}return b}});a.replaceCarets&&(c=c.replace(RegExp(e.escapeForRegexp(e.getCaretPlaceholder()),"g"),"${0:cursor}"));var c=
|
||||||
emmet.define("filters",function(h,e){function g(c){return!c?[]:e.isString(c)?c.split(/[\|,]/g):c}var f={};return{add:function(c,b){f[c]=b},apply:function(c,b,a){var d=h("utils"),a=h("profile").get(a);e.each(g(b),function(b){(b=d.trim(b.toLowerCase()))&&b in f&&(c=f[b](c,a))});return c},composeList:function(c,b,a){b=h("profile").get(b);c=g(b.filters||h("resources").getSubset(c,"filters")||"html");a&&(c=c.concat(g(a)));if(!c||!c.length)c=g("html");return c},extractFromAbbreviation:function(c){var b=
|
this.processText(c,a),i=e.stringBuilder(),m=0,e=d.map(f,function(a){i.append(c.substring(m,a.start));var b=i.length,e=g[a.group]||"";i.append(e);m=a.end;return{group:a.group,start:b,end:b+e.length}});i.append(c.substring(m));return{text:i.toString(),tabstops:d.sortBy(e,"start")}},processText:function(c,a){for(var a=d.extend({},b,a),e=h("utils").stringBuilder(),g=h("stringStream").create(c),f,i;f=g.next();)if(f=="\\"&&!g.eol())e.append(a.escape(g.next()));else{i=f;if(f=="$")if(g.start=g.pos-1,g.match(/^[0-9]+/))i=
|
||||||
"",c=c.replace(/\|([\w\|\-]+)$/,function(a,d){b=d;return""});return[c,g(b)]}}});
|
a.tabstop({start:e.length,group:g.current().substr(1),token:g.current()});else if(f=g.match(/^\{([a-z_\-][\w\-]*)\}/))i=a.variable({start:e.length,name:f[1],token:g.current()});else if(f=g.match(/^\{([0-9]+)(:.+?)?\}/,!1)){g.skipToPair("{","}");i={start:e.length,group:f[1],token:g.current()};if(f=i.token.substring(i.group.length+2,i.token.length-1))i.placeholder=f.substr(1);i=a.tabstop(i)}e.append(i)}return e.toString()},upgrade:function(b,a){var e=0,g={tabstop:function(b){var c=parseInt(b.group);
|
||||||
emmet.define("elements",function(h,e){function g(a){return{data:a}}var f={},c=/([\w\-]+)\s*=\s*(['"])(.*?)\2/g,b={add:function(a,b){var c=this;f[a]=function(){var e=b.apply(c,arguments);if(e)e.type=a;return e}},get:function(a){return f[a]},create:function(a){var b=[].slice.call(arguments,1),c=this.get(a);return c?c.apply(this,b):null},is:function(a,b){return a&&a.type===b}};b.add("element",function(a,b,f){var h={name:a,is_empty:!!f};if(b)if(h.attributes=[],e.isArray(b))h.attributes=b;else if(e.isString(b))for(;a=
|
c>e&&(e=c);return b.placeholder?"${"+(c+a)+":"+b.placeholder+"}":"${"+(c+a)+"}"}};d.each(["start","end","content"],function(a){b[a]=this.processText(b[a],g)},this);return e},variablesResolver:function(b){var a={},e=h("resources");return function(g,j){if(j=="child")return g;if(j=="cursor")return h("utils").getCaretPlaceholder();var i=b.attribute(j);if(!d.isUndefined(i))return i;if(i=e.getVariable(j))return i;a[j]||(a[j]=f++);return"${"+a[j]+":"+j+"}"}},resetPlaceholderCounter:function(){console.log("deprecated");
|
||||||
c.exec(b);)h.attributes.push({name:a[1],value:a[3]});else e.each(b,function(a,b){h.attributes.push({name:b,value:a})});return h});b.add("snippet",g);b.add("reference",g);b.add("empty",function(){return{}});return b});
|
f=100},resetTabstopIndex:function(){i=0;f=100}}});
|
||||||
emmet.define("editTree",function(h,e,g){function f(a,b){this.options=e.extend({offset:0},b);this.source=a;this._children=[];this._positions={name:0};this.initialize.apply(this,arguments)}function c(a,b,c){this.parent=a;this._name=b.value;this._value=c?c.value:"";this._positions={name:b.start,value:c?c.start:-1};this.initialize.apply(this,arguments)}var b=h("range").create;f.extend=g.extend;f.prototype={initialize:function(){},_updateSource:function(a,d,c){var f=b(d,e.isUndefined(c)?0:c-d),g=a.length-
|
emmet.define("preferences",function(h,d){var f={},i={},b=null,c=null;return{define:function(a,b,c){var h=a;d.isString(a)&&(h={},h[a]={value:b,description:c});d.each(h,function(a,b){i[b]=d.isObject(a)&&"value"in a&&d.keys(a).length<3?a:{value:a}})},set:function(a,b){var c=a;d.isString(a)&&(c={},c[a]=b);d.each(c,function(a,b){if(!(b in i))throw'Property "'+b+'" is not defined. You should define it first with `define` method of current module';if(a!==i[b].value){switch(typeof i[b].value){case "boolean":var c=
|
||||||
f.length(),n=function(a){e.each(a,function(b,d){b>=f.end&&(a[d]+=g)})};n(this._positions);e.each(this.list(),function(a){n(a._positions)});this.source=h("utils").replaceSubstring(this.source,a,f)},add:function(a,b){var e=new c(a,b);this._children.push(e);return e},get:function(a){return e.isNumber(a)?this.list()[a]:e.isString(a)?e.find(this.list(),function(b){return b.name()===a}):a},getAll:function(a){e.isArray(a)||(a=[a]);var b=[],c=[];e.each(a,function(a){e.isString(a)?b.push(a):e.isNumber(a)&&
|
a;d.isString(c)?(c=c.toLowerCase(),a=c=="yes"||c=="true"||c=="1"):a=!!c;break;case "number":a=parseInt(a+"",10)||0;break;default:a+=""}f[b]=a}else b in f&&delete f[b]})},get:function(a){if(a in f)return f[a];if(a in i)return i[a].value},getArray:function(a){a=this.get(a);d.isUndefined(a)||(a=d.map(a.split(","),h("utils").trim),a.length||(a=null));return a},getDict:function(a){var b={};d.each(this.getArray(a),function(a){a=a.split(":");b[a[0]]=a[1]});return b},description:function(a){return a in i?
|
||||||
c.push(a)});return e.filter(this.list(),function(a,f){return e.include(c,f)||e.include(b,a.name())})},value:function(a,b,c){var f=this.get(a);if(f)return f.value(b);if(!e.isUndefined(b))return this.add(a,b,c)},values:function(a){return e.map(this.getAll(a),function(a){return a.value()})},remove:function(a){if(a=this.get(a))this._updateSource("",a.fullRange()),this._children=e.without(this._children,a)},list:function(){return this._children},indexOf:function(a){return e.indexOf(this.list(),this.get(a))},
|
i[a].description:void 0},remove:function(a){d.isArray(a)||(a=[a]);d.each(a,function(a){a in f&&delete f[a];a in i&&delete i[a]})},list:function(){return d.map(d.keys(i).sort(),function(a){return{name:a,value:this.get(a),type:typeof i[a].value,description:i[a].description}},this)},load:function(a){d.each(a,function(a,b){this.set(b,a)},this)},exportModified:function(){return d.clone(f)},reset:function(){f={}},_startTest:function(){b=i;c=f;i={};f={}},_stopTest:function(){i=b;f=c}}});
|
||||||
name:function(a){if(!e.isUndefined(a)&&this._name!==(a=String(a)))this._updateSource(a,this._positions.name,this._positions.name+this._name.length),this._name=a;return this._name},nameRange:function(a){return b(this._positions.name+(a?this.options.offset:0),this.name())},range:function(a){return b(a?this.options.offset:0,this.toString())},itemFromPosition:function(a,b){return e.find(this.list(),function(c){return c.range(b).inside(a)})},toString:function(){return this.source}};c.extend=g.extend;c.prototype=
|
emmet.define("filters",function(h,d){function f(b){return!b?[]:d.isString(b)?b.split(/[\|,]/g):b}var i={};return{add:function(b,c){i[b]=c},apply:function(b,c,a){var e=h("utils"),a=h("profile").get(a);d.each(f(c),function(c){(c=e.trim(c.toLowerCase()))&&c in i&&(b=i[c](b,a))});return b},composeList:function(b,c,a){c=h("profile").get(c);b=f(c.filters||h("resources").findItem(b,"filters")||"html");c.extraFilters&&(b=b.concat(f(c.extraFilters)));a&&(b=b.concat(f(a)));if(!b||!b.length)b=f("html");return b},
|
||||||
{initialize:function(){},_pos:function(a,b){return a+(b?this.parent.options.offset:0)},value:function(a){if(!e.isUndefined(a)&&this._value!==(a=String(a)))this.parent._updateSource(a,this.valueRange()),this._value=a;return this._value},name:function(a){if(!e.isUndefined(a)&&this._name!==(a=String(a)))this.parent._updateSource(a,this.nameRange()),this._name=a;return this._name},namePosition:function(a){return this._pos(this._positions.name,a)},valuePosition:function(a){return this._pos(this._positions.value,
|
extractFromAbbreviation:function(b){var c="",b=b.replace(/\|([\w\|\-]+)$/,function(a,b){c=b;return""});return[b,f(c)]}}});
|
||||||
a)},range:function(a){return b(this.namePosition(a),this.toString())},fullRange:function(a){return this.range(a)},nameRange:function(a){return b(this.namePosition(a),this.name())},valueRange:function(a){return b(this.valuePosition(a),this.value())},toString:function(){return this.name()+this.value()},valueOf:function(){return this.toString()}};return{EditContainer:f,EditElement:c,createToken:function(a,b,c){a={start:a||0,value:b||"",type:c};a.end=a.start+a.value.length;return a}}});
|
emmet.define("elements",function(h,d){function f(a){return{data:a}}var i={},b=/([\w\-]+)\s*=\s*(['"])(.*?)\2/g,c={add:function(a,b){var c=this;i[a]=function(){var d=b.apply(c,arguments);if(d)d.type=a;return d}},get:function(a){return i[a]},create:function(a){var b=[].slice.call(arguments,1),c=this.get(a);return c?c.apply(this,b):null},is:function(a,b){return a&&a.type===b}};c.add("element",function(a,c,g){var h={name:a,is_empty:!!g};if(c)if(h.attributes=[],d.isArray(c))h.attributes=c;else if(d.isString(c))for(;a=
|
||||||
emmet.define("cssEditTree",function(h,e){function g(a,b){return h("range").create(a,b)}function f(a,b){var b=b||d|i,c=["white","line"];if((b&i)==i)for(;a.length&&e.include(c,e.last(a).type);)a.pop();if((b&d)==d)for(;a.length&&e.include(c,a[0].type);)a.shift();return a}function c(a){var b=["white","line",":"],c=[],h,j;a.nextUntil(function(){return!e.include(b,this.itemNext().type)});for(j=a.current().end;h=a.next();){if(h.type=="}"||h.type==";")return f(c,d|(h.type=="}"?i:0)),c.length?(j=c[0].start,
|
b.exec(c);)h.attributes.push({name:a[1],value:a[3]});else d.each(c,function(a,b){h.attributes.push({name:b,value:a})});return h});c.add("snippet",f);c.add("reference",f);c.add("empty",function(){return{}});return c});
|
||||||
a=e.last(c).end):a=j,g(j,a-j);c.push(h)}if(c.length)return g(c[0].start,e.last(c).end-c[0].start)}function b(a){var b=h("stringStream").create(a),d=[],c=/[\s\u00a0,]/,f=function(){b.next();d.push(g(b.start,b.current()));b.start=b.pos};b.eatSpace();for(b.start=b.pos;a=b.next();)if(a=='"'||a=="'"){b.next();if(!b.skipTo(a))break;f()}else if(a=="("){b.backUp(1);if(!b.skipToPair("(",")"))break;b.backUp(1);f()}else if(c.test(a))d.push(g(b.start,b.current().length-1)),b.eatWhile(c),b.start=b.pos;f();return e.chain(d).filter(function(a){return!!a.length()}).uniq(!1,
|
emmet.define("editTree",function(h,d,f){function i(a,b){this.options=d.extend({offset:0},b);this.source=a;this._children=[];this._positions={name:0};this.initialize.apply(this,arguments)}function b(a,b,c){this.parent=a;this._name=b.value;this._value=c?c.value:"";this._positions={name:b.start,value:c?c.start:-1};this.initialize.apply(this,arguments)}var c=h("range").create;i.extend=f.extend;i.prototype={initialize:function(){},_updateSource:function(a,b,g){var f=c(b,d.isUndefined(g)?0:g-b),i=a.length-
|
||||||
function(a){return a.toString()}).value()}var a={styleBefore:"\n\t",styleSeparator:": ",offset:0},d=1,i=2,j=h("editTree").EditContainer.extend({initialize:function(b){e.defaults(this.options,a);var d=h("editTree"),i=h("tokenIterator").create(h("cssParser").parse(b)),j,r=[],t;for(j=i.position();t=i.next();){if(t.type=="{")break;r.push(t)}f(r);r.length?(j=r[0].start,r=e.last(r).end):r=j;j=g(j,r-j);this._positions.name=j.start;this._name=j.substring(b);if(!i.current()||i.current().type!="{")throw"Invalid CSS rule";
|
f.length(),m=function(a){d.each(a,function(b,c){b>=f.end&&(a[c]+=i)})};m(this._positions);d.each(this.list(),function(a){m(a._positions)});this.source=h("utils").replaceSubstring(this.source,a,f)},add:function(a,c){var d=new b(a,c);this._children.push(d);return d},get:function(a){return d.isNumber(a)?this.list()[a]:d.isString(a)?d.find(this.list(),function(b){return b.name()===a}):a},getAll:function(a){d.isArray(a)||(a=[a]);var b=[],c=[];d.each(a,function(a){d.isString(a)?b.push(a):d.isNumber(a)&&
|
||||||
for(this._positions.contentStart=i.position()+1;j=i.next();){if(r=j.type=="identifier")a:{r=i.tokens;t=i._i+1;for(var x=r.length;t<x;t++){if(r[t].type==":"){r=!0;break a}if(r[t].type=="identifier"||r[t].type=="line"){r=!1;break a}}r=!1}r&&(j=g(j),r=c(i),t=i.current()&&i.current().type==";"?g(i.current()):g(r.end,0),this._children.push(new l(this,d.createToken(j.start,j.substring(b)),d.createToken(r.start,r.substring(b)),d.createToken(t.start,t.substring(b)))))}this._saveStyle()},_saveStyle:function(){var a=
|
c.push(a)});return d.filter(this.list(),function(a,h){return d.include(c,h)||d.include(b,a.name())})},value:function(a,b,c){var h=this.get(a);if(h)return h.value(b);if(!d.isUndefined(b))return this.add(a,b,c)},values:function(a){return d.map(this.getAll(a),function(a){return a.value()})},remove:function(a){if(a=this.get(a))this._updateSource("",a.fullRange()),this._children=d.without(this._children,a)},list:function(){return this._children},indexOf:function(a){return d.indexOf(this.list(),this.get(a))},
|
||||||
this._positions.contentStart,b=this.source,d=h("utils");e.each(this.list(),function(c){c.styleBefore=b.substring(a,c.namePosition());var f=d.splitByLines(c.styleBefore);if(f.length>1)c.styleBefore="\n"+e.last(f);c.styleSeparator=b.substring(c.nameRange().end,c.valuePosition());c.styleBefore=e.last(c.styleBefore.split("*/"));c.styleSeparator=c.styleSeparator.replace(/\/\*.*?\*\//g,"");a=c.range().end})},add:function(a,b,d){var c=this.list(),f=this._positions.contentStart,i=e.pick(this.options,"styleBefore",
|
name:function(a){if(!d.isUndefined(a)&&this._name!==(a=String(a)))this._updateSource(a,this._positions.name,this._positions.name+this._name.length),this._name=a;return this._name},nameRange:function(a){return c(this._positions.name+(a?this.options.offset:0),this.name())},range:function(a){return c(a?this.options.offset:0,this.toString())},itemFromPosition:function(a,b){return d.find(this.list(),function(c){return c.range(b).inside(a)})},toString:function(){return this.source}};b.extend=f.extend;b.prototype=
|
||||||
"styleSeparator"),j=h("editTree");if(e.isUndefined(d))d=c.length;var g=c[d];if(g)f=g.fullRange().start;else if(g=c[d-1])g.end(";"),f=g.range().end;g&&(i=e.pick(g,"styleBefore","styleSeparator"));a=j.createToken(f+i.styleBefore.length,a);b=j.createToken(a.end+i.styleSeparator.length,b);j=new l(this,a,b,j.createToken(b.end,";"));e.extend(j,i);this._updateSource(j.styleBefore+j.toString(),f);this._children.splice(d,0,j);return j}}),l=h("editTree").EditElement.extend({initialize:function(a,b,d,c){this.styleBefore=
|
{initialize:function(){},_pos:function(a,b){return a+(b?this.parent.options.offset:0)},value:function(a){if(!d.isUndefined(a)&&this._value!==(a=String(a)))this.parent._updateSource(a,this.valueRange()),this._value=a;return this._value},name:function(a){if(!d.isUndefined(a)&&this._name!==(a=String(a)))this.parent._updateSource(a,this.nameRange()),this._name=a;return this._name},namePosition:function(a){return this._pos(this._positions.name,a)},valuePosition:function(a){return this._pos(this._positions.value,
|
||||||
a.options.styleBefore;this.styleSeparator=a.options.styleSeparator;this._end=c.value;this._positions.end=c.start},valueParts:function(a){var d=b(this.value());if(a){var c=this.valuePosition(!0);e.each(d,function(a){a.shift(c)})}return d},end:function(a){if(!e.isUndefined(a)&&this._end!==a)this.parent._updateSource(a,this._positions.end,this._positions.end+this._end.length),this._end=a;return this._end},fullRange:function(a){a=this.range(a);a.start-=this.styleBefore.length;return a},toString:function(){return this.name()+
|
a)},range:function(a){return c(this.namePosition(a),this.toString())},fullRange:function(a){return this.range(a)},nameRange:function(a){return c(this.namePosition(a),this.name())},valueRange:function(a){return c(this.valuePosition(a),this.value())},toString:function(){return this.name()+this.value()},valueOf:function(){return this.toString()}};return{EditContainer:i,EditElement:b,createToken:function(a,b,c){a={start:a||0,value:b||"",type:c};a.end=a.start+a.value.length;return a}}});
|
||||||
this.styleSeparator+this.value()+this.end()}});return{parse:function(a,b){return new j(a,b)},parseFromPosition:function(a,b,d){d=this.extractRule(a,b,d);return!d||!d.inside(b)?null:this.parse(d.substring(a),{offset:d.start})},extractRule:function(a,b,d){for(var c="",e=a.length,f=-1,i;b>=0;){i=a.charAt(b);if(i=="{"){f=b;break}else if(i=="}"&&!d){b++;break}b--}for(;b<e;){i=a.charAt(b);if(i=="{")f=b;else if(i=="}"){f!=-1&&(c=a.substring(f,b+1));break}b++}if(c){b=f-1;for(d="";b>=0;){i=a.charAt(b);if("{}/\\<>".indexOf(i)!=
|
emmet.define("cssEditTree",function(h,d){function f(a,b){return h("range").create(a,b)}function i(a,b){var b=b||e|g,c=["white","line"];if((b&g)==g)for(;a.length&&d.include(c,d.last(a).type);)a.pop();if((b&e)==e)for(;a.length&&d.include(c,a[0].type);)a.shift();return a}function b(a){var b=["white","line",":"],c=[],h,j;a.nextUntil(function(){return!d.include(b,this.itemNext().type)});for(j=a.current().end;h=a.next();){if(h.type=="}"||h.type==";")return i(c,e|(h.type=="}"?g:0)),c.length?(j=c[0].start,
|
||||||
-1)break;b--}d=a.substring(b+1,f).replace(/^[\s\n\r]+/m,"");return h("range").create(f-d.length,c.length+d.length)}return null},baseName:function(a){return a.replace(/^\s*\-\w+\-/,"")},findParts:b}});
|
a=d.last(c).end):a=j,f(j,a-j);c.push(h)}if(c.length)return f(c[0].start,d.last(c).end-c[0].start)}function c(a){var b=h("stringStream").create(a),c=[],e=/[\s\u00a0,]/,g=function(){b.next();c.push(f(b.start,b.current()));b.start=b.pos};b.eatSpace();for(b.start=b.pos;a=b.next();)if(a=='"'||a=="'"){b.next();if(!b.skipTo(a))break;g()}else if(a=="("){b.backUp(1);if(!b.skipToPair("(",")"))break;b.backUp(1);g()}else if(e.test(a))c.push(f(b.start,b.current().length-1)),b.eatWhile(e),b.start=b.pos;g();return d.chain(c).filter(function(a){return!!a.length()}).uniq(!1,
|
||||||
emmet.define("xmlEditTree",function(h,e){var g={styleBefore:" ",styleSeparator:"=",styleQuote:'"',offset:0},f=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/m,c=h("editTree").EditContainer.extend({initialize:function(a){e.defaults(this.options,g);this._positions.name=1;var d=null,c=h("xmlParser").parse(a),f=h("range");e.each(c,function(c){c.value=f.create(c).substring(a);switch(c.type){case "tag":if(/^<[^\/]+/.test(c.value))this._name=c.value.substring(1);
|
function(a){return a.toString()}).value()}var a={styleBefore:"\n\t",styleSeparator:": ",offset:0},e=1,g=2,j=h("editTree").EditContainer.extend({initialize:function(c){d.defaults(this.options,a);var e=h("editTree"),g=h("tokenIterator").create(h("cssParser").parse(c)),j,s=[],r;for(j=g.position();r=g.next();){if(r.type=="{")break;s.push(r)}i(s);s.length?(j=s[0].start,s=d.last(s).end):s=j;j=f(j,s-j);this._positions.name=j.start;this._name=j.substring(c);if(!g.current()||g.current().type!="{")throw"Invalid CSS rule";
|
||||||
break;case "attribute":d&&this._children.push(new b(this,d));d=c;break;case "string":this._children.push(new b(this,d,c)),d=null}},this);d&&this._children.push(new b(this,d));this._saveStyle()},_saveStyle:function(){var a=this.nameRange().end,b=this.source;e.each(this.list(),function(c){c.styleBefore=b.substring(a,c.namePosition());if(c.valuePosition()!==-1)c.styleSeparator=b.substring(c.namePosition()+c.name().length,c.valuePosition()-c.styleQuote.length);a=c.range().end})},add:function(a,d,c){var f=
|
for(this._positions.contentStart=g.position()+1;j=g.next();){if(s=j.type=="identifier")a:{s=g.tokens;r=g._i+1;for(var u=s.length;r<u;r++){if(s[r].type==":"){s=!0;break a}if(s[r].type=="identifier"||s[r].type=="line"){s=!1;break a}}s=!1}s&&(j=f(j),s=b(g),r=g.current()&&g.current().type==";"?f(g.current()):f(s.end,0),this._children.push(new l(this,e.createToken(j.start,j.substring(c)),e.createToken(s.start,s.substring(c)),e.createToken(r.start,r.substring(c)))))}this._saveStyle()},_saveStyle:function(){var a=
|
||||||
this.list(),g=this.nameRange().end,n=h("editTree"),m=e.pick(this.options,"styleBefore","styleSeparator","styleQuote");if(e.isUndefined(c))c=f.length;var o=f[c];if(o)g=o.fullRange().start;else if(o=f[c-1])g=o.range().end;o&&(m=e.pick(o,"styleBefore","styleSeparator","styleQuote"));d=m.styleQuote+d+m.styleQuote;a=new b(this,n.createToken(g+m.styleBefore.length,a),n.createToken(g+m.styleBefore.length+a.length+m.styleSeparator.length,d));e.extend(a,m);this._updateSource(a.styleBefore+a.toString(),g);
|
this._positions.contentStart,b=this.source,c=h("utils");d.each(this.list(),function(e){e.styleBefore=b.substring(a,e.namePosition());var g=c.splitByLines(e.styleBefore);if(g.length>1)e.styleBefore="\n"+d.last(g);e.styleSeparator=b.substring(e.nameRange().end,e.valuePosition());e.styleBefore=d.last(e.styleBefore.split("*/"));e.styleSeparator=e.styleSeparator.replace(/\/\*.*?\*\//g,"");a=e.range().end})},add:function(a,b,c){var e=this.list(),g=this._positions.contentStart,f=d.pick(this.options,"styleBefore",
|
||||||
this._children.splice(c,0,a);return a}}),b=h("editTree").EditElement.extend({initialize:function(a,b,c){this.styleBefore=a.options.styleBefore;this.styleSeparator=a.options.styleSeparator;b="";a=a.options.styleQuote;if(c)b=c.value,a=b.charAt(0),a=='"'||a=="'"?b=b.substring(1):a="",a&&b.charAt(b.length-1)==a&&(b=b.substring(0,b.length-1));this.styleQuote=a;this._value=b;this._positions.value=c?c.start+a.length:-1},fullRange:function(a){a=this.range(a);a.start-=this.styleBefore.length;return a},toString:function(){return this.name()+
|
"styleSeparator"),j=h("editTree");if(d.isUndefined(c))c=e.length;var i=e[c];if(i)g=i.fullRange().start;else if(i=e[c-1])i.end(";"),g=i.range().end;i&&(f=d.pick(i,"styleBefore","styleSeparator"));a=j.createToken(g+f.styleBefore.length,a);b=j.createToken(a.end+f.styleSeparator.length,b);j=new l(this,a,b,j.createToken(b.end,";"));d.extend(j,f);this._updateSource(j.styleBefore+j.toString(),g);this._children.splice(c,0,j);return j}}),l=h("editTree").EditElement.extend({initialize:function(a,b,c,d){this.styleBefore=
|
||||||
this.styleSeparator+this.styleQuote+this.value()+this.styleQuote}});return{parse:function(a,b){return new c(a,b)},parseFromPosition:function(a,b,c){c=this.extractTag(a,b,c);return!c||!c.inside(b)?null:this.parse(c.substring(a),{offset:c.start})},extractTag:function(a,b,c){var e=a.length,g,n=h("range"),m=Math.min(2E3,e),o=null,q=function(b){var c;if(a.charAt(b)=="<"&&(c=a.substr(b,m).match(f)))return n.create(b,c[0])};for(g=b;g>=0;g--)if(o=q(g))break;if(o&&(o.inside(b)||c))return o;if(!o&&c)return null;
|
a.options.styleBefore;this.styleSeparator=a.options.styleSeparator;this._end=d.value;this._positions.end=d.start},valueParts:function(a){var b=c(this.value());if(a){var e=this.valuePosition(!0);d.each(b,function(a){a.shift(e)})}return b},end:function(a){if(!d.isUndefined(a)&&this._end!==a)this.parent._updateSource(a,this._positions.end,this._positions.end+this._end.length),this._end=a;return this._end},fullRange:function(a){a=this.range(a);a.start-=this.styleBefore.length;return a},toString:function(){return this.name()+
|
||||||
for(g=b;g<e;g++)if(o=q(g))return o}}});
|
this.styleSeparator+this.value()+this.end()}});return{parse:function(a,b){return new j(a,b)},parseFromPosition:function(a,b,c){c=this.extractRule(a,b,c);return!c||!c.inside(b)?null:this.parse(c.substring(a),{offset:c.start})},extractRule:function(a,b,c){for(var d="",e=a.length,g=-1,f;b>=0;){f=a.charAt(b);if(f=="{"){g=b;break}else if(f=="}"&&!c){b++;break}b--}for(;b<e;){f=a.charAt(b);if(f=="{")g=b;else if(f=="}"){g!=-1&&(d=a.substring(g,b+1));break}b++}if(d){b=g-1;for(c="";b>=0;){f=a.charAt(b);if("{}/\\<>\n\r".indexOf(f)!=
|
||||||
emmet.define("expandAbbreviation",function(h,e){var g=h("handlerList").create(),f=null,c=h("actions");c.add("expand_abbreviation",function(b,a,c){var f=e.toArray(arguments),j=h("editorUtils").outputInfo(b,a,c);f[1]=j.syntax;f[2]=j.profile;return g.exec(!1,f)});c.add("expand_abbreviation_with_tab",function(b,a,d){c.run("expand_abbreviation",b,a,d)||b.replaceContent(h("resources").getVariable("indentation"),b.getCaretPos())},{hidden:!0});g.add(function(b,a,c){var e=b.getSelectionRange().end,g=f.findAbbreviation(b);
|
-1)break;b--}c=a.substring(b+1,g).replace(/^[\s\n\r]+/m,"");return h("range").create(g-c.length,d.length+c.length)}return null},baseName:function(a){return a.replace(/^\s*\-\w+\-/,"")},findParts:c}});
|
||||||
return g&&(a=emmet.expandAbbreviation(g,a,c,h("actionUtils").captureContext(b)))?(b.replaceContent(a,e-g.length,e),!0):!1},{order:-1});return f={addHandler:function(b,a){g.add(b,a)},removeHandler:function(b){g.remove(b,options)},findAbbreviation:function(b){var a=h("range").create(b.getSelectionRange()),c=String(b.getContent());if(a.length())return a.substring(c);b=b.getCurrentLineRange();return h("actionUtils").extractAbbreviation(c.substring(b.start,a.start))}}});
|
emmet.define("xmlEditTree",function(h,d){var f={styleBefore:" ",styleSeparator:"=",styleQuote:'"',offset:0},i=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/m,b=h("editTree").EditContainer.extend({initialize:function(a){d.defaults(this.options,f);this._positions.name=1;var b=null,g=h("xmlParser").parse(a),j=h("range");d.each(g,function(d){d.value=j.create(d).substring(a);switch(d.type){case "tag":if(/^<[^\/]+/.test(d.value))this._name=d.value.substring(1);
|
||||||
emmet.define("wrapWithAbbreviation",function(h){h("actions").add("wrap_with_abbreviation",function(e,g,f,c){var c=h("editorUtils").outputInfo(e,f,c),b=h("utils"),a=h("editorUtils"),d=h("html_matcher"),g=g||e.prompt("Enter abbreviation");if(!g)return null;var g=String(g),i=e.getSelectionRange(),f=i.start,i=i.end;if(f==i){i=d(c.content,f,c.profile);if(!i||i[0]==-1)return!1;i=b.narrowToNonSpace(c.content,i[0],i[1]-i[0]);f=i.start;i=i.end}b=b.escapeText(c.content.substring(f,i));return(g=h("wrapWithAbbreviation").wrap(g,
|
break;case "attribute":b&&this._children.push(new c(this,b));b=d;break;case "string":this._children.push(new c(this,b,d)),b=null}},this);b&&this._children.push(new c(this,b));this._saveStyle()},_saveStyle:function(){var a=this.nameRange().end,b=this.source;d.each(this.list(),function(c){c.styleBefore=b.substring(a,c.namePosition());if(c.valuePosition()!==-1)c.styleSeparator=b.substring(c.namePosition()+c.name().length,c.valuePosition()-c.styleQuote.length);a=c.range().end})},add:function(a,b,g){var f=
|
||||||
a.unindent(e,b),c.syntax,c.profile))?(e.replaceContent(g,f,i),!0):!1});return{wrap:function(e,g,f,c){var b=h("filters"),a=h("utils"),f=f||emmet.defaultSyntax(),c=c||emmet.defaultProfile();h("tabStops").resetTabstopIndex();e=b.extractFromAbbreviation(e);return(g=h("abbreviationParser").parse(e[0],{syntax:f,pastedContent:g}))?(f=b.composeList(f,c,e[1]),b.apply(g,f,c),a.replaceVariables(g.toString())):null}}});
|
this.list(),i=this.nameRange().end,m=h("editTree"),n=d.pick(this.options,"styleBefore","styleSeparator","styleQuote");if(d.isUndefined(g))g=f.length;var o=f[g];if(o)i=o.fullRange().start;else if(o=f[g-1])i=o.range().end;o&&(n=d.pick(o,"styleBefore","styleSeparator","styleQuote"));b=n.styleQuote+b+n.styleQuote;a=new c(this,m.createToken(i+n.styleBefore.length,a),m.createToken(i+n.styleBefore.length+a.length+n.styleSeparator.length,b));d.extend(a,n);this._updateSource(a.styleBefore+a.toString(),i);
|
||||||
emmet.exec(function(h,e){function g(b,a){var c=a-(b.options.offset||0),f=/^[\s\n\r]/;return e.find(b.list(),function(a){return a.range().end===c?f.test(b.source.charAt(c)):a.range().inside(c)})}function f(b,a,c,e){for(var f=-1,g=-1;a--;)if(b.substr(a,c.length)==c){f=a;break}if(f!=-1){a=f;for(c=b.length;c>=a++;)if(b.substr(a,e.length)==e){g=a+e.length;break}}return f!=-1&&g!=-1?h("range").create(f,g-f):null}function c(b,a,c,e){function g(b){return b.replace(RegExp("^"+q.escapeForRegexp(a)+"\\s*"),
|
this._children.splice(g,0,a);return a}}),c=h("editTree").EditElement.extend({initialize:function(a,b,c){this.styleBefore=a.options.styleBefore;this.styleSeparator=a.options.styleSeparator;b="";a=a.options.styleQuote;if(c)b=c.value,a=b.charAt(0),a=='"'||a=="'"?b=b.substring(1):a="",a&&b.charAt(b.length-1)==a&&(b=b.substring(0,b.length-1));this.styleQuote=a;this._value=b;this._positions.value=c?c.start+a.length:-1},fullRange:function(a){a=this.range(a);a.start-=this.styleBefore.length;return a},toString:function(){return this.name()+
|
||||||
function(a){m-=a.length;return""}).replace(RegExp("\\s*"+q.escapeForRegexp(c)+"$"),"")}var l=h("editorUtils"),n=l.outputInfo(b).content,m=b.getCaretPos(),o=null,q=h("utils");(o=f(n,m,a,c))&&o.overlap(e)?(e=o,o=g(e.substring(n))):(o=a+" "+e.substring(n).replace(RegExp(q.escapeForRegexp(a)+"\\s*|\\s*"+q.escapeForRegexp(c),"g"),"")+" "+c,m+=a.length+1);return o!==null?(b.setCaretPos(e.start),b.replaceContent(l.unindent(b,o),e.start,e.end),b.setCaretPos(m),!0):!1}h("actions").add("toggle_comment",function(b){var a=
|
this.styleSeparator+this.styleQuote+this.value()+this.styleQuote}});return{parse:function(a,c){return new b(a,c)},parseFromPosition:function(a,b,c){c=this.extractTag(a,b,c);return!c||!c.inside(b)?null:this.parse(c.substring(a),{offset:c.start})},extractTag:function(a,b,c){var d=a.length,f,m=h("range"),n=Math.min(2E3,d),o=null,q=function(b){var c;if(a.charAt(b)=="<"&&(c=a.substr(b,n).match(i)))return m.create(b,c[0])};for(f=b;f>=0;f--)if(o=q(f))break;if(o&&(o.inside(b)||c))return o;if(!o&&c)return null;
|
||||||
h("editorUtils").outputInfo(b);if(a.syntax=="css"){var d=b.getCaretPos(),e=h("html_matcher").getTags(a.content,d);if(e&&e[0]&&e[0].type=="tag"&&e[0].start<=d&&e[0].end>=d)a.syntax="html"}if(a.syntax=="css"){e=h("range").create(b.getSelectionRange());a=h("editorUtils").outputInfo(b);if(!e.length()&&(d=h("cssEditTree").parseFromPosition(a.content,b.getCaretPos())))e=(e=g(d,b.getCaretPos()))?e.range(!0):h("range").create(d.nameRange(!0).start,d.source);e.length()||(e=h("range").create(b.getCurrentLineRange()),
|
for(f=b;f<d;f++)if(o=q(f))return o}}});
|
||||||
h("utils").narrowToNonSpace(a.content,e));b=c(b,"/*","*/",e)}else{a=h("range").create(b.getSelectionRange());d=h("editorUtils").outputInfo(b);if(!a.length()&&(d=h("html_matcher").getTags(d.content,b.getCaretPos(),d.profile))&&d[0])a.start=d[0].start,a.end=d[1]?d[1].end:d[0].end;b=c(b,"<\!--","--\>",a)}return b})});
|
emmet.define("expandAbbreviation",function(h,d){var f=h("handlerList").create(),i=null,b=h("actions");b.add("expand_abbreviation",function(b,a,e){var g=d.toArray(arguments),j=h("editorUtils").outputInfo(b,a,e);g[1]=j.syntax;g[2]=j.profile;return f.exec(!1,g)});b.add("expand_abbreviation_with_tab",function(c,a,d){var g=c.getSelection(),f=h("resources").getVariable("indentation");if(g)return d=h("utils"),a=h("range").create(c.getSelectionRange()),g=d.padString(g,f),c.replaceContent(f+"${0}",c.getCaretPos()),
|
||||||
emmet.exec(function(h){function e(e,f,c){function b(b){for(var c=b;c>=0;){var d=a.charAt(c);if(d=="\n"||d=="\r")break;c--}return a.substring(c,b)}for(var f=f||1,c=e.getCaretPos()+(c||0),a=String(e.getContent()),e=a.length,d=-1,h=/^\s+$/;c<=e&&c>=0;){c+=f;var j=a.charAt(c),l=a.charAt(c+1),n=a.charAt(c-1);switch(j){case '"':case "'":l==j&&n=="="&&(d=c+1);break;case ">":l=="<"&&(d=c+1);break;case "\n":case "\r":h.test(b(c-1))&&(d=c)}if(d!=-1)break}return d}h=h("actions");h.add("prev_edit_point",function(g){var f=
|
f=h("range").create(c.getCaretPos(),a.length()),c.replaceContent(g,f.start,f.end,!0),c.createSelection(f.start,f.start+g.length),!0;b.run("expand_abbreviation",c,a,d)||c.replaceContent(f,c.getCaretPos());return!0},{hidden:!0});f.add(function(b,a,d){var g=b.getSelectionRange().end,f=i.findAbbreviation(b);return f&&(a=emmet.expandAbbreviation(f,a,d,h("actionUtils").captureContext(b)))?(b.replaceContent(a,g-f.length,g),!0):!1},{order:-1});return i={addHandler:function(b,a){f.add(b,a)},removeHandler:function(b){f.remove(b,
|
||||||
g.getCaretPos(),c=e(g,-1);c==f&&(c=e(g,-1,-2));return c!=-1?(g.setCaretPos(c),!0):!1},{label:"Previous Edit Point"});h.add("next_edit_point",function(g){var f=e(g,1);f!=-1&&g.setCaretPos(f)})});
|
options)},findAbbreviation:function(b){var a=h("range").create(b.getSelectionRange()),d=String(b.getContent());if(a.length())return a.substring(d);b=b.getCurrentLineRange();return h("actionUtils").extractAbbreviation(d.substring(b.start,a.start))}}});
|
||||||
emmet.exec(function(h,e){function g(a,b,c,d){var e=h("range"),f=h("editorUtils").outputInfo(a).content,g=f.length,j,i=e.create(-1,0),l=e.create(a.getSelectionRange());j=l.start;for(var n=1E5;j>=0&&j<g&&--n>0;){if(e=c(f,j,b)){if(i.equal(e))break;i=e.clone();if(j=d(e.substring(f),e.start,l.clone()))return a.createSelection(j.start,j.end),!0;else j=b?e.start:e.end-1}j+=b?-1:1}return!1}function f(a){var b=!0;return g(a,!1,function(a,c){if(b){b=!1;var d;a:{d=c;for(var e;d>=0;){if(e=i(a,d)){d=e;break a}d--}d=
|
emmet.define("wrapWithAbbreviation",function(h){var d=null;h("actions").add("wrap_with_abbreviation",function(f,i,b,c){var b=h("editorUtils").outputInfo(f,b,c),a=h("utils"),c=h("editorUtils"),i=i||f.prompt("Enter abbreviation");if(!i)return null;var i=String(i),e=h("range").create(f.getSelectionRange());if(!e.length()){e=h("htmlMatcher").tag(b.content,e.start);if(!e)return!1;e=a.narrowToNonSpace(b.content,e.range)}a=a.escapeText(e.substring(b.content));return(i=d.wrap(i,c.unindent(f,a),b.syntax,b.profile,
|
||||||
null}return d}else return i(a,c)},function(a,b,c){return d(a,b,c,!1)})}function c(a){return g(a,!0,i,function(a,b,c){return d(a,b,c,!0)})}function b(b,c,d){var d=d||0,f=h("range"),g=[],i=-1,l="",n="",q,m;e.each(c,function(c){switch(c.type){case "tag":m=b.substring(c.start,c.end);/^<[\w\:\-]/.test(m)&&g.push(f.create({start:c.start+1,end:c.end}));break;case "attribute":i=c.start;l=b.substring(c.start,c.end);break;case "string":g.push(f.create(i,c.end-i)),q=f.create(c),n=q.substring(b),j(n.charAt(0))&&
|
h("actionUtils").captureContext(f)))?(f.replaceContent(i,e.start,e.end),!0):!1});return d={wrap:function(d,i,b,c,a){var e=h("filters"),g=h("utils"),b=b||emmet.defaultSyntax(),c=h("profile").get(c,b);h("tabStops").resetTabstopIndex();d=e.extractFromAbbreviation(d);return(i=h("abbreviationParser").parse(d[0],{syntax:b,pastedContent:i,contextNode:a}))?(b=e.composeList(b,c,d[1]),e.apply(i,b,c),g.replaceVariables(i.toString())):null}}});
|
||||||
q.start++,j(n.charAt(n.length-1))&&q.end--,g.push(q),l=="class"&&(g=g.concat(a(q.substring(b),q.start)))}});e.each(g,function(a){a.shift(d)});return e.chain(g).filter(function(a){return!!a.length()}).uniq(!1,function(a){return a.toString()}).value()}function a(a,b){var b=b||0,c=[],d=h("stringStream").create(a),e=h("range");d.eatSpace();d.start=d.pos;for(var f;f=d.next();)if(/[\s\u00a0]/.test(f))c.push(e.create(d.start+b,d.pos-d.start-1)),d.eatSpace(),d.start=d.pos;c.push(e.create(d.start+b,d.pos-
|
emmet.exec(function(h,d){function f(b,a){var e=a-(b.options.offset||0),g=/^[\s\n\r]/;return d.find(b.list(),function(a){return a.range().end===e?g.test(b.source.charAt(e)):a.range().inside(e)})}function i(b,a,d,g){for(var f=-1,i=-1;a--;)if(b.substr(a,d.length)==d){f=a;break}if(f!=-1){a=f;for(d=b.length;d>=a++;)if(b.substr(a,g.length)==g){i=a+g.length;break}}return f!=-1&&i!=-1?h("range").create(f,i-f):null}function b(b,a,d,g){function f(b){return b.replace(RegExp("^"+q.escapeForRegexp(a)+"\\s*"),
|
||||||
d.start));return c}function d(a,c,d,f){a=b(a,h("xmlParser").parse(a),c);f&&a.reverse();return(c=e.find(a,function(a){return a.equal(d)}))?(f=e.indexOf(a,c),f<a.length-1?a[f+1]:null):f?e.find(a,function(a){return a.start<d.start}):!c&&(f=e.filter(a,function(a){return a.inside(d.end)}),f.length>1)?f[1]:e.find(a,function(a){return a.end>d.end})}function i(a,b){var c;if(a.charAt(b)=="<"&&(c=a.substring(b,a.length).match(q)))return h("range").create(b,c[0])}function j(a){return a=='"'||a=="'"}function l(a){var b=
|
function(a){n-=a.length;return""}).replace(RegExp("\\s*"+q.escapeForRegexp(d)+"$"),"")}var l=h("editorUtils"),m=l.outputInfo(b).content,n=b.getCaretPos(),o=null,q=h("utils");(o=i(m,n,a,d))&&o.overlap(g)?(g=o,o=f(g.substring(m))):(o=a+" "+g.substring(m).replace(RegExp(q.escapeForRegexp(a)+"\\s*|\\s*"+q.escapeForRegexp(d),"g"),"")+" "+d,n+=a.length+1);return o!==null?(o=q.escapeText(o),b.setCaretPos(g.start),b.replaceContent(l.unindent(b,o),g.start,g.end),b.setCaretPos(n),!0):!1}h("actions").add("toggle_comment",
|
||||||
a.valueRange(!0),c=[a.range(!0),b],d=h("stringStream"),f=h("cssEditTree"),g=h("range"),j=a.value();e.each(a.valueParts(),function(a){var h=a.clone();c.push(h.shift(b.start));var i=d.create(a.substring(j));if(i.match(/^[\w\-]+\(/,!0)){i.start=i.pos;i.skipToPair("(",")");var n=i.current();c.push(g.create(h.start+i.start,n));e.each(f.findParts(n),function(a){c.push(g.create(h.start+i.start+a.start,a.substring(n)))})}});return e.chain(c).filter(function(a){return!!a.length()}).uniq(!1,function(a){return a.toString()}).value()}
|
function(c){var a=h("editorUtils").outputInfo(c);if(a.syntax=="css"){var d=c.getCaretPos(),g=h("htmlMatcher").tag(a.content,d);if(g&&g.open.range.inside(d))a.syntax="html"}if(a.syntax=="css"){g=h("range").create(c.getSelectionRange());a=h("editorUtils").outputInfo(c);if(!g.length()&&(d=h("cssEditTree").parseFromPosition(a.content,c.getCaretPos())))g=(g=f(d,c.getCaretPos()))?g.range(!0):h("range").create(d.nameRange(!0).start,d.source);g.length()||(g=h("range").create(c.getCurrentLineRange()),h("utils").narrowToNonSpace(a.content,
|
||||||
function n(a,b,c){var d=null,f=null,g=a.list(),h,j;c?(g.reverse(),h=function(a){return a.range(!0).start<=b.start},j=function(a){return a.start<b.start}):(h=function(a){return a.range(!0).end>=b.end},j=function(a){return a.end>b.start});for(;d=e.find(g,h);){a=l(d);c&&a.reverse();if(f=e.find(a,function(a){return a.equal(b)})){if(f=e.indexOf(a,f),f!=a.length-1){f=a[f+1];break}}else{f=e.filter(a,function(a){return a.inside(b.end)});if(f.length>1){f=f[1];break}if(f=e.find(a,j))break}f=null;b.start=b.end=
|
g));c=b(c,"/*","*/",g)}else{a=h("range").create(c.getSelectionRange());d=h("editorUtils").outputInfo(c);if(!a.length()&&(d=h("htmlMatcher").tag(d.content,c.getCaretPos())))a=d.outerRange;c=b(c,"<\!--","--\>",a)}return c})});
|
||||||
c?d.range(!0).start-1:d.range(!0).end+1}return f}function m(a,b,c){a=h("cssEditTree").parse(a,{offset:b});b=a.nameRange(!0);return c.end<b.end?b:n(a,c,!1)}function o(a,b,c){b=h("cssEditTree").parse(a,{offset:b});a=n(b,c,!0);return!a&&(b=b.nameRange(!0),c.start>b.start)?b:a}var q=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=h("actions");r.add("select_next_item",function(a){return a.getSyntax()=="css"?g(a,!1,h("cssEditTree").extractRule,m):f(a)});r.add("select_previous_item",
|
emmet.exec(function(h){function d(d,h,b){function c(b){for(var c=b;c>=0;){var d=a.charAt(c);if(d=="\n"||d=="\r")break;c--}return a.substring(c,b)}for(var h=h||1,b=d.getCaretPos()+(b||0),a=String(d.getContent()),d=a.length,e=-1,g=/^\s+$/;b<=d&&b>=0;){b+=h;var j=a.charAt(b),l=a.charAt(b+1),m=a.charAt(b-1);switch(j){case '"':case "'":l==j&&m=="="&&(e=b+1);break;case ">":l=="<"&&(e=b+1);break;case "\n":case "\r":g.test(c(b-1))&&(e=b)}if(e!=-1)break}return e}h=h("actions");h.add("prev_edit_point",function(f){var h=
|
||||||
function(a){return a.getSyntax()=="css"?g(a,!0,h("cssEditTree").extractRule,o):c(a)})});
|
f.getCaretPos(),b=d(f,-1);b==h&&(b=d(f,-1,-2));return b!=-1?(f.setCaretPos(b),!0):!1},{label:"Previous Edit Point"});h.add("next_edit_point",function(f){var h=d(f,1);return h!=-1?(f.setCaretPos(h),!0):!1})});
|
||||||
emmet.exec(function(h){function e(c,b,a){var b=String((b||"out").toLowerCase()),d=h("editorUtils").outputInfo(c,a),a=d.syntax,e=h("range"),g=e.create(c.getSelectionRange()),d=d.content,l=null,l=f.last_match.opening_tag,n=f.last_match.closing_tag;if(b=="in"&&l&&g.length())if(n)l.start==g.start?d.charAt(l.end)=="<"?(b=e.create(f.find(d,l.end+1,a)),l=b.start==l.end&&b.end==n.start?e.create(f(d,l.end+1,a)):e.create(l.end,n.start-l.end)):l=e.create(l.end,n.start-l.end):(b=d.substring(0,n.start).indexOf("<",
|
emmet.exec(function(h,d){function f(a,b,c,d){var e=h("range"),g=h("editorUtils").outputInfo(a).content,f=g.length,j,i=e.create(-1,0),l=e.create(a.getSelectionRange());j=l.start;for(var o=1E5;j>=0&&j<f&&--o>0;){if(e=c(g,j,b)){if(i.equal(e))break;i=e.clone();if(j=d(e.substring(g),e.start,l.clone()))return a.createSelection(j.start,j.end),!0;else j=b?e.start:e.end-1}j+=b?-1:1}return!1}function i(a){var b=!0;return f(a,!1,function(a,c){if(b){b=!1;var d;a:{d=c;for(var e;d>=0;){if(e=g(a,d)){d=e;break a}d--}d=
|
||||||
l.end),l=e.create(f(d,b!=-1?b+1:l.end,a)));else return!1;else l=e.create(f(d,g.end,a));return l&&l.start!=-1?(c.createSelection(l.start,l.end),!0):!1}var g=h("actions"),f=h("html_matcher");g.add("match_pair",e,{hidden:!0});g.add("match_pair_inward",function(c){return e(c,"in")},{label:"HTML/Match Pair Tag (inward)"});g.add("match_pair_outward",function(c){return e(c,"out")},{label:"HTML/Match Pair Tag (outward)"});g.add("matching_pair",function(c){var b=String(c.getContent()),a=c.getCaretPos();b.charAt(a)==
|
null}return d}else return g(a,c)},function(a,b,c){return e(a,b,c,!1)})}function b(a){return f(a,!0,g,function(a,b,c){return e(a,b,c,!0)})}function c(b,c,e){var e=e||0,g=h("range"),f=[],i=-1,l="",z="",x,o;d.each(c,function(c){switch(c.type){case "tag":o=b.substring(c.start,c.end);/^<[\w\:\-]/.test(o)&&f.push(g.create({start:c.start+1,end:c.end}));break;case "attribute":i=c.start;l=b.substring(c.start,c.end);break;case "string":f.push(g.create(i,c.end-i)),x=g.create(c),z=x.substring(b),j(z.charAt(0))&&
|
||||||
"<"&&a++;var d=f.getTags(b,a,String(c.getProfileName()));if(d&&d[0]&&(b=d[0],d=d[1]))if(b.start<=a&&b.end>=a)return c.setCaretPos(d.start),!0;else if(d.start<=a&&d.end>=a)return c.setCaretPos(b.start),!0;return!1},{label:"HTML/Go To Matching Tag Pair"})});
|
x.start++,j(z.charAt(z.length-1))&&x.end--,f.push(x),l=="class"&&(f=f.concat(a(x.substring(b),x.start)))}});d.each(f,function(a){a.shift(e)});return d.chain(f).filter(function(a){return!!a.length()}).uniq(!1,function(a){return a.toString()}).value()}function a(a,b){var b=b||0,c=[],d=h("stringStream").create(a),e=h("range");d.eatSpace();d.start=d.pos;for(var g;g=d.next();)if(/[\s\u00a0]/.test(g))c.push(e.create(d.start+b,d.pos-d.start-1)),d.eatSpace(),d.start=d.pos;c.push(e.create(d.start+b,d.pos-
|
||||||
emmet.exec(function(h){h("actions").add("remove_tag",function(e){var g=h("utils"),f=h("editorUtils").outputInfo(e),c=h("html_matcher").getTags(f.content,e.getCaretPos(),f.profile);if(c&&c[0]){if(c[1]){var b=g.narrowToNonSpace(f.content,c[0].end,c[1].start-c[0].end),a=g.findNewlineBounds(f.content,b.start),a=g.getLinePadding(a.substring(f.content)),f=b.substring(f.content),f=g.unindentString(f,a);e.replaceContent(g.getCaretPlaceholder()+g.escapeText(f),c[0].start,c[1].end)}else e.replaceContent(g.getCaretPlaceholder(),
|
d.start));return c}function e(a,b,e,g){a=c(a,h("xmlParser").parse(a),b);g&&a.reverse();return(b=d.find(a,function(a){return a.equal(e)}))?(g=d.indexOf(a,b),g<a.length-1?a[g+1]:null):g?d.find(a,function(a){return a.start<e.start}):!b&&(g=d.filter(a,function(a){return a.inside(e.end)}),g.length>1)?g[1]:d.find(a,function(a){return a.end>e.end})}function g(a,b){var c;if(a.charAt(b)=="<"&&(c=a.substring(b,a.length).match(q)))return h("range").create(b,c[0])}function j(a){return a=='"'||a=="'"}function l(a){var b=
|
||||||
c[0].start,c[0].end);return!0}return!1},{label:"HTML/Remove Tag"})});
|
a.valueRange(!0),c=[a.range(!0),b],e=h("stringStream"),g=h("cssEditTree"),f=h("range"),j=a.value();d.each(a.valueParts(),function(a){var h=a.clone();c.push(h.shift(b.start));var i=e.create(a.substring(j));if(i.match(/^[\w\-]+\(/,!0)){i.start=i.pos;i.skipToPair("(",")");var l=i.current();c.push(f.create(h.start+i.start,l));d.each(g.findParts(l),function(a){c.push(f.create(h.start+i.start+a.start,a.substring(l)))})}});return d.chain(c).filter(function(a){return!!a.length()}).uniq(!1,function(a){return a.toString()}).value()}
|
||||||
emmet.exec(function(h){h("actions").add("split_join_tag",function(e,g){var f=h("html_matcher"),c=h("editorUtils").outputInfo(e,null,g),b=h("profile").get(c.profile);if((f=f.getTags(c.content,e.getCaretPos(),c.profile))&&f[0]){if(f[1]){c=h("utils");b=f[0].full_tag.replace(/\s*>$/,(b.self_closing_tag===!0?"/":" /")+">");if(b.length+f[0].start<e.getCaretPos())b+=c.getCaretPlaceholder();else var a=e.getCaretPos()-f[0].start,b=c.replaceSubstring(b,c.getCaretPlaceholder(),a);e.replaceContent(b,f[0].start,
|
function m(a,b,c){var e=null,g=null,f=a.list(),h,j;c?(f.reverse(),h=function(a){return a.range(!0).start<=b.start},j=function(a){return a.start<b.start}):(h=function(a){return a.range(!0).end>=b.end},j=function(a){return a.end>b.start});for(;e=d.find(f,h);){a=l(e);c&&a.reverse();if(g=d.find(a,function(a){return a.equal(b)})){if(g=d.indexOf(a,g),g!=a.length-1){g=a[g+1];break}}else{g=d.filter(a,function(a){return a.inside(b.end)});if(g.length>1){g=g[1];break}if(g=d.find(a,j))break}g=null;b.start=b.end=
|
||||||
f[1].end)}else{var d=h("utils"),c=d.getNewline(),a=h("resources").getVariable("indentation"),d=d.getCaretPlaceholder(),b=b.tag_nl===!0?c+a+d+c:d,b=f[0].full_tag.replace(/\s*\/>$/,">")+b+"</"+f[0].name+">";e.replaceContent(b,f[0].start,f[0].end)}f=!0}else f=!1;return f},{label:"HTML/Split\\Join Tag Declaration"})});
|
c?e.range(!0).start-1:e.range(!0).end+1}return g}function n(a,b,c){a=h("cssEditTree").parse(a,{offset:b});b=a.nameRange(!0);return c.end<b.end?b:m(a,c,!1)}function o(a,b,c){b=h("cssEditTree").parse(a,{offset:b});a=m(b,c,!0);return!a&&(b=b.nameRange(!0),c.start>b.start)?b:a}var q=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,s=h("actions");s.add("select_next_item",function(a){return a.getSyntax()=="css"?f(a,!1,h("cssEditTree").extractRule,n):i(a)});s.add("select_previous_item",
|
||||||
emmet.define("reflectCSSValue",function(h,e){function g(b){var a=h("cssEditTree"),d=h("editorUtils").outputInfo(b),b=b.getCaretPos();if(a=a.parseFromPosition(d.content,b))if(d=a.itemFromPosition(b,!0)){var e=a.source,f=a.options.offset,b=b-f-d.range().start;c.exec(!1,[d]);if(e!==a.source)return{data:a.source,start:f,end:f+e.length,caret:f+d.range().start+b}}}function f(b){var b=h("cssEditTree").baseName(b),a;if(b=="opacity"||b=="filter")return/^(?:\-\w+\-)?(?:opacity|filter)$/;else if(a=b.match(/^border-radius-(top|bottom)(left|right)/))return RegExp("^(?:\\-\\w+\\-)?(?:"+
|
function(a){return a.getSyntax()=="css"?f(a,!0,h("cssEditTree").extractRule,o):b(a)})});
|
||||||
b+"|border-"+a[1]+"-"+a[2]+"-radius)$");else if(a=b.match(/^border-(top|bottom)-(left|right)-radius/))return RegExp("^(?:\\-\\w+\\-)?(?:"+b+"|border-radius-"+a[1]+a[2]+")$");return RegExp("^(?:\\-\\w+\\-)?"+b+"$")}var c=h("handlerList").create();h("actions").add("reflect_css_value",function(b){return b.getSyntax()!="css"?!1:h("actionUtils").compoundUpdate(b,g(b))},{label:"CSS/Reflect Value"});c.add(function(b){var a=f(b.name());e.each(b.parent.list(),function(c){if(a.test(c.name())){var e;var f=b.name(),
|
emmet.exec(function(h){function d(c,a){var a=String((a||"out").toLowerCase()),d=h("editorUtils").outputInfo(c),g=h("range").create(c.getSelectionRange()),d=d.content;b&&!b.range.equal(g)&&(b=null);if(b&&g.length())if(a=="in")if(b.type=="tag"&&!b.close)return!1;else if(b.range.equal(b.outerRange))b.range=b.innerRange;else{var f=h("utils").narrowToNonSpace(d,b.innerRange);if((b=i.find(d,f.start+1))&&b.range.equal(g)&&b.outerRange.equal(g))b.range=b.innerRange}else if(!b.innerRange.equal(b.outerRange)&&
|
||||||
g=b.value(),n=c.name();e=c.value();var m=h("cssEditTree"),o=h("utils"),f=m.baseName(f),n=m.baseName(n);e=f=="opacity"&&n=="filter"?e.replace(/opacity=[^)]*/i,"opacity="+Math.floor(parseFloat(g)*100)):f=="filter"&&n=="opacity"?(f=g.match(/opacity=([^)]*)/i))?o.prettifyNumber(parseInt(f[1])/100):e:g;c.value(e)}})},{order:-1});return{addHandler:function(b,a){c.add(b,a)},removeHandler:function(b){c.remove(b,options)}}});
|
b.range.equal(b.innerRange)&&g.equal(b.range))b.range=b.outerRange;else{if((b=i.find(d,g.start))&&b.range.equal(g)&&b.innerRange.equal(g))b.range=b.outerRange}else b=i.find(d,g.start);if(b&&!b.range.equal(g))return c.createSelection(b.range.start,b.range.end),!0;b=null;return!1}var f=h("actions"),i=h("htmlMatcher"),b=null;f.add("match_pair",d,{hidden:!0});f.add("match_pair_inward",function(b){return d(b,"in")},{label:"HTML/Match Pair Tag (inward)"});f.add("match_pair_outward",function(b){return d(b,
|
||||||
emmet.exec(function(h){h("actions").add("evaluate_math_expression",function(e){var g=h("actionUtils"),f=h("utils"),c=String(e.getContent()),b=h("range").create(e.getSelectionRange());b.length()||(b=g.findExpressionBounds(e,function(a){return f.isNumeric(a)||".+-*/\\".indexOf(a)!=-1}));if(b&&b.length()){g=b.substring(c);g=g.replace(/([\d\.\-]+)\\([\d\.\-]+)/g,"Math.round($1/$2)");try{var a=f.prettifyNumber((new Function("return "+g))());e.replaceContent(a,b.start,b.end);e.setCaretPos(b.start+a.length);
|
"out")},{label:"HTML/Match Pair Tag (outward)"});f.add("matching_pair",function(b){var a=String(b.getContent()),d=b.getCaretPos();a.charAt(d)=="<"&&d++;return(a=i.tag(a,d))&&a.close?(a.open.range.inside(d)?b.setCaretPos(a.close.range.start):b.setCaretPos(a.open.range.start),!0):!1},{label:"HTML/Go To Matching Tag Pair"})});
|
||||||
return!0}catch(d){}}return!1},{label:"Numbers/Evaluate Math Expression"})});
|
emmet.exec(function(h){h("actions").add("remove_tag",function(d){var f=h("utils"),i=h("editorUtils").outputInfo(d),b=h("htmlMatcher").tag(i.content,d.getCaretPos());if(b){if(b.close){var c=f.narrowToNonSpace(i.content,b.innerRange),a=f.findNewlineBounds(i.content,c.start),a=f.getLinePadding(a.substring(i.content)),i=c.substring(i.content),i=f.unindentString(i,a);d.replaceContent(f.getCaretPlaceholder()+f.escapeText(i),b.outerRange.start,b.outerRange.end)}else d.replaceContent(f.getCaretPlaceholder(),
|
||||||
emmet.exec(function(h,e){function g(b,a){var c=h("utils"),g=!1,j=!1,l=h("actionUtils").findExpressionBounds(b,function(a,b,e){return c.isNumeric(a)?!0:a=="."?!c.isNumeric(e.charAt(b+1))?!1:j?!1:j=!0:a=="-"?g?!1:g=!0:!1});if(l&&l.length()){var n=l.substring(String(b.getContent())),m=parseFloat(n);if(!e.isNaN(m)){m=c.prettifyNumber(m+a);if(/^(\-?)0+[1-9]/.test(n)){var o="";RegExp.$1&&(o="-",m=m.substring(1));m=m.split(".");m[0]=c.zeroPadString(m[0],f(n));m=o+m.join(".")}b.replaceContent(m,l.start,l.end);
|
b.range.start,b.range.end);return!0}return!1},{label:"HTML/Remove Tag"})});
|
||||||
b.createSelection(l.start,l.start+m.length);return!0}}return!1}function f(b){b=b.replace(/^\-/,"");return~b.indexOf(".")?b.split(".")[0].length:b.length}var c=h("actions");e.each([1,-1,10,-10,0.1,-0.1],function(b){var a=b>0?"increment":"decrement";c.add(a+"_number_by_"+String(Math.abs(b)).replace(".","").substring(0,2),function(a){return g(a,b)},{label:"Numbers/"+a.charAt(0).toUpperCase()+a.substring(1)+" number by "+Math.abs(b)})})});
|
emmet.exec(function(h){h("actions").add("split_join_tag",function(d,f){var i=h("htmlMatcher"),b=h("editorUtils").outputInfo(d,null,f),c=h("profile").get(b.profile);if(i=i.tag(b.content,d.getCaretPos())){if(i.close){var b=h("utils"),c=c.selfClosing()||" /",c=i.open.range.substring(i.source).replace(/\s*>$/,c+">"),a=d.getCaretPos();c.length+i.outerRange.start<a&&(a=c.length+i.outerRange.start);c=b.escapeText(c);d.replaceContent(c,i.outerRange.start,i.outerRange.end)}else{var b=h("utils"),e=b.getNewline(),
|
||||||
emmet.exec(function(h,e){var g=h("actions"),f=h("preferences");f.define("css.closeBraceIndentation","\n","Indentation before closing brace of CSS rule. Some users prefereindented closing brace of CSS rule for better readability. This preference\u2019s value will be automatically inserted before closing brace when user adds newline in newly created CSS rule (e.g. when \u201cInsert formatted linebreak\u201d action will be performed in CSS file). If you\u2019re such user, you may want to write put a value like <code>\\n\\t</code> in this preference.");
|
g=h("resources").getVariable("indentation"),a=d.getCaretPos(),c=c.tag_nl===!0?e+g+e:"",e=i.outerContent().replace(/\s*\/>$/,">"),a=i.outerRange.start+e.length;e+=c+"</"+i.open.name+">";e=b.escapeText(e);d.replaceContent(e,i.outerRange.start,i.outerRange.end)}d.setCaretPos(a);i=!0}else i=!1;return i},{label:"HTML/Split\\Join Tag Declaration"})});
|
||||||
g.add("insert_formatted_line_break_only",function(c){var b=h("utils"),a=h("resources"),d=h("editorUtils").outputInfo(c),g=c.getCaretPos(),j=b.getNewline();if(e.include(["html","xml","xsl"],d.syntax)){if(a=a.getVariable("indentation"),d=h("html_matcher").getTags(d.content,g,d.profile),d[0]&&d[1]&&d[0].type=="tag"&&d[0].end==g&&d[1].start==g)return c.replaceContent(j+a+b.getCaretPlaceholder()+j,g),!0}else if(d.syntax=="css"&&(d=d.content,g&&d.charAt(g-1)=="{")){var l=f.get("css.closeBraceIndentation"),
|
emmet.define("reflectCSSValue",function(h,d){function f(c){var a=h("cssEditTree"),d=h("editorUtils").outputInfo(c),c=c.getCaretPos();if(a=a.parseFromPosition(d.content,c))if(d=a.itemFromPosition(c,!0)){var g=a.source,f=a.options.offset,c=c-f-d.range().start;b.exec(!1,[d]);if(g!==a.source)return{data:a.source,start:f,end:f+g.length,caret:f+d.range().start+c}}}function i(b){var b=h("cssEditTree").baseName(b),a;if(b=="opacity"||b=="filter")return/^(?:\-\w+\-)?(?:opacity|filter)$/;else if(a=b.match(/^border-radius-(top|bottom)(left|right)/))return RegExp("^(?:\\-\\w+\\-)?(?:"+
|
||||||
a=a.getVariable("indentation"),n=d.charAt(g)=="}";if(!n)for(var m=g,o=d.length,q;m<o;m++){q=d.charAt(m);if(q=="{")break;if(q=="}"){l="";n=!0;break}}n||(l+="}");b=j+a+b.getCaretPlaceholder()+l;c.replaceContent(b,g);return!0}return!1},{hidden:!0});g.add("insert_formatted_line_break",function(c){if(!g.run("insert_formatted_line_break_only",c)){for(var b=h("utils"),a=h("editorUtils").getCurrentLinePadding(c),d=String(c.getContent()),e=c.getCaretPos(),f=d.length,b=b.getNewline(),l="",n=c.getCurrentLineRange().end+
|
b+"|border-"+a[1]+"-"+a[2]+"-radius)$");else if(a=b.match(/^border-(top|bottom)-(left|right)-radius/))return RegExp("^(?:\\-\\w+\\-)?(?:"+b+"|border-radius-"+a[1]+a[2]+")$");return RegExp("^(?:\\-\\w+\\-)?"+b+"$")}var b=h("handlerList").create();h("actions").add("reflect_css_value",function(b){return b.getSyntax()!="css"?!1:h("actionUtils").compoundUpdate(b,f(b))},{label:"CSS/Reflect Value"});b.add(function(b){var a=i(b.name());d.each(b.parent.list(),function(d){if(a.test(d.name())){var g;var f=b.name(),
|
||||||
1,m;n<f;n++)if(m=d.charAt(n),m==" "||m=="\t")l+=m;else break;l.length>a.length?c.replaceContent(b+l,e,e,!0):c.replaceContent(b,e)}return!0},{hidden:!0})});
|
i=b.value(),m=d.name();g=d.value();var n=h("cssEditTree"),o=h("utils"),f=n.baseName(f),m=n.baseName(m);g=f=="opacity"&&m=="filter"?g.replace(/opacity=[^)]*/i,"opacity="+Math.floor(parseFloat(i)*100)):f=="filter"&&m=="opacity"?(f=i.match(/opacity=([^)]*)/i))?o.prettifyNumber(parseInt(f[1])/100):g:i;d.value(g)}})},{order:-1});return{addHandler:function(c,a){b.add(c,a)},removeHandler:function(c){b.remove(c,options)}}});
|
||||||
emmet.exec(function(h){h("actions").add("merge_lines",function(e){var g=h("html_matcher"),f=h("utils"),c=h("editorUtils").outputInfo(e),b=h("range").create(e.getSelectionRange());if(!b.length()&&(g=g(c.content,e.getCaretPos(),c.profile)))b.start=g[0],b.end=g[1];if(b.length()){c=b.substring(c.content);f=f.splitByLines(c);for(c=1;c<f.length;c++)f[c]=f[c].replace(/^\s+/,"");c=f.join("").replace(/\s{2,}/," ");e.replaceContent(c,b.start,b.end);e.createSelection(b.start,b.start+c.length);return!0}return!1})});
|
emmet.exec(function(h){h("actions").add("evaluate_math_expression",function(d){var f=h("actionUtils"),i=h("utils"),b=String(d.getContent()),c=h("range").create(d.getSelectionRange());c.length()||(c=f.findExpressionBounds(d,function(a){return i.isNumeric(a)||".+-*/\\".indexOf(a)!=-1}));if(c&&c.length()){f=c.substring(b);f=f.replace(/([\d\.\-]+)\\([\d\.\-]+)/g,"Math.round($1/$2)");try{var a=i.prettifyNumber((new Function("return "+f))());d.replaceContent(a,c.start,c.end);d.setCaretPos(c.start+a.length);
|
||||||
emmet.exec(function(h){function e(e,f,c){c=c||0;return f.charAt(c)==e.charAt(0)&&f.substr(c,e.length)==e}h("actions").add("encode_decode_data_url",function(g){var f=String(g.getSelection()),c=g.getCaretPos();if(!f)for(var b=String(g.getContent());c-- >=0;)if(e("src=",b,c)){if(b=b.substr(c).match(/^(src=(["'])?)([^'"<>\s]+)\1?/))f=b[3],c+=b[1].length;break}else if(e("url(",b,c)){if(b=b.substr(c).match(/^(url\((['"])?)([^'"\)\s]+)\1?/))f=b[3],c+=b[1].length;break}if(f)if(e("data:",f))if(b=String(g.prompt("Enter path to file (absolute or relative)"))){var a=
|
return!0}catch(e){}}return!1},{label:"Numbers/Evaluate Math Expression"})});
|
||||||
h("file"),d=a.createPath(g.getFilePath(),b);if(!d)throw"Can't save file";a.save(d,h("base64").decode(f.replace(/^data\:.+?;.+?,/,"")));g.replaceContent("$0"+b,c,c+f.length);g=!0}else g=!1;else{b=h("file");a=h("actionUtils");d=g.getFilePath();if(d===null)throw"You should save your file before using this action";d=b.locateFile(d,f);if(d===null)throw"Can't find "+f+" file";var i=h("base64").encode(String(b.read(d)));if(!i)throw"Can't encode file content to base64";i="data:"+(a.mimeTypes[String(b.getExt(d))]||
|
emmet.exec(function(h,d){function f(b,a){var e=h("utils"),g=!1,f=!1,l=h("actionUtils").findExpressionBounds(b,function(a,b,c){return e.isNumeric(a)?!0:a=="."?!e.isNumeric(c.charAt(b+1))?!1:f?!1:f=!0:a=="-"?g?!1:g=!0:!1});if(l&&l.length()){var m=l.substring(String(b.getContent())),n=parseFloat(m);if(!d.isNaN(n)){n=e.prettifyNumber(n+a);if(/^(\-?)0+[1-9]/.test(m)){var o="";RegExp.$1&&(o="-",n=n.substring(1));n=n.split(".");n[0]=e.zeroPadString(n[0],i(m));n=o+n.join(".")}b.replaceContent(n,l.start,l.end);
|
||||||
"application/octet-stream")+";base64,"+i;g.replaceContent("$0"+i,c,c+f.length);g=!0}else g=!1;return g},{label:"Encode\\Decode data:URL image"})});
|
b.createSelection(l.start,l.start+n.length);return!0}}return!1}function i(b){b=b.replace(/^\-/,"");return~b.indexOf(".")?b.split(".")[0].length:b.length}var b=h("actions");d.each([1,-1,10,-10,0.1,-0.1],function(c){var a=c>0?"increment":"decrement";b.add(a+"_number_by_"+String(Math.abs(c)).replace(".","").substring(0,2),function(a){return f(a,c)},{label:"Numbers/"+a.charAt(0).toUpperCase()+a.substring(1)+" number by "+Math.abs(c)})})});
|
||||||
emmet.exec(function(h,e){function g(e,c){var b;if(c){if(/^data:/.test(c))b=h("base64").decode(c.replace(/^data\:.+?;.+?,/,""));else{b=h("file");var a=b.locateFile(e.getFilePath(),c);if(a===null)throw"Can't find "+c+" file";b=String(b.read(a))}return h("actionUtils").getImageSize(b)}}h("actions").add("update_image_size",function(f){var c;if(String(f.getSyntax())=="css")a:{c=f.getCaretPos();var b=h("editorUtils").outputInfo(f);if(b=h("cssEditTree").parseFromPosition(b.content,c,!0)){var a=b.itemFromPosition(c,
|
emmet.exec(function(h,d){var f=h("actions"),i=h("preferences");i.define("css.closeBraceIndentation","\n","Indentation before closing brace of CSS rule. Some users prefere indented closing brace of CSS rule for better readability. This preference\u2019s value will be automatically inserted before closing brace when user adds newline in newly created CSS rule (e.g. when \u201cInsert formatted linebreak\u201d action will be performed in CSS file). If you\u2019re such user, you may want to write put a value like <code>\\n\\t</code> in this preference.");
|
||||||
!0),d;if(a&&(d=/url\((["']?)(.+?)\1\)/i.exec(a.value()||"")))if(d=g(f,d[2])){a=b.range(!0);b.value("width",d.width+"px");b.value("height",d.height+"px",b.indexOf("width")+1);c=e.extend(a,{data:b.toString(),caret:c});break a}}c=null}else a:{c=f.getCaretPos();b=h("editorUtils").outputInfo(f);if((b=h("xmlEditTree").parseFromPosition(b.content,c,!0))&&b.name().toLowerCase()=="img")if(d=g(f,b.value("src"))){a=b.range(!0);b.value("width",d.width);b.value("height",d.height,b.indexOf("width")+1);c=e.extend(a,
|
f.add("insert_formatted_line_break_only",function(b){var c=h("utils"),a=h("resources"),e=h("editorUtils").outputInfo(b),g=b.getCaretPos(),f=c.getNewline();if(d.include(["html","xml","xsl"],e.syntax)){if(a=a.getVariable("indentation"),(e=h("htmlMatcher").tag(e.content,g))&&!e.innerRange.length())return b.replaceContent(f+a+c.getCaretPlaceholder()+f,g),!0}else if(e.syntax=="css"&&(e=e.content,g&&e.charAt(g-1)=="{")){var l=i.get("css.closeBraceIndentation"),a=a.getVariable("indentation"),m=e.charAt(g)==
|
||||||
{data:b.toString(),caret:c});break a}c=null}return h("actionUtils").compoundUpdate(f,c)})});
|
"}";if(!m)for(var n=g,o=e.length,q;n<o;n++){q=e.charAt(n);if(q=="{")break;if(q=="}"){l="";m=!0;break}}m||(l+="}");c=f+a+c.getCaretPlaceholder()+l;b.replaceContent(c,g);return!0}return!1},{hidden:!0});f.add("insert_formatted_line_break",function(b){if(!f.run("insert_formatted_line_break_only",b)){for(var c=h("utils"),a=h("editorUtils").getCurrentLinePadding(b),d=String(b.getContent()),g=b.getCaretPos(),i=d.length,c=c.getNewline(),l="",m=b.getCurrentLineRange().end+1,n;m<i;m++)if(n=d.charAt(m),n==" "||
|
||||||
emmet.define("cssResolver",function(h,e){function g(a){var b=a&&a.charCodeAt(0);return a&&a=="."||b>47&&b<58}function f(a){a=h("utils").trim(a);if(~a.indexOf("/*"))return!1;a=h("tabStops").processText(a,{replaceCarets:!0,tabstop:function(){return"value"}});return a.split(":").length==2}function c(a){var b=h("utils"),a=b.trim(a);if(a.indexOf(":")==-1)return{name:a,value:o};a=a.split(":");return{name:b.trim(a.shift()),value:b.trim(a.join(":")).replace(/^(\$\{0\}|\$0)(\s*;?)$/,"${1}$2")}}function b(a,
|
n=="\t")l+=n;else break;l.length>a.length?b.replaceContent(c+l,g,g,!0):b.replaceContent(c,g)}return!0},{hidden:!0})});
|
||||||
b){var c=n[b];c||(c=e.find(n,function(a){return a.prefix==b}));return c&&c.supports&&e.include(c.supports,a)}function a(a,c){var d=[];e.each(n,function(c,e){b(a,e)&&d.push(e)});!d.length&&!c&&e.each(n,function(a,b){a.obsolete||d.push(b)});return d}function d(a,b){e.isString(b)&&(b={prefix:b});n[a]=e.extend({},l,b)}function i(a,b){if(!e.isString(a))a=a.data;if(!f(a))return a;b&&(~a.indexOf(";")?a=a.split(";").join(" !important;"):a+=" !important");var c=a.indexOf(":");return a=a.substring(0,c).replace(/\s+$/,
|
emmet.exec(function(h){h("actions").add("merge_lines",function(d){var f=h("htmlMatcher"),i=h("utils"),b=h("editorUtils").outputInfo(d),c=h("range").create(d.getSelectionRange());if(!c.length()&&(f=f.find(b.content,d.getCaretPos())))c=f.outerRange;if(c.length()){b=c.substring(b.content);b=i.splitByLines(b);for(f=1;f<b.length;f++)b[f]=b[f].replace(/^\s+/,"");b=b.join("").replace(/\s{2,}/," ");f=b.length;b=i.escapeText(b);d.replaceContent(b,c.start,c.end);d.createSelection(c.start,c.start+f);return!0}return!1})});
|
||||||
"")+q.get("css.valueSeparator")+h("utils").trim(a.substring(c+1))}var j=null,l={prefix:"emmet",obsolete:!1,transformName:function(a){return"-"+this.prefix+"-"+a},supports:null},n={},m={p:"%",e:"em",x:"ex"},o="${1};",q=h("preferences");q.define("css.valueSeparator",": ","Defines a symbol that should be placed between CSS property and value when expanding CSS abbreviations.");q.define("css.autoInsertVendorPrefixes",!0,"Automatically generate vendor-prefixed copies of expanded CSS property. By default, Emmet will generate vendor-prefixed NaN(e.g. <code>-bxsh</code>). With this option enabled, you don\u2019t need dashes before abbreviations: Emmet will produce vendor-prefixed properties for you.");
|
emmet.exec(function(h){function d(d,h,b){b=b||0;return h.charAt(b)==d.charAt(0)&&h.substr(b,d.length)==d}h("actions").add("encode_decode_data_url",function(f){var i=String(f.getSelection()),b=f.getCaretPos();if(!i)for(var c=String(f.getContent());b-- >=0;)if(d("src=",c,b)){if(c=c.substr(b).match(/^(src=(["'])?)([^'"<>\s]+)\1?/))i=c[3],b+=c[1].length;break}else if(d("url(",c,b)){if(c=c.substr(b).match(/^(url\((['"])?)([^'"\)\s]+)\1?/))i=c[3],b+=c[1].length;break}if(i)if(d("data:",i))if(c=String(f.prompt("Enter path to file (absolute or relative)"))){var a=
|
||||||
var r=e.template("A comma-separated list of CSS properties that may have <code><%= vendor %></code> vendor prefix. This list is used to generate a list of prefixed properties when expanding <code>-property</code> abbreviations. Empty list means that all possible CSS values may have <code><%= vendor %></code> prefix.");e.each({webkit:"animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-clip, background-composite, background-origin, background-size, border-fit, border-horizontal-spacing, border-image, border-vertical-spacing, box-align, box-direction, box-flex, box-flex-group, box-lines, box-ordinal-group, box-orient, box-pack, box-reflect, box-shadow, color-correction, column-break-after, column-break-before, column-break-inside, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, dashboard-region, font-smoothing, highlight, hyphenate-character, hyphenate-limit-after, hyphenate-limit-before, hyphens, line-box-contain, line-break, line-clamp, locale, margin-before-collapse, margin-after-collapse, marquee-direction, marquee-increment, marquee-repetition, marquee-style, mask-attachment, mask-box-image, mask-box-image-outset, mask-box-image-repeat, mask-box-image-slice, mask-box-image-source, mask-box-image-width, mask-clip, mask-composite, mask-image, mask-origin, mask-position, mask-repeat, mask-size, nbsp-mode, perspective, perspective-origin, rtl-ordering, text-combine, text-decorations-in-effect, text-emphasis-color, text-emphasis-position, text-emphasis-style, text-fill-color, text-orientation, text-security, text-stroke-color, text-stroke-width, transform, transition, transform-origin, transform-style, transition-delay, transition-duration, transition-property, transition-timing-function, user-drag, user-modify, user-select, writing-mode, svg-shadow",
|
h("file"),e=a.createPath(f.getFilePath(),c);if(!e)throw"Can't save file";a.save(e,h("base64").decode(i.replace(/^data\:.+?;.+?,/,"")));f.replaceContent("$0"+c,b,b+i.length);f=!0}else f=!1;else{c=h("file");a=h("actionUtils");e=f.getFilePath();if(e===null)throw"You should save your file before using this action";e=c.locateFile(e,i);if(e===null)throw"Can't find "+i+" file";var g=h("base64").encode(String(c.read(e)));if(!g)throw"Can't encode file content to base64";g="data:"+(a.mimeTypes[String(c.getExt(e))]||
|
||||||
moz:"animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-inline-policy, binding, border-bottom-colors, border-image, border-left-colors, border-right-colors, border-top-colors, box-align, box-direction, box-flex, box-ordinal-group, box-orient, box-pack, box-shadow, box-sizing, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-width, float-edge, font-feature-settings, font-language-override, force-broken-image-icon, hyphens, image-region, orient, outline-radius-bottomleft, outline-radius-bottomright, outline-radius-topleft, outline-radius-topright, perspective, perspective-origin, stack-sizing, tab-size, text-blink, text-decoration-color, text-decoration-line, text-decoration-style, text-size-adjust, transform, transform-origin, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-focus, user-input, user-modify, user-select, window-shadow",
|
"application/octet-stream")+";base64,"+g;f.replaceContent("$0"+g,b,b+i.length);f=!0}else f=!1;return f},{label:"Encode\\Decode data:URL image"})});
|
||||||
ms:"accelerator, animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, backface-visibility, background-position-x, background-position-y, behavior, block-progression, box-align, box-direction, box-flex, box-line-progression, box-lines, box-ordinal-group, box-orient, box-pack, content-zoom-boundary, content-zoom-boundary-max, content-zoom-boundary-min, content-zoom-chaining, content-zoom-snap, content-zoom-snap-points, content-zoom-snap-type, content-zooming, filter, flow-from, flow-into, font-feature-settings, grid-column, grid-column-align, grid-column-span, grid-columns, grid-layer, grid-row, grid-row-align, grid-row-span, grid-rows, high-contrast-adjust, hyphenate-limit-chars, hyphenate-limit-lines, hyphenate-limit-zone, hyphens, ime-mode, interpolation-mode, layout-flow, layout-grid, layout-grid-char, layout-grid-line, layout-grid-mode, layout-grid-type, line-break, overflow-style, overflow-x, overflow-y, perspective, perspective-origin, perspective-origin-x, perspective-origin-y, scroll-boundary, scroll-boundary-bottom, scroll-boundary-left, scroll-boundary-right, scroll-boundary-top, scroll-chaining, scroll-rails, scroll-snap-points-x, scroll-snap-points-y, scroll-snap-type, scroll-snap-x, scroll-snap-y, scrollbar-arrow-color, scrollbar-base-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color, scrollbar-track-color, text-align-last, text-autospace, text-justify, text-kashida-space, text-overflow, text-size-adjust, text-underline-position, touch-action, transform, transform-origin, transform-origin-x, transform-origin-y, transform-origin-z, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-select, word-break, word-wrap, wrap-flow, wrap-margin, wrap-through, writing-mode, zoom",
|
emmet.exec(function(h,d){function f(d,b){var c;if(b){if(/^data:/.test(b))c=h("base64").decode(b.replace(/^data\:.+?;.+?,/,""));else{c=h("file");var a=c.locateFile(d.getFilePath(),b);if(a===null)throw"Can't find "+b+" file";c=String(c.read(a))}return h("actionUtils").getImageSize(c)}}h("actions").add("update_image_size",function(i){var b;if(String(i.getSyntax())=="css")a:{b=i.getCaretPos();var c=h("editorUtils").outputInfo(i);if(c=h("cssEditTree").parseFromPosition(c.content,b,!0)){var a=c.itemFromPosition(b,
|
||||||
|
!0),e;if(a&&(e=/url\((["']?)(.+?)\1\)/i.exec(a.value()||"")))if(e=f(i,e[2])){a=c.range(!0);c.value("width",e.width+"px");c.value("height",e.height+"px",c.indexOf("width")+1);b=d.extend(a,{data:c.toString(),caret:b});break a}}b=null}else a:{b=i.getCaretPos();c=h("editorUtils").outputInfo(i);if((c=h("xmlEditTree").parseFromPosition(c.content,b,!0))&&(c.name()||"").toLowerCase()=="img")if(e=f(i,c.value("src"))){a=c.range(!0);c.value("width",e.width);c.value("height",e.height,c.indexOf("width")+1);b=
|
||||||
|
d.extend(a,{data:c.toString(),caret:b});break a}b=null}return h("actionUtils").compoundUpdate(i,b)})});
|
||||||
|
emmet.define("cssResolver",function(h,d){function f(a){var b=a&&a.charCodeAt(0);return a&&a=="."||b>47&&b<58}function i(a){a=h("utils").trim(a);if(~a.indexOf("/*")||/[\n\r]/.test(a))return!1;if(!/^[a-z0-9\-]+\s*\:/i.test(a))return!1;a=h("tabStops").processText(a,{replaceCarets:!0,tabstop:function(){return"value"}});return a.split(":").length==2}function b(a){a.charAt(0);if(a.charAt(0)=="#"){var b=a.replace(/^#+/,"")||"0",d=h("utils").repeatString,a=null;switch(b.length){case 1:a=d(b,6);break;case 2:a=
|
||||||
|
d(b,3);break;case 3:a=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2);break;case 4:a=b+b.substr(0,2);break;case 5:a=b+b.charAt(0);break;default:a=b.substr(0,6)}p.get("css.color.short")&&(b=a.split(""),b[0]==b[1]&&b[2]==b[3]&&b[4]==b[5]&&(a=b[0]+b[2]+b[4]));switch(p.get("css.color.case")){case "upper":a=a.toUpperCase();break;case "lower":a=a.toLowerCase()}a="#"+a}else a=c(a);return a}function c(a){var b=p.getDict("css.keywordAliases");return a in b?b[a]:a}function a(a){return d.include(p.getArray("css.keywords"),
|
||||||
|
c(a))}function e(a){var b=h("utils"),a=b.trim(a);if(a.indexOf(":")==-1)return{name:a,value:u};a=a.split(":");return{name:b.trim(a.shift()),value:b.trim(a.join(":")).replace(/^(\$\{0\}|\$0)(\s*;?)$/,"${1}$2")}}function g(a,b){var c=r[b];c||(c=d.find(r,function(a){return a.prefix==b}));return c&&c.supports(a)}function j(a,b){var c=[];d.each(r,function(b,d){g(a,d)&&c.push(d)});!c.length&&!b&&d.each(r,function(a,b){a.obsolete||c.push(b)});return c}function l(a,b){d.isString(b)&&(b={prefix:b});r[a]=d.extend({},
|
||||||
|
s,b)}function m(a,b){if(b){var c=p.get(b+"."+a);if(!d.isUndefined(c))return c}return p.get("css."+a)}function n(a,b,c){if(!d.isString(a))a=a.data;if(!i(a))return a;b&&(~a.indexOf(";")?a=a.split(";").join(" !important;"):a+=" !important");b=a.indexOf(":");a=a.substring(0,b).replace(/\s+$/,"")+m("valueSeparator",c)+h("utils").trim(a.substring(b+1));return a.replace(/\s*;\s*$/,m("propertyEnd",c))}function o(a){var b=p.getArray(a);d.each(p.getArray(a+"Addon"),function(a){a.charAt(0)=="-"?b=d.without(b,
|
||||||
|
a.substr(1)):(a.charAt(0)=="+"&&(a=a.substr(1)),b.push(a))});return b}var q=null,s={prefix:"emmet",obsolete:!1,transformName:function(a){return"-"+this.prefix+"-"+a},properties:function(){return o("css."+this.prefix+"Properties")||[]},supports:function(a){return d.include(this.properties(),a)}},r={},u="${1};",p=h("preferences");p.define("css.valueSeparator",": ","Defines a symbol that should be placed between CSS property and value when expanding CSS abbreviations.");p.define("css.propertyEnd",";",
|
||||||
|
"Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations.");p.define("stylus.valueSeparator"," ","Defines a symbol that should be placed between CSS property and value when expanding CSS abbreviations in Stylus dialect.");p.define("stylus.propertyEnd","","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations in Stylus dialect.");p.define("sass.propertyEnd","","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations in SASS dialect.");
|
||||||
|
p.define("css.autoInsertVendorPrefixes",!0,"Automatically generate vendor-prefixed copies of expanded CSS property. By default, Emmet will generate vendor-prefixed properties only when you put dash before abbreviation (e.g. <code>-bxsh</code>). With this option enabled, you don\u2019t need dashes before abbreviations: Emmet will produce vendor-prefixed properties for you.");var v=d.template("A comma-separated list of CSS properties that may have <code><%= vendor %></code> vendor prefix. This list is used to generate a list of prefixed properties when expanding <code>-property</code> abbreviations. Empty list means that all possible CSS values may have <code><%= vendor %></code> prefix."),
|
||||||
|
w=d.template("A comma-separated list of <em>additional</em> CSS properties for <code>css.<%= vendor %>Preperties</code> preference. You should use this list if you want to add or remove a few CSS properties to original set. To add a new property, simply write its name, to remove it, precede property with hyphen.<br>For example, to add <em>foo</em> property and remove <em>border-radius</em> one, the preference value will look like this: <code>foo, -border-radius</code>.");d.each({webkit:"animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-clip, background-composite, background-origin, background-size, border-fit, border-horizontal-spacing, border-image, border-vertical-spacing, box-align, box-direction, box-flex, box-flex-group, box-lines, box-ordinal-group, box-orient, box-pack, box-reflect, box-shadow, color-correction, column-break-after, column-break-before, column-break-inside, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, dashboard-region, font-smoothing, highlight, hyphenate-character, hyphenate-limit-after, hyphenate-limit-before, hyphens, line-box-contain, line-break, line-clamp, locale, margin-before-collapse, margin-after-collapse, marquee-direction, marquee-increment, marquee-repetition, marquee-style, mask-attachment, mask-box-image, mask-box-image-outset, mask-box-image-repeat, mask-box-image-slice, mask-box-image-source, mask-box-image-width, mask-clip, mask-composite, mask-image, mask-origin, mask-position, mask-repeat, mask-size, nbsp-mode, perspective, perspective-origin, rtl-ordering, text-combine, text-decorations-in-effect, text-emphasis-color, text-emphasis-position, text-emphasis-style, text-fill-color, text-orientation, text-security, text-stroke-color, text-stroke-width, transform, transition, transform-origin, transform-style, transition-delay, transition-duration, transition-property, transition-timing-function, user-drag, user-modify, user-select, writing-mode, svg-shadow, box-sizing, border-radius",
|
||||||
|
moz:"animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-inline-policy, binding, border-bottom-colors, border-image, border-left-colors, border-right-colors, border-top-colors, box-align, box-direction, box-flex, box-ordinal-group, box-orient, box-pack, box-shadow, box-sizing, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-width, float-edge, font-feature-settings, font-language-override, force-broken-image-icon, hyphens, image-region, orient, outline-radius-bottomleft, outline-radius-bottomright, outline-radius-topleft, outline-radius-topright, perspective, perspective-origin, stack-sizing, tab-size, text-blink, text-decoration-color, text-decoration-line, text-decoration-style, text-size-adjust, transform, transform-origin, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-focus, user-input, user-modify, user-select, window-shadow, background-clip, border-radius",
|
||||||
|
ms:"accelerator, backface-visibility, background-position-x, background-position-y, behavior, block-progression, box-align, box-direction, box-flex, box-line-progression, box-lines, box-ordinal-group, box-orient, box-pack, content-zoom-boundary, content-zoom-boundary-max, content-zoom-boundary-min, content-zoom-chaining, content-zoom-snap, content-zoom-snap-points, content-zoom-snap-type, content-zooming, filter, flow-from, flow-into, font-feature-settings, grid-column, grid-column-align, grid-column-span, grid-columns, grid-layer, grid-row, grid-row-align, grid-row-span, grid-rows, high-contrast-adjust, hyphenate-limit-chars, hyphenate-limit-lines, hyphenate-limit-zone, hyphens, ime-mode, interpolation-mode, layout-flow, layout-grid, layout-grid-char, layout-grid-line, layout-grid-mode, layout-grid-type, line-break, overflow-style, perspective, perspective-origin, perspective-origin-x, perspective-origin-y, scroll-boundary, scroll-boundary-bottom, scroll-boundary-left, scroll-boundary-right, scroll-boundary-top, scroll-chaining, scroll-rails, scroll-snap-points-x, scroll-snap-points-y, scroll-snap-type, scroll-snap-x, scroll-snap-y, scrollbar-arrow-color, scrollbar-base-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color, scrollbar-track-color, text-align-last, text-autospace, text-justify, text-kashida-space, text-overflow, text-size-adjust, text-underline-position, touch-action, transform, transform-origin, transform-origin-x, transform-origin-y, transform-origin-z, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-select, word-break, word-wrap, wrap-flow, wrap-margin, wrap-through, writing-mode",
|
||||||
o:"dashboard-region, animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, border-image, link, link-source, object-fit, object-position, tab-size, table-baseline, transform, transform-origin, transition, transition-delay, transition-duration, transition-property, transition-timing-function, accesskey, input-format, input-required, marquee-dir, marquee-loop, marquee-speed, marquee-style"},
|
o:"dashboard-region, animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, border-image, link, link-source, object-fit, object-position, tab-size, table-baseline, transform, transform-origin, transition, transition-delay, transition-duration, transition-property, transition-timing-function, accesskey, input-format, input-required, marquee-dir, marquee-loop, marquee-speed, marquee-style"},
|
||||||
function(a,b){q.define("css."+b+"Properties",a,r({vendor:b}))});q.define("css.unitlessProperties","z-index, line-height, opacity, font-weight","The list of properties whose values \u200b\u200bmust not contain units.");d("w",{prefix:"webkit",supports:q.getArray("css.webkitProperties")});d("m",{prefix:"moz",supports:q.getArray("css.mozProperties")});d("s",{prefix:"ms",supports:q.getArray("css.msProperties")});d("o",{prefix:"o",supports:q.getArray("css.oProperties")});var t=q.getArray("css.unitlessProperties"),
|
function(a,b){p.define("css."+b+"Properties",a,v({vendor:b}));p.define("css."+b+"PropertiesAddon","",w({vendor:b}))});p.define("css.unitlessProperties","z-index, line-height, opacity, font-weight, zoom","The list of properties whose values \u200b\u200bmust not contain units.");p.define("css.intUnit","px","Default unit for integer values");p.define("css.floatUnit","em","Default unit for float values");p.define("css.keywords","auto, inherit","A comma-separated list of valid keywords that can be used in CSS abbreviations.");
|
||||||
x=["css","less","sass","scss"];h("resources").addResolver(function(a,b){return e.include(x,b)&&a.isElement()?j.expandToSnippet(a.abbreviation):null});var u=h("expandAbbreviation");u.addHandler(function(a,b,c){if(!e.include(x,b))return!1;var d=a.getSelectionRange().end,f=u.findAbbreviation(a);return f&&(b=emmet.expandAbbreviation(f,b,c))?(f=d-f.length,c=d,a.getContent().charAt(d)==";"&&c++,a.replaceContent(b,f,c),!0):!1});return j={addPrefix:d,supportsPrefix:b,prefixed:function(a,c){return b(a,c)?
|
p.define("css.keywordAliases","a:auto, i:inherit, s:solid, da:dashed, do:dotted","A comma-separated list of keyword aliases, used in CSS abbreviation. Each alias should be defined as <code>alias:keyword_name</code>.");p.define("css.unitAliases","e:em, p:%, x:ex, r:rem","A comma-separated list of unit aliases, used in CSS abbreviation. Each alias should be defined as <code>alias:unit_value</code>.");p.define("css.color.short",!0,"Should color values like <code>#ffffff</code> be shortened to <code>#fff</code> after abbreviation with color was expanded.");
|
||||||
"-"+c+"-"+a:a},listPrefixes:function(){return e.map(n,function(a){return a.prefix})},getPrefix:function(a){return n[a]},removePrefix:function(a){a in n&&delete n[a]},addUnitAlias:function(a,b){m[a]=b},getUnitAlias:function(a){return m[a]},removeUnitAlias:function(a){a in m&&delete m[a]},extractPrefixes:function(a){if(a.charAt(0)!="-")return{property:a,prefixes:null};for(var b=1,c=a.length,d,e=[];b<c;){d=a.charAt(b);if(d=="-"){b++;break}if(d in n)e.push(d);else{e.length=0;b=1;break}b++}if(b==c-1)b=
|
p.define("css.color.case","keep","Letter case of color values generated by abbreviations with color (like <code>c#0</code>). Possible values are <code>upper</code>, <code>lower</code> and <code>keep</code>.");p.define("css.fuzzySearch",!0,"Enable fuzzy search among CSS snippet names. When enabled, every <em>unknown</em> snippet will be scored against available snippet names (not values or CSS properties!). The match with best score will be used to resolve snippet value. For example, with this preference enabled, the following abbreviations are equal: <code>ov:h</code> == <code>ov-h</code> == <code>o-h</code> == <code>oh</code>");
|
||||||
1,e.length=1;return{property:a.substring(b),prefixes:e.length?e:"all"}},findValuesInAbbreviation:function(a){for(var b=0,c=a.length,d;b<c;){d=a.charAt(b);if(g(d)||d=="-"&&g(a.charAt(b+1)))return a.substring(b);b++}return""},parseValues:function(a){for(var b="",c=[],d=0,e=a.length,f,h;d<e;)if(f=a.charAt(d),f=="-"&&b)c.push(b),b="",d++;else if(b+=f,d++,h=a.charAt(d),f!="-"&&!g(f)&&(g(h)||h=="-"))c.push(b),b="";b&&c.push(b);return c},extractValues:function(a){var b=this.findValuesInAbbreviation(a);return!b?
|
p.define("css.fuzzySearchMinScore",0.3,"The minium score (from 0 to 1) that fuzzy-matched abbreviation should achive. Lower values may produce many false-positive matches, higher values may reduce possible matches.");l("w",{prefix:"webkit"});l("m",{prefix:"moz"});l("s",{prefix:"ms"});l("o",{prefix:"o"});var k=["css","less","sass","scss","stylus"];h("resources").addResolver(function(a,b){return d.include(k,b)&&a.isElement()?q.expandToSnippet(a.abbreviation,b):null});var t=h("expandAbbreviation");t.addHandler(function(a,
|
||||||
{property:a,values:null}:{property:a.substring(0,a.length-b.length),values:this.parseValues(b)}},normalizeValue:function(a,b){b=(b||"").toLowerCase();return a.replace(/^(\-?[0-9\.]+)([a-z]*)$/,function(a,c,d){return!d&&(c=="0"||e.include(t,b))?c:!d?c+(~c.indexOf(".")?"em":"px"):c+(d in m?m[d]:d)})},expand:function(b,d){var g=h("resources"),j=q.get("css.autoInsertVendorPrefixes"),l;if(l=/^(.+)\!$/.test(b))b=RegExp.$1;var m=g.getSnippet("css",b);if(m&&!j)return i(m,l);var m=this.extractPrefixes(b),
|
b,c){if(!d.include(k,b))return!1;var e=a.getSelectionRange().end,g=t.findAbbreviation(a);return g&&(b=emmet.expandAbbreviation(g,b,c))?(g=e-g.length,c=e,a.getContent().charAt(e)==";"&&b.charAt(b.length-1)==";"&&c++,a.replaceContent(b,g,c),!0):!1});return q={addPrefix:l,supportsPrefix:g,prefixed:function(a,b){return g(a,b)?"-"+b+"-"+a:a},listPrefixes:function(){return d.map(r,function(a){return a.prefix})},getPrefix:function(a){return r[a]},removePrefix:function(a){a in r&&delete r[a]},extractPrefixes:function(a){if(a.charAt(0)!=
|
||||||
r=this.extractValues(m.property),r=e.extend(m,r);if(m=g.getSnippet("css",r.property)){if(!e.isString(m))m=m.data}else m=r.property+":"+o;if(!f(m))return m;var t=c(m),u=[];!d&&r.values&&(d=e.map(r.values,function(a){return this.normalizeValue(a,t.name)},this).join(" ")+";");t.value=d||t.value;g=r.prefixes=="all"||j?a(t.name,j&&r.prefixes!="all"):r.prefixes;e.each(g,function(a){a in n&&u.push(i(n[a].transformName(t.name)+":"+t.value,l))});u.push(i(t.name+":"+t.value,l));return u},expandToSnippet:function(a,
|
"-")return{property:a,prefixes:null};for(var b=1,c=a.length,d,e=[];b<c;){d=a.charAt(b);if(d=="-"){b++;break}if(d in r)e.push(d);else{e.length=0;b=1;break}b++}if(b==c-1)b=1,e.length=1;return{property:a.substring(b),prefixes:e.length?e:"all"}},findValuesInAbbreviation:function(b,c){for(var c=c||"css",d=0,e=b.length,g="",i;d<e;){i=b.charAt(d);if(f(i)||i=="#"||i=="-"&&f(b.charAt(d+1))){g=b.substring(d);break}d++}i=b.substring(0,b.length-g.length);d=h("resources");for(e=[];~i.indexOf("-")&&!d.findSnippet(c,
|
||||||
b){var c=this.expand(a,b);return e.isArray(c)?c.join("\n"):!e.isString(c)?c.data:String(c)}}});
|
i);){i=i.split("-");var j=i.pop();if(!a(j))break;e.unshift(j);i=i.join("-")}return e.join("-")+g},parseValues:function(c){for(var e=h("stringStream").create(c),g=[],i=null;i=e.next();){if(i=="#")e.match(/^[0-9a-f]+/,!0);else if(i=="-"){if(a(d.last(g))||e.start&&f(c.charAt(e.start-1)))e.start=e.pos;e.match(/^\-?[0-9]*(\.[0-9]+)?[a-z%\.]*/,!0)}else e.match(/^[0-9]*(\.[0-9]*)?[a-z%]*/,!0);g.push(e.current());e.start=e.pos}return d.map(d.compact(g),b)},extractValues:function(a){var b=this.findValuesInAbbreviation(a);
|
||||||
emmet.define("cssGradient",function(h,e){function g(a){return h("utils").trim(a).replace(/\s+/g," ")}function f(a){var a=g(a),b=null,a=a.replace(/^(\w+\(.+?\))\s*/,function(a,c){b=c;return""});b||(a=a.split(" "),b=a[0],a=a[1]||"");var c={color:b};a&&a.replace(/^(\-?[\d\.]+)([a-z%]+)?$/,function(a,b,d){c.position=b;~b.indexOf(".")?d="":d||(d="%");if(d)c.unit=d});return c}function c(a){var b=0;e.each(a,function(c,d){if(!d)return c.position=c.position||0;if(d==a.length-1&&!("position"in c))c.position=
|
return!b?{property:a,values:null}:{property:a.substring(0,a.length-b.length).replace(/-$/,""),values:this.parseValues(b)}},normalizeValue:function(a,b){var b=(b||"").toLowerCase(),c=p.getArray("css.unitlessProperties");return a.replace(/^(\-?[0-9\.]+)([a-z]*)$/,function(a,e,g){if(!g&&(e=="0"||d.include(c,b)))return e;g?(a=p.getDict("css.unitAliases"),e+=g in a?a[g]:g):e=e.replace(/\.$/,"")+p.get(~e.indexOf(".")?"css.floatUnit":"css.intUnit");return e})},expand:function(a,b,c){var c=c||"css",g=h("resources"),
|
||||||
1;if("position"in c){var f=a[b].position||0,g=(c.position-f)/(d-b);e.each(a.slice(b,d),function(a,b){a.position=f+g*b});b=d}})}function b(a){var b=parseFloat(a);if(!e.isNaN(b))switch(b%360){case 0:return"left";case 90:return"bottom";case 180:return"right";case 240:return"top"}return a}function a(a){a=b(a);if(n.test(a))throw"The direction is an angle that can\u2019t be converted.";var c=function(b){return~a.indexOf(b)?"100%":"0"};return c("right")+" "+c("bottom")+", "+c("left")+" "+c("top")}function d(a){var b=
|
f=p.get("css.autoInsertVendorPrefixes"),k;if(k=/^(.+)\!$/.test(a))a=RegExp.$1;var l=g.findSnippet(c,a);if(l&&!f)return n(l,k,c);l=this.extractPrefixes(a);a=this.extractValues(l.property);a=d.extend(l,a);l=g.findSnippet(c,a.property);!l&&p.get("css.fuzzySearch")&&(l=g.fuzzyFindSnippet(c,a.property,parseFloat(p.get("css.fuzzySearchMinScore"))));if(l){if(!d.isString(l))l=l.data}else l=a.property+":"+u;if(!i(l))return l;var o=e(l),m=[];!b&&a.values&&(b=d.map(a.values,function(a){return this.normalizeValue(a,
|
||||||
o.getArray("css.gradient.prefixes"),b=e.map(b,function(b){return"-"+b+"-"+a});b.push(a);return b}function i(a,b,c){var f=a.parent,g=h("utils"),j=h("cssResolver"),i=o.getArray("css.gradient.prefixes");e.each(f.getAll(d(a.name())),function(b){b!=a&&/gradient/i.test(b.value())&&f.remove(b)});var k=a.value();c||(c=h("range").create(0,a.value()));var n=function(a){return g.replaceSubstring(k,a,c)},l=h("cssGradient");a.value(n(l.toString(b)));var m=[];e.each(i,function(c){var d=j.prefixed(a.name(),c);if(c==
|
o.name)},this).join(" ")+";");o.value=b||o.value;b=a.prefixes=="all"||!a.prefixes&&f?j(o.name,f&&a.prefixes!="all"):a.prefixes;d.each(b,function(a){a in r&&m.push(n(r[a].transformName(o.name)+":"+o.value,k,c))});m.push(n(o.name+":"+o.value,k,c));return m},expandToSnippet:function(a,b){var c=this.expand(a,null,b);return d.isArray(c)?c.join("\n"):!d.isString(c)?c.data:String(c)},getSyntaxPreference:m,transformSnippet:n}});
|
||||||
"webkit"&&o.get("css.gradient.oldWebkit"))try{m.push({name:d,value:n(l.oldWebkitLinearGradient(b))})}catch(e){}m.push({name:d,value:n(l.toString(b,c))})});m=m.sort(function(a,b){return b.name.length-a.name.length});e.each(m,function(b){f.add(b.name,b.value,f.indexOf(a))})}function j(a){var b=a.value(),c=h("cssGradient"),d=null;return(a=e.find(a.valueParts(),function(a){return d=c.parse(a.substring(b))}))&&d?{gradient:d,valueRange:a}:null}var l=["top","to bottom","0deg"],n=/\d+deg/i,m=/top|bottom|left|right/i,
|
emmet.define("cssGradient",function(h,d){function f(a){return h("utils").trim(a).replace(/\s+/g," ")}function i(a){var a=f(a),b=null,a=a.replace(/^(\w+\(.+?\))\s*/,function(a,c){b=c;return""});b||(a=a.split(" "),b=a[0],a=a[1]||"");var c={color:b};a&&a.replace(/^(\-?[\d\.]+)([a-z%]+)?$/,function(a,b,d){c.position=b;~b.indexOf(".")?d="":d||(d="%");if(d)c.unit=d});return c}function b(a){var b=0;d.each(a,function(c,e){if(!e)return c.position=c.position||0;if(e==a.length-1&&!("position"in c))c.position=
|
||||||
o=h("preferences");o.define("css.gradient.prefixes","webkit, moz, ms, o","A comma-separated list of vendor-prefixes for which values should be generated.");o.define("css.gradient.oldWebkit",!0,"Generate gradient definition for old Webkit implementations");o.define("css.gradient.omitDefaultDirection",!0,"Do not output default direction definition in generated gradients.");h("expandAbbreviation").addHandler(function(a,b,c){b=h("editorUtils").outputInfo(a,b,c);if(b.syntax!="css")return!1;var d=a.getCaretPos();
|
1;if("position"in c){var g=a[b].position||0,f=(c.position-g)/(e-b);d.each(a.slice(b,e),function(a,b){a.position=g+f*b});b=e}})}function c(a){var b=parseFloat(a);if(!d.isNaN(b))switch(b%360){case 0:return"left";case 90:return"bottom";case 180:return"right";case 240:return"top"}return a}function a(a){a=c(a);if(r.test(a))throw"The direction is an angle that can\u2019t be converted.";var b=function(b){return~a.indexOf(b)?"100%":"0"};return b("right")+" "+b("bottom")+", "+b("left")+" "+b("top")}function e(a){var b=
|
||||||
if(b=h("cssEditTree").parseFromPosition(b.content,d,!0))if((c=b.itemFromPosition(d,!0))||(c=e.find(b.list(),function(a){return a.range(!0).end==d})),c){var f=j(c);if(f){c.end(";");var g=b.options.offset||0,n=g+b.toString().length;i(c,f.gradient,f.valueRange);a.replaceContent(b.toString(),g,n,!0);a.setCaretPos(c.valueRange(!0).end);return!0}}return!1});h("reflectCSSValue").addHandler(function(a){var b=h("cssGradient"),c=h("utils"),f=j(a);if(!f)return!1;var g=a.value(),i=function(a){return c.replaceSubstring(g,
|
p.getArray("css.gradient.prefixes"),b=d.map(b,function(b){return"-"+b+"-"+a});b.push(a);return b}function g(a,b){var c=[],e=h("cssResolver");p.get("css.gradient.fallback")&&~b.toLowerCase().indexOf("background")&&c.push({name:"background-color",value:"${1:"+a.colorStops[0].color+"}"});d.each(p.getArray("css.gradient.prefixes"),function(d){var g=e.prefixed(b,d);if(d=="webkit"&&p.get("css.gradient.oldWebkit"))try{c.push({name:g,value:q.oldWebkitLinearGradient(a)})}catch(f){}c.push({name:g,value:q.toString(a,
|
||||||
a,f.valueRange)};e.each(a.parent.getAll(d(a.name())),function(c){if(c!==a){var d=c.value().match(/^\s*(\-([a-z]+)\-)?linear\-gradient/);d?c.value(i(b.toString(f.gradient,d[2]||""))):c.value().match(/\s*\-webkit\-gradient/)&&c.value(i(b.oldWebkitLinearGradient(f.gradient)))}});return!0});return{parse:function(a){var b=null,a=h("utils").trim(a).replace(/^([\w\-]+)\((.+?)\)$/,function(a,c,d){c=c.toLowerCase().replace(/^\-[a-z]+\-/,"");if(c=="linear-gradient"||c=="lg"){for(var a=l[0],d=h("stringStream").create(h("utils").trim(d)),
|
d)})});return c.sort(function(a,b){return b.name.length-a.name.length})}function j(a,b,c){var f=a.parent,i=h("utils");d.each(f.getAll(e(a.name())),function(b){b!=a&&/gradient/i.test(b.value())&&f.remove(b)});var j=a.value();c||(c=h("range").create(0,a.value()));a.value(function(a){return i.replaceSubstring(j,a,c)}(q.toString(b))+"${2}");b=g(b,a.name());d.each(b,function(b){f.add(b.name,b.value,f.indexOf(a))})}function l(a){var b=a.value(),c=null;return(a=d.find(a.valueParts(),function(a){return c=
|
||||||
c=[],j;j=d.next();)d.peek()==","?(c.push(d.current()),d.next(),d.eatSpace(),d.start=d.pos):j=="("&&d.skipTo(")");c.push(d.current());c=e.compact(e.map(c,g));if(c.length){if(n.test(c[0])||m.test(c[0]))a=c.shift();b={type:"linear",direction:a,colorStops:e.map(c,f)}}else b=null;return""}return a});return b},oldWebkitLinearGradient:function(b){e.isString(b)&&(b=this.parse(b));if(!b)return null;var d=e.map(b.colorStops,e.clone);e.each(d,function(a){if("position"in a)if(~a.position.indexOf(".")||a.unit==
|
q.parse(a.substring(b))}))&&c?{gradient:c,valueRange:a}:null}function m(a,b){var c=p.get("css.gradient.defaultProperty");if(!c)return!1;var e=String(a.getContent()),f=h("range").create(a.getCurrentLineRange()),i=f.substring(e).replace(/^\s+/,function(a){f.start+=a.length;return""}).replace(/\s+$/,function(a){f.end-=a.length;return""}),e=h("cssResolver");if(i=q.parse(i)){var j=g(i,c);j.push({name:c,value:q.toString(i)+"${2}"});var l=e.getSyntaxPreference("valueSeparator",b),o=e.getSyntaxPreference("propertyEnd",
|
||||||
"%")a.position=parseFloat(a.position)/(a.unit=="%"?100:1);else throw"Can't convert color stop '"+(a.position+(a.unit||""))+"'";});c(d);d=e.map(d,function(a,b){return!a.position&&!b?"from("+a.color+")":a.position==1&&b==d.length-1?"to("+a.color+")":"color-stop("+a.position.toFixed(2).replace(/\.?0+$/,"")+", "+a.color+")"});return"-webkit-gradient(linear, "+a(b.direction)+", "+d.join(", ")+")"},toString:function(a,b){if(a.type=="linear"){var c=(b?"-"+b+"-":"")+"linear-gradient",d=e.map(a.colorStops,
|
b),j=d.map(j,function(a){return a.name+l+a.value+o});a.replaceContent(j.join("\n"),f.start,f.end);return!0}return!1}function n(a,b){var c=null,e=h("cssEditTree").parseFromPosition(a,b,!0);e&&((c=e.itemFromPosition(b,!0))||(c=d.find(e.list(),function(a){return a.range(!0).end==b})));return{rule:e,property:c}}var o=["top","to bottom","0deg"],q=null,s=["css","less","sass","scss","stylus","styl"],r=/\d+deg/i,u=/top|bottom|left|right/i,p=h("preferences");p.define("css.gradient.prefixes","webkit, moz, o",
|
||||||
function(a){return a.color+("position"in a?" "+a.position+(a.unit||""):"")});a.direction&&(!o.get("css.gradient.omitDefaultDirection")||!e.include(l,a.direction))&&d.unshift(a.direction);return c+"("+d.join(", ")+")"}}}});emmet.exec(function(h,e){var g=h("handlerList").create(),f=h("resources");e.extend(f,{addGenerator:function(c,b,a){e.isString(c)&&(c=RegExp(c));g.add(function(a,e){var f;return(f=c.exec(a.name()))?b(f,a,e):null},a)}});f.addResolver(function(c,b){return g.exec(null,e.toArray(arguments))})});
|
"A comma-separated list of vendor-prefixes for which values should be generated.");p.define("css.gradient.oldWebkit",!0,"Generate gradient definition for old Webkit implementations");p.define("css.gradient.omitDefaultDirection",!0,"Do not output default direction definition in generated gradients.");p.define("css.gradient.defaultProperty","background-image","When gradient expanded outside CSS value context, it will produce properties with this name.");p.define("css.gradient.fallback",!1,"With this option enabled, CSS gradient generator will produce <code>background-color</code> property with gradient first color as fallback for old browsers.");
|
||||||
emmet.define("tagName",function(h,e){var g={empty:"area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command".split(","),blockLevel:"address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6".split(","),inlineLevel:"a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var".split(",")},
|
h("expandAbbreviation").addHandler(function(a,b,c){var e=h("editorUtils").outputInfo(a,b,c);if(!d.include(s,e.syntax))return!1;var c=a.getCaretPos(),g=e.content,e=n(g,c);if(e.property){var f=l(e.property);if(f){var b=e.rule.options.offset||0,i=b+e.rule.toString().length;if(/[\n\r]/.test(e.property.value())){var o=e.property.valueRange(!0).start+f.valueRange.end,g=h("utils").replaceSubstring(g,";",o),c=n(g,c);c.property&&(f=l(c.property),e=c)}e.property.end(";");j(e.property,f.gradient,f.valueRange);
|
||||||
f={ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"};return{resolve:function(c){c=(c||"").toLowerCase();return c in f?this.getMapping(c):this.isInlineLevel(c)?"span":"div"},getMapping:function(c){return f[c.toLowerCase()]},isInlineLevel:function(c){return this.isTypeOf(c,"inlineLevel")},isBlockLevel:function(c){return this.isTypeOf(c,"blockLevel")},isEmptyElement:function(c){return this.isTypeOf(c,
|
a.replaceContent(e.rule.toString(),b,i,!0);return!0}}return m(a,b)});h("reflectCSSValue").addHandler(function(a){var b=h("utils"),c=l(a);if(!c)return!1;var g=a.value(),f=function(a){return b.replaceSubstring(g,a,c.valueRange)};d.each(a.parent.getAll(e(a.name())),function(b){if(b!==a){var d=b.value().match(/^\s*(\-([a-z]+)\-)?linear\-gradient/);d?b.value(f(q.toString(c.gradient,d[2]||""))):b.value().match(/\s*\-webkit\-gradient/)&&b.value(f(q.oldWebkitLinearGradient(c.gradient)))}});return!0});return q=
|
||||||
"empty")},isTypeOf:function(c,b){return e.include(g[b],c)},addMapping:function(c,b){f[c]=b},removeMapping:function(c){c in f&&delete f[c]},addElementToCollection:function(c,b){g[b]||(g[b]=[]);var a=this.getCollection(b);e.include(a,c)||a.push(c)},removeElementFromCollection:function(c,b){b in g&&(g[b]=e.without(this.getCollection(b),c))},getCollection:function(c){return g[c]}}});
|
{parse:function(a){var b=null;h("utils").trim(a).replace(/^([\w\-]+)\((.+?)\)$/,function(a,c,e){c=c.toLowerCase().replace(/^\-[a-z]+\-/,"");if(c=="linear-gradient"||c=="lg"){for(var a=o[0],e=h("stringStream").create(h("utils").trim(e)),c=[],g;g=e.next();)e.peek()==","?(c.push(e.current()),e.next(),e.eatSpace(),e.start=e.pos):g=="("&&e.skipTo(")");c.push(e.current());c=d.compact(d.map(c,f));if(c.length){if(r.test(c[0])||u.test(c[0]))a=c.shift();b={type:"linear",direction:a,colorStops:d.map(c,i)}}else b=
|
||||||
emmet.exec(function(h,e){function g(){return{element:d.get("bem.elementSeparator"),modifier:d.get("bem.modifierSeparator")}}function f(a){if(h("abbreviationUtils").isSnippet(a))return a;a.__bem={block:"",element:"",modifier:""};var d=c(a.attribute("class")).split(" "),f=/^[a-z]\-/i;a.__bem.block=e.find(d,function(a){return f.test(a)});if(!a.__bem.block)f=/^[a-z]/i,a.__bem.block=e.find(d,function(a){return f.test(a)})||"";d=e.chain(d).map(function(c){var d;d=b(c,a,"element");d=b(d,a,"modifier");var e=
|
null;return""}return a});return b},oldWebkitLinearGradient:function(c){d.isString(c)&&(c=this.parse(c));if(!c)return null;var e=d.map(c.colorStops,d.clone);d.each(e,function(a){if("position"in a)if(~a.position.indexOf(".")||a.unit=="%")a.position=parseFloat(a.position)/(a.unit=="%"?100:1);else throw"Can't convert color stop '"+(a.position+(a.unit||""))+"'";});b(e);e=d.map(e,function(a,b){return!a.position&&!b?"from("+a.color+")":a.position==1&&b==e.length-1?"to("+a.color+")":"color-stop("+a.position.toFixed(2).replace(/\.?0+$/,
|
||||||
"",f="",h="",c=g();~d.indexOf(c.element)?(e=d.split(c.element),h=e[1].split(c.modifier),e=e[0],f=h.shift(),h=h.join(c.modifier)):~d.indexOf(c.modifier)&&(h=d.split(c.modifier),e=h.shift(),h=h.join(c.modifier));if(e||f||h){if(!e)e=a.__bem.block;d=e;var i=[];f&&(d+=c.element+f);i.push(d);h&&i.push(d+c.modifier+h);a.__bem.block=e;a.__bem.element=f;a.__bem.modifier=h;c=i}else c=d;return c}).flatten().uniq().value();a.attribute("class",d.join(" "));return a}function c(a){var b=h("utils"),a=(" "+(a||"")+
|
"")+", "+a.color+")"});return"-webkit-gradient(linear, "+a(c.direction)+", "+e.join(", ")+")"},toString:function(a,b){if(a.type=="linear"){var c=(b?"-"+b+"-":"")+"linear-gradient",e=d.map(a.colorStops,function(a){return a.color+("position"in a?" "+a.position+(a.unit||""):"")});a.direction&&(!p.get("css.gradient.omitDefaultDirection")||!d.include(o,a.direction))&&e.unshift(a.direction);return c+"("+e.join(", ")+")"}}}});
|
||||||
" ").replace(/\s+/g," "),c=d.get("bem.shortElementPrefix");c&&(c=RegExp("\\s("+b.escapeForRegexp(c)+"+)","g"),a=a.replace(c,function(a,c){return" "+b.repeatString(g().element,c.length)}));return b.trim(a)}function b(a,b,c){var d=g(),e=RegExp("^("+d[c]+")+","g");if(e.test(a)){for(var f=0,e=a.replace(e,function(a){f=a.length/d[c].length;return""}),h=b;h.parent&&f--;)h=h.parent;if(!h||!h.__bem)h=b;if(h&&h.__bem)return a=h.__bem.block,c=="modifier"&&h.__bem.element&&(a+=d.element+h.__bem.element),a+d[c]+
|
emmet.exec(function(h,d){var f=h("handlerList").create(),i=h("resources");d.extend(i,{addGenerator:function(b,c,a){d.isString(b)&&(b=RegExp(b));f.add(function(a,d){var f;return(f=b.exec(a.name()))?c(f,a,d):null},a)}});i.addResolver(function(b,c){return f.exec(null,d.toArray(arguments))})});
|
||||||
e}return a}function a(b,c){b.name&&f(b,c);var d=h("abbreviationUtils");e.each(b.children,function(b){a(b,c);!d.isSnippet(b)&&b.start&&(i=!0)});return b}var d=h("preferences");d.define("bem.elementSeparator","__","Class name\u2019s element separator.");d.define("bem.modifierSeparator","_","Class name\u2019s modifier separator.");d.define("bem.shortElementPrefix","-","Symbol for describing short \u201cblock-element\u201d notation. Class names prefixed with this symbol will be treated as element name for parent\u2018s block name. Each symbol instance traverses one level up in parsed tree for block name lookup. Empty value will disable short notation.");
|
emmet.define("tagName",function(h,d){var f={empty:"area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command".split(","),blockLevel:"address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6".split(","),inlineLevel:"a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var".split(",")},
|
||||||
var i=!1;h("filters").add("bem",function(b,c){i=!1;b=a(b,c);i&&(b=h("filters").apply(b,"html",c));return b})});
|
i={p:"span",ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"};return{resolve:function(b){b=(b||"").toLowerCase();return b in i?this.getMapping(b):this.isInlineLevel(b)?"span":"div"},getMapping:function(b){return i[b.toLowerCase()]},isInlineLevel:function(b){return this.isTypeOf(b,"inlineLevel")},isBlockLevel:function(b){return this.isTypeOf(b,"blockLevel")},isEmptyElement:function(b){return this.isTypeOf(b,
|
||||||
emmet.exec(function(h,e){function g(b,a,d){var f=h("utils"),g=c.get("filter.commentTrigger");if(g=="*"||e.find(g.split(","),function(a){return!!b.attribute(f.trim(a))}))g={node:b,name:b.name(),padding:b.parent?b.parent.padding:"",attr:function(a,c,d){return(a=b.attribute(a))?(c||"")+a+(d||""):""}},a=f.normalizeNewline(a?a(g):""),d=f.normalizeNewline(d?d(g):""),b.start=b.start.replace(/</,a+"<"),b.end=b.end.replace(/>/,">"+d)}function f(b,a,c){var i=h("abbreviationUtils");e.each(b.children,function(b){i.isBlock(b)&&
|
"empty")},isTypeOf:function(b,c){return d.include(f[c],b)},addMapping:function(b,c){i[b]=c},removeMapping:function(b){b in i&&delete i[b]},addElementToCollection:function(b,c){f[c]||(f[c]=[]);var a=this.getCollection(c);d.include(a,b)||a.push(b)},removeElementFromCollection:function(b,c){c in f&&(f[c]=d.without(this.getCollection(c),b))},getCollection:function(b){return f[b]}}});
|
||||||
g(b,a,c);f(b,a,c)});return b}var c=h("preferences");c.define("filter.commentAfter",'\n<\!-- /<%= attr("id", "#") %><%= attr("class", ".") %> --\>',"A definition of comment that should be placed <i>after</i> matched element when <code>comment</code> filter is applied. This definition is an ERB-style template passed to <code>_.template()</code> function (see Underscore.js docs for details). In template context, the following properties and functions are availabe:\n<ul><li><code>attr(name, before, after)</code> \u2013 a function that outputsspecified attribute value concatenated with <code>before</code> and <code>after</code> strings. If attribute doesn't exists, the empty string will be returned.</li><li><code>node</code> \u2013 current node (instance of <code>AbbreviationNode</code>)</li><li><code>name</code> \u2013 name of current tag</li><li><code>padding</code> \u2013 current string padding, can be used for formatting</li></ul>");
|
emmet.exec(function(h,d){function f(){return{element:e.get("bem.elementSeparator"),modifier:e.get("bem.modifierSeparator")}}function i(a){if(h("abbreviationUtils").isSnippet(a))return a;a.__bem={block:"",element:"",modifier:""};var e=b(a.attribute("class")).split(" "),g=/^[a-z]\-/i;a.__bem.block=d.find(e,function(a){return g.test(a)});if(!a.__bem.block)g=/^[a-z]/i,a.__bem.block=d.find(e,function(a){return g.test(a)})||"";(e=d.chain(e).map(function(b){var d;d=c(b,a,"element");d=c(d,a,"modifier");var e=
|
||||||
c.define("filter.commentBefore","","A definition of comment that should be placed <i>before</i> matched element when <code>comment</code> filter is applied. For more info, read description of <code>filter.commentAfter</code> property");c.define("filter.commentTrigger","id, class","A comma-separated list of attribute names that should exist in abbreviatoin where comment should be added. If you wish to add comment for every element, set this option to <code>*</code>");h("filters").add("c",function(b){var a=
|
"",g="",h="",b=f();~d.indexOf(b.element)?(e=d.split(b.element),h=e[1].split(b.modifier),e=e[0],g=h.shift(),h=h.join(b.modifier)):~d.indexOf(b.modifier)&&(h=d.split(b.modifier),e=h.shift(),h=h.join(b.modifier));if(e||g||h){if(!e)e=a.__bem.block;d=e;var i=[];g&&(d+=b.element+g);i.push(d);h&&i.push(d+b.modifier+h);a.__bem.block=e;a.__bem.element=g;a.__bem.modifier=h;b=i}else b=d;return b}).flatten().uniq().value().join(" "))&&a.attribute("class",e);return a}function b(a){var b=h("utils"),a=(" "+(a||
|
||||||
e.template(c.get("filter.commentBefore")),d=e.template(c.get("filter.commentAfter"));return f(b,a,d)})});emmet.exec(function(h,e){function g(c){return c.replace(/([<>&])/g,function(b,a){return f[a]})}var f={"<":"<",">":">","&":"&"};h("filters").add("e",function b(a){e.each(a.children,function(a){a.start=g(a.start);a.end=g(a.end);a.content=g(a.content);b(a)});return a})});
|
"")+" ").replace(/\s+/g," "),c=e.get("bem.shortElementPrefix");c&&(c=RegExp("\\s("+b.escapeForRegexp(c)+"+)","g"),a=a.replace(c,function(a,c){return" "+b.repeatString(f().element,c.length)}));return b.trim(a)}function c(a,b,c){var d=f(),e=RegExp("^("+d[c]+")+","g");if(e.test(a)){for(var g=0,e=a.replace(e,function(a){g=a.length/d[c].length;return""}),h=b;h.parent&&g--;)h=h.parent;if(!h||!h.__bem)h=b;if(h&&h.__bem)return a=h.__bem.block,c=="modifier"&&h.__bem.element&&(a+=d.element+h.__bem.element),
|
||||||
emmet.exec(function(h,e){function g(){return h("resources").getVariable("indentation")}function f(b){return b.parent&&!b.parent.parent&&!b.index()}function c(b,a){var c=h("abbreviationUtils");if(a.tag_nl===!0||c.isBlock(b))return!0;if(!b.parent||!a.inline_break)return!1;var f=0;return!!e.find(b.parent.children,function(b){b.isTextNode()||!c.isInline(b)?f=0:c.isInline(b)&&f++;if(f>=a.inline_break)return!0})}h("filters").add("_format",function a(d,i,j){var j=j||0,l=h("abbreviationUtils");e.each(d.children,
|
a+d[c]+e}return a}function a(b,c){b.name&&i(b,c);var e=h("abbreviationUtils");d.each(b.children,function(b){a(b,c);!e.isSnippet(b)&&b.start&&(g=!0)});return b}var e=h("preferences");e.define("bem.elementSeparator","__","Class name\u2019s element separator.");e.define("bem.modifierSeparator","_","Class name\u2019s modifier separator.");e.define("bem.shortElementPrefix","-","Symbol for describing short \u201cblock-element\u201d notation. Class names prefixed with this symbol will be treated as element name for parent\u2018s block name. Each symbol instance traverses one level up in parsed tree for block name lookup. Empty value will disable short notation.");
|
||||||
function(d){if(l.isSnippet(d)){if(!f(d))d.start=h("utils").getNewline()+d.start}else{d.start=d.end="%s";var e=h("utils"),o=h("abbreviationUtils"),q=o.isUnary(d),e=e.getNewline();if(i.tag_nl!==!1){var r=i.tag_nl===!0&&(i.tag_nl_leaf||d.children.length);if(!d.isTextNode()){if(c(d,i)){if(!f(d)&&(!o.isSnippet(d.parent)||d.index()))d.start=e+d.start;if(o.hasBlockChildren(d)||d.children.length&&c(d.children[0],i)||r&&!q)d.end=e+d.end;if(o.hasTagsInContent(d)||r&&!d.children.length&&!q)d.start+=e+g()}else if(o.isInline(d)&&
|
var g=!1;h("filters").add("bem",function(b,c){g=!1;b=a(b,c);g&&(b=h("filters").apply(b,"html",c));return b})});
|
||||||
d.parent&&h("abbreviationUtils").hasBlockChildren(d.parent)&&!f(d))d.start=e+d.start;else if(o.isInline(d)&&o.hasBlockChildren(d))d.end=e+d.end;d.padding=g()}}}a(d,i,j+1)});return d})});
|
emmet.exec(function(h,d){function f(c,a,e){var g=h("utils"),f=b.get("filter.commentTrigger");if(f=="*"||d.find(f.split(","),function(a){return!!c.attribute(g.trim(a))}))f={node:c,name:c.name(),padding:c.parent?c.parent.padding:"",attr:function(a,b,d){return(a=c.attribute(a))?(b||"")+a+(d||""):""}},a=g.normalizeNewline(a?a(f):""),e=g.normalizeNewline(e?e(f):""),c.start=c.start.replace(/</,a+"<"),c.end=c.end.replace(/>/,">"+e)}function i(b,a,e){var g=h("abbreviationUtils");d.each(b.children,function(b){g.isBlock(b)&&
|
||||||
emmet.exec(function(h,e){function g(f,c){var b="",a=[],d=c.attributeQuote(),g=c.cursor();e.each(f.attributeList(),function(e){var f=c.attributeName(e.name);switch(f.toLowerCase()){case "id":b+="#"+(e.value||g);break;case "class":b+="."+h("utils").trim(e.value||g).replace(/\s+/g,".");break;default:a.push(":"+f+" => "+d+(e.value||g)+d)}});a.length&&(b+="{"+a.join(", ")+"}");return b}h("filters").add("haml",function c(b,a,d){var d=d||0,i=h("abbreviationUtils");d||(b=h("filters").apply(b,"_format",a));
|
f(b,a,e);i(b,a,e)});return b}var b=h("preferences");b.define("filter.commentAfter",'\n<\!-- /<%= attr("id", "#") %><%= attr("class", ".") %> --\>',"A definition of comment that should be placed <i>after</i> matched element when <code>comment</code> filter is applied. This definition is an ERB-style template passed to <code>_.template()</code> function (see Underscore.js docs for details). In template context, the following properties and functions are availabe:\n<ul><li><code>attr(name, before, after)</code> \u2013 a function that outputsspecified attribute value concatenated with <code>before</code> and <code>after</code> strings. If attribute doesn't exists, the empty string will be returned.</li><li><code>node</code> \u2013 current node (instance of <code>AbbreviationNode</code>)</li><li><code>name</code> \u2013 name of current tag</li><li><code>padding</code> \u2013 current string padding, can be used for formatting</li></ul>");
|
||||||
e.each(b.children,function(b){if(!i.isSnippet(b)&&b.parent){var e=h("abbreviationUtils"),n=h("utils"),m=g(b,a),o=a.cursor(),e=e.isUnary(b),q=a.self_closing_tag&&e?"/":"",r="",r="%"+a.tagName(b.name());r.toLowerCase()=="%div"&&m&&m.indexOf("{")==-1&&(r="");b.end="";b.start=n.replaceSubstring(b.start,r+m+q+" ",b.start.indexOf("%s"),"%s");!b.children.length&&!e&&(b.start+=o)}c(b,a,d+1)});return b})});
|
b.define("filter.commentBefore","","A definition of comment that should be placed <i>before</i> matched element when <code>comment</code> filter is applied. For more info, read description of <code>filter.commentAfter</code> property");b.define("filter.commentTrigger","id, class","A comma-separated list of attribute names that should exist in abbreviatoin where comment should be added. If you wish to add comment for every element, set this option to <code>*</code>");h("filters").add("c",function(c){var a=
|
||||||
emmet.exec(function(h,e){function g(f,c){var b=c.attributeQuote(),a=c.cursor();return e.map(f.attributeList(),function(d){return" "+c.attributeName(d.name)+"="+b+(d.value||a)+b}).join("")}h("filters").add("html",function c(b,a,d){var d=d||0,i=h("abbreviationUtils");d||(b=h("filters").apply(b,"_format",a));e.each(b.children,function(b){if(!i.isSnippet(b)&&b.parent){var e=h("abbreviationUtils"),n=h("utils"),m=g(b,a),o=a.cursor(),e=e.isUnary(b),q="",r="";if(!b.isTextNode()){var t=a.tagName(b.name());
|
d.template(b.get("filter.commentBefore")),e=d.template(b.get("filter.commentAfter"));return i(c,a,e)})});emmet.exec(function(h,d){function f(b){return b.replace(/([<>&])/g,function(b,a){return i[a]})}var i={"<":"<",">":">","&":"&"};h("filters").add("e",function c(a){d.each(a.children,function(a){a.start=f(a.start);a.end=f(a.end);a.content=f(a.content);c(a)});return a})});
|
||||||
e?(q="<"+t+m+a.selfClosing()+">",b.end=""):(q="<"+t+m+">",r="</"+t+">")}b.start=n.replaceSubstring(b.start,q,b.start.indexOf("%s"),"%s");b.end=n.replaceSubstring(b.end,r,b.end.indexOf("%s"),"%s");!b.children.length&&!e&&b.content.indexOf(o)==-1&&(b.start+=o)}c(b,a,d+1)});return b})});
|
emmet.exec(function(h,d){function f(){return h("resources").getVariable("indentation")}function i(a){return a.parent&&!a.parent.parent&&!a.index()}function b(a,b){var d=h("abbreviationUtils");return b.tag_nl===!0||d.isBlock(a)?!0:!a.parent||!b.inline_break?!1:c(a.parent,b)}function c(a,b){var c=0,f=h("abbreviationUtils");return!!d.find(a.children,function(a){a.isTextNode()||!f.isInline(a)?c=0:f.isInline(a)&&c++;if(c>=b.inline_break)return!0})}function a(a,b){var f=h("abbreviationUtils");return!d.any(a.children,
|
||||||
emmet.exec(function(h,e){var g=/^\s+/,f=/[\n\r]/g;h("filters").add("s",function b(a){var d=h("abbreviationUtils");e.each(a.children,function(a){if(!d.isSnippet(a))a.start=a.start.replace(g,""),a.end=a.end.replace(g,"");a.start=a.start.replace(f,"");a.end=a.end.replace(f,"");a.content=a.content.replace(f,"");b(a)});return a})});
|
function(a){return f.isSnippet(a)?!1:!f.isInline(a)})?c(a,b):!0}h("filters").add("_format",function g(c,l,m){var m=m||0,n=h("abbreviationUtils");d.each(c.children,function(c){if(n.isSnippet(c)){if(c.start=c.end="",!i(c)&&l.tag_nl!==!1&&b(c,l)&&!h("abbreviationUtils").isInline(c.parent))c.start=h("utils").getNewline()+c.start}else{c.start=c.end="%s";var d=h("utils"),j=h("abbreviationUtils"),r=j.isUnary(c),d=d.getNewline();if(l.tag_nl!==!1){var u=l.tag_nl===!0&&(l.tag_nl_leaf||c.children.length);if(!c.isTextNode()){if(b(c,
|
||||||
emmet.exec(function(h,e){function g(f,c){e.each(f.children,function(b){if(b.content)b.content=b.content.replace(c,"");g(b,c)});return f}h("preferences").define("filter.trimRegexp","[\\s|\\u00a0]*[\\d|#|\\-|*|\\u2022]+\\.?\\s*","Regular expression used to remove list markers (numbers, dashes, bullets, etc.) in <code>t</code> (trim) filter. The trim filter is useful for wrapping with abbreviation lists, pased from other documents (for example, Word documents).");h("filters").add("t",function(e){var c=
|
l)){if(!i(c)&&(!j.isSnippet(c.parent)||c.index()))c.start=d+c.start;if(j.hasBlockChildren(c)||c.children.length&&b(c.children[0],l)||u&&!r)c.end=d+c.end;if(j.hasTagsInContent(c)||u&&!c.children.length&&!r)c.start+=d+f()}else if(j.isInline(c)&&c.parent&&h("abbreviationUtils").hasBlockChildren(c.parent)&&!i(c))c.start=d+c.start;else if(j.isInline(c)&&a(c,l))c.end=d+c.end;c.padding=f()}}}g(c,l,m+1)});return c})});
|
||||||
RegExp(h("preferences").get("filter.trimRegexp"));return g(e,c)})});emmet.exec(function(h,e){var g={"xsl:variable":1,"xsl:with-param":1};h("filters").add("xsl",function c(b){var a=h("abbreviationUtils");e.each(b.children,function(b){if(!a.isSnippet(b)&&(b.name()||"").toLowerCase()in g&&b.children.length)b.start=b.start.replace(/\s+select\s*=\s*(['"]).*?\1/,"");c(b)});return b})});
|
emmet.exec(function(h,d){function f(f,b){var c="",a=[],e=b.attributeQuote(),g=b.cursor();d.each(f.attributeList(),function(d){var f=b.attributeName(d.name);switch(f.toLowerCase()){case "id":c+="#"+(d.value||g);break;case "class":c+="."+h("utils").trim(d.value||g).replace(/\s+/g,".");break;default:a.push(":"+f+" => "+e+(d.value||g)+e)}});a.length&&(c+="{"+a.join(", ")+"}");return c}h("filters").add("haml",function b(c,a,e){var e=e||0,g=h("abbreviationUtils");e||(c=h("filters").apply(c,"_format",a));
|
||||||
emmet.exec(function(h,e){function g(a,b){return Math.round(Math.random()*(b-a)+a)}function f(a,b){for(var c=a.length,d=Math.min(c,b),f=[];f.length<d;){var h=g(0,c-1);e.include(f,h)||f.push(h)}return e.map(f,function(b){return a[b]})}function c(a,b){a.length&&(a[0]=a[0].charAt(0).toUpperCase()+a[0].substring(1));return a.join(" ")+(b||(e.isString("?!...")?"?!...".charAt(g(0,4)):"?!..."[g(0,4)]))}function b(a){var b=a.length,c=0,c=b>3&&b<=6?g(0,1):b>6&&b<=12?g(0,2):g(1,4);e.each(f(e.range(c)),function(b){a[b]+=
|
d.each(c.children,function(c){if(!g.isSnippet(c)&&c.parent){var d=h("abbreviationUtils"),m=h("utils"),n=f(c,a),o=a.cursor(),d=d.isUnary(c),q=a.self_closing_tag&&d?"/":"",s="",s="%"+a.tagName(c.name());s.toLowerCase()=="%div"&&n&&n.indexOf("{")==-1&&(s="");c.end="";c.start=m.replaceSubstring(c.start,s+n+q+" ",c.start.indexOf("%s"),"%s");!c.children.length&&!d&&(c.start+=o)}b(c,a,e+1)});return c})});
|
||||||
","})}h("abbreviationParser").addPreprocessor(function(e){var h=/^(?:lorem|lipsum)(\d*)$/i,l;e.findAll(function(e){if(e._name&&(l=e._name.match(h))){var i=l[1]||30;e._name="";e.data("forceNameResolving",e.isRepeating()||e.attributeList().length);e.data("paste",function(e){var h=[],j=0;e||(e=a.slice(0,i+1),e.length>5&&(e[4]+=","),j+=e.length,h.push(c(e,".")));for(;j<i;)e=f(d,Math.min(g(3,12)*g(1,5),i-j)),j+=e.length,b(e),h.push(c(e));return h.join(" ")})}})});var a="lorem ipsum dolor sit amet consectetur adipisicing elit".split(" "),
|
emmet.exec(function(h,d){function f(f,b){var c=b.attributeQuote(),a=b.cursor();return d.map(f.attributeList(),function(d){return" "+b.attributeName(d.name)+"="+c+(d.value||a)+c}).join("")}h("filters").add("html",function b(c,a,e){var e=e||0,g=h("abbreviationUtils");e||(c=h("filters").apply(c,"_format",a));d.each(c.children,function(c){if(!g.isSnippet(c)&&c.parent){var d=h("abbreviationUtils"),m=h("utils"),n=f(c,a),o=a.cursor(),d=d.isUnary(c),q="",s="";if(!c.isTextNode()){var r=a.tagName(c.name());
|
||||||
d=["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus","tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat",
|
d?(q="<"+r+n+a.selfClosing()+">",c.end=""):(q="<"+r+n+">",s="</"+r+">")}c.start=m.replaceSubstring(c.start,q,c.start.indexOf("%s"),"%s");c.end=m.replaceSubstring(c.end,s,c.end.indexOf("%s"),"%s");!c.children.length&&!d&&c.content.indexOf(o)==-1&&(c.start+=o)}b(c,a,e+1)});return c})});
|
||||||
"aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus","quis","voluptates","dolores","molestiae","harum","dolorem","quia",
|
emmet.exec(function(h,d){var f=/^\s+/,i=/[\n\r]/g;h("filters").add("s",function c(a){var e=h("abbreviationUtils");d.each(a.children,function(a){if(!e.isSnippet(a))a.start=a.start.replace(f,""),a.end=a.end.replace(f,"");a.start=a.start.replace(i,"");a.end=a.end.replace(i,"");a.content=a.content.replace(i,"");c(a)});return a})});
|
||||||
"voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod","explicabo","doloremque","aperiam","consequatur","asperiores","commodi",
|
emmet.exec(function(h,d){function f(h,b){d.each(h.children,function(c){if(c.content)c.content=c.content.replace(b,"");f(c,b)});return h}h("preferences").define("filter.trimRegexp","[\\s|\\u00a0]*[\\d|#|\\-|*|\\u2022]+\\.?\\s*","Regular expression used to remove list markers (numbers, dashes, bullets, etc.) in <code>t</code> (trim) filter. The trim filter is useful for wrapping with abbreviation lists, pased from other documents (for example, Word documents).");h("filters").add("t",function(d){var b=
|
||||||
"optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]});emmet.require("actions").add("select_line",function(h){var e=h.getCurrentLineRange();h.createSelection(e.start,e.end);return!0});
|
RegExp(h("preferences").get("filter.trimRegexp"));return f(d,b)})});emmet.exec(function(h,d){var f={"xsl:variable":1,"xsl:with-param":1};h("filters").add("xsl",function b(c){var a=h("abbreviationUtils");d.each(c.children,function(c){if(!a.isSnippet(c)&&(c.name()||"").toLowerCase()in f&&c.children.length)c.start=c.start.replace(/\s+select\s*=\s*(['"]).*?\1/,"");b(c)});return c})});
|
||||||
emmet.require("resources").setVocabulary({variables:{lang:"en",locale:"en-US",charset:"UTF-8",indentation:"\t",newline:"\n"},css:{filters:"html",snippets:{"@i":"@import url(|);","@m":"@media print {\n\t|\n}","@f":"@font-face {\n\tfont-family:|;\n\tsrc:url(|);\n}","!":"!important",pos:"position:|;","pos:s":"position:static;","pos:a":"position:absolute;","pos:r":"position:relative;","pos:f":"position:fixed;",t:"top:|;","t:a":"top:auto;",r:"right:|;","r:a":"right:auto;",b:"bottom:|;","b:a":"bottom:auto;",
|
emmet.exec(function(h,d){function f(a,b){return Math.round(Math.random()*(b-a)+a)}function i(a,b){for(var c=a.length,e=Math.min(c,b),h=[];h.length<e;){var i=f(0,c-1);d.include(h,i)||h.push(i)}return d.map(h,function(b){return a[b]})}function b(a,b){a.length&&(a[0]=a[0].charAt(0).toUpperCase()+a[0].substring(1));return a.join(" ")+(b||(d.isString("?!...")?"?!...".charAt(f(0,4)):"?!..."[f(0,4)]))}function c(a){var b=a.length,c=0,c=b>3&&b<=6?f(0,1):b>6&&b<=12?f(0,2):f(1,4);d.each(i(d.range(c)),function(b){a[b]+=
|
||||||
brad:"-webkit-border-radius: ${1:radius};\n-moz-border-radius: $1;\nborder-radius: $1;",bsha:"-webkit-box-shadow: ${1:hoff} ${2:voff} ${3:blur} ${4:rgba(0,0,0,0.5)};\n-moz-box-shadow: $1 $2 $3 $4;\nbox-shadow: $1 $2 $3 $4;",l:"left:|;","l:a":"left:auto;",z:"z-index:|;","z:a":"z-index:auto;",fl:"float:|;","fl:n":"float:none;","fl:l":"float:left;","fl:r":"float:right;",cl:"clear:|;","cl:n":"clear:none;","cl:l":"clear:left;","cl:r":"clear:right;","cl:b":"clear:both;",d:"display:|;","d:n":"display:none;",
|
","})}h("abbreviationParser").addPreprocessor(function(d){var h=/^(?:lorem|lipsum)(\d*)$/i,l;d.findAll(function(d){if(d._name&&(l=d._name.match(h))){var g=l[1]||30;d._name="";d.data("forceNameResolving",d.isRepeating()||d.attributeList().length);d.data("pasteOverwrites",!0);d.data("paste",function(d){var h=g,j=!d,d=[],l=0,h=parseInt(h,10);j&&(j=a.slice(0,h),j.length>5&&(j[4]+=","),l+=j.length,d.push(b(j,".")));for(;l<h;)j=i(e,Math.min(f(3,12)*f(1,5),h-l)),l+=j.length,c(j),d.push(b(j));return d.join(" ")})}})});
|
||||||
"d:b":"display:block;","d:i":"display:inline;","d:ib":"display:inline-block;","d:li":"display:list-item;","d:ri":"display:run-in;","d:cp":"display:compact;","d:tb":"display:table;","d:itb":"display:inline-table;","d:tbcp":"display:table-caption;","d:tbcl":"display:table-column;","d:tbclg":"display:table-column-group;","d:tbhg":"display:table-header-group;","d:tbfg":"display:table-footer-group;","d:tbr":"display:table-row;","d:tbrg":"display:table-row-group;","d:tbc":"display:table-cell;","d:rb":"display:ruby;",
|
var a="lorem ipsum dolor sit amet consectetur adipisicing elit".split(" "),e=["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus",
|
||||||
"d:rbb":"display:ruby-base;","d:rbbg":"display:ruby-base-group;","d:rbt":"display:ruby-text;","d:rbtg":"display:ruby-text-group;",v:"visibility:|;","v:v":"visibility:visible;","v:h":"visibility:hidden;","v:c":"visibility:collapse;",ov:"overflow:|;","ov:v":"overflow:visible;","ov:h":"overflow:hidden;","ov:s":"overflow:scroll;","ov:a":"overflow:auto;",ovx:"overflow-x:|;","ovx:v":"overflow-x:visible;","ovx:h":"overflow-x:hidden;","ovx:s":"overflow-x:scroll;","ovx:a":"overflow-x:auto;",ovy:"overflow-y:|;",
|
"tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat","aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus",
|
||||||
"ovy:v":"overflow-y:visible;","ovy:h":"overflow-y:hidden;","ovy:s":"overflow-y:scroll;","ovy:a":"overflow-y:auto;",ovs:"overflow-style:|;","ovs:a":"overflow-style:auto;","ovs:s":"overflow-style:scrollbar;","ovs:p":"overflow-style:panner;","ovs:m":"overflow-style:move;","ovs:mq":"overflow-style:marquee;",zoo:"zoom:1;",cp:"clip:|;","cp:a":"clip:auto;","cp:r":"clip:rect(|);",bxz:"box-sizing:|;","bxz:cb":"box-sizing:content-box;","bxz:bb":"box-sizing:border-box;",bxsh:"box-shadow:${1:hoff} ${2:voff} ${3:radius} ${4:color};",
|
"quis","voluptates","dolores","molestiae","harum","dolorem","quia","voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod",
|
||||||
|
"explicabo","doloremque","aperiam","consequatur","asperiores","commodi","optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]});emmet.exec(function(h){h("actions").add("select_line",function(d){var f=d.getCurrentLineRange();d.createSelection(f.start,f.end);return!0})});
|
||||||
|
emmet.exec(function(h){h("resources").setVocabulary({variables:{lang:"en",locale:"en-US",charset:"UTF-8",indentation:"\t",newline:"\n"},css:{filters:"html",snippets:{"@i":"@import url(|);","@m":"@media print {\n\t|\n}","@f":"@font-face {\n\tfont-family:|;\n\tsrc:url(|);\n}","@f+":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}",
|
||||||
|
"!":"!important",pos:"position:|;","pos:s":"position:static;","pos:a":"position:absolute;","pos:r":"position:relative;","pos:f":"position:fixed;",t:"top:|;","t:a":"top:auto;",r:"right:|;","r:a":"right:auto;",b:"bottom:|;","b:a":"bottom:auto;",l:"left:|;","l:a":"left:auto;",z:"z-index:|;","z:a":"z-index:auto;",fl:"float:|;","fl:n":"float:none;","fl:l":"float:left;","fl:r":"float:right;",cl:"clear:|;","cl:n":"clear:none;","cl:l":"clear:left;","cl:r":"clear:right;","cl:b":"clear:both;",d:"display:|;",
|
||||||
|
"d:n":"display:none;","d:b":"display:block;","d:i":"display:inline;","d:ib":"display:inline-block;","d:li":"display:list-item;","d:ri":"display:run-in;","d:cp":"display:compact;","d:tb":"display:table;","d:itb":"display:inline-table;","d:tbcp":"display:table-caption;","d:tbcl":"display:table-column;","d:tbclg":"display:table-column-group;","d:tbhg":"display:table-header-group;","d:tbfg":"display:table-footer-group;","d:tbr":"display:table-row;","d:tbrg":"display:table-row-group;","d:tbc":"display:table-cell;",
|
||||||
|
"d:rb":"display:ruby;","d:rbb":"display:ruby-base;","d:rbbg":"display:ruby-base-group;","d:rbt":"display:ruby-text;","d:rbtg":"display:ruby-text-group;",v:"visibility:|;","v:v":"visibility:visible;","v:h":"visibility:hidden;","v:c":"visibility:collapse;",ov:"overflow:|;","ov:v":"overflow:visible;","ov:h":"overflow:hidden;","ov:s":"overflow:scroll;","ov:a":"overflow:auto;",ovx:"overflow-x:|;","ovx:v":"overflow-x:visible;","ovx:h":"overflow-x:hidden;","ovx:s":"overflow-x:scroll;","ovx:a":"overflow-x:auto;",
|
||||||
|
ovy:"overflow-y:|;","ovy:v":"overflow-y:visible;","ovy:h":"overflow-y:hidden;","ovy:s":"overflow-y:scroll;","ovy:a":"overflow-y:auto;",ovs:"overflow-style:|;","ovs:a":"overflow-style:auto;","ovs:s":"overflow-style:scrollbar;","ovs:p":"overflow-style:panner;","ovs:m":"overflow-style:move;","ovs:mq":"overflow-style:marquee;",zoo:"zoom:1;",cp:"clip:|;","cp:a":"clip:auto;","cp:r":"clip:rect(|);",bxz:"box-sizing:|;","bxz:cb":"box-sizing:content-box;","bxz:bb":"box-sizing:border-box;",bxsh:"box-shadow:${1:hoff} ${2:voff} ${3:radius} ${4:color};",
|
||||||
"bxsh:n":"box-shadow:none;",m:"margin:|;","m:a":"margin:auto;",mt:"margin-top:|;","mt:a":"margin-top:auto;",mr:"margin-right:|;","mr:a":"margin-right:auto;",mb:"margin-bottom:|;","mb:a":"margin-bottom:auto;",ml:"margin-left:|;","ml:a":"margin-left:auto;",p:"padding:|;",pt:"padding-top:|;",pr:"padding-right:|;",pb:"padding-bottom:|;",pl:"padding-left:|;",w:"width:|;","w:a":"width:auto;",h:"height:|;","h:a":"height:auto;",maw:"max-width:|;","maw:n":"max-width:none;",mah:"max-height:|;","mah:n":"max-height:none;",
|
"bxsh:n":"box-shadow:none;",m:"margin:|;","m:a":"margin:auto;",mt:"margin-top:|;","mt:a":"margin-top:auto;",mr:"margin-right:|;","mr:a":"margin-right:auto;",mb:"margin-bottom:|;","mb:a":"margin-bottom:auto;",ml:"margin-left:|;","ml:a":"margin-left:auto;",p:"padding:|;",pt:"padding-top:|;",pr:"padding-right:|;",pb:"padding-bottom:|;",pl:"padding-left:|;",w:"width:|;","w:a":"width:auto;",h:"height:|;","h:a":"height:auto;",maw:"max-width:|;","maw:n":"max-width:none;",mah:"max-height:|;","mah:n":"max-height:none;",
|
||||||
miw:"min-width:|;",mih:"min-height:|;",o:"outline:|;","o:n":"outline:none;",oo:"outline-offset:|;",ow:"outline-width:|;",os:"outline-style:|;",oc:"outline-color:${1:#000};","oc:i":"outline-color:invert;",bd:"border:|;","bd+":"border:${1:1px} ${2:solid} ${3:#000};","bd:n":"border:none;",bdbk:"border-break:|;","bdbk:c":"border-break:close;",bdcl:"border-collapse:|;","bdcl:c":"border-collapse:collapse;","bdcl:s":"border-collapse:separate;",bdc:"border-color:${1:#000};",bdi:"border-image:url(|);","bdi:n":"border-image:none;",
|
miw:"min-width:|;",mih:"min-height:|;",o:"outline:|;","o:n":"outline:none;",oo:"outline-offset:|;",ow:"outline-width:|;",os:"outline-style:|;",oc:"outline-color:#${1:000};","oc:i":"outline-color:invert;",bd:"border:|;","bd+":"border:${1:1px} ${2:solid} ${3:#000};","bd:n":"border:none;",bdbk:"border-break:|;","bdbk:c":"border-break:close;",bdcl:"border-collapse:|;","bdcl:c":"border-collapse:collapse;","bdcl:s":"border-collapse:separate;",bdc:"border-color:#${1:000};",bdi:"border-image:url(|);","bdi:n":"border-image:none;",
|
||||||
bdti:"border-top-image:url(|);","bdti:n":"border-top-image:none;",bdri:"border-right-image:url(|);","bdri:n":"border-right-image:none;",bdbi:"border-bottom-image:url(|);","bdbi:n":"border-bottom-image:none;",bdli:"border-left-image:url(|);","bdli:n":"border-left-image:none;",bdci:"border-corner-image:url(|);","bdci:n":"border-corner-image:none;","bdci:c":"border-corner-image:continue;",bdtli:"border-top-left-image:url(|);","bdtli:n":"border-top-left-image:none;","bdtli:c":"border-top-left-image:continue;",
|
bdti:"border-top-image:url(|);","bdti:n":"border-top-image:none;",bdri:"border-right-image:url(|);","bdri:n":"border-right-image:none;",bdbi:"border-bottom-image:url(|);","bdbi:n":"border-bottom-image:none;",bdli:"border-left-image:url(|);","bdli:n":"border-left-image:none;",bdci:"border-corner-image:url(|);","bdci:n":"border-corner-image:none;","bdci:c":"border-corner-image:continue;",bdtli:"border-top-left-image:url(|);","bdtli:n":"border-top-left-image:none;","bdtli:c":"border-top-left-image:continue;",
|
||||||
bdtri:"border-top-right-image:url(|);","bdtri:n":"border-top-right-image:none;","bdtri:c":"border-top-right-image:continue;",bdbri:"border-bottom-right-image:url(|);","bdbri:n":"border-bottom-right-image:none;","bdbri:c":"border-bottom-right-image:continue;",bdbli:"border-bottom-left-image:url(|);","bdbli:n":"border-bottom-left-image:none;","bdbli:c":"border-bottom-left-image:continue;",bdf:"border-fit:|;","bdf:c":"border-fit:clip;","bdf:r":"border-fit:repeat;","bdf:sc":"border-fit:scale;","bdf:st":"border-fit:stretch;",
|
bdtri:"border-top-right-image:url(|);","bdtri:n":"border-top-right-image:none;","bdtri:c":"border-top-right-image:continue;",bdbri:"border-bottom-right-image:url(|);","bdbri:n":"border-bottom-right-image:none;","bdbri:c":"border-bottom-right-image:continue;",bdbli:"border-bottom-left-image:url(|);","bdbli:n":"border-bottom-left-image:none;","bdbli:c":"border-bottom-left-image:continue;",bdf:"border-fit:|;","bdf:c":"border-fit:clip;","bdf:r":"border-fit:repeat;","bdf:sc":"border-fit:scale;","bdf:st":"border-fit:stretch;",
|
||||||
"bdf:ow":"border-fit:overwrite;","bdf:of":"border-fit:overflow;","bdf:sp":"border-fit:space;",bdl:"border-length:|;","bdl:a":"border-length:auto;",bdsp:"border-spacing:|;",bds:"border-style:|;","bds:n":"border-style:none;","bds:h":"border-style:hidden;","bds:dt":"border-style:dotted;","bds:ds":"border-style:dashed;","bds:s":"border-style:solid;","bds:db":"border-style:double;","bds:dtds":"border-style:dot-dash;","bds:dtdtds":"border-style:dot-dot-dash;","bds:w":"border-style:wave;","bds:g":"border-style:groove;",
|
"bdf:ow":"border-fit:overwrite;","bdf:of":"border-fit:overflow;","bdf:sp":"border-fit:space;",bdl:"border-length:|;","bdl:a":"border-length:auto;",bdsp:"border-spacing:|;",bds:"border-style:|;","bds:n":"border-style:none;","bds:h":"border-style:hidden;","bds:dt":"border-style:dotted;","bds:ds":"border-style:dashed;","bds:s":"border-style:solid;","bds:db":"border-style:double;","bds:dtds":"border-style:dot-dash;","bds:dtdtds":"border-style:dot-dot-dash;","bds:w":"border-style:wave;","bds:g":"border-style:groove;",
|
||||||
"bds:r":"border-style:ridge;","bds:i":"border-style:inset;","bds:o":"border-style:outset;",bdw:"border-width:|;",bdt:"border-top:|;","bdt+":"border-top:${1:1px} ${2:solid} ${3:#000};","bdt:n":"border-top:none;",bdtw:"border-top-width:|;",bdts:"border-top-style:|;","bdts:n":"border-top-style:none;",bdtc:"border-top-color:${1:#000};",bdr:"border-right:|;","bdr+":"border-right:${1:1px} ${2:solid} ${3:#000};","bdr:n":"border-right:none;",bdrw:"border-right-width:|;",bdrs:"border-right-style:|;","bdrs:n":"border-right-style:none;",
|
"bds:r":"border-style:ridge;","bds:i":"border-style:inset;","bds:o":"border-style:outset;",bdw:"border-width:|;",bdt:"border-top:|;",bt:"border-top:|;","bdt+":"border-top:${1:1px} ${2:solid} ${3:#000};","bdt:n":"border-top:none;",bdtw:"border-top-width:|;",bdts:"border-top-style:|;","bdts:n":"border-top-style:none;",bdtc:"border-top-color:#${1:000};",bdr:"border-right:|;",br:"border-right:|;","bdr+":"border-right:${1:1px} ${2:solid} ${3:#000};","bdr:n":"border-right:none;",bdrw:"border-right-width:|;",
|
||||||
bdrc:"border-right-color:${1:#000};",bdb:"border-bottom:|;","bdb+":"border-bottom:${1:1px} ${2:solid} ${3:#000};","bdb:n":"border-bottom:none;",bdbw:"border-bottom-width:|;",bdbs:"border-bottom-style:|;","bdbs:n":"border-bottom-style:none;",bdbc:"border-bottom-color:${1:#000};",bdl:"border-left:|;","bdl+":"border-left:${1:1px} ${2:solid} ${3:#000};","bdl:n":"border-left:none;",bdlw:"border-left-width:|;",bdls:"border-left-style:|;","bdls:n":"border-left-style:none;",bdlc:"border-left-color:${1:#000};",
|
bdrs:"border-right-style:|;","bdrs:n":"border-right-style:none;",bdrc:"border-right-color:#${1:000};",bdb:"border-bottom:|;",bb:"border-bottom:|;","bdb+":"border-bottom:${1:1px} ${2:solid} ${3:#000};","bdb:n":"border-bottom:none;",bdbw:"border-bottom-width:|;",bdbs:"border-bottom-style:|;","bdbs:n":"border-bottom-style:none;",bdbc:"border-bottom-color:#${1:000};",bdl:"border-left:|;",bl:"border-left:|;","bdl+":"border-left:${1:1px} ${2:solid} ${3:#000};","bdl:n":"border-left:none;",bdlw:"border-left-width:|;",
|
||||||
bdrs:"border-radius:|;",bdtrrs:"border-top-right-radius:|;",bdtlrs:"border-top-left-radius:|;",bdbrrs:"border-bottom-right-radius:|;",bdblrs:"border-bottom-left-radius:|;",bg:"background:|;","bg+":"background:${1:#fff} url(${2}) ${3:0} ${4:0} ${5:no-repeat};","bg:n":"background:none;","bg:ie":"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1:x}.png',sizingMethod='${2:crop}');",bgc:"background-color:${1:#fff};",bgi:"background-image:url(|);","bgi:n":"background-image:none;",bgr:"background-repeat:|;",
|
bdls:"border-left-style:|;","bdls:n":"border-left-style:none;",bdlc:"border-left-color:#${1:000};",bdrs:"border-radius:|;",bdtrrs:"border-top-right-radius:|;",bdtlrs:"border-top-left-radius:|;",bdbrrs:"border-bottom-right-radius:|;",bdblrs:"border-bottom-left-radius:|;",bg:"background:|;","bg+":"background:${1:#fff} url(${2}) ${3:0} ${4:0} ${5:no-repeat};","bg:n":"background:none;","bg:ie":"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1:x}.png',sizingMethod='${2:crop}');",bgc:"background-color:#${1:fff};",
|
||||||
"bgr:n":"background-repeat:no-repeat;","bgr:x":"background-repeat:repeat-x;","bgr:y":"background-repeat:repeat-y;",bga:"background-attachment:|;","bga:f":"background-attachment:fixed;","bga:s":"background-attachment:scroll;",bgp:"background-position:${1:0} ${2:0};",bgpx:"background-position-x:|;",bgpy:"background-position-y:|;",bgbk:"background-break:|;","bgbk:bb":"background-break:bounding-box;","bgbk:eb":"background-break:each-box;","bgbk:c":"background-break:continuous;",bgcp:"background-clip:|;",
|
bgi:"background-image:url(|);","bgi:n":"background-image:none;",bgr:"background-repeat:|;","bgr:n":"background-repeat:no-repeat;","bgr:x":"background-repeat:repeat-x;","bgr:y":"background-repeat:repeat-y;",bga:"background-attachment:|;","bga:f":"background-attachment:fixed;","bga:s":"background-attachment:scroll;",bgp:"background-position:${1:0} ${2:0};",bgpx:"background-position-x:|;",bgpy:"background-position-y:|;",bgbk:"background-break:|;","bgbk:bb":"background-break:bounding-box;","bgbk:eb":"background-break:each-box;",
|
||||||
"bgcp:bb":"background-clip:border-box;","bgcp:pb":"background-clip:padding-box;","bgcp:cb":"background-clip:content-box;","bgcp:nc":"background-clip:no-clip;",bgo:"background-origin:|;","bgo:pb":"background-origin:padding-box;","bgo:bb":"background-origin:border-box;","bgo:cb":"background-origin:content-box;",bgz:"background-size:|;","bgz:a":"background-size:auto;","bgz:ct":"background-size:contain;","bgz:cv":"background-size:cover;",c:"color:${1:#000};",tbl:"table-layout:|;","tbl:a":"table-layout:auto;",
|
"bgbk:c":"background-break:continuous;",bgcp:"background-clip:|;","bgcp:bb":"background-clip:border-box;","bgcp:pb":"background-clip:padding-box;","bgcp:cb":"background-clip:content-box;","bgcp:nc":"background-clip:no-clip;",bgo:"background-origin:|;","bgo:pb":"background-origin:padding-box;","bgo:bb":"background-origin:border-box;","bgo:cb":"background-origin:content-box;",bgz:"background-size:|;","bgz:a":"background-size:auto;","bgz:ct":"background-size:contain;","bgz:cv":"background-size:cover;",
|
||||||
"tbl:f":"table-layout:fixed;",cps:"caption-side:|;","cps:t":"caption-side:top;","cps:b":"caption-side:bottom;",ec:"empty-cells:|;","ec:s":"empty-cells:show;","ec:h":"empty-cells:hide;",lis:"list-style:|;","lis:n":"list-style:none;",lisp:"list-style-position:|;","lisp:i":"list-style-position:inside;","lisp:o":"list-style-position:outside;",list:"list-style-type:|;","list:n":"list-style-type:none;","list:d":"list-style-type:disc;","list:c":"list-style-type:circle;","list:s":"list-style-type:square;",
|
c:"color:#${1:000};",cm:"/* |${child} */",cn:"content:|;",tbl:"table-layout:|;","tbl:a":"table-layout:auto;","tbl:f":"table-layout:fixed;",cps:"caption-side:|;","cps:t":"caption-side:top;","cps:b":"caption-side:bottom;",ec:"empty-cells:|;","ec:s":"empty-cells:show;","ec:h":"empty-cells:hide;",lis:"list-style:|;","lis:n":"list-style:none;",lisp:"list-style-position:|;","lisp:i":"list-style-position:inside;","lisp:o":"list-style-position:outside;",list:"list-style-type:|;","list:n":"list-style-type:none;",
|
||||||
"list:dc":"list-style-type:decimal;","list:dclz":"list-style-type:decimal-leading-zero;","list:lr":"list-style-type:lower-roman;","list:ur":"list-style-type:upper-roman;",lisi:"list-style-image:|;","lisi:n":"list-style-image:none;",q:"quotes:|;","q:n":"quotes:none;","q:ru":"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C';","q:en":"quotes:'\\201C' '\\201D' '\\2018' '\\2019';",ct:"content:|;","ct:n":"content:normal;","ct:oq":"content:open-quote;","ct:noq":"content:no-open-quote;","ct:cq":"content:close-quote;",
|
"list:d":"list-style-type:disc;","list:c":"list-style-type:circle;","list:s":"list-style-type:square;","list:dc":"list-style-type:decimal;","list:dclz":"list-style-type:decimal-leading-zero;","list:lr":"list-style-type:lower-roman;","list:ur":"list-style-type:upper-roman;",lisi:"list-style-image:|;","lisi:n":"list-style-image:none;",q:"quotes:|;","q:n":"quotes:none;","q:ru":"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C';","q:en":"quotes:'\\201C' '\\201D' '\\2018' '\\2019';",ct:"content:|;","ct:n":"content:normal;",
|
||||||
"ct:ncq":"content:no-close-quote;","ct:a":"content:attr(|);","ct:c":"content:counter(|);","ct:cs":"content:counters(|);",coi:"counter-increment:|;",cor:"counter-reset:|;",va:"vertical-align:|;","va:sup":"vertical-align:super;","va:t":"vertical-align:top;","va:tt":"vertical-align:text-top;","va:m":"vertical-align:middle;","va:bl":"vertical-align:baseline;","va:b":"vertical-align:bottom;","va:tb":"vertical-align:text-bottom;","va:sub":"vertical-align:sub;",ta:"text-align:|;","ta:l":"text-align:left;",
|
"ct:oq":"content:open-quote;","ct:noq":"content:no-open-quote;","ct:cq":"content:close-quote;","ct:ncq":"content:no-close-quote;","ct:a":"content:attr(|);","ct:c":"content:counter(|);","ct:cs":"content:counters(|);",coi:"counter-increment:|;",cor:"counter-reset:|;",va:"vertical-align:|;","va:sup":"vertical-align:super;","va:t":"vertical-align:top;","va:tt":"vertical-align:text-top;","va:m":"vertical-align:middle;","va:bl":"vertical-align:baseline;","va:b":"vertical-align:bottom;","va:tb":"vertical-align:text-bottom;",
|
||||||
"ta:c":"text-align:center;","ta:r":"text-align:right;",tal:"text-align-last:|;","tal:a":"text-align-last:auto;","tal:l":"text-align-last:left;","tal:c":"text-align-last:center;","tal:r":"text-align-last:right;",td:"text-decoration:|;","td:n":"text-decoration:none;","td:u":"text-decoration:underline;","td:o":"text-decoration:overline;","td:l":"text-decoration:line-through;",te:"text-emphasis:|;","te:n":"text-emphasis:none;","te:ac":"text-emphasis:accent;","te:dt":"text-emphasis:dot;","te:c":"text-emphasis:circle;",
|
"va:sub":"vertical-align:sub;",ta:"text-align:|;","ta:l":"text-align:left;","ta:c":"text-align:center;","ta:r":"text-align:right;",tal:"text-align-last:|;","tal:a":"text-align-last:auto;","tal:l":"text-align-last:left;","tal:c":"text-align-last:center;","tal:r":"text-align-last:right;",td:"text-decoration:|;","td:n":"text-decoration:none;","td:u":"text-decoration:underline;","td:o":"text-decoration:overline;","td:l":"text-decoration:line-through;",te:"text-emphasis:|;","te:n":"text-emphasis:none;",
|
||||||
"te:ds":"text-emphasis:disc;","te:b":"text-emphasis:before;","te:a":"text-emphasis:after;",th:"text-height:|;","th:a":"text-height:auto;","th:f":"text-height:font-size;","th:t":"text-height:text-size;","th:m":"text-height:max-size;",ti:"text-indent:|;","ti:-":"text-indent:-9999px;",tj:"text-justify:|;","tj:a":"text-justify:auto;","tj:iw":"text-justify:inter-word;","tj:ii":"text-justify:inter-ideograph;","tj:ic":"text-justify:inter-cluster;","tj:d":"text-justify:distribute;","tj:k":"text-justify:kashida;",
|
"te:ac":"text-emphasis:accent;","te:dt":"text-emphasis:dot;","te:c":"text-emphasis:circle;","te:ds":"text-emphasis:disc;","te:b":"text-emphasis:before;","te:a":"text-emphasis:after;",th:"text-height:|;","th:a":"text-height:auto;","th:f":"text-height:font-size;","th:t":"text-height:text-size;","th:m":"text-height:max-size;",ti:"text-indent:|;","ti:-":"text-indent:-9999px;",tj:"text-justify:|;","tj:a":"text-justify:auto;","tj:iw":"text-justify:inter-word;","tj:ii":"text-justify:inter-ideograph;","tj:ic":"text-justify:inter-cluster;",
|
||||||
"tj:t":"text-justify:tibetan;",to:"text-outline:|;","to+":"text-outline:${1:0} ${2:0} ${3:#000};","to:n":"text-outline:none;",tr:"text-replace:|;","tr:n":"text-replace:none;",tt:"text-transform:|;","tt:n":"text-transform:none;","tt:c":"text-transform:capitalize;","tt:u":"text-transform:uppercase;","tt:l":"text-transform:lowercase;",tw:"text-wrap:|;","tw:n":"text-wrap:normal;","tw:no":"text-wrap:none;","tw:u":"text-wrap:unrestricted;","tw:s":"text-wrap:suppress;",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000};",
|
"tj:d":"text-justify:distribute;","tj:k":"text-justify:kashida;","tj:t":"text-justify:tibetan;",to:"text-outline:|;","to+":"text-outline:${1:0} ${2:0} ${3:#000};","to:n":"text-outline:none;",tr:"text-replace:|;","tr:n":"text-replace:none;",tt:"text-transform:|;","tt:n":"text-transform:none;","tt:c":"text-transform:capitalize;","tt:u":"text-transform:uppercase;","tt:l":"text-transform:lowercase;",tw:"text-wrap:|;","tw:n":"text-wrap:normal;","tw:no":"text-wrap:none;","tw:u":"text-wrap:unrestricted;",
|
||||||
"tsh+":"text-shadow:${1:0} ${2:0} ${3:0} ${4:#000};","tsh:n":"text-shadow:none;",trf:"transform:|;","trf:skx":"transform: skewX(${1:angle});","trf:sky":"transform: skewY(${1:angle});","trf:sc":"transform: scale(${1:x}, ${2:y});","trf:scx":"transform: scaleX(${1:x});","trf:scy":"transform: scaleY(${1:y});","trf:r":"transform: rotate(${1:angle});","trf:t":"transform: translate(${1:x}, ${2:y});","trf:tx":"transform: translateX(${1:x});","trf:ty":"transform: translateY(${1:y});",lh:"line-height:|;",whs:"white-space:|;",
|
"tw:s":"text-wrap:suppress;",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000};","tsh+":"text-shadow:${1:0} ${2:0} ${3:0} ${4:#000};","tsh:n":"text-shadow:none;",trf:"transform:|;","trf:skx":"transform: skewX(${1:angle});","trf:sky":"transform: skewY(${1:angle});","trf:sc":"transform: scale(${1:x}, ${2:y});","trf:scx":"transform: scaleX(${1:x});","trf:scy":"transform: scaleY(${1:y});","trf:r":"transform: rotate(${1:angle});","trf:t":"transform: translate(${1:x}, ${2:y});","trf:tx":"transform: translateX(${1:x});",
|
||||||
"whs:n":"white-space:normal;","whs:p":"white-space:pre;","whs:nw":"white-space:nowrap;","whs:pw":"white-space:pre-wrap;","whs:pl":"white-space:pre-line;",whsc:"white-space-collapse:|;","whsc:n":"white-space-collapse:normal;","whsc:k":"white-space-collapse:keep-all;","whsc:l":"white-space-collapse:loose;","whsc:bs":"white-space-collapse:break-strict;","whsc:ba":"white-space-collapse:break-all;",wob:"word-break:|;","wob:n":"word-break:normal;","wob:k":"word-break:keep-all;","wob:l":"word-break:loose;",
|
"trf:ty":"transform: translateY(${1:y});",trs:"transition:${1:prop} ${2:time};",trsde:"transition-delay:${1:time};",trsdu:"transition-duration:${1:time};",trsp:"transition-property:${1:prop};",trstf:"transition-timing-function:${1:tfunc};",lh:"line-height:|;",whs:"white-space:|;","whs:n":"white-space:normal;","whs:p":"white-space:pre;","whs:nw":"white-space:nowrap;","whs:pw":"white-space:pre-wrap;","whs:pl":"white-space:pre-line;",whsc:"white-space-collapse:|;","whsc:n":"white-space-collapse:normal;",
|
||||||
"wob:bs":"word-break:break-strict;","wob:ba":"word-break:break-all;",wos:"word-spacing:|;",wow:"word-wrap:|;","wow:nm":"word-wrap:normal;","wow:n":"word-wrap:none;","wow:u":"word-wrap:unrestricted;","wow:s":"word-wrap:suppress;",lts:"letter-spacing:|;",f:"font:|;","f+":"font:${1:1em} ${2:Arial,sans-serif};",fw:"font-weight:|;","fw:n":"font-weight:normal;","fw:b":"font-weight:bold;","fw:br":"font-weight:bolder;","fw:lr":"font-weight:lighter;",fs:"font-style:|;","fs:n":"font-style:normal;","fs:i":"font-style:italic;",
|
"whsc:k":"white-space-collapse:keep-all;","whsc:l":"white-space-collapse:loose;","whsc:bs":"white-space-collapse:break-strict;","whsc:ba":"white-space-collapse:break-all;",wob:"word-break:|;","wob:n":"word-break:normal;","wob:k":"word-break:keep-all;","wob:l":"word-break:loose;","wob:bs":"word-break:break-strict;","wob:ba":"word-break:break-all;",wos:"word-spacing:|;",wow:"word-wrap:|;","wow:nm":"word-wrap:normal;","wow:n":"word-wrap:none;","wow:u":"word-wrap:unrestricted;","wow:s":"word-wrap:suppress;",
|
||||||
"fs:o":"font-style:oblique;",fv:"font-variant:|;","fv:n":"font-variant:normal;","fv:sc":"font-variant:small-caps;",fz:"font-size:|;",fza:"font-size-adjust:|;","fza:n":"font-size-adjust:none;",ff:"font-family:|;","ff:s":"font-family:serif;","ff:ss":"font-family:sans-serif;","ff:c":"font-family:cursive;","ff:f":"font-family:fantasy;","ff:m":"font-family:monospace;",fef:"font-effect:|;","fef:n":"font-effect:none;","fef:eg":"font-effect:engrave;","fef:eb":"font-effect:emboss;","fef:o":"font-effect:outline;",
|
lts:"letter-spacing:|;",f:"font:|;","f+":"font:${1:1em} ${2:Arial,sans-serif};",fw:"font-weight:|;","fw:n":"font-weight:normal;","fw:b":"font-weight:bold;","fw:br":"font-weight:bolder;","fw:lr":"font-weight:lighter;",fs:"font-style:|;","fs:n":"font-style:normal;","fs:i":"font-style:italic;","fs:o":"font-style:oblique;",fv:"font-variant:|;","fv:n":"font-variant:normal;","fv:sc":"font-variant:small-caps;",fz:"font-size:|;",fza:"font-size-adjust:|;","fza:n":"font-size-adjust:none;",ff:"font-family:|;",
|
||||||
fem:"font-emphasize:|;",femp:"font-emphasize-position:|;","femp:b":"font-emphasize-position:before;","femp:a":"font-emphasize-position:after;",fems:"font-emphasize-style:|;","fems:n":"font-emphasize-style:none;","fems:ac":"font-emphasize-style:accent;","fems:dt":"font-emphasize-style:dot;","fems:c":"font-emphasize-style:circle;","fems:ds":"font-emphasize-style:disc;",fsm:"font-smooth:|;","fsm:a":"font-smooth:auto;","fsm:n":"font-smooth:never;","fsm:aw":"font-smooth:always;",fst:"font-stretch:|;",
|
"ff:s":"font-family:serif;","ff:ss":"font-family:sans-serif;","ff:c":"font-family:cursive;","ff:f":"font-family:fantasy;","ff:m":"font-family:monospace;",fef:"font-effect:|;","fef:n":"font-effect:none;","fef:eg":"font-effect:engrave;","fef:eb":"font-effect:emboss;","fef:o":"font-effect:outline;",fem:"font-emphasize:|;",femp:"font-emphasize-position:|;","femp:b":"font-emphasize-position:before;","femp:a":"font-emphasize-position:after;",fems:"font-emphasize-style:|;","fems:n":"font-emphasize-style:none;",
|
||||||
"fst:n":"font-stretch:normal;","fst:uc":"font-stretch:ultra-condensed;","fst:ec":"font-stretch:extra-condensed;","fst:c":"font-stretch:condensed;","fst:sc":"font-stretch:semi-condensed;","fst:se":"font-stretch:semi-expanded;","fst:e":"font-stretch:expanded;","fst:ee":"font-stretch:extra-expanded;","fst:ue":"font-stretch:ultra-expanded;",op:"opacity:|;","op:ie":"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);","op:ms":"-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';",
|
"fems:ac":"font-emphasize-style:accent;","fems:dt":"font-emphasize-style:dot;","fems:c":"font-emphasize-style:circle;","fems:ds":"font-emphasize-style:disc;",fsm:"font-smooth:|;","fsm:a":"font-smooth:auto;","fsm:n":"font-smooth:never;","fsm:aw":"font-smooth:always;",fst:"font-stretch:|;","fst:n":"font-stretch:normal;","fst:uc":"font-stretch:ultra-condensed;","fst:ec":"font-stretch:extra-condensed;","fst:c":"font-stretch:condensed;","fst:sc":"font-stretch:semi-condensed;","fst:se":"font-stretch:semi-expanded;",
|
||||||
rz:"resize:|;","rz:n":"resize:none;","rz:b":"resize:both;","rz:h":"resize:horizontal;","rz:v":"resize:vertical;",cur:"cursor:|;","cur:a":"cursor:auto;","cur:d":"cursor:default;","cur:c":"cursor:crosshair;","cur:ha":"cursor:hand;","cur:he":"cursor:help;","cur:m":"cursor:move;","cur:p":"cursor:pointer;","cur:t":"cursor:text;",pgbb:"page-break-before:|;","pgbb:au":"page-break-before:auto;","pgbb:al":"page-break-before:always;","pgbb:l":"page-break-before:left;","pgbb:r":"page-break-before:right;",pgbi:"page-break-inside:|;",
|
"fst:e":"font-stretch:expanded;","fst:ee":"font-stretch:extra-expanded;","fst:ue":"font-stretch:ultra-expanded;",op:"opacity:|;","op:ie":"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);","op:ms":"-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';",rz:"resize:|;","rz:n":"resize:none;","rz:b":"resize:both;","rz:h":"resize:horizontal;","rz:v":"resize:vertical;",cur:"cursor:|;","cur:a":"cursor:auto;","cur:d":"cursor:default;","cur:c":"cursor:crosshair;","cur:ha":"cursor:hand;",
|
||||||
"pgbi:au":"page-break-inside:auto;","pgbi:av":"page-break-inside:avoid;",pgba:"page-break-after:|;","pgba:au":"page-break-after:auto;","pgba:al":"page-break-after:always;","pgba:l":"page-break-after:left;","pgba:r":"page-break-after:right;",orp:"orphans:|;",wid:"widows:|;"}},html:{filters:"html",snippets:{"cc:ie6":"<\!--[if lte IE 6]>\n\t${child}|\n<![endif]--\>","cc:ie":"<\!--[if IE]>\n\t${child}|\n<![endif]--\>","cc:noie":"<\!--[if !IE]><\!--\>\n\t${child}|\n<\!--<![endif]--\>","html:4t":'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}">\n\t<title></title>\n</head>\n<body>\n\t${child}|\n</body>\n</html>',
|
"cur:he":"cursor:help;","cur:m":"cursor:move;","cur:p":"cursor:pointer;","cur:t":"cursor:text;",pgbb:"page-break-before:|;","pgbb:au":"page-break-before:auto;","pgbb:al":"page-break-before:always;","pgbb:l":"page-break-before:left;","pgbb:r":"page-break-before:right;",pgbi:"page-break-inside:|;","pgbi:au":"page-break-inside:auto;","pgbi:av":"page-break-inside:avoid;",pgba:"page-break-after:|;","pgba:au":"page-break-after:auto;","pgba:al":"page-break-after:always;","pgba:l":"page-break-after:left;",
|
||||||
"html:4s":'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n<html lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}">\n\t<title></title>\n</head>\n<body>\n\t${child}|\n</body>\n</html>',"html:xt":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}" />\n\t<title></title>\n</head>\n<body>\n\t${child}|\n</body>\n</html>',
|
"pgba:r":"page-break-after:right;",orp:"orphans:|;",wid:"widows:|;"}},html:{filters:"html",profile:"html",snippets:{c:"<\!-- |${child} --\>","cc:ie6":"<\!--[if lte IE 6]>\n\t${child}|\n<![endif]--\>","cc:ie":"<\!--[if IE]>\n\t${child}|\n<![endif]--\>","cc:noie":"<\!--[if !IE]><\!--\>\n\t${child}|\n<\!--<![endif]--\>","html:4t":'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}">\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',
|
||||||
"html:xs":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}" />\n\t<title></title>\n</head>\n<body>\n\t${child}|\n</body>\n</html>',"html:xxs":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}" />\n\t<title></title>\n</head>\n<body>\n\t${child}|\n</body>\n</html>',
|
"html:4s":'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n<html lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}">\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',"html:xt":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}" />\n\t<title></title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',
|
||||||
"html:5":'<!doctype html>\n<html lang="${lang}">\n<head>\n\t<meta charset="${charset}">\n\t<title></title>\n</head>\n<body>\n\t${child}|\n</body>\n</html>'},abbreviations:{a:'<a href="">',"a:link":'<a href="http://|">',"a:mail":'<a href="mailto:|">',abbr:'<abbr title="">',acronym:'<acronym title="">',base:'<base href="" />',bdo:'<bdo dir="">',"bdo:r":'<bdo dir="rtl">',"bdo:l":'<bdo dir="ltr">',link:'<link rel="stylesheet" href="" />',"link:css":'<link rel="stylesheet" href="${1:style}.css" media="all" />',
|
"html:xs":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}" />\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',"html:xxs":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}" />\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',
|
||||||
|
"html:5":'<!doctype html>\n<html lang="${lang}">\n<head>\n\t<meta charset="${charset}">\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>'},abbreviations:{"!":"html:5",a:'<a href="">',"a:link":'<a href="http://|">',"a:mail":'<a href="mailto:|">',abbr:'<abbr title="">',acronym:'<acronym title="">',base:'<base href="" />',bdo:'<bdo dir="">',"bdo:r":'<bdo dir="rtl">',"bdo:l":'<bdo dir="ltr">',link:'<link rel="stylesheet" href="" />',"link:css":'<link rel="stylesheet" href="${1:style}.css" media="all" />',
|
||||||
"link:print":'<link rel="stylesheet" href="${1:print}.css" media="print" />',"link:favicon":'<link rel="shortcut icon" type="image/x-icon" href="${1:favicon.ico}" />',"link:touch":'<link rel="apple-touch-icon" href="${1:favicon.png}" />',"link:rss":'<link rel="alternate" type="application/rss+xml" title="RSS" href="${1:rss.xml}" />',"link:atom":'<link rel="alternate" type="application/atom+xml" title="Atom" href="${1:atom.xml}" />',"meta:utf":'<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />',
|
"link:print":'<link rel="stylesheet" href="${1:print}.css" media="print" />',"link:favicon":'<link rel="shortcut icon" type="image/x-icon" href="${1:favicon.ico}" />',"link:touch":'<link rel="apple-touch-icon" href="${1:favicon.png}" />',"link:rss":'<link rel="alternate" type="application/rss+xml" title="RSS" href="${1:rss.xml}" />',"link:atom":'<link rel="alternate" type="application/atom+xml" title="Atom" href="${1:atom.xml}" />',"meta:utf":'<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />',
|
||||||
"meta:win":'<meta http-equiv="Content-Type" content="text/html;charset=windows-1251" />',"meta:compat":'<meta http-equiv="X-UA-Compatible" content="${1:IE=7}" />',style:"<style>",script:"<script>","script:src":'<script src="">',img:'<img src="" alt="" />',iframe:'<iframe src="" frameborder="0">',embed:'<embed src="" type="" />',object:'<object data="" type="">',param:'<param name="" value="" />',map:'<map name="">',area:'<area shape="" coords="" href="" alt="" />',"area:d":'<area shape="default" href="" alt="" />',
|
"meta:win":'<meta http-equiv="Content-Type" content="text/html;charset=windows-1251" />',"meta:compat":'<meta http-equiv="X-UA-Compatible" content="${1:IE=7}" />',style:"<style>",script:"<script>","script:src":'<script src="">',img:'<img src="" alt="" />',iframe:'<iframe src="" frameborder="0">',embed:'<embed src="" type="" />',object:'<object data="" type="">',param:'<param name="" value="" />',map:'<map name="">',area:'<area shape="" coords="" href="" alt="" />',"area:d":'<area shape="default" href="" alt="" />',
|
||||||
"area:c":'<area shape="circle" coords="" href="" alt="" />',"area:r":'<area shape="rect" coords="" href="" alt="" />',"area:p":'<area shape="poly" coords="" href="" alt="" />',form:'<form action="">',"form:get":'<form action="" method="get">',"form:post":'<form action="" method="post">',label:'<label for="">',input:'<input type="" />',"input:hidden":'<input type="hidden" name="" />',"input:h":'<input type="hidden" name="" />',"input:text":'<input type="text" name="" id="" />',"input:t":'<input type="text" name="" id="" />',
|
"area:c":'<area shape="circle" coords="" href="" alt="" />',"area:r":'<area shape="rect" coords="" href="" alt="" />',"area:p":'<area shape="poly" coords="" href="" alt="" />',form:'<form action="">',"form:get":'<form action="" method="get">',"form:post":'<form action="" method="post">',label:'<label for="">',input:'<input type="" />',"input:hidden":'<input type="hidden" name="" />',"input:h":'<input type="hidden" name="" />',"input:text":'<input type="text" name="" id="" />',"input:t":'<input type="text" name="" id="" />',
|
||||||
"input:search":'<input type="search" name="" id="" />',"input:email":'<input type="email" name="" id="" />',"input:url":'<input type="url" name="" id="" />',"input:password":'<input type="password" name="" id="" />',"input:p":'<input type="password" name="" id="" />',"input:datetime":'<input type="datetime" name="" id="" />',"input:date":'<input type="date" name="" id="" />',"input:datetime-local":'<input type="datetime-local" name="" id="" />',"input:month":'<input type="month" name="" id="" />',
|
"input:search":'<input type="search" name="" id="" />',"input:email":'<input type="email" name="" id="" />',"input:url":'<input type="url" name="" id="" />',"input:password":'<input type="password" name="" id="" />',"input:p":'<input type="password" name="" id="" />',"input:datetime":'<input type="datetime" name="" id="" />',"input:date":'<input type="date" name="" id="" />',"input:datetime-local":'<input type="datetime-local" name="" id="" />',"input:month":'<input type="month" name="" id="" />',
|
||||||
"input:week":'<input type="week" name="" id="" />',"input:time":'<input type="time" name="" id="" />',"input:number":'<input type="number" name="" id="" />',"input:color":'<input type="color" name="" id="" />',"input:checkbox":'<input type="checkbox" name="" id="" />',"input:c":'<input type="checkbox" name="" id="" />',"input:radio":'<input type="radio" name="" id="" />',"input:r":'<input type="radio" name="" id="" />',"input:range":'<input type="range" name="" id="" />',"input:file":'<input type="file" name="" id="" />',
|
"input:week":'<input type="week" name="" id="" />',"input:time":'<input type="time" name="" id="" />',"input:number":'<input type="number" name="" id="" />',"input:color":'<input type="color" name="" id="" />',"input:checkbox":'<input type="checkbox" name="" id="" />',"input:c":'<input type="checkbox" name="" id="" />',"input:radio":'<input type="radio" name="" id="" />',"input:r":'<input type="radio" name="" id="" />',"input:range":'<input type="range" name="" id="" />',"input:file":'<input type="file" name="" id="" />',
|
||||||
"input:f":'<input type="file" name="" id="" />',"input:submit":'<input type="submit" value="" />',"input:s":'<input type="submit" value="" />',"input:image":'<input type="image" src="" alt="" />',"input:i":'<input type="image" src="" alt="" />',"input:reset":'<input type="reset" value="" />',"input:button":'<input type="button" value="" />',"input:b":'<input type="button" value="" />',select:'<select name="" id=""></select>',option:'<option value=""></option>',textarea:'<textarea name="" id="" cols="${1:30}" rows="${2:10}">',
|
"input:f":'<input type="file" name="" id="" />',"input:submit":'<input type="submit" value="" />',"input:s":'<input type="submit" value="" />',"input:image":'<input type="image" src="" alt="" />',"input:i":'<input type="image" src="" alt="" />',"input:reset":'<input type="reset" value="" />',"input:button":'<input type="button" value="" />',"input:b":'<input type="button" value="" />',select:'<select name="" id=""></select>',option:'<option value=""></option>',textarea:'<textarea name="" id="" cols="${1:30}" rows="${2:10}">',
|
||||||
"menu:context":'<menu type="context">',"menu:c":'<menu type="context">',"menu:toolbar":'<menu type="toolbar">',"menu:t":'<menu type="toolbar">',video:'<video src="">',audio:'<audio src="">',"html:xml":'<html xmlns="http://www.w3.org/1999/xhtml">',bq:"<blockquote>",acr:"<acronym>",fig:"<figure>",figc:"<figcaption>",ifr:"<iframe>",emb:"<embed>",obj:"<object>",src:"<source>",cap:"<caption>",colg:"<colgroup>",fst:"<fieldset>",btn:"<button>",optg:"<optgroup>",opt:"<option>",tarea:"<textarea>",leg:"<legend>",
|
"menu:context":'<menu type="context">',"menu:c":'<menu type="context">',"menu:toolbar":'<menu type="toolbar">',"menu:t":'<menu type="toolbar">',video:'<video src="">',audio:'<audio src="">',"html:xml":'<html xmlns="http://www.w3.org/1999/xhtml">',bq:"blockquote",acr:"acronym",fig:"figure",figc:"figcaption",ifr:"iframe",emb:"embed",obj:"object",src:"source",cap:"caption",colg:"colgroup",fst:"fieldset",btn:"button",optg:"optgroup",opt:"option",tarea:"textarea",leg:"legend",sect:"section",art:"article",
|
||||||
sect:"<section>",art:"<article>",hdr:"<header>",ftr:"<footer>",adr:"<address>",dlg:"<dialog>",str:"<strong>",prog:"<progress>",fset:"<fieldset>",datag:"<datagrid>",datal:"<datalist>",kg:"<keygen>",out:"<output>",det:"<details>",cmd:"<command>","ol+":"ol>li","ul+":"ul>li","dl+":"dl>dt+dd","map+":"map>area","table+":"table>tr>td","colgroup+":"colgroup>col","colg+":"colgroup>col","tr+":"tr>td","select+":"select>option","optgroup+":"optgroup>option","optg+":"optgroup>option"}},xml:{"extends":"html",profile:"xml",
|
hdr:"header",ftr:"footer",adr:"address",dlg:"dialog",str:"strong",prog:"progress",fset:"fieldset",datag:"datagrid",datal:"datalist",kg:"keygen",out:"output",det:"details",cmd:"command","ol+":"ol>li","ul+":"ul>li","dl+":"dl>dt+dd","map+":"map>area","table+":"table>tr>td","colgroup+":"colgroup>col","colg+":"colgroup>col","tr+":"tr>td","select+":"select>option","optgroup+":"optgroup>option","optg+":"optgroup>option"}},xml:{"extends":"html",profile:"xml",filters:"html"},xsl:{"extends":"html",profile:"xml",
|
||||||
filters:"html"},xsl:{"extends":"html",filters:"html, xsl",abbreviations:{tm:'<xsl:template match="" mode="">',tmatch:"tm",tn:'<xsl:template name="">',tname:"tn",call:'<xsl:call-template name=""/>',ap:'<xsl:apply-templates select="" mode=""/>',api:"<xsl:apply-imports/>",imp:'<xsl:import href=""/>',inc:'<xsl:include href=""/>',ch:"<xsl:choose>","xsl:when":'<xsl:when test="">',wh:"xsl:when",ot:"<xsl:otherwise>","if":'<xsl:if test="">',par:'<xsl:param name="">',pare:'<xsl:param name="" select=""/>',"var":'<xsl:variable name="">',
|
filters:"html, xsl",abbreviations:{tm:'<xsl:template match="" mode="">',tmatch:"tm",tn:'<xsl:template name="">',tname:"tn",call:'<xsl:call-template name=""/>',ap:'<xsl:apply-templates select="" mode=""/>',api:"<xsl:apply-imports/>",imp:'<xsl:import href=""/>',inc:'<xsl:include href=""/>',ch:"<xsl:choose>","xsl:when":'<xsl:when test="">',wh:"xsl:when",ot:"<xsl:otherwise>","if":'<xsl:if test="">',par:'<xsl:param name="">',pare:'<xsl:param name="" select=""/>',"var":'<xsl:variable name="">',vare:'<xsl:variable name="" select=""/>',
|
||||||
vare:'<xsl:variable name="" select=""/>',wp:'<xsl:with-param name="" select=""/>',key:'<xsl:key name="" match="" use=""/>',elem:'<xsl:element name="">',attr:'<xsl:attribute name="">',attrs:'<xsl:attribute-set name="">',cp:'<xsl:copy select=""/>',co:'<xsl:copy-of select=""/>',val:'<xsl:value-of select=""/>',each:'<xsl:for-each select="">',"for":"each",tex:"<xsl:text></xsl:text>",com:"<xsl:comment>",msg:'<xsl:message terminate="no">',fall:"<xsl:fallback>",num:'<xsl:number value=""/>',nam:'<namespace-alias stylesheet-prefix="" result-prefix=""/>',
|
wp:'<xsl:with-param name="" select=""/>',key:'<xsl:key name="" match="" use=""/>',elem:'<xsl:element name="">',attr:'<xsl:attribute name="">',attrs:'<xsl:attribute-set name="">',cp:'<xsl:copy select=""/>',co:'<xsl:copy-of select=""/>',val:'<xsl:value-of select=""/>',each:'<xsl:for-each select="">',"for":"each",tex:"<xsl:text></xsl:text>",com:"<xsl:comment>",msg:'<xsl:message terminate="no">',fall:"<xsl:fallback>",num:'<xsl:number value=""/>',nam:'<namespace-alias stylesheet-prefix="" result-prefix=""/>',
|
||||||
pres:'<xsl:preserve-space elements=""/>',strip:'<xsl:strip-space elements=""/>',proc:'<xsl:processing-instruction name="">',sort:'<xsl:sort select="" order=""/>',"choose+":"xsl:choose>xsl:when+xsl:otherwise"}},haml:{filters:"haml","extends":"html"},scss:{filters:"haml","extends":"css"},sass:{filters:"haml","extends":"css"},less:{filters:"haml","extends":"css"}},"system");
|
pres:'<xsl:preserve-space elements=""/>',strip:'<xsl:strip-space elements=""/>',proc:'<xsl:processing-instruction name="">',sort:'<xsl:sort select="" order=""/>',"choose+":"xsl:choose>xsl:when+xsl:otherwise"}},haml:{filters:"haml","extends":"html"},scss:{"extends":"css"},sass:{"extends":"css"},less:{"extends":"css"},stylus:{"extends":"css"}},"system")});
|
||||||
emmet.exec(function(h,e){var g={"Cmd-E":"expand_abbreviation",Tab:"expand_abbreviation","Cmd-D":"match_pair_outward","Shift-Cmd-D":"match_pair_inward","Shift-Cmd-A":"wrap_with_abbreviation","Ctrl-Alt-Right":"next_edit_point","Ctrl-Alt-Left":"prev_edit_point","Cmd-L":"select_line","Cmd-Shift-M":"merge_lines","Cmd-/":"toggle_comment","Cmd-J":"split_join_tag","Cmd-K":"remove_tag","Shift-Cmd-Y":"evaluate_math_expression","Ctrl-Up":"increment_number_by_1","Ctrl-Down":"decrement_number_by_1","Alt-Up":"increment_number_by_01",
|
emmet.define("cm-editor-proxy",function(h,d){var f=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)||/Mac/.test(navigator.platform),i={"Cmd-E":"expand_abbreviation",Tab:"expand_abbreviation_with_tab","Cmd-D":"match_pair_outward","Shift-Cmd-D":"match_pair_inward","Cmd-T":"matching_pair","Shift-Cmd-A":"wrap_with_abbreviation","Ctrl-Alt-Right":"next_edit_point","Ctrl-Alt-Left":"prev_edit_point","Cmd-L":"select_line","Cmd-Shift-M":"merge_lines","Cmd-/":"toggle_comment",
|
||||||
"Alt-Down":"decrement_number_by_01","Ctrl-Alt-Up":"increment_number_by_10","Ctrl-Alt-Down":"decrement_number_by_10","Cmd-.":"select_next_item","Cmd-,":"select_previous_item","Cmd-B":"reflect_css_value",Enter:"insert_formatted_line_break"},f={"text/html":"html","application/xml":"xml","text/xsl":"xsl","text/css":"css","text/x-less":"less"};if(!(/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)||/Mac/.test(navigator.platform))){var c={};e.each(g,function(a,b){c[b.replace("Cmd",
|
"Cmd-J":"split_join_tag","Cmd-K":"remove_tag","Shift-Cmd-Y":"evaluate_math_expression","Ctrl-Up":"increment_number_by_1","Ctrl-Down":"decrement_number_by_1","Alt-Up":"increment_number_by_01","Alt-Down":"decrement_number_by_01","Ctrl-Alt-Up":"increment_number_by_10","Ctrl-Alt-Down":"decrement_number_by_10","Shift-Cmd-.":"select_next_item","Shift-Cmd-,":"select_previous_item","Cmd-B":"reflect_css_value",Enter:"insert_formatted_line_break_only"},b={"text/html":"html","application/xml":"xml","text/xsl":"xsl",
|
||||||
"Ctrl")]=a});g=c}CodeMirror.defaults.profile="html";var b={context:null,getSelectionRange:function(){var a=this.getCaretPos();return{start:a,end:a+this.getSelection().length}},createSelection:function(a,b){a==b?this.context.setCursor(this.context.posFromIndex(a)):this.context.setSelection(this.context.posFromIndex(a),this.context.posFromIndex(b))},getCurrentLineRange:function(){var a=this.context.getCursor(!0);return{start:this.context.indexFromPos({line:a.line,ch:0}),end:this.context.indexFromPos({line:a.line,
|
"text/css":"css","text/x-less":"less"};CodeMirror.defineOption?CodeMirror.defineOption("profile","html"):CodeMirror.defaults.profile="html";var c={context:null,getSelectionRange:function(){var a=this.getCaretPos();return{start:a,end:a+this.getSelection().length}},createSelection:function(a,b){a==b?this.context.setCursor(this.context.posFromIndex(a)):this.context.setSelection(this.context.posFromIndex(a),this.context.posFromIndex(b))},getCurrentLineRange:function(){var a=this.context.getCursor(!0);
|
||||||
ch:this.context.getLine(a.line).length})}},getCaretPos:function(){return this.context.indexFromPos(this.context.getCursor(!0))},setCaretPos:function(a){this.createSelection(a,a)},getCurrentLine:function(){return this.context.getLine(this.context.getCursor(!0).line)||""},replaceContent:function(a,b,c,f){e.isUndefined(c)&&(c=e.isUndefined(b)?content.length:b);e.isUndefined(b)&&(b=0);var g=h("utils");f||(a=g.padString(a,g.getLinePaddingFromPosition(this.getContent(),b)));var f=h("tabStops").extract(a,
|
return{start:this.context.indexFromPos({line:a.line,ch:0}),end:this.context.indexFromPos({line:a.line,ch:this.context.getLine(a.line).length})}},getCaretPos:function(){return this.context.indexFromPos(this.context.getCursor(!0))},setCaretPos:function(a){this.createSelection(a,a)},getCurrentLine:function(){return this.context.getLine(this.context.getCursor(!0).line)||""},replaceContent:function(a,b,c,f){d.isUndefined(c)&&(c=d.isUndefined(b)?content.length:b);d.isUndefined(b)&&(b=0);var i=h("utils");
|
||||||
{escape:function(a){return a}}),a=f.text,n=f.tabstops[0];n?(n.start+=b,n.end+=b):n={start:a.length+b,end:a.length+b};var m=this;this.context.compoundChange(function(){m.context.replaceRange(a,m.context.posFromIndex(b),m.context.posFromIndex(c));m.createSelection(n.start,n.end)})},getContent:function(){return this.context.getValue()},getSyntax:function(){var a=this.context.getOption("mode");a in f&&(a=f[a]);var b=this.getCaretPos();h("resources").hasSyntax(a)||(a="html");if(a=="html"){var c=h("html_matcher").getTags(this.getContent(),
|
f||(a=i.padString(a,i.getLinePaddingFromPosition(this.getContent(),b)));var f=h("tabStops").extract(a,{escape:function(a){return a}}),a=f.text,m=f.tabstops[0];m?(m.start+=b,m.end+=b):m={start:a.length+b,end:a.length+b};var n=this;(this.context.operation||this.context.compoundChange).call(this.context,function(){n.context.replaceRange(a,n.context.posFromIndex(b),n.context.posFromIndex(c));n.createSelection(m.start,m.end)})},getContent:function(){return this.context.getValue()},getSyntax:function(){var a=
|
||||||
b);c&&c[0]&&c[0].type=="tag"&&c[0].name.toLowerCase()=="style"&&c[0].end<=b&&c[1].start>=b&&(a="css")}return a},getProfileName:function(){if(this.context.getOption("profile"))return this.context.getOption("profile");switch(this.getSyntax()){case "xml":case "xsl":return"xml";case "html":var a=h("resources").getVariable("profile");a||(a=this.getContent().search(/<!DOCTYPE[^>]+XHTML/i)!=-1?"xhtml":"html");return a}return"xhtml"},prompt:function(a){return prompt(a)},getSelection:function(){return this.context.getSelection()||
|
this.context.getOption("mode");a in b&&(a=b[a]);return h("actionUtils").detectSyntax(this,a)},getProfileName:function(){return this.context.getOption("profile")?this.context.getOption("profile"):h("actionUtils").detectProfile(this)},prompt:function(a){return prompt(a)},getSelection:function(){return this.context.getSelection()||""},getFilePath:function(){return location.href},setupContext:function(a){this.context=a;var b="\t";a.getOption("indentWithTabs")||(b=h("utils").repeatString(" ",a.getOption("indentUnit")));
|
||||||
""},getFilePath:function(){return location.href}};if(!CodeMirror.defaults.extraKeys)CodeMirror.defaults.extraKeys={};e.each(g,function(a,c){CodeMirror.defaults.extraKeys[c]=function(c){b.context=c;var d="\t";c.getOption("indentWithTabs")||(d=h("utils").repeatString(" ",c.getOption("indentUnit")));h("resources").setVariable("indentation",d);try{if(h("actions").run(a,b))return!0}catch(e){}throw CodeMirror.Pass;}})});
|
h("resources").setVariable("indentation",b)},addAction:function(a,b){var d="emmet."+a;CodeMirror.commands[d]||(CodeMirror.commands[d]=function(b){c.setupContext(b);var d;if(d=a=="expand_abbreviation_with_tab")if(!(d=c.getSelection()))d=c.getSyntax(),d=!h("resources").hasSyntax(d);if(d)return CodeMirror.Pass;d=!0;try{var e=h("actions").run(a,c);(a=="next_edit_point"||a=="prev_edit_point")&&b.replaceSelection("");!e&&a=="insert_formatted_line_break_only"&&(d=!1)}catch(f){}if(!d)return CodeMirror.Pass;
|
||||||
|
});if(b){if(!CodeMirror.defaults.extraKeys)CodeMirror.defaults.extraKeys={};f||(b=b.replace("Cmd","Ctrl"));CodeMirror.defaults.extraKeys[b]=d}}};typeof emmetKeymap!="undefined"&&(i=emmetKeymap);d.each(i,c.addAction);return c});
|
||||||
|
|||||||
+371
-13
@@ -1,29 +1,387 @@
|
|||||||
// TODO number prefixes
|
|
||||||
(function() {
|
(function() {
|
||||||
// Really primitive kill-ring implementation.
|
"use strict";
|
||||||
|
|
||||||
|
var Pos = CodeMirror.Pos;
|
||||||
|
function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
|
||||||
|
|
||||||
|
// Kill 'ring'
|
||||||
|
|
||||||
var killRing = [];
|
var killRing = [];
|
||||||
function addToRing(str) {
|
function addToRing(str) {
|
||||||
killRing.push(str);
|
killRing.push(str);
|
||||||
if (killRing.length > 50) killRing.shift();
|
if (killRing.length > 50) killRing.shift();
|
||||||
}
|
}
|
||||||
function getFromRing() { return killRing[killRing.length - 1] || ""; }
|
function growRingTop(str) {
|
||||||
|
if (!killRing.length) return addToRing(str);
|
||||||
|
killRing[killRing.length - 1] += str;
|
||||||
|
}
|
||||||
|
function getFromRing(n) { return killRing[killRing.length - (n ? Math.min(n, 1) : 1)] || ""; }
|
||||||
function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }
|
function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }
|
||||||
|
|
||||||
CodeMirror.keyMap.emacs = {
|
var lastKill = null;
|
||||||
"Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");},
|
|
||||||
"Ctrl-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");},
|
function kill(cm, from, to, mayGrow, text) {
|
||||||
"Ctrl-Alt-W": function(cm) {addToRing(cm.getSelection()); cm.replaceSelection("");},
|
if (text == null) text = cm.getRange(from, to);
|
||||||
"Alt-W": function(cm) {addToRing(cm.getSelection());},
|
|
||||||
"Ctrl-Y": function(cm) {cm.replaceSelection(getFromRing());},
|
if (mayGrow && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))
|
||||||
|
growRingTop(text);
|
||||||
|
else
|
||||||
|
addToRing(text);
|
||||||
|
cm.replaceRange("", from, to, "+delete");
|
||||||
|
|
||||||
|
if (mayGrow) lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};
|
||||||
|
else lastKill = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Boundaries of various units
|
||||||
|
|
||||||
|
function byChar(cm, pos, dir) {
|
||||||
|
return cm.findPosH(pos, dir, "char", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function byWord(cm, pos, dir) {
|
||||||
|
return cm.findPosH(pos, dir, "word", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function byLine(cm, pos, dir) {
|
||||||
|
return cm.findPosV(pos, dir, "line", cm.doc.sel.goalColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
function byPage(cm, pos, dir) {
|
||||||
|
return cm.findPosV(pos, dir, "page", cm.doc.sel.goalColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
function byParagraph(cm, pos, dir) {
|
||||||
|
var no = pos.line, line = cm.getLine(no);
|
||||||
|
var sawText = /\S/.test(dir < 0 ? line.slice(0, pos.ch) : line.slice(pos.ch));
|
||||||
|
var fst = cm.firstLine(), lst = cm.lastLine();
|
||||||
|
for (;;) {
|
||||||
|
no += dir;
|
||||||
|
if (no < fst || no > lst)
|
||||||
|
return cm.clipPos(Pos(no - dir, dir < 0 ? 0 : null));
|
||||||
|
line = cm.getLine(no);
|
||||||
|
var hasText = /\S/.test(line);
|
||||||
|
if (hasText) sawText = true;
|
||||||
|
else if (sawText) return Pos(no, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function bySentence(cm, pos, dir) {
|
||||||
|
var line = pos.line, ch = pos.ch;
|
||||||
|
var text = cm.getLine(pos.line), sawWord = false;
|
||||||
|
for (;;) {
|
||||||
|
var next = text.charAt(ch + (dir < 0 ? -1 : 0));
|
||||||
|
if (!next) { // End/beginning of line reached
|
||||||
|
if (line == (dir < 0 ? cm.firstLine() : cm.lastLine())) return Pos(line, ch);
|
||||||
|
text = cm.getLine(line + dir);
|
||||||
|
if (!/\S/.test(text)) return Pos(line, ch);
|
||||||
|
line += dir;
|
||||||
|
ch = dir < 0 ? text.length : 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (sawWord && /[!?.]/.test(next)) return Pos(line, ch + (dir > 0 ? 1 : 0));
|
||||||
|
if (!sawWord) sawWord = /\w/.test(next);
|
||||||
|
ch += dir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function byExpr(cm, pos, dir) {
|
||||||
|
var wrap;
|
||||||
|
if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, true))
|
||||||
|
&& wrap.match && (wrap.forward ? 1 : -1) == dir)
|
||||||
|
return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to;
|
||||||
|
|
||||||
|
for (var first = true;; first = false) {
|
||||||
|
var token = cm.getTokenAt(pos);
|
||||||
|
var after = Pos(pos.line, dir < 0 ? token.start : token.end);
|
||||||
|
if (first && dir > 0 && token.end == pos.ch || !/\w/.test(token.string)) {
|
||||||
|
var newPos = cm.findPosH(after, dir, "char");
|
||||||
|
if (posEq(after, newPos)) return pos;
|
||||||
|
else pos = newPos;
|
||||||
|
} else {
|
||||||
|
return after;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prefixes (only crudely supported)
|
||||||
|
|
||||||
|
function getPrefix(cm, precise) {
|
||||||
|
var digits = cm.state.emacsPrefix;
|
||||||
|
if (!digits) return precise ? null : 1;
|
||||||
|
clearPrefix(cm);
|
||||||
|
return digits == "-" ? -1 : Number(digits);
|
||||||
|
}
|
||||||
|
|
||||||
|
function repeated(cmd) {
|
||||||
|
var f = typeof cmd == "string" ? function(cm) { cm.execCommand(cmd); } : cmd;
|
||||||
|
return function(cm) {
|
||||||
|
var prefix = getPrefix(cm);
|
||||||
|
f(cm);
|
||||||
|
for (var i = 1; i < prefix; ++i) f(cm);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function findEnd(cm, by, dir) {
|
||||||
|
var pos = cm.getCursor(), prefix = getPrefix(cm);
|
||||||
|
if (prefix < 0) { dir = -dir; prefix = -prefix; }
|
||||||
|
for (var i = 0; i < prefix; ++i) {
|
||||||
|
var newPos = by(cm, pos, dir);
|
||||||
|
if (posEq(newPos, pos)) break;
|
||||||
|
pos = newPos;
|
||||||
|
}
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
function move(by, dir) {
|
||||||
|
var f = function(cm) {
|
||||||
|
cm.extendSelection(findEnd(cm, by, dir));
|
||||||
|
};
|
||||||
|
f.motion = true;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
function killTo(cm, by, dir) {
|
||||||
|
kill(cm, cm.getCursor(), findEnd(cm, by, dir), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addPrefix(cm, digit) {
|
||||||
|
if (cm.state.emacsPrefix) {
|
||||||
|
if (digit != "-") cm.state.emacsPrefix += digit;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Not active yet
|
||||||
|
cm.state.emacsPrefix = digit;
|
||||||
|
cm.on("keyHandled", maybeClearPrefix);
|
||||||
|
cm.on("inputRead", maybeDuplicateInput);
|
||||||
|
}
|
||||||
|
|
||||||
|
var prefixPreservingKeys = {"Alt-G": true, "Ctrl-X": true, "Ctrl-Q": true, "Ctrl-U": true};
|
||||||
|
|
||||||
|
function maybeClearPrefix(cm, arg) {
|
||||||
|
if (!cm.state.emacsPrefixMap && !prefixPreservingKeys.hasOwnProperty(arg))
|
||||||
|
clearPrefix(cm);
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearPrefix(cm) {
|
||||||
|
cm.state.emacsPrefix = null;
|
||||||
|
cm.off("keyHandled", maybeClearPrefix);
|
||||||
|
cm.off("inputRead", maybeDuplicateInput);
|
||||||
|
}
|
||||||
|
|
||||||
|
function maybeDuplicateInput(cm, event) {
|
||||||
|
var dup = getPrefix(cm);
|
||||||
|
if (dup > 1 && event.origin == "+input") {
|
||||||
|
var one = event.text.join("\n"), txt = "";
|
||||||
|
for (var i = 1; i < dup; ++i) txt += one;
|
||||||
|
cm.replaceSelection(txt, "end", "+input");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addPrefixMap(cm) {
|
||||||
|
cm.state.emacsPrefixMap = true;
|
||||||
|
cm.addKeyMap(prefixMap);
|
||||||
|
cm.on("keyHandled", maybeRemovePrefixMap);
|
||||||
|
cm.on("inputRead", maybeRemovePrefixMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
function maybeRemovePrefixMap(cm, arg) {
|
||||||
|
if (typeof arg == "string" && (/^\d$/.test(arg) || arg == "Ctrl-U")) return;
|
||||||
|
cm.removeKeyMap(prefixMap);
|
||||||
|
cm.state.emacsPrefixMap = false;
|
||||||
|
cm.off("keyHandled", maybeRemovePrefixMap);
|
||||||
|
cm.off("inputRead", maybeRemovePrefixMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Utilities
|
||||||
|
|
||||||
|
function setMark(cm) {
|
||||||
|
cm.setCursor(cm.getCursor());
|
||||||
|
cm.setExtending(true);
|
||||||
|
cm.on("change", function() { cm.setExtending(false); });
|
||||||
|
}
|
||||||
|
|
||||||
|
function getInput(cm, msg, f) {
|
||||||
|
if (cm.openDialog)
|
||||||
|
cm.openDialog(msg + ": <input type=\"text\" style=\"width: 10em\"/>", f, {bottom: true});
|
||||||
|
else
|
||||||
|
f(prompt(msg, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
function operateOnWord(cm, op) {
|
||||||
|
var start = cm.getCursor(), end = cm.findPosH(start, 1, "word");
|
||||||
|
cm.replaceRange(op(cm.getRange(start, end)), start, end);
|
||||||
|
cm.setCursor(end);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toEnclosingExpr(cm) {
|
||||||
|
var pos = cm.getCursor(), line = pos.line, ch = pos.ch;
|
||||||
|
var stack = [];
|
||||||
|
while (line >= cm.firstLine()) {
|
||||||
|
var text = cm.getLine(line);
|
||||||
|
for (var i = ch == null ? text.length : ch; i > 0;) {
|
||||||
|
var ch = text.charAt(--i);
|
||||||
|
if (ch == ")")
|
||||||
|
stack.push("(");
|
||||||
|
else if (ch == "]")
|
||||||
|
stack.push("[");
|
||||||
|
else if (ch == "}")
|
||||||
|
stack.push("{");
|
||||||
|
else if (/[\(\{\[]/.test(ch) && (!stack.length || stack.pop() != ch))
|
||||||
|
return cm.extendSelection(Pos(line, i));
|
||||||
|
}
|
||||||
|
--line; ch = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Actual keymap
|
||||||
|
|
||||||
|
var keyMap = CodeMirror.keyMap.emacs = {
|
||||||
|
"Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"));},
|
||||||
|
"Ctrl-K": repeated(function(cm) {
|
||||||
|
var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));
|
||||||
|
var text = cm.getRange(start, end);
|
||||||
|
if (!/\S/.test(text)) {
|
||||||
|
text += "\n";
|
||||||
|
end = Pos(start.line + 1, 0);
|
||||||
|
}
|
||||||
|
kill(cm, start, end, true, text);
|
||||||
|
}),
|
||||||
|
"Alt-W": function(cm) {
|
||||||
|
addToRing(cm.getSelection());
|
||||||
|
},
|
||||||
|
"Ctrl-Y": function(cm) {
|
||||||
|
var start = cm.getCursor();
|
||||||
|
cm.replaceRange(getFromRing(getPrefix(cm)), start, start, "paste");
|
||||||
|
cm.setSelection(start, cm.getCursor());
|
||||||
|
},
|
||||||
"Alt-Y": function(cm) {cm.replaceSelection(popFromRing());},
|
"Alt-Y": function(cm) {cm.replaceSelection(popFromRing());},
|
||||||
"Ctrl-/": "undo", "Shift-Ctrl--": "undo", "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
|
|
||||||
|
"Ctrl-Space": setMark, "Ctrl-Shift-2": setMark,
|
||||||
|
|
||||||
|
"Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1),
|
||||||
|
"Right": move(byChar, 1), "Left": move(byChar, -1),
|
||||||
|
"Ctrl-D": function(cm) { killTo(cm, byChar, 1); },
|
||||||
|
"Delete": function(cm) { killTo(cm, byChar, 1); },
|
||||||
|
"Ctrl-H": function(cm) { killTo(cm, byChar, -1); },
|
||||||
|
"Backspace": function(cm) { killTo(cm, byChar, -1); },
|
||||||
|
|
||||||
|
"Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1),
|
||||||
|
"Alt-D": function(cm) { killTo(cm, byWord, 1); },
|
||||||
|
"Alt-Backspace": function(cm) { killTo(cm, byWord, -1); },
|
||||||
|
|
||||||
|
"Ctrl-N": move(byLine, 1), "Ctrl-P": move(byLine, -1),
|
||||||
|
"Down": move(byLine, 1), "Up": move(byLine, -1),
|
||||||
|
"Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
|
||||||
|
"End": "goLineEnd", "Home": "goLineStart",
|
||||||
|
|
||||||
|
"Alt-V": move(byPage, -1), "Ctrl-V": move(byPage, 1),
|
||||||
|
"PageUp": move(byPage, -1), "PageDown": move(byPage, 1),
|
||||||
|
|
||||||
|
"Ctrl-Up": move(byParagraph, -1), "Ctrl-Down": move(byParagraph, 1),
|
||||||
|
|
||||||
|
"Alt-A": move(bySentence, -1), "Alt-E": move(bySentence, 1),
|
||||||
|
"Alt-K": function(cm) { killTo(cm, bySentence, 1); },
|
||||||
|
|
||||||
|
"Ctrl-Alt-K": function(cm) { killTo(cm, byExpr, 1); },
|
||||||
|
"Ctrl-Alt-Backspace": function(cm) { killTo(cm, byExpr, -1); },
|
||||||
|
"Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1),
|
||||||
|
|
||||||
|
"Shift-Ctrl-Alt-2": function(cm) {
|
||||||
|
cm.setSelection(findEnd(cm, byExpr, 1), cm.getCursor());
|
||||||
|
},
|
||||||
|
"Ctrl-Alt-T": function(cm) {
|
||||||
|
var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1);
|
||||||
|
var rightEnd = byExpr(cm, leftEnd, 1), rightStart = byExpr(cm, rightEnd, -1);
|
||||||
|
cm.replaceRange(cm.getRange(rightStart, rightEnd) + cm.getRange(leftEnd, rightStart) +
|
||||||
|
cm.getRange(leftStart, leftEnd), leftStart, rightEnd);
|
||||||
|
},
|
||||||
|
"Ctrl-Alt-U": repeated(toEnclosingExpr),
|
||||||
|
|
||||||
|
"Alt-Space": function(cm) {
|
||||||
|
var pos = cm.getCursor(), from = pos.ch, to = pos.ch, text = cm.getLine(pos.line);
|
||||||
|
while (from && /\s/.test(text.charAt(from - 1))) --from;
|
||||||
|
while (to < text.length && /\s/.test(text.charAt(to))) ++to;
|
||||||
|
cm.replaceRange(" ", Pos(pos.line, from), Pos(pos.line, to));
|
||||||
|
},
|
||||||
|
"Ctrl-O": repeated(function(cm) { cm.replaceSelection("\n", "start"); }),
|
||||||
|
"Ctrl-T": repeated(function(cm) {
|
||||||
|
var pos = cm.getCursor();
|
||||||
|
if (pos.ch < cm.getLine(pos.line).length) pos = Pos(pos.line, pos.ch + 1);
|
||||||
|
var from = cm.findPosH(pos, -2, "char");
|
||||||
|
var range = cm.getRange(from, pos);
|
||||||
|
if (range.length != 2) return;
|
||||||
|
cm.setSelection(from, pos);
|
||||||
|
cm.replaceSelection(range.charAt(1) + range.charAt(0), "end");
|
||||||
|
}),
|
||||||
|
|
||||||
|
"Alt-C": repeated(function(cm) {
|
||||||
|
operateOnWord(cm, function(w) {
|
||||||
|
var letter = w.search(/\w/);
|
||||||
|
if (letter == -1) return w;
|
||||||
|
return w.slice(0, letter) + w.charAt(letter).toUpperCase() + w.slice(letter + 1).toLowerCase();
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
"Alt-U": repeated(function(cm) {
|
||||||
|
operateOnWord(cm, function(w) { return w.toUpperCase(); });
|
||||||
|
}),
|
||||||
|
"Alt-L": repeated(function(cm) {
|
||||||
|
operateOnWord(cm, function(w) { return w.toLowerCase(); });
|
||||||
|
}),
|
||||||
|
|
||||||
|
"Alt-;": "toggleComment",
|
||||||
|
|
||||||
|
"Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"),
|
||||||
|
"Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"),
|
||||||
|
"Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
|
||||||
"Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace",
|
"Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace",
|
||||||
"Ctrl-Z": "undo", "Cmd-Z": "undo", "Alt-/": "autocomplete",
|
"Alt-/": "autocomplete",
|
||||||
fallthrough: ["basic", "emacsy"]
|
"Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto",
|
||||||
|
|
||||||
|
"Alt-G": function(cm) {cm.setOption("keyMap", "emacs-Alt-G");},
|
||||||
|
"Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");},
|
||||||
|
"Ctrl-Q": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-Q");},
|
||||||
|
"Ctrl-U": addPrefixMap
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeMirror.keyMap["emacs-Ctrl-X"] = {
|
CodeMirror.keyMap["emacs-Ctrl-X"] = {
|
||||||
"Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": "undo", "K": "close",
|
"Tab": function(cm) {
|
||||||
|
cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit"));
|
||||||
|
},
|
||||||
|
"Ctrl-X": function(cm) {
|
||||||
|
cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor"));
|
||||||
|
},
|
||||||
|
|
||||||
|
"Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": repeated("undo"), "K": "close",
|
||||||
|
"Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), true); },
|
||||||
|
auto: "emacs", nofallthrough: true, disableInput: true
|
||||||
|
};
|
||||||
|
|
||||||
|
CodeMirror.keyMap["emacs-Alt-G"] = {
|
||||||
|
"G": function(cm) {
|
||||||
|
var prefix = getPrefix(cm, true);
|
||||||
|
if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1);
|
||||||
|
|
||||||
|
getInput(cm, "Goto line", function(str) {
|
||||||
|
var num;
|
||||||
|
if (str && !isNaN(num = Number(str)) && num == num|0 && num > 0)
|
||||||
|
cm.setCursor(num - 1);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
auto: "emacs", nofallthrough: true, disableInput: true
|
||||||
|
};
|
||||||
|
|
||||||
|
CodeMirror.keyMap["emacs-Ctrl-Q"] = {
|
||||||
|
"Tab": repeated("insertTab"),
|
||||||
auto: "emacs", nofallthrough: true
|
auto: "emacs", nofallthrough: true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var prefixMap = {"Ctrl-G": clearPrefix};
|
||||||
|
function regPrefix(d) {
|
||||||
|
prefixMap[d] = function(cm) { addPrefix(cm, d); };
|
||||||
|
keyMap["Ctrl-" + d] = function(cm) { addPrefix(cm, d); };
|
||||||
|
prefixPreservingKeys["Ctrl-" + d] = true;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < 10; ++i) regPrefix(String(i));
|
||||||
|
regPrefix("-");
|
||||||
})();
|
})();
|
||||||
|
|||||||
+3624
-744
File diff suppressed because it is too large
Load Diff
+199
-109
@@ -1,173 +1,263 @@
|
|||||||
.CodeMirror {
|
/* BASICS */
|
||||||
line-height: 1em;
|
|
||||||
font-family: monospace;
|
|
||||||
|
|
||||||
/* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */
|
.CodeMirror {
|
||||||
|
/* Set height, width, borders, and global font properties here */
|
||||||
|
font-family: monospace;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
.CodeMirror-scroll {
|
||||||
|
/* Set scrolling behaviour here */
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PADDING */
|
||||||
|
|
||||||
|
.CodeMirror-lines {
|
||||||
|
padding: 4px 0; /* Vertical padding around content */
|
||||||
|
}
|
||||||
|
.CodeMirror pre {
|
||||||
|
padding: 0 4px; /* Horizontal padding of content */
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||||
|
background-color: white; /* The little square between H and V scrollbars */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* GUTTER */
|
||||||
|
|
||||||
|
.CodeMirror-gutters {
|
||||||
|
border-right: 1px solid #ddd;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.CodeMirror-linenumbers {}
|
||||||
|
.CodeMirror-linenumber {
|
||||||
|
padding: 0 3px 0 5px;
|
||||||
|
min-width: 20px;
|
||||||
|
text-align: right;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* CURSOR */
|
||||||
|
|
||||||
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
|
border-left: 1px solid black;
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
/* Shown when moving in bi-directional text */
|
||||||
|
.CodeMirror div.CodeMirror-secondarycursor {
|
||||||
|
border-left: 1px solid silver;
|
||||||
|
}
|
||||||
|
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
||||||
|
width: auto;
|
||||||
|
border: 0;
|
||||||
|
background: #7e7;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
/* Can style cursor different in overwrite (non-insert) mode */
|
||||||
|
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||||
|
|
||||||
|
.cm-tab { display: inline-block; }
|
||||||
|
|
||||||
|
/* DEFAULT THEME */
|
||||||
|
|
||||||
|
.cm-s-default .cm-keyword {color: #708;}
|
||||||
|
.cm-s-default .cm-atom {color: #219;}
|
||||||
|
.cm-s-default .cm-number {color: #164;}
|
||||||
|
.cm-s-default .cm-def {color: #00f;}
|
||||||
|
.cm-s-default .cm-variable {color: black;}
|
||||||
|
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||||
|
.cm-s-default .cm-variable-3 {color: #085;}
|
||||||
|
.cm-s-default .cm-property {color: black;}
|
||||||
|
.cm-s-default .cm-operator {color: black;}
|
||||||
|
.cm-s-default .cm-comment {color: #a50;}
|
||||||
|
.cm-s-default .cm-string {color: #a11;}
|
||||||
|
.cm-s-default .cm-string-2 {color: #f50;}
|
||||||
|
.cm-s-default .cm-meta {color: #555;}
|
||||||
|
.cm-s-default .cm-error {color: #f00;}
|
||||||
|
.cm-s-default .cm-qualifier {color: #555;}
|
||||||
|
.cm-s-default .cm-builtin {color: #30a;}
|
||||||
|
.cm-s-default .cm-bracket {color: #997;}
|
||||||
|
.cm-s-default .cm-tag {color: #170;}
|
||||||
|
.cm-s-default .cm-attribute {color: #00c;}
|
||||||
|
.cm-s-default .cm-header {color: blue;}
|
||||||
|
.cm-s-default .cm-quote {color: #090;}
|
||||||
|
.cm-s-default .cm-hr {color: #999;}
|
||||||
|
.cm-s-default .cm-link {color: #00c;}
|
||||||
|
|
||||||
|
.cm-negative {color: #d44;}
|
||||||
|
.cm-positive {color: #292;}
|
||||||
|
.cm-header, .cm-strong {font-weight: bold;}
|
||||||
|
.cm-em {font-style: italic;}
|
||||||
|
.cm-link {text-decoration: underline;}
|
||||||
|
|
||||||
|
.cm-invalidchar {color: #f00;}
|
||||||
|
|
||||||
|
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||||
|
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
||||||
|
.CodeMirror-activeline-background {background: #e8f2ff;}
|
||||||
|
|
||||||
|
/* STOP */
|
||||||
|
|
||||||
|
/* The rest of this file contains styles related to the mechanics of
|
||||||
|
the editor. You probably shouldn't touch them. */
|
||||||
|
|
||||||
|
.CodeMirror {
|
||||||
|
line-height: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
/* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
background: white;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scroll {
|
.CodeMirror-scroll {
|
||||||
overflow: auto;
|
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||||
height: 300px;
|
/* See overflow: hidden in .CodeMirror */
|
||||||
/* This is needed to prevent an IE[67] bug where the scrolled content
|
margin-bottom: -30px; margin-right: -30px;
|
||||||
is visible outside of the scrolling box. */
|
padding-bottom: 30px; padding-right: 30px;
|
||||||
|
height: 100%;
|
||||||
|
outline: none; /* Prevent dragging from highlighting the element */
|
||||||
|
position: relative;
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
.CodeMirror-sizer {
|
||||||
position: relative;
|
position: relative;
|
||||||
outline: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Vertical scrollbar */
|
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||||
.CodeMirror-scrollbar {
|
before actuall scrolling happens, thus preventing shaking and
|
||||||
|
flickering artifacts. */
|
||||||
|
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
z-index: 6;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.CodeMirror-vscrollbar {
|
||||||
right: 0; top: 0;
|
right: 0; top: 0;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
z-index: 5;
|
|
||||||
}
|
}
|
||||||
.CodeMirror-scrollbar-inner {
|
.CodeMirror-hscrollbar {
|
||||||
/* This needs to have a nonzero width in order for the scrollbar to appear
|
bottom: 0; left: 0;
|
||||||
in Firefox and IE9. */
|
overflow-y: hidden;
|
||||||
width: 1px;
|
overflow-x: scroll;
|
||||||
}
|
}
|
||||||
.CodeMirror-scrollbar.cm-sb-overlap {
|
.CodeMirror-scrollbar-filler {
|
||||||
/* Ensure that the scrollbar appears in Lion, and that it overlaps the content
|
right: 0; bottom: 0;
|
||||||
rather than sitting to the right of it. */
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1;
|
|
||||||
float: none;
|
|
||||||
right: 0;
|
|
||||||
min-width: 12px;
|
|
||||||
}
|
}
|
||||||
.CodeMirror-scrollbar.cm-sb-nonoverlap {
|
.CodeMirror-gutter-filler {
|
||||||
min-width: 12px;
|
left: 0; bottom: 0;
|
||||||
}
|
|
||||||
.CodeMirror-scrollbar.cm-sb-ie7 {
|
|
||||||
min-width: 18px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-gutter {
|
.CodeMirror-gutters {
|
||||||
position: absolute; left: 0; top: 0;
|
position: absolute; left: 0; top: 0;
|
||||||
z-index: 10;
|
padding-bottom: 30px;
|
||||||
background-color: #f7f7f7;
|
z-index: 3;
|
||||||
border-right: 1px solid #eee;
|
}
|
||||||
min-width: 2em;
|
.CodeMirror-gutter {
|
||||||
|
white-space: normal;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
box-sizing: content-box;
|
||||||
|
padding-bottom: 30px;
|
||||||
|
margin-bottom: -32px;
|
||||||
|
display: inline-block;
|
||||||
|
/* Hack to make IE7 behave */
|
||||||
|
*zoom:1;
|
||||||
|
*display:inline;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter-text {
|
.CodeMirror-gutter-elt {
|
||||||
color: #aaa;
|
position: absolute;
|
||||||
text-align: right;
|
|
||||||
padding: .4em .2em .4em .4em;
|
|
||||||
white-space: pre !important;
|
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
z-index: 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-lines {
|
.CodeMirror-lines {
|
||||||
padding: .4em;
|
|
||||||
white-space: pre;
|
|
||||||
cursor: text;
|
cursor: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror pre {
|
.CodeMirror pre {
|
||||||
-moz-border-radius: 0;
|
/* Reset some styles that the rest of the page might have set */
|
||||||
-webkit-border-radius: 0;
|
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||||
-o-border-radius: 0;
|
border-width: 0;
|
||||||
border-radius: 0;
|
background: transparent;
|
||||||
border-width: 0; margin: 0; padding: 0; background: transparent;
|
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
padding: 0; margin: 0;
|
margin: 0;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
z-index: 2;
|
||||||
|
position: relative;
|
||||||
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-wrap pre {
|
.CodeMirror-wrap pre {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: normal;
|
word-break: normal;
|
||||||
}
|
}
|
||||||
|
.CodeMirror-code pre {
|
||||||
|
border-right: 30px solid transparent;
|
||||||
|
width: -webkit-fit-content;
|
||||||
|
width: -moz-fit-content;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
.CodeMirror-wrap .CodeMirror-code pre {
|
||||||
|
border-right: none;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
.CodeMirror-linebackground {
|
||||||
|
position: absolute;
|
||||||
|
left: 0; right: 0; top: 0; bottom: 0;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-linewidget {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-widget {}
|
||||||
|
|
||||||
.CodeMirror-wrap .CodeMirror-scroll {
|
.CodeMirror-wrap .CodeMirror-scroll {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror textarea {
|
.CodeMirror-measure {
|
||||||
outline: none !important;
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
.CodeMirror-measure pre { position: static; }
|
||||||
|
|
||||||
.CodeMirror pre.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
z-index: 10;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
border-left: 1px solid black;
|
|
||||||
border-right: none;
|
border-right: none;
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
|
.CodeMirror-focused div.CodeMirror-cursor {
|
||||||
width: auto;
|
|
||||||
border: 0;
|
|
||||||
background: transparent;
|
|
||||||
background: rgba(0, 200, 0, .4);
|
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
|
||||||
}
|
|
||||||
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
|
||||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
|
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
|
||||||
}
|
|
||||||
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
|
|
||||||
.CodeMirror-focused pre.CodeMirror-cursor {
|
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.CodeMirror-selected { background: #d9d9d9; }
|
.CodeMirror-selected { background: #d9d9d9; }
|
||||||
.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
|
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||||
|
|
||||||
.CodeMirror-searching {
|
.cm-searching {
|
||||||
background: #ffa;
|
background: #ffa;
|
||||||
background: rgba(255, 255, 0, .4);
|
background: rgba(255, 255, 0, .4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default theme */
|
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
||||||
|
.CodeMirror span { *vertical-align: text-bottom; }
|
||||||
.cm-s-default span.cm-keyword {color: #708;}
|
|
||||||
.cm-s-default span.cm-atom {color: #219;}
|
|
||||||
.cm-s-default span.cm-number {color: #164;}
|
|
||||||
.cm-s-default span.cm-def {color: #00f;}
|
|
||||||
.cm-s-default span.cm-variable {color: black;}
|
|
||||||
.cm-s-default span.cm-variable-2 {color: #05a;}
|
|
||||||
.cm-s-default span.cm-variable-3 {color: #085;}
|
|
||||||
.cm-s-default span.cm-property {color: black;}
|
|
||||||
.cm-s-default span.cm-operator {color: black;}
|
|
||||||
.cm-s-default span.cm-comment {color: #a50;}
|
|
||||||
.cm-s-default span.cm-string {color: #a11;}
|
|
||||||
.cm-s-default span.cm-string-2 {color: #f50;}
|
|
||||||
.cm-s-default span.cm-meta {color: #555;}
|
|
||||||
.cm-s-default span.cm-error {color: #f00;}
|
|
||||||
.cm-s-default span.cm-qualifier {color: #555;}
|
|
||||||
.cm-s-default span.cm-builtin {color: #30a;}
|
|
||||||
.cm-s-default span.cm-bracket {color: #cc7;}
|
|
||||||
.cm-s-default span.cm-tag {color: #170;}
|
|
||||||
.cm-s-default span.cm-attribute {color: #00c;}
|
|
||||||
.cm-s-default span.cm-header {color: blue;}
|
|
||||||
.cm-s-default span.cm-quote {color: #090;}
|
|
||||||
.cm-s-default span.cm-hr {color: #999;}
|
|
||||||
.cm-s-default span.cm-link {color: #00c;}
|
|
||||||
|
|
||||||
span.cm-header, span.cm-strong {font-weight: bold;}
|
|
||||||
span.cm-em {font-style: italic;}
|
|
||||||
span.cm-emstrong {font-style: italic; font-weight: bold;}
|
|
||||||
span.cm-link {text-decoration: underline;}
|
|
||||||
|
|
||||||
span.cm-invalidchar {color: #f00;}
|
|
||||||
|
|
||||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
|
||||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
|
|
||||||
/* Hide the cursor when printing */
|
/* Hide the cursor when printing */
|
||||||
.CodeMirror pre.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+5384
-2734
File diff suppressed because it is too large
Load Diff
@@ -1,164 +0,0 @@
|
|||||||
/**
|
|
||||||
* Tag-closer extension for CodeMirror.
|
|
||||||
*
|
|
||||||
* This extension adds a "closeTag" utility function that can be used with key bindings to
|
|
||||||
* insert a matching end tag after the ">" character of a start tag has been typed. It can
|
|
||||||
* also complete "</" if a matching start tag is found. It will correctly ignore signal
|
|
||||||
* characters for empty tags, comments, CDATA, etc.
|
|
||||||
*
|
|
||||||
* The function depends on internal parser state to identify tags. It is compatible with the
|
|
||||||
* following CodeMirror modes and will ignore all others:
|
|
||||||
* - htmlmixed
|
|
||||||
* - xml
|
|
||||||
*
|
|
||||||
* See demos/closetag.html for a usage example.
|
|
||||||
*
|
|
||||||
* @author Nathan Williams <nathan@nlwillia.net>
|
|
||||||
* Contributed under the same license terms as CodeMirror.
|
|
||||||
*/
|
|
||||||
(function() {
|
|
||||||
/** Option that allows tag closing behavior to be toggled. Default is true. */
|
|
||||||
CodeMirror.defaults['closeTagEnabled'] = true;
|
|
||||||
|
|
||||||
/** Array of tag names to add indentation after the start tag for. Default is the list of block-level html tags. */
|
|
||||||
CodeMirror.defaults['closeTagIndent'] = ['applet', 'blockquote', 'body', 'button', 'div', 'dl', 'fieldset', 'form', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'html', 'iframe', 'layer', 'legend', 'object', 'ol', 'p', 'select', 'table', 'ul'];
|
|
||||||
|
|
||||||
/** Array of tag names where an end tag is forbidden. */
|
|
||||||
CodeMirror.defaults['closeTagVoid'] = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Call during key processing to close tags. Handles the key event if the tag is closed, otherwise throws CodeMirror.Pass.
|
|
||||||
* - cm: The editor instance.
|
|
||||||
* - ch: The character being processed.
|
|
||||||
* - indent: Optional. An array of tag names to indent when closing. Omit or pass true to use the default indentation tag list defined in the 'closeTagIndent' option.
|
|
||||||
* Pass false to disable indentation. Pass an array to override the default list of tag names.
|
|
||||||
* - vd: Optional. An array of tag names that should not be closed. Omit to use the default void (end tag forbidden) tag list defined in the 'closeTagVoid' option. Ignored in xml mode.
|
|
||||||
*/
|
|
||||||
CodeMirror.defineExtension("closeTag", function(cm, ch, indent, vd) {
|
|
||||||
if (!cm.getOption('closeTagEnabled')) {
|
|
||||||
throw CodeMirror.Pass;
|
|
||||||
}
|
|
||||||
|
|
||||||
var mode = cm.getOption('mode');
|
|
||||||
|
|
||||||
if (mode == 'text/html' || mode == 'xml') {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Relevant structure of token:
|
|
||||||
*
|
|
||||||
* htmlmixed
|
|
||||||
* className
|
|
||||||
* state
|
|
||||||
* htmlState
|
|
||||||
* type
|
|
||||||
* tagName
|
|
||||||
* context
|
|
||||||
* tagName
|
|
||||||
* mode
|
|
||||||
*
|
|
||||||
* xml
|
|
||||||
* className
|
|
||||||
* state
|
|
||||||
* tagName
|
|
||||||
* type
|
|
||||||
*/
|
|
||||||
|
|
||||||
var pos = cm.getCursor();
|
|
||||||
var tok = cm.getTokenAt(pos);
|
|
||||||
var state = tok.state;
|
|
||||||
|
|
||||||
if (state.mode && state.mode != 'html') {
|
|
||||||
throw CodeMirror.Pass; // With htmlmixed, we only care about the html sub-mode.
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ch == '>') {
|
|
||||||
var type = state.htmlState ? state.htmlState.type : state.type; // htmlmixed : xml
|
|
||||||
|
|
||||||
if (tok.className == 'tag' && type == 'closeTag') {
|
|
||||||
throw CodeMirror.Pass; // Don't process the '>' at the end of an end-tag.
|
|
||||||
}
|
|
||||||
|
|
||||||
cm.replaceSelection('>'); // Mode state won't update until we finish the tag.
|
|
||||||
pos = {line: pos.line, ch: pos.ch + 1};
|
|
||||||
cm.setCursor(pos);
|
|
||||||
|
|
||||||
tok = cm.getTokenAt(cm.getCursor());
|
|
||||||
state = tok.state;
|
|
||||||
type = state.htmlState ? state.htmlState.type : state.type; // htmlmixed : xml
|
|
||||||
|
|
||||||
if (tok.className == 'tag' && type != 'selfcloseTag') {
|
|
||||||
var tagName = state.htmlState ? state.htmlState.tagName : state.tagName; // htmlmixed : xml
|
|
||||||
if (tagName.length > 0 && shouldClose(cm, vd, tagName)) {
|
|
||||||
insertEndTag(cm, indent, pos, tagName);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Undo the '>' insert and allow cm to handle the key instead.
|
|
||||||
cm.setSelection({line: pos.line, ch: pos.ch - 1}, pos);
|
|
||||||
cm.replaceSelection("");
|
|
||||||
|
|
||||||
} else if (ch == '/') {
|
|
||||||
if (tok.className == 'tag' && tok.string == '<') {
|
|
||||||
var tagName = state.htmlState ? (state.htmlState.context ? state.htmlState.context.tagName : '') : (state.context ? state.context.tagName : ''); // htmlmixed : xml
|
|
||||||
if (tagName.length > 0) {
|
|
||||||
completeEndTag(cm, pos, tagName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
throw CodeMirror.Pass; // Bubble if not handled
|
|
||||||
});
|
|
||||||
|
|
||||||
function insertEndTag(cm, indent, pos, tagName) {
|
|
||||||
if (shouldIndent(cm, indent, tagName)) {
|
|
||||||
cm.replaceSelection('\n\n</' + tagName + '>', 'end');
|
|
||||||
cm.indentLine(pos.line + 1);
|
|
||||||
cm.indentLine(pos.line + 2);
|
|
||||||
cm.setCursor({line: pos.line + 1, ch: cm.getLine(pos.line + 1).length});
|
|
||||||
} else {
|
|
||||||
cm.replaceSelection('</' + tagName + '>');
|
|
||||||
cm.setCursor(pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function shouldIndent(cm, indent, tagName) {
|
|
||||||
if (typeof indent == 'undefined' || indent == null || indent == true) {
|
|
||||||
indent = cm.getOption('closeTagIndent');
|
|
||||||
}
|
|
||||||
if (!indent) {
|
|
||||||
indent = [];
|
|
||||||
}
|
|
||||||
return indexOf(indent, tagName.toLowerCase()) != -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function shouldClose(cm, vd, tagName) {
|
|
||||||
if (cm.getOption('mode') == 'xml') {
|
|
||||||
return true; // always close xml tags
|
|
||||||
}
|
|
||||||
if (typeof vd == 'undefined' || vd == null) {
|
|
||||||
vd = cm.getOption('closeTagVoid');
|
|
||||||
}
|
|
||||||
if (!vd) {
|
|
||||||
vd = [];
|
|
||||||
}
|
|
||||||
return indexOf(vd, tagName.toLowerCase()) == -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// C&P from codemirror.js...would be nice if this were visible to utilities.
|
|
||||||
function indexOf(collection, elt) {
|
|
||||||
if (collection.indexOf) return collection.indexOf(elt);
|
|
||||||
for (var i = 0, e = collection.length; i < e; ++i)
|
|
||||||
if (collection[i] == elt) return i;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function completeEndTag(cm, pos, tagName) {
|
|
||||||
cm.replaceSelection('/' + tagName + '>');
|
|
||||||
cm.setCursor({line: pos.line, ch: pos.ch + tagName.length + 2 });
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
|
||||||
@@ -1,196 +0,0 @@
|
|||||||
// the tagRangeFinder function is
|
|
||||||
// Copyright (C) 2011 by Daniel Glazman <daniel@glazman.org>
|
|
||||||
// released under the MIT license (../../LICENSE) like the rest of CodeMirror
|
|
||||||
CodeMirror.tagRangeFinder = function(cm, line, hideEnd) {
|
|
||||||
var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
||||||
var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
||||||
var xmlNAMERegExp = new RegExp("^[" + nameStartChar + "][" + nameChar + "]*");
|
|
||||||
|
|
||||||
var lineText = cm.getLine(line);
|
|
||||||
var found = false;
|
|
||||||
var tag = null;
|
|
||||||
var pos = 0;
|
|
||||||
while (!found) {
|
|
||||||
pos = lineText.indexOf("<", pos);
|
|
||||||
if (-1 == pos) // no tag on line
|
|
||||||
return;
|
|
||||||
if (pos + 1 < lineText.length && lineText[pos + 1] == "/") { // closing tag
|
|
||||||
pos++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// ok we weem to have a start tag
|
|
||||||
if (!lineText.substr(pos + 1).match(xmlNAMERegExp)) { // not a tag name...
|
|
||||||
pos++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var gtPos = lineText.indexOf(">", pos + 1);
|
|
||||||
if (-1 == gtPos) { // end of start tag not in line
|
|
||||||
var l = line + 1;
|
|
||||||
var foundGt = false;
|
|
||||||
var lastLine = cm.lineCount();
|
|
||||||
while (l < lastLine && !foundGt) {
|
|
||||||
var lt = cm.getLine(l);
|
|
||||||
var gt = lt.indexOf(">");
|
|
||||||
if (-1 != gt) { // found a >
|
|
||||||
foundGt = true;
|
|
||||||
var slash = lt.lastIndexOf("/", gt);
|
|
||||||
if (-1 != slash && slash < gt) {
|
|
||||||
var str = lineText.substr(slash, gt - slash + 1);
|
|
||||||
if (!str.match( /\/\s*\>/ )) { // yep, that's the end of empty tag
|
|
||||||
if (hideEnd === true) l++;
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
l++;
|
|
||||||
}
|
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var slashPos = lineText.lastIndexOf("/", gtPos);
|
|
||||||
if (-1 == slashPos) { // cannot be empty tag
|
|
||||||
found = true;
|
|
||||||
// don't continue
|
|
||||||
}
|
|
||||||
else { // empty tag?
|
|
||||||
// check if really empty tag
|
|
||||||
var str = lineText.substr(slashPos, gtPos - slashPos + 1);
|
|
||||||
if (!str.match( /\/\s*\>/ )) { // finally not empty
|
|
||||||
found = true;
|
|
||||||
// don't continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (found) {
|
|
||||||
var subLine = lineText.substr(pos + 1);
|
|
||||||
tag = subLine.match(xmlNAMERegExp);
|
|
||||||
if (tag) {
|
|
||||||
// we have an element name, wooohooo !
|
|
||||||
tag = tag[0];
|
|
||||||
// do we have the close tag on same line ???
|
|
||||||
if (-1 != lineText.indexOf("</" + tag + ">", pos)) // yep
|
|
||||||
{
|
|
||||||
found = false;
|
|
||||||
}
|
|
||||||
// we don't, so we have a candidate...
|
|
||||||
}
|
|
||||||
else
|
|
||||||
found = false;
|
|
||||||
}
|
|
||||||
if (!found)
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (found) {
|
|
||||||
var startTag = "(\\<\\/" + tag + "\\>)|(\\<" + tag + "\\>)|(\\<" + tag + "\\s)|(\\<" + tag + "$)";
|
|
||||||
var startTagRegExp = new RegExp(startTag, "g");
|
|
||||||
var endTag = "</" + tag + ">";
|
|
||||||
var depth = 1;
|
|
||||||
var l = line + 1;
|
|
||||||
var lastLine = cm.lineCount();
|
|
||||||
while (l < lastLine) {
|
|
||||||
lineText = cm.getLine(l);
|
|
||||||
var match = lineText.match(startTagRegExp);
|
|
||||||
if (match) {
|
|
||||||
for (var i = 0; i < match.length; i++) {
|
|
||||||
if (match[i] == endTag)
|
|
||||||
depth--;
|
|
||||||
else
|
|
||||||
depth++;
|
|
||||||
if (!depth) {
|
|
||||||
if (hideEnd === true) l++;
|
|
||||||
return l;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
l++;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
CodeMirror.braceRangeFinder = function(cm, line, hideEnd) {
|
|
||||||
var lineText = cm.getLine(line), at = lineText.length, startChar, tokenType;
|
|
||||||
for (;;) {
|
|
||||||
var found = lineText.lastIndexOf("{", at);
|
|
||||||
if (found < 0) break;
|
|
||||||
tokenType = cm.getTokenAt({line: line, ch: found}).className;
|
|
||||||
if (!/^(comment|string)/.test(tokenType)) { startChar = found; break; }
|
|
||||||
at = found - 1;
|
|
||||||
}
|
|
||||||
if (startChar == null || lineText.lastIndexOf("}") > startChar) return;
|
|
||||||
var count = 1, lastLine = cm.lineCount(), end;
|
|
||||||
outer: for (var i = line + 1; i < lastLine; ++i) {
|
|
||||||
var text = cm.getLine(i), pos = 0;
|
|
||||||
for (;;) {
|
|
||||||
var nextOpen = text.indexOf("{", pos), nextClose = text.indexOf("}", pos);
|
|
||||||
if (nextOpen < 0) nextOpen = text.length;
|
|
||||||
if (nextClose < 0) nextClose = text.length;
|
|
||||||
pos = Math.min(nextOpen, nextClose);
|
|
||||||
if (pos == text.length) break;
|
|
||||||
if (cm.getTokenAt({line: i, ch: pos + 1}).className == tokenType) {
|
|
||||||
if (pos == nextOpen) ++count;
|
|
||||||
else if (!--count) { end = i; break outer; }
|
|
||||||
}
|
|
||||||
++pos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (end == null || end == line + 1) return;
|
|
||||||
if (hideEnd === true) end++;
|
|
||||||
return end;
|
|
||||||
};
|
|
||||||
|
|
||||||
CodeMirror.indentRangeFinder = function(cm, line) {
|
|
||||||
var tabSize = cm.getOption("tabSize");
|
|
||||||
var myIndent = cm.getLineHandle(line).indentation(tabSize), last;
|
|
||||||
for (var i = line + 1, end = cm.lineCount(); i < end; ++i) {
|
|
||||||
var handle = cm.getLineHandle(i);
|
|
||||||
if (!/^\s*$/.test(handle.text)) {
|
|
||||||
if (handle.indentation(tabSize) <= myIndent) break;
|
|
||||||
last = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!last) return null;
|
|
||||||
return last + 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
CodeMirror.newFoldFunction = function(rangeFinder, markText, hideEnd) {
|
|
||||||
var folded = [];
|
|
||||||
if (markText == null) markText = '<div style="position: absolute; left: 2px; color:#600">▼</div>%N%';
|
|
||||||
|
|
||||||
function isFolded(cm, n) {
|
|
||||||
for (var i = 0; i < folded.length; ++i) {
|
|
||||||
var start = cm.lineInfo(folded[i].start);
|
|
||||||
if (!start) folded.splice(i--, 1);
|
|
||||||
else if (start.line == n) return {pos: i, region: folded[i]};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function expand(cm, region) {
|
|
||||||
cm.clearMarker(region.start);
|
|
||||||
for (var i = 0; i < region.hidden.length; ++i)
|
|
||||||
cm.showLine(region.hidden[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return function(cm, line) {
|
|
||||||
cm.operation(function() {
|
|
||||||
var known = isFolded(cm, line);
|
|
||||||
if (known) {
|
|
||||||
folded.splice(known.pos, 1);
|
|
||||||
expand(cm, known.region);
|
|
||||||
} else {
|
|
||||||
var end = rangeFinder(cm, line, hideEnd);
|
|
||||||
if (end == null) return;
|
|
||||||
var hidden = [];
|
|
||||||
for (var i = line + 1; i < end; ++i) {
|
|
||||||
var handle = cm.hideLine(i);
|
|
||||||
if (handle) hidden.push(handle);
|
|
||||||
}
|
|
||||||
var first = cm.setMarker(line, markText);
|
|
||||||
var region = {start: first, hidden: hidden};
|
|
||||||
cm.onDeleteLine(first, function() { expand(cm, region); });
|
|
||||||
folded.push(region);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,299 +0,0 @@
|
|||||||
// ============== Formatting extensions ============================
|
|
||||||
// A common storage for all mode-specific formatting features
|
|
||||||
if (!CodeMirror.modeExtensions) CodeMirror.modeExtensions = {};
|
|
||||||
|
|
||||||
// Returns the extension of the editor's current mode
|
|
||||||
CodeMirror.defineExtension("getModeExt", function () {
|
|
||||||
var mname = CodeMirror.resolveMode(this.getOption("mode")).name;
|
|
||||||
var ext = CodeMirror.modeExtensions[mname];
|
|
||||||
if (!ext) throw new Error("No extensions found for mode " + mname);
|
|
||||||
return ext;
|
|
||||||
});
|
|
||||||
|
|
||||||
// If the current mode is 'htmlmixed', returns the extension of a mode located at
|
|
||||||
// the specified position (can be htmlmixed, css or javascript). Otherwise, simply
|
|
||||||
// returns the extension of the editor's current mode.
|
|
||||||
CodeMirror.defineExtension("getModeExtAtPos", function (pos) {
|
|
||||||
var token = this.getTokenAt(pos);
|
|
||||||
if (token && token.state && token.state.mode)
|
|
||||||
return CodeMirror.modeExtensions[token.state.mode == "html" ? "htmlmixed" : token.state.mode];
|
|
||||||
else
|
|
||||||
return this.getModeExt();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Comment/uncomment the specified range
|
|
||||||
CodeMirror.defineExtension("commentRange", function (isComment, from, to) {
|
|
||||||
var curMode = this.getModeExtAtPos(this.getCursor());
|
|
||||||
if (isComment) { // Comment range
|
|
||||||
var commentedText = this.getRange(from, to);
|
|
||||||
this.replaceRange(curMode.commentStart + this.getRange(from, to) + curMode.commentEnd
|
|
||||||
, from, to);
|
|
||||||
if (from.line == to.line && from.ch == to.ch) { // An empty comment inserted - put cursor inside
|
|
||||||
this.setCursor(from.line, from.ch + curMode.commentStart.length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { // Uncomment range
|
|
||||||
var selText = this.getRange(from, to);
|
|
||||||
var startIndex = selText.indexOf(curMode.commentStart);
|
|
||||||
var endIndex = selText.lastIndexOf(curMode.commentEnd);
|
|
||||||
if (startIndex > -1 && endIndex > -1 && endIndex > startIndex) {
|
|
||||||
// Take string till comment start
|
|
||||||
selText = selText.substr(0, startIndex)
|
|
||||||
// From comment start till comment end
|
|
||||||
+ selText.substring(startIndex + curMode.commentStart.length, endIndex)
|
|
||||||
// From comment end till string end
|
|
||||||
+ selText.substr(endIndex + curMode.commentEnd.length);
|
|
||||||
}
|
|
||||||
this.replaceRange(selText, from, to);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Applies automatic mode-aware indentation to the specified range
|
|
||||||
CodeMirror.defineExtension("autoIndentRange", function (from, to) {
|
|
||||||
var cmInstance = this;
|
|
||||||
this.operation(function () {
|
|
||||||
for (var i = from.line; i <= to.line; i++) {
|
|
||||||
cmInstance.indentLine(i, "smart");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Applies automatic formatting to the specified range
|
|
||||||
CodeMirror.defineExtension("autoFormatRange", function (from, to) {
|
|
||||||
var absStart = this.indexFromPos(from);
|
|
||||||
var absEnd = this.indexFromPos(to);
|
|
||||||
// Insert additional line breaks where necessary according to the
|
|
||||||
// mode's syntax
|
|
||||||
var res = this.getModeExt().autoFormatLineBreaks(this.getValue(), absStart, absEnd);
|
|
||||||
var cmInstance = this;
|
|
||||||
|
|
||||||
// Replace and auto-indent the range
|
|
||||||
this.operation(function () {
|
|
||||||
cmInstance.replaceRange(res, from, to);
|
|
||||||
var startLine = cmInstance.posFromIndex(absStart).line;
|
|
||||||
var endLine = cmInstance.posFromIndex(absStart + res.length).line;
|
|
||||||
for (var i = startLine; i <= endLine; i++) {
|
|
||||||
cmInstance.indentLine(i, "smart");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Define extensions for a few modes
|
|
||||||
|
|
||||||
CodeMirror.modeExtensions["css"] = {
|
|
||||||
commentStart: "/*",
|
|
||||||
commentEnd: "*/",
|
|
||||||
wordWrapChars: [";", "\\{", "\\}"],
|
|
||||||
autoFormatLineBreaks: function (text, startPos, endPos) {
|
|
||||||
text = text.substring(startPos, endPos);
|
|
||||||
return text.replace(new RegExp("(;|\\{|\\})([^\r\n])", "g"), "$1\n$2");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
CodeMirror.modeExtensions["javascript"] = {
|
|
||||||
commentStart: "/*",
|
|
||||||
commentEnd: "*/",
|
|
||||||
wordWrapChars: [";", "\\{", "\\}"],
|
|
||||||
|
|
||||||
getNonBreakableBlocks: function (text) {
|
|
||||||
var nonBreakableRegexes = [
|
|
||||||
new RegExp("for\\s*?\\(([\\s\\S]*?)\\)"),
|
|
||||||
new RegExp("\\\\\"([\\s\\S]*?)(\\\\\"|$)"),
|
|
||||||
new RegExp("\\\\\'([\\s\\S]*?)(\\\\\'|$)"),
|
|
||||||
new RegExp("'([\\s\\S]*?)('|$)"),
|
|
||||||
new RegExp("\"([\\s\\S]*?)(\"|$)"),
|
|
||||||
new RegExp("//.*([\r\n]|$)")
|
|
||||||
];
|
|
||||||
var nonBreakableBlocks = new Array();
|
|
||||||
for (var i = 0; i < nonBreakableRegexes.length; i++) {
|
|
||||||
var curPos = 0;
|
|
||||||
while (curPos < text.length) {
|
|
||||||
var m = text.substr(curPos).match(nonBreakableRegexes[i]);
|
|
||||||
if (m != null) {
|
|
||||||
nonBreakableBlocks.push({
|
|
||||||
start: curPos + m.index,
|
|
||||||
end: curPos + m.index + m[0].length
|
|
||||||
});
|
|
||||||
curPos += m.index + Math.max(1, m[0].length);
|
|
||||||
}
|
|
||||||
else { // No more matches
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
nonBreakableBlocks.sort(function (a, b) {
|
|
||||||
return a.start - b.start;
|
|
||||||
});
|
|
||||||
|
|
||||||
return nonBreakableBlocks;
|
|
||||||
},
|
|
||||||
|
|
||||||
autoFormatLineBreaks: function (text, startPos, endPos) {
|
|
||||||
text = text.substring(startPos, endPos);
|
|
||||||
var curPos = 0;
|
|
||||||
var reLinesSplitter = new RegExp("(;|\\{|\\})([^\r\n;])", "g");
|
|
||||||
var nonBreakableBlocks = this.getNonBreakableBlocks(text);
|
|
||||||
if (nonBreakableBlocks != null) {
|
|
||||||
var res = "";
|
|
||||||
for (var i = 0; i < nonBreakableBlocks.length; i++) {
|
|
||||||
if (nonBreakableBlocks[i].start > curPos) { // Break lines till the block
|
|
||||||
res += text.substring(curPos, nonBreakableBlocks[i].start).replace(reLinesSplitter, "$1\n$2");
|
|
||||||
curPos = nonBreakableBlocks[i].start;
|
|
||||||
}
|
|
||||||
if (nonBreakableBlocks[i].start <= curPos
|
|
||||||
&& nonBreakableBlocks[i].end >= curPos) { // Skip non-breakable block
|
|
||||||
res += text.substring(curPos, nonBreakableBlocks[i].end);
|
|
||||||
curPos = nonBreakableBlocks[i].end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (curPos < text.length - 1) {
|
|
||||||
res += text.substr(curPos).replace(reLinesSplitter, "$1\n$2");
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return text.replace(reLinesSplitter, "$1\n$2");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
CodeMirror.modeExtensions["xml"] = {
|
|
||||||
commentStart: "<!--",
|
|
||||||
commentEnd: "-->",
|
|
||||||
wordWrapChars: [">"],
|
|
||||||
|
|
||||||
autoFormatLineBreaks: function (text, startPos, endPos) {
|
|
||||||
text = text.substring(startPos, endPos);
|
|
||||||
var lines = text.split("\n");
|
|
||||||
var reProcessedPortion = new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)");
|
|
||||||
var reOpenBrackets = new RegExp("<", "g");
|
|
||||||
var reCloseBrackets = new RegExp("(>)([^\r\n])", "g");
|
|
||||||
for (var i = 0; i < lines.length; i++) {
|
|
||||||
var mToProcess = lines[i].match(reProcessedPortion);
|
|
||||||
if (mToProcess != null && mToProcess.length > 3) { // The line starts with whitespaces and ends with whitespaces
|
|
||||||
lines[i] = mToProcess[1]
|
|
||||||
+ mToProcess[2].replace(reOpenBrackets, "\n$&").replace(reCloseBrackets, "$1\n$2")
|
|
||||||
+ mToProcess[3];
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return lines.join("\n");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
CodeMirror.modeExtensions["htmlmixed"] = {
|
|
||||||
commentStart: "<!--",
|
|
||||||
commentEnd: "-->",
|
|
||||||
wordWrapChars: [">", ";", "\\{", "\\}"],
|
|
||||||
|
|
||||||
getModeInfos: function (text, absPos) {
|
|
||||||
var modeInfos = new Array();
|
|
||||||
modeInfos[0] =
|
|
||||||
{
|
|
||||||
pos: 0,
|
|
||||||
modeExt: CodeMirror.modeExtensions["xml"],
|
|
||||||
modeName: "xml"
|
|
||||||
};
|
|
||||||
|
|
||||||
var modeMatchers = new Array();
|
|
||||||
modeMatchers[0] =
|
|
||||||
{
|
|
||||||
regex: new RegExp("<style[^>]*>([\\s\\S]*?)(</style[^>]*>|$)", "i"),
|
|
||||||
modeExt: CodeMirror.modeExtensions["css"],
|
|
||||||
modeName: "css"
|
|
||||||
};
|
|
||||||
modeMatchers[1] =
|
|
||||||
{
|
|
||||||
regex: new RegExp("<script[^>]*>([\\s\\S]*?)(</script[^>]*>|$)", "i"),
|
|
||||||
modeExt: CodeMirror.modeExtensions["javascript"],
|
|
||||||
modeName: "javascript"
|
|
||||||
};
|
|
||||||
|
|
||||||
var lastCharPos = (typeof (absPos) !== "undefined" ? absPos : text.length - 1);
|
|
||||||
// Detect modes for the entire text
|
|
||||||
for (var i = 0; i < modeMatchers.length; i++) {
|
|
||||||
var curPos = 0;
|
|
||||||
while (curPos <= lastCharPos) {
|
|
||||||
var m = text.substr(curPos).match(modeMatchers[i].regex);
|
|
||||||
if (m != null) {
|
|
||||||
if (m.length > 1 && m[1].length > 0) {
|
|
||||||
// Push block begin pos
|
|
||||||
var blockBegin = curPos + m.index + m[0].indexOf(m[1]);
|
|
||||||
modeInfos.push(
|
|
||||||
{
|
|
||||||
pos: blockBegin,
|
|
||||||
modeExt: modeMatchers[i].modeExt,
|
|
||||||
modeName: modeMatchers[i].modeName
|
|
||||||
});
|
|
||||||
// Push block end pos
|
|
||||||
modeInfos.push(
|
|
||||||
{
|
|
||||||
pos: blockBegin + m[1].length,
|
|
||||||
modeExt: modeInfos[0].modeExt,
|
|
||||||
modeName: modeInfos[0].modeName
|
|
||||||
});
|
|
||||||
curPos += m.index + m[0].length;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
curPos += m.index + Math.max(m[0].length, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { // No more matches
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Sort mode infos
|
|
||||||
modeInfos.sort(function sortModeInfo(a, b) {
|
|
||||||
return a.pos - b.pos;
|
|
||||||
});
|
|
||||||
|
|
||||||
return modeInfos;
|
|
||||||
},
|
|
||||||
|
|
||||||
autoFormatLineBreaks: function (text, startPos, endPos) {
|
|
||||||
var modeInfos = this.getModeInfos(text);
|
|
||||||
var reBlockStartsWithNewline = new RegExp("^\\s*?\n");
|
|
||||||
var reBlockEndsWithNewline = new RegExp("\n\\s*?$");
|
|
||||||
var res = "";
|
|
||||||
// Use modes info to break lines correspondingly
|
|
||||||
if (modeInfos.length > 1) { // Deal with multi-mode text
|
|
||||||
for (var i = 1; i <= modeInfos.length; i++) {
|
|
||||||
var selStart = modeInfos[i - 1].pos;
|
|
||||||
var selEnd = (i < modeInfos.length ? modeInfos[i].pos : endPos);
|
|
||||||
|
|
||||||
if (selStart >= endPos) { // The block starts later than the needed fragment
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (selStart < startPos) {
|
|
||||||
if (selEnd <= startPos) { // The block starts earlier than the needed fragment
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
selStart = startPos;
|
|
||||||
}
|
|
||||||
if (selEnd > endPos) {
|
|
||||||
selEnd = endPos;
|
|
||||||
}
|
|
||||||
var textPortion = text.substring(selStart, selEnd);
|
|
||||||
if (modeInfos[i - 1].modeName != "xml") { // Starting a CSS or JavaScript block
|
|
||||||
if (!reBlockStartsWithNewline.test(textPortion)
|
|
||||||
&& selStart > 0) { // The block does not start with a line break
|
|
||||||
textPortion = "\n" + textPortion;
|
|
||||||
}
|
|
||||||
if (!reBlockEndsWithNewline.test(textPortion)
|
|
||||||
&& selEnd < text.length - 1) { // The block does not end with a line break
|
|
||||||
textPortion += "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res += modeInfos[i - 1].modeExt.autoFormatLineBreaks(textPortion);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { // Single-mode text
|
|
||||||
res = modeInfos[0].modeExt.autoFormatLineBreaks(text.substring(startPos, endPos));
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
// Define match-highlighter commands. Depends on searchcursor.js
|
|
||||||
// Use by attaching the following function call to the onCursorActivity event:
|
|
||||||
//myCodeMirror.matchHighlight(minChars);
|
|
||||||
// And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html)
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var DEFAULT_MIN_CHARS = 2;
|
|
||||||
|
|
||||||
function MatchHighlightState() {
|
|
||||||
this.marked = [];
|
|
||||||
}
|
|
||||||
function getMatchHighlightState(cm) {
|
|
||||||
return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState());
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearMarks(cm) {
|
|
||||||
var state = getMatchHighlightState(cm);
|
|
||||||
for (var i = 0; i < state.marked.length; ++i)
|
|
||||||
state.marked[i].clear();
|
|
||||||
state.marked = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
function markDocument(cm, className, minChars) {
|
|
||||||
clearMarks(cm);
|
|
||||||
minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS);
|
|
||||||
if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) {
|
|
||||||
var state = getMatchHighlightState(cm);
|
|
||||||
var query = cm.getSelection();
|
|
||||||
cm.operation(function() {
|
|
||||||
if (cm.lineCount() < 2000) { // This is too expensive on big documents.
|
|
||||||
for (var cursor = cm.getSearchCursor(query); cursor.findNext();) {
|
|
||||||
//Only apply matchhighlight to the matches other than the one actually selected
|
|
||||||
if (!(cursor.from().line === cm.getCursor(true).line && cursor.from().ch === cm.getCursor(true).ch))
|
|
||||||
state.marked.push(cm.markText(cursor.from(), cursor.to(), className));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CodeMirror.defineExtension("matchHighlight", function(className, minChars) {
|
|
||||||
markDocument(this, className, minChars);
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
CodeMirror.runMode = function(string, modespec, callback, options) {
|
|
||||||
function esc(str) {
|
|
||||||
return str.replace(/[<&]/, function(ch) { return ch == "<" ? "<" : "&"; });
|
|
||||||
}
|
|
||||||
|
|
||||||
var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
|
|
||||||
var isNode = callback.nodeType == 1;
|
|
||||||
var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
|
|
||||||
if (isNode) {
|
|
||||||
var node = callback, accum = [], col = 0;
|
|
||||||
callback = function(text, style) {
|
|
||||||
if (text == "\n") {
|
|
||||||
accum.push("<br>");
|
|
||||||
col = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var escaped = "";
|
|
||||||
// HTML-escape and replace tabs
|
|
||||||
for (var pos = 0;;) {
|
|
||||||
var idx = text.indexOf("\t", pos);
|
|
||||||
if (idx == -1) {
|
|
||||||
escaped += esc(text.slice(pos));
|
|
||||||
col += text.length - pos;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
col += idx - pos;
|
|
||||||
escaped += esc(text.slice(pos, idx));
|
|
||||||
var size = tabSize - col % tabSize;
|
|
||||||
col += size;
|
|
||||||
for (var i = 0; i < size; ++i) escaped += " ";
|
|
||||||
pos = idx + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (style)
|
|
||||||
accum.push("<span class=\"cm-" + esc(style) + "\">" + escaped + "</span>");
|
|
||||||
else
|
|
||||||
accum.push(escaped);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
|
|
||||||
for (var i = 0, e = lines.length; i < e; ++i) {
|
|
||||||
if (i) callback("\n");
|
|
||||||
var stream = new CodeMirror.StringStream(lines[i]);
|
|
||||||
while (!stream.eol()) {
|
|
||||||
var style = mode.token(stream, state);
|
|
||||||
callback(stream.current(), style, i, stream.start);
|
|
||||||
stream.start = stream.pos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isNode)
|
|
||||||
node.innerHTML = accum.join("");
|
|
||||||
};
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
(function(){
|
|
||||||
function SearchCursor(cm, query, pos, caseFold) {
|
|
||||||
this.atOccurrence = false; this.cm = cm;
|
|
||||||
if (caseFold == null && typeof query == "string") caseFold = false;
|
|
||||||
|
|
||||||
pos = pos ? cm.clipPos(pos) : {line: 0, ch: 0};
|
|
||||||
this.pos = {from: pos, to: pos};
|
|
||||||
|
|
||||||
// The matches method is filled in based on the type of query.
|
|
||||||
// It takes a position and a direction, and returns an object
|
|
||||||
// describing the next occurrence of the query, or null if no
|
|
||||||
// more matches were found.
|
|
||||||
if (typeof query != "string") { // Regexp match
|
|
||||||
if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
|
|
||||||
this.matches = function(reverse, pos) {
|
|
||||||
if (reverse) {
|
|
||||||
query.lastIndex = 0;
|
|
||||||
var line = cm.getLine(pos.line).slice(0, pos.ch), match = query.exec(line), start = 0;
|
|
||||||
while (match) {
|
|
||||||
start += match.index;
|
|
||||||
line = line.slice(match.index);
|
|
||||||
query.lastIndex = 0;
|
|
||||||
var newmatch = query.exec(line);
|
|
||||||
if (newmatch) match = newmatch;
|
|
||||||
else break;
|
|
||||||
start++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
query.lastIndex = pos.ch;
|
|
||||||
var line = cm.getLine(pos.line), match = query.exec(line),
|
|
||||||
start = match && match.index;
|
|
||||||
}
|
|
||||||
if (match)
|
|
||||||
return {from: {line: pos.line, ch: start},
|
|
||||||
to: {line: pos.line, ch: start + match[0].length},
|
|
||||||
match: match};
|
|
||||||
};
|
|
||||||
} else { // String query
|
|
||||||
if (caseFold) query = query.toLowerCase();
|
|
||||||
var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
|
|
||||||
var target = query.split("\n");
|
|
||||||
// Different methods for single-line and multi-line queries
|
|
||||||
if (target.length == 1)
|
|
||||||
this.matches = function(reverse, pos) {
|
|
||||||
var line = fold(cm.getLine(pos.line)), len = query.length, match;
|
|
||||||
if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1)
|
|
||||||
: (match = line.indexOf(query, pos.ch)) != -1)
|
|
||||||
return {from: {line: pos.line, ch: match},
|
|
||||||
to: {line: pos.line, ch: match + len}};
|
|
||||||
};
|
|
||||||
else
|
|
||||||
this.matches = function(reverse, pos) {
|
|
||||||
var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(cm.getLine(ln));
|
|
||||||
var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match));
|
|
||||||
if (reverse ? offsetA >= pos.ch || offsetA != match.length
|
|
||||||
: offsetA <= pos.ch || offsetA != line.length - match.length)
|
|
||||||
return;
|
|
||||||
for (;;) {
|
|
||||||
if (reverse ? !ln : ln == cm.lineCount() - 1) return;
|
|
||||||
line = fold(cm.getLine(ln += reverse ? -1 : 1));
|
|
||||||
match = target[reverse ? --idx : ++idx];
|
|
||||||
if (idx > 0 && idx < target.length - 1) {
|
|
||||||
if (line != match) return;
|
|
||||||
else continue;
|
|
||||||
}
|
|
||||||
var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length);
|
|
||||||
if (reverse ? offsetB != line.length - match.length : offsetB != match.length)
|
|
||||||
return;
|
|
||||||
var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB};
|
|
||||||
return {from: reverse ? end : start, to: reverse ? start : end};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SearchCursor.prototype = {
|
|
||||||
findNext: function() {return this.find(false);},
|
|
||||||
findPrevious: function() {return this.find(true);},
|
|
||||||
|
|
||||||
find: function(reverse) {
|
|
||||||
var self = this, pos = this.cm.clipPos(reverse ? this.pos.from : this.pos.to);
|
|
||||||
function savePosAndFail(line) {
|
|
||||||
var pos = {line: line, ch: 0};
|
|
||||||
self.pos = {from: pos, to: pos};
|
|
||||||
self.atOccurrence = false;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
if (this.pos = this.matches(reverse, pos)) {
|
|
||||||
this.atOccurrence = true;
|
|
||||||
return this.pos.match || true;
|
|
||||||
}
|
|
||||||
if (reverse) {
|
|
||||||
if (!pos.line) return savePosAndFail(0);
|
|
||||||
pos = {line: pos.line-1, ch: this.cm.getLine(pos.line-1).length};
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var maxLine = this.cm.lineCount();
|
|
||||||
if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
|
|
||||||
pos = {line: pos.line+1, ch: 0};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
from: function() {if (this.atOccurrence) return this.pos.from;},
|
|
||||||
to: function() {if (this.atOccurrence) return this.pos.to;},
|
|
||||||
|
|
||||||
replace: function(newText) {
|
|
||||||
var self = this;
|
|
||||||
if (this.atOccurrence)
|
|
||||||
self.pos.to = this.cm.replaceRange(newText, self.pos.from, self.pos.to);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
|
|
||||||
return new SearchCursor(this, query, pos, caseFold);
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
.CodeMirror-completions {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 10;
|
|
||||||
overflow: hidden;
|
|
||||||
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
||||||
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
||||||
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
|
||||||
}
|
|
||||||
.CodeMirror-completions select {
|
|
||||||
background: #fafafa;
|
|
||||||
outline: none;
|
|
||||||
border: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
(function() {
|
|
||||||
CodeMirror.simpleHint = function(editor, getHints, givenOptions) {
|
|
||||||
// Determine effective options based on given values and defaults.
|
|
||||||
var options = {}, defaults = CodeMirror.simpleHint.defaults;
|
|
||||||
for (var opt in defaults)
|
|
||||||
if (defaults.hasOwnProperty(opt))
|
|
||||||
options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];
|
|
||||||
|
|
||||||
function collectHints(previousToken) {
|
|
||||||
// We want a single cursor position.
|
|
||||||
if (editor.somethingSelected()) return;
|
|
||||||
|
|
||||||
var tempToken = editor.getTokenAt(editor.getCursor());
|
|
||||||
|
|
||||||
// Don't show completions if token has changed and the option is set.
|
|
||||||
if (options.closeOnTokenChange && previousToken != null &&
|
|
||||||
(tempToken.start != previousToken.start || tempToken.className != previousToken.className)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = getHints(editor);
|
|
||||||
if (!result || !result.list.length) return;
|
|
||||||
var completions = result.list;
|
|
||||||
function insert(str) {
|
|
||||||
editor.replaceRange(str, result.from, result.to);
|
|
||||||
}
|
|
||||||
// When there is only one completion, use it directly.
|
|
||||||
if (completions.length == 1) {insert(completions[0]); return true;}
|
|
||||||
|
|
||||||
// Build the select widget
|
|
||||||
var complete = document.createElement("div");
|
|
||||||
complete.className = "CodeMirror-completions";
|
|
||||||
var sel = complete.appendChild(document.createElement("select"));
|
|
||||||
// Opera doesn't move the selection when pressing up/down in a
|
|
||||||
// multi-select, but it does properly support the size property on
|
|
||||||
// single-selects, so no multi-select is necessary.
|
|
||||||
if (!window.opera) sel.multiple = true;
|
|
||||||
for (var i = 0; i < completions.length; ++i) {
|
|
||||||
var opt = sel.appendChild(document.createElement("option"));
|
|
||||||
opt.appendChild(document.createTextNode(completions[i]));
|
|
||||||
}
|
|
||||||
sel.firstChild.selected = true;
|
|
||||||
sel.size = Math.min(10, completions.length);
|
|
||||||
var pos = editor.cursorCoords();
|
|
||||||
complete.style.left = pos.x + "px";
|
|
||||||
complete.style.top = pos.yBot + "px";
|
|
||||||
document.body.appendChild(complete);
|
|
||||||
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
|
|
||||||
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
|
|
||||||
if(winW - pos.x < sel.clientWidth)
|
|
||||||
complete.style.left = (pos.x - sel.clientWidth) + "px";
|
|
||||||
// Hack to hide the scrollbar.
|
|
||||||
if (completions.length <= 10)
|
|
||||||
complete.style.width = (sel.clientWidth - 1) + "px";
|
|
||||||
|
|
||||||
var done = false;
|
|
||||||
function close() {
|
|
||||||
if (done) return;
|
|
||||||
done = true;
|
|
||||||
complete.parentNode.removeChild(complete);
|
|
||||||
}
|
|
||||||
function pick() {
|
|
||||||
insert(completions[sel.selectedIndex]);
|
|
||||||
close();
|
|
||||||
setTimeout(function(){editor.focus();}, 50);
|
|
||||||
}
|
|
||||||
CodeMirror.connect(sel, "blur", close);
|
|
||||||
CodeMirror.connect(sel, "keydown", function(event) {
|
|
||||||
var code = event.keyCode;
|
|
||||||
// Enter
|
|
||||||
if (code == 13) {CodeMirror.e_stop(event); pick();}
|
|
||||||
// Escape
|
|
||||||
else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();}
|
|
||||||
else if (code != 38 && code != 40) {
|
|
||||||
close(); editor.focus();
|
|
||||||
// Pass the event to the CodeMirror instance so that it can handle things like backspace properly.
|
|
||||||
editor.triggerOnKeyDown(event);
|
|
||||||
// Don't show completions if the code is backspace and the option is set.
|
|
||||||
if (!options.closeOnBackspace || code != 8) {
|
|
||||||
setTimeout(function(){collectHints(tempToken);}, 50);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
CodeMirror.connect(sel, "dblclick", pick);
|
|
||||||
|
|
||||||
sel.focus();
|
|
||||||
// Opera sometimes ignores focusing a freshly created node
|
|
||||||
if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return collectHints();
|
|
||||||
};
|
|
||||||
CodeMirror.simpleHint.defaults = {
|
|
||||||
closeOnBackspace: true,
|
|
||||||
closeOnTokenChange: false
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
CodeMirror.xmlHints = [];
|
|
||||||
|
|
||||||
CodeMirror.xmlHint = function(cm, simbol) {
|
|
||||||
|
|
||||||
if(simbol.length > 0) {
|
|
||||||
var cursor = cm.getCursor();
|
|
||||||
cm.replaceSelection(simbol);
|
|
||||||
cursor = {line: cursor.line, ch: cursor.ch + 1};
|
|
||||||
cm.setCursor(cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
// dirty hack for simple-hint to receive getHint event on space
|
|
||||||
var getTokenAt = editor.getTokenAt;
|
|
||||||
|
|
||||||
editor.getTokenAt = function() { return 'disabled'; };
|
|
||||||
CodeMirror.simpleHint(cm, getHint);
|
|
||||||
|
|
||||||
editor.getTokenAt = getTokenAt;
|
|
||||||
};
|
|
||||||
|
|
||||||
var getHint = function(cm) {
|
|
||||||
|
|
||||||
var cursor = cm.getCursor();
|
|
||||||
|
|
||||||
if (cursor.ch > 0) {
|
|
||||||
|
|
||||||
var text = cm.getRange({line: 0, ch: 0}, cursor);
|
|
||||||
var typed = '';
|
|
||||||
var simbol = '';
|
|
||||||
for(var i = text.length - 1; i >= 0; i--) {
|
|
||||||
if(text[i] == ' ' || text[i] == '<') {
|
|
||||||
simbol = text[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
typed = text[i] + typed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
text = text.slice(0, text.length - typed.length);
|
|
||||||
|
|
||||||
var path = getActiveElement(cm, text) + simbol;
|
|
||||||
var hints = CodeMirror.xmlHints[path];
|
|
||||||
|
|
||||||
if(typeof hints === 'undefined')
|
|
||||||
hints = [''];
|
|
||||||
else {
|
|
||||||
hints = hints.slice(0);
|
|
||||||
for (var i = hints.length - 1; i >= 0; i--) {
|
|
||||||
if(hints[i].indexOf(typed) != 0)
|
|
||||||
hints.splice(i, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
list: hints,
|
|
||||||
from: { line: cursor.line, ch: cursor.ch - typed.length },
|
|
||||||
to: cursor
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
var getActiveElement = function(codeMirror, text) {
|
|
||||||
|
|
||||||
var element = '';
|
|
||||||
|
|
||||||
if(text.length >= 0) {
|
|
||||||
|
|
||||||
var regex = new RegExp('<([^!?][^\\s/>]*).*?>', 'g');
|
|
||||||
|
|
||||||
var matches = [];
|
|
||||||
var match;
|
|
||||||
while ((match = regex.exec(text)) != null) {
|
|
||||||
matches.push({
|
|
||||||
tag: match[1],
|
|
||||||
selfclose: (match[0].slice(match[0].length - 2) === '/>')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = matches.length - 1, skip = 0; i >= 0; i--) {
|
|
||||||
|
|
||||||
var item = matches[i];
|
|
||||||
|
|
||||||
if (item.tag[0] == '/')
|
|
||||||
{
|
|
||||||
skip++;
|
|
||||||
}
|
|
||||||
else if (item.selfclose == false)
|
|
||||||
{
|
|
||||||
if (skip > 0)
|
|
||||||
{
|
|
||||||
skip--;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
element = '<' + item.tag + '>' + element;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
element += getOpenTag(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
return element;
|
|
||||||
};
|
|
||||||
|
|
||||||
var getOpenTag = function(text) {
|
|
||||||
|
|
||||||
var open = text.lastIndexOf('<');
|
|
||||||
var close = text.lastIndexOf('>');
|
|
||||||
|
|
||||||
if (close < open)
|
|
||||||
{
|
|
||||||
text = text.slice(open);
|
|
||||||
|
|
||||||
if(text != '<') {
|
|
||||||
|
|
||||||
var space = text.indexOf(' ');
|
|
||||||
if(space < 0)
|
|
||||||
space = text.indexOf('\t');
|
|
||||||
if(space < 0)
|
|
||||||
space = text.indexOf('\n');
|
|
||||||
|
|
||||||
if (space < 0)
|
|
||||||
space = text.length;
|
|
||||||
|
|
||||||
return text.slice(0, space);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
};
|
|
||||||
|
|
||||||
})();
|
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
CodeMirror.defineMode("apl", function() {
|
||||||
|
var builtInOps = {
|
||||||
|
".": "innerProduct",
|
||||||
|
"\\": "scan",
|
||||||
|
"/": "reduce",
|
||||||
|
"⌿": "reduce1Axis",
|
||||||
|
"⍀": "scan1Axis",
|
||||||
|
"¨": "each",
|
||||||
|
"⍣": "power"
|
||||||
|
};
|
||||||
|
var builtInFuncs = {
|
||||||
|
"+": ["conjugate", "add"],
|
||||||
|
"−": ["negate", "subtract"],
|
||||||
|
"×": ["signOf", "multiply"],
|
||||||
|
"÷": ["reciprocal", "divide"],
|
||||||
|
"⌈": ["ceiling", "greaterOf"],
|
||||||
|
"⌊": ["floor", "lesserOf"],
|
||||||
|
"∣": ["absolute", "residue"],
|
||||||
|
"⍳": ["indexGenerate", "indexOf"],
|
||||||
|
"?": ["roll", "deal"],
|
||||||
|
"⋆": ["exponentiate", "toThePowerOf"],
|
||||||
|
"⍟": ["naturalLog", "logToTheBase"],
|
||||||
|
"○": ["piTimes", "circularFuncs"],
|
||||||
|
"!": ["factorial", "binomial"],
|
||||||
|
"⌹": ["matrixInverse", "matrixDivide"],
|
||||||
|
"<": [null, "lessThan"],
|
||||||
|
"≤": [null, "lessThanOrEqual"],
|
||||||
|
"=": [null, "equals"],
|
||||||
|
">": [null, "greaterThan"],
|
||||||
|
"≥": [null, "greaterThanOrEqual"],
|
||||||
|
"≠": [null, "notEqual"],
|
||||||
|
"≡": ["depth", "match"],
|
||||||
|
"≢": [null, "notMatch"],
|
||||||
|
"∈": ["enlist", "membership"],
|
||||||
|
"⍷": [null, "find"],
|
||||||
|
"∪": ["unique", "union"],
|
||||||
|
"∩": [null, "intersection"],
|
||||||
|
"∼": ["not", "without"],
|
||||||
|
"∨": [null, "or"],
|
||||||
|
"∧": [null, "and"],
|
||||||
|
"⍱": [null, "nor"],
|
||||||
|
"⍲": [null, "nand"],
|
||||||
|
"⍴": ["shapeOf", "reshape"],
|
||||||
|
",": ["ravel", "catenate"],
|
||||||
|
"⍪": [null, "firstAxisCatenate"],
|
||||||
|
"⌽": ["reverse", "rotate"],
|
||||||
|
"⊖": ["axis1Reverse", "axis1Rotate"],
|
||||||
|
"⍉": ["transpose", null],
|
||||||
|
"↑": ["first", "take"],
|
||||||
|
"↓": [null, "drop"],
|
||||||
|
"⊂": ["enclose", "partitionWithAxis"],
|
||||||
|
"⊃": ["diclose", "pick"],
|
||||||
|
"⌷": [null, "index"],
|
||||||
|
"⍋": ["gradeUp", null],
|
||||||
|
"⍒": ["gradeDown", null],
|
||||||
|
"⊤": ["encode", null],
|
||||||
|
"⊥": ["decode", null],
|
||||||
|
"⍕": ["format", "formatByExample"],
|
||||||
|
"⍎": ["execute", null],
|
||||||
|
"⊣": ["stop", "left"],
|
||||||
|
"⊢": ["pass", "right"]
|
||||||
|
};
|
||||||
|
|
||||||
|
var isOperator = /[\.\/⌿⍀¨⍣]/;
|
||||||
|
var isNiladic = /⍬/;
|
||||||
|
var isFunction = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/;
|
||||||
|
var isArrow = /←/;
|
||||||
|
var isComment = /[⍝#].*$/;
|
||||||
|
|
||||||
|
var stringEater = function(type) {
|
||||||
|
var prev;
|
||||||
|
prev = false;
|
||||||
|
return function(c) {
|
||||||
|
prev = c;
|
||||||
|
if (c === type) {
|
||||||
|
return prev === "\\";
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
startState: function() {
|
||||||
|
return {
|
||||||
|
prev: false,
|
||||||
|
func: false,
|
||||||
|
op: false,
|
||||||
|
string: false,
|
||||||
|
escape: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
token: function(stream, state) {
|
||||||
|
var ch, funcName, word;
|
||||||
|
if (stream.eatSpace()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ch = stream.next();
|
||||||
|
if (ch === '"' || ch === "'") {
|
||||||
|
stream.eatWhile(stringEater(ch));
|
||||||
|
stream.next();
|
||||||
|
state.prev = true;
|
||||||
|
return "string";
|
||||||
|
}
|
||||||
|
if (/[\[{\(]/.test(ch)) {
|
||||||
|
state.prev = false;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (/[\]}\)]/.test(ch)) {
|
||||||
|
state.prev = true;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (isNiladic.test(ch)) {
|
||||||
|
state.prev = false;
|
||||||
|
return "niladic";
|
||||||
|
}
|
||||||
|
if (/[¯\d]/.test(ch)) {
|
||||||
|
if (state.func) {
|
||||||
|
state.func = false;
|
||||||
|
state.prev = false;
|
||||||
|
} else {
|
||||||
|
state.prev = true;
|
||||||
|
}
|
||||||
|
stream.eatWhile(/[\w\.]/);
|
||||||
|
return "number";
|
||||||
|
}
|
||||||
|
if (isOperator.test(ch)) {
|
||||||
|
return "operator apl-" + builtInOps[ch];
|
||||||
|
}
|
||||||
|
if (isArrow.test(ch)) {
|
||||||
|
return "apl-arrow";
|
||||||
|
}
|
||||||
|
if (isFunction.test(ch)) {
|
||||||
|
funcName = "apl-";
|
||||||
|
if (builtInFuncs[ch] != null) {
|
||||||
|
if (state.prev) {
|
||||||
|
funcName += builtInFuncs[ch][1];
|
||||||
|
} else {
|
||||||
|
funcName += builtInFuncs[ch][0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
state.func = true;
|
||||||
|
state.prev = false;
|
||||||
|
return "function " + funcName;
|
||||||
|
}
|
||||||
|
if (isComment.test(ch)) {
|
||||||
|
stream.skipToEnd();
|
||||||
|
return "comment";
|
||||||
|
}
|
||||||
|
if (ch === "∘" && stream.peek() === ".") {
|
||||||
|
stream.next();
|
||||||
|
return "function jot-dot";
|
||||||
|
}
|
||||||
|
stream.eatWhile(/[\w\$_]/);
|
||||||
|
word = stream.current();
|
||||||
|
state.prev = true;
|
||||||
|
return "keyword";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
CodeMirror.defineMIME("text/apl", "apl");
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
<!doctype html>
|
||||||
|
|
||||||
|
<title>CodeMirror: APL mode</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<link rel=stylesheet href="../../doc/docs.css">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
|
<script src="../../lib/codemirror.js"></script>
|
||||||
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
|
<script src="./apl.js"></script>
|
||||||
|
<style>
|
||||||
|
.CodeMirror { border: 2px inset #dee; }
|
||||||
|
</style>
|
||||||
|
<div id=nav>
|
||||||
|
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><a href="../../index.html">Home</a>
|
||||||
|
<li><a href="../../doc/manual.html">Manual</a>
|
||||||
|
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li><a href="../index.html">Language modes</a>
|
||||||
|
<li><a class=active href="#">APL</a>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<h2>APL mode</h2>
|
||||||
|
<form><textarea id="code" name="code">
|
||||||
|
⍝ Conway's game of life
|
||||||
|
|
||||||
|
⍝ This example was inspired by the impressive demo at
|
||||||
|
⍝ http://www.youtube.com/watch?v=a9xAKttWgP4
|
||||||
|
|
||||||
|
⍝ Create a matrix:
|
||||||
|
⍝ 0 1 1
|
||||||
|
⍝ 1 1 0
|
||||||
|
⍝ 0 1 0
|
||||||
|
creature ← (3 3 ⍴ ⍳ 9) ∈ 1 2 3 4 7 ⍝ Original creature from demo
|
||||||
|
creature ← (3 3 ⍴ ⍳ 9) ∈ 1 3 6 7 8 ⍝ Glider
|
||||||
|
|
||||||
|
⍝ Place the creature on a larger board, near the centre
|
||||||
|
board ← ¯1 ⊖ ¯2 ⌽ 5 7 ↑ creature
|
||||||
|
|
||||||
|
⍝ A function to move from one generation to the next
|
||||||
|
life ← {∨/ 1 ⍵ ∧ 3 4 = ⊂+/ +⌿ 1 0 ¯1 ∘.⊖ 1 0 ¯1 ⌽¨ ⊂⍵}
|
||||||
|
|
||||||
|
⍝ Compute n-th generation and format it as a
|
||||||
|
⍝ character matrix
|
||||||
|
gen ← {' #'[(life ⍣ ⍵) board]}
|
||||||
|
|
||||||
|
⍝ Show first three generations
|
||||||
|
(gen 1) (gen 2) (gen 3)
|
||||||
|
</textarea></form>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||||
|
lineNumbers: true,
|
||||||
|
matchBrackets: true,
|
||||||
|
mode: "text/apl"
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p>Simple mode that tries to handle APL as well as it can.</p>
|
||||||
|
<p>It attempts to label functions/operators based upon
|
||||||
|
monadic/dyadic usage (but this is far from fully fleshed out).
|
||||||
|
This means there are meaningful classnames so hover states can
|
||||||
|
have popups etc.</p>
|
||||||
|
|
||||||
|
<p><strong>MIME types defined:</strong> <code>text/apl</code> (APL code)</p>
|
||||||
|
</article>
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
/*
|
||||||
|
* =====================================================================================
|
||||||
|
*
|
||||||
|
* Filename: mode/asterisk/asterisk.js
|
||||||
|
*
|
||||||
|
* Description: CodeMirror mode for Asterisk dialplan
|
||||||
|
*
|
||||||
|
* Created: 05/17/2012 09:20:25 PM
|
||||||
|
* Revision: none
|
||||||
|
*
|
||||||
|
* Author: Stas Kobzar (stas@modulis.ca),
|
||||||
|
* Company: Modulis.ca Inc.
|
||||||
|
*
|
||||||
|
* =====================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
CodeMirror.defineMode("asterisk", function() {
|
||||||
|
var atoms = ["exten", "same", "include","ignorepat","switch"],
|
||||||
|
dpcmd = ["#include","#exec"],
|
||||||
|
apps = [
|
||||||
|
"addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi",
|
||||||
|
"alarmreceiver","amd","answer","authenticate","background","backgrounddetect",
|
||||||
|
"bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent",
|
||||||
|
"changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge",
|
||||||
|
"congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge",
|
||||||
|
"dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility",
|
||||||
|
"datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa",
|
||||||
|
"dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy",
|
||||||
|
"externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif",
|
||||||
|
"goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete",
|
||||||
|
"ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus",
|
||||||
|
"jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme",
|
||||||
|
"meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete",
|
||||||
|
"minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode",
|
||||||
|
"mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish",
|
||||||
|
"originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce",
|
||||||
|
"parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones",
|
||||||
|
"privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten",
|
||||||
|
"readfile","receivefax","receivefax","receivefax","record","removequeuemember",
|
||||||
|
"resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun",
|
||||||
|
"saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax",
|
||||||
|
"sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags",
|
||||||
|
"setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel",
|
||||||
|
"slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground",
|
||||||
|
"speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound",
|
||||||
|
"speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor",
|
||||||
|
"stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec",
|
||||||
|
"trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate",
|
||||||
|
"vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring",
|
||||||
|
"waitforsilence","waitmusiconhold","waituntil","while","zapateller"
|
||||||
|
];
|
||||||
|
|
||||||
|
function basicToken(stream,state){
|
||||||
|
var cur = '';
|
||||||
|
var ch = '';
|
||||||
|
ch = stream.next();
|
||||||
|
// comment
|
||||||
|
if(ch == ";") {
|
||||||
|
stream.skipToEnd();
|
||||||
|
return "comment";
|
||||||
|
}
|
||||||
|
// context
|
||||||
|
if(ch == '[') {
|
||||||
|
stream.skipTo(']');
|
||||||
|
stream.eat(']');
|
||||||
|
return "header";
|
||||||
|
}
|
||||||
|
// string
|
||||||
|
if(ch == '"') {
|
||||||
|
stream.skipTo('"');
|
||||||
|
return "string";
|
||||||
|
}
|
||||||
|
if(ch == "'") {
|
||||||
|
stream.skipTo("'");
|
||||||
|
return "string-2";
|
||||||
|
}
|
||||||
|
// dialplan commands
|
||||||
|
if(ch == '#') {
|
||||||
|
stream.eatWhile(/\w/);
|
||||||
|
cur = stream.current();
|
||||||
|
if(dpcmd.indexOf(cur) !== -1) {
|
||||||
|
stream.skipToEnd();
|
||||||
|
return "strong";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// application args
|
||||||
|
if(ch == '$'){
|
||||||
|
var ch1 = stream.peek();
|
||||||
|
if(ch1 == '{'){
|
||||||
|
stream.skipTo('}');
|
||||||
|
stream.eat('}');
|
||||||
|
return "variable-3";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// extension
|
||||||
|
stream.eatWhile(/\w/);
|
||||||
|
cur = stream.current();
|
||||||
|
if(atoms.indexOf(cur) !== -1) {
|
||||||
|
state.extenStart = true;
|
||||||
|
switch(cur) {
|
||||||
|
case 'same': state.extenSame = true; break;
|
||||||
|
case 'include':
|
||||||
|
case 'switch':
|
||||||
|
case 'ignorepat':
|
||||||
|
state.extenInclude = true;break;
|
||||||
|
default:break;
|
||||||
|
}
|
||||||
|
return "atom";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
startState: function() {
|
||||||
|
return {
|
||||||
|
extenStart: false,
|
||||||
|
extenSame: false,
|
||||||
|
extenInclude: false,
|
||||||
|
extenExten: false,
|
||||||
|
extenPriority: false,
|
||||||
|
extenApplication: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
token: function(stream, state) {
|
||||||
|
|
||||||
|
var cur = '';
|
||||||
|
var ch = '';
|
||||||
|
if(stream.eatSpace()) return null;
|
||||||
|
// extension started
|
||||||
|
if(state.extenStart){
|
||||||
|
stream.eatWhile(/[^\s]/);
|
||||||
|
cur = stream.current();
|
||||||
|
if(/^=>?$/.test(cur)){
|
||||||
|
state.extenExten = true;
|
||||||
|
state.extenStart = false;
|
||||||
|
return "strong";
|
||||||
|
} else {
|
||||||
|
state.extenStart = false;
|
||||||
|
stream.skipToEnd();
|
||||||
|
return "error";
|
||||||
|
}
|
||||||
|
} else if(state.extenExten) {
|
||||||
|
// set exten and priority
|
||||||
|
state.extenExten = false;
|
||||||
|
state.extenPriority = true;
|
||||||
|
stream.eatWhile(/[^,]/);
|
||||||
|
if(state.extenInclude) {
|
||||||
|
stream.skipToEnd();
|
||||||
|
state.extenPriority = false;
|
||||||
|
state.extenInclude = false;
|
||||||
|
}
|
||||||
|
if(state.extenSame) {
|
||||||
|
state.extenPriority = false;
|
||||||
|
state.extenSame = false;
|
||||||
|
state.extenApplication = true;
|
||||||
|
}
|
||||||
|
return "tag";
|
||||||
|
} else if(state.extenPriority) {
|
||||||
|
state.extenPriority = false;
|
||||||
|
state.extenApplication = true;
|
||||||
|
ch = stream.next(); // get comma
|
||||||
|
if(state.extenSame) return null;
|
||||||
|
stream.eatWhile(/[^,]/);
|
||||||
|
return "number";
|
||||||
|
} else if(state.extenApplication) {
|
||||||
|
stream.eatWhile(/,/);
|
||||||
|
cur = stream.current();
|
||||||
|
if(cur === ',') return null;
|
||||||
|
stream.eatWhile(/\w/);
|
||||||
|
cur = stream.current().toLowerCase();
|
||||||
|
state.extenApplication = false;
|
||||||
|
if(apps.indexOf(cur) !== -1){
|
||||||
|
return "def strong";
|
||||||
|
}
|
||||||
|
} else{
|
||||||
|
return basicToken(stream,state);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
CodeMirror.defineMIME("text/x-asterisk", "asterisk");
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
<!doctype html>
|
||||||
|
|
||||||
|
<title>CodeMirror: Asterisk dialplan mode</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<link rel=stylesheet href="../../doc/docs.css">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
|
<script src="../../lib/codemirror.js"></script>
|
||||||
|
<script src="asterisk.js"></script>
|
||||||
|
<style>
|
||||||
|
.CodeMirror {border: 1px solid #999;}
|
||||||
|
.cm-s-default span.cm-arrow { color: red; }
|
||||||
|
</style>
|
||||||
|
<div id=nav>
|
||||||
|
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><a href="../../index.html">Home</a>
|
||||||
|
<li><a href="../../doc/manual.html">Manual</a>
|
||||||
|
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li><a href="../index.html">Language modes</a>
|
||||||
|
<li><a class=active href="#">Asterisk dialplan</a>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<h2>Asterisk dialplan mode</h2>
|
||||||
|
<form><textarea id="code" name="code">
|
||||||
|
; extensions.conf - the Asterisk dial plan
|
||||||
|
;
|
||||||
|
|
||||||
|
[general]
|
||||||
|
;
|
||||||
|
; If static is set to no, or omitted, then the pbx_config will rewrite
|
||||||
|
; this file when extensions are modified. Remember that all comments
|
||||||
|
; made in the file will be lost when that happens.
|
||||||
|
static=yes
|
||||||
|
|
||||||
|
#include "/etc/asterisk/additional_general.conf
|
||||||
|
|
||||||
|
[iaxprovider]
|
||||||
|
switch => IAX2/user:[key]@myserver/mycontext
|
||||||
|
|
||||||
|
[dynamic]
|
||||||
|
#exec /usr/bin/dynamic-peers.pl
|
||||||
|
|
||||||
|
[trunkint]
|
||||||
|
;
|
||||||
|
; International long distance through trunk
|
||||||
|
;
|
||||||
|
exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
|
||||||
|
exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${FILTER(0-9,${EXTEN:${GLOBAL(TRUNKMSD)}})})
|
||||||
|
|
||||||
|
[local]
|
||||||
|
;
|
||||||
|
; Master context for local, toll-free, and iaxtel calls only
|
||||||
|
;
|
||||||
|
ignorepat => 9
|
||||||
|
include => default
|
||||||
|
|
||||||
|
[demo]
|
||||||
|
include => stdexten
|
||||||
|
;
|
||||||
|
; We start with what to do when a call first comes in.
|
||||||
|
;
|
||||||
|
exten => s,1,Wait(1) ; Wait a second, just for fun
|
||||||
|
same => n,Answer ; Answer the line
|
||||||
|
same => n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
|
||||||
|
same => n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
|
||||||
|
same => n(restart),BackGround(demo-congrats) ; Play a congratulatory message
|
||||||
|
same => n(instruct),BackGround(demo-instruct) ; Play some instructions
|
||||||
|
same => n,WaitExten ; Wait for an extension to be dialed.
|
||||||
|
|
||||||
|
exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
|
||||||
|
exten => 2,n,Goto(s,instruct)
|
||||||
|
|
||||||
|
exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
|
||||||
|
exten => 3,n,Goto(s,restart) ; Start with the congratulations
|
||||||
|
|
||||||
|
exten => 1000,1,Goto(default,s,1)
|
||||||
|
;
|
||||||
|
; We also create an example user, 1234, who is on the console and has
|
||||||
|
; voicemail, etc.
|
||||||
|
;
|
||||||
|
exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
|
||||||
|
; (but skip if channel is not up)
|
||||||
|
exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}))
|
||||||
|
exten => 1234,n,Goto(default,s,1) ; exited Voicemail
|
||||||
|
|
||||||
|
exten => 1235,1,Voicemail(1234,u) ; Right to voicemail
|
||||||
|
|
||||||
|
exten => 1236,1,Dial(Console/dsp) ; Ring forever
|
||||||
|
exten => 1236,n,Voicemail(1234,b) ; Unless busy
|
||||||
|
|
||||||
|
;
|
||||||
|
; # for when they're done with the demo
|
||||||
|
;
|
||||||
|
exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
|
||||||
|
exten => #,n,Hangup ; Hang them up.
|
||||||
|
|
||||||
|
;
|
||||||
|
; A timeout and "invalid extension rule"
|
||||||
|
;
|
||||||
|
exten => t,1,Goto(#,1) ; If they take too long, give up
|
||||||
|
exten => i,1,Playback(invalid) ; "That's not valid, try again"
|
||||||
|
|
||||||
|
;
|
||||||
|
; Create an extension, 500, for dialing the
|
||||||
|
; Asterisk demo.
|
||||||
|
;
|
||||||
|
exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
|
||||||
|
exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo
|
||||||
|
exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site
|
||||||
|
exten => 500,n,Goto(s,6) ; Return to the start over message.
|
||||||
|
|
||||||
|
;
|
||||||
|
; Create an extension, 600, for evaluating echo latency.
|
||||||
|
;
|
||||||
|
exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
|
||||||
|
exten => 600,n,Echo ; Do the echo test
|
||||||
|
exten => 600,n,Playback(demo-echodone) ; Let them know it's over
|
||||||
|
exten => 600,n,Goto(s,6) ; Start over
|
||||||
|
|
||||||
|
;
|
||||||
|
; You can use the Macro Page to intercom a individual user
|
||||||
|
exten => 76245,1,Macro(page,SIP/Grandstream1)
|
||||||
|
; or if your peernames are the same as extensions
|
||||||
|
exten => _7XXX,1,Macro(page,SIP/${EXTEN})
|
||||||
|
;
|
||||||
|
;
|
||||||
|
; System Wide Page at extension 7999
|
||||||
|
;
|
||||||
|
exten => 7999,1,Set(TIMEOUT(absolute)=60)
|
||||||
|
exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
|
||||||
|
|
||||||
|
; Give voicemail at extension 8500
|
||||||
|
;
|
||||||
|
exten => 8500,1,VoicemailMain
|
||||||
|
exten => 8500,n,Goto(s,6)
|
||||||
|
|
||||||
|
</textarea></form>
|
||||||
|
<script>
|
||||||
|
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||||
|
mode: "text/x-asterisk",
|
||||||
|
matchBrackets: true,
|
||||||
|
lineNumber: true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p><strong>MIME types defined:</strong> <code>text/x-asterisk</code>.</p>
|
||||||
|
|
||||||
|
</article>
|
||||||
+88
-10
@@ -1,5 +1,7 @@
|
|||||||
CodeMirror.defineMode("clike", function(config, parserConfig) {
|
CodeMirror.defineMode("clike", function(config, parserConfig) {
|
||||||
var indentUnit = config.indentUnit,
|
var indentUnit = config.indentUnit,
|
||||||
|
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
|
||||||
|
dontAlignCalls = parserConfig.dontAlignCalls,
|
||||||
keywords = parserConfig.keywords || {},
|
keywords = parserConfig.keywords || {},
|
||||||
builtin = parserConfig.builtin || {},
|
builtin = parserConfig.builtin || {},
|
||||||
blockKeywords = parserConfig.blockKeywords || {},
|
blockKeywords = parserConfig.blockKeywords || {},
|
||||||
@@ -89,7 +91,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
this.prev = prev;
|
this.prev = prev;
|
||||||
}
|
}
|
||||||
function pushContext(state, col, type) {
|
function pushContext(state, col, type) {
|
||||||
return state.context = new Context(state.indented, col, type, null, state.context);
|
var indent = state.indented;
|
||||||
|
if (state.context && state.context.type == "statement")
|
||||||
|
indent = state.context.indented;
|
||||||
|
return state.context = new Context(indent, col, type, null, state.context);
|
||||||
}
|
}
|
||||||
function popContext(state) {
|
function popContext(state) {
|
||||||
var t = state.context.type;
|
var t = state.context.type;
|
||||||
@@ -123,7 +128,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
if (style == "comment" || style == "meta") return style;
|
if (style == "comment" || style == "meta") return style;
|
||||||
if (ctx.align == null) ctx.align = true;
|
if (ctx.align == null) ctx.align = true;
|
||||||
|
|
||||||
if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
|
if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);
|
||||||
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
||||||
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
||||||
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
||||||
@@ -133,23 +138,28 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
while (ctx.type == "statement") ctx = popContext(state);
|
while (ctx.type == "statement") ctx = popContext(state);
|
||||||
}
|
}
|
||||||
else if (curPunc == ctx.type) popContext(state);
|
else if (curPunc == ctx.type) popContext(state);
|
||||||
else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
|
else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement"))
|
||||||
pushContext(state, stream.column(), "statement");
|
pushContext(state, stream.column(), "statement");
|
||||||
state.startOfLine = false;
|
state.startOfLine = false;
|
||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
|
|
||||||
indent: function(state, textAfter) {
|
indent: function(state, textAfter) {
|
||||||
if (state.tokenize != tokenBase && state.tokenize != null) return 0;
|
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
|
||||||
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
||||||
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
||||||
var closing = firstChar == ctx.type;
|
var closing = firstChar == ctx.type;
|
||||||
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
|
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
|
||||||
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
else if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
|
||||||
|
else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
|
||||||
else return ctx.indented + (closing ? 0 : indentUnit);
|
else return ctx.indented + (closing ? 0 : indentUnit);
|
||||||
},
|
},
|
||||||
|
|
||||||
electricChars: "{}"
|
electricChars: "{}",
|
||||||
|
blockCommentStart: "/*",
|
||||||
|
blockCommentEnd: "*/",
|
||||||
|
lineComment: "//",
|
||||||
|
fold: "brace"
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -165,7 +175,19 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
|
|
||||||
function cppHook(stream, state) {
|
function cppHook(stream, state) {
|
||||||
if (!state.startOfLine) return false;
|
if (!state.startOfLine) return false;
|
||||||
stream.skipToEnd();
|
for (;;) {
|
||||||
|
if (stream.skipTo("\\")) {
|
||||||
|
stream.next();
|
||||||
|
if (stream.eol()) {
|
||||||
|
state.tokenize = cppHook;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stream.skipToEnd();
|
||||||
|
state.tokenize = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return "meta";
|
return "meta";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +234,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
blockKeywords: words("catch class do else finally for if switch try while"),
|
blockKeywords: words("catch class do else finally for if switch try while"),
|
||||||
atoms: words("true false null"),
|
atoms: words("true false null"),
|
||||||
hooks: {
|
hooks: {
|
||||||
"@": function(stream, state) {
|
"@": function(stream) {
|
||||||
stream.eatWhile(/[\w\$_]/);
|
stream.eatWhile(/[\w\$_]/);
|
||||||
return "meta";
|
return "meta";
|
||||||
}
|
}
|
||||||
@@ -275,10 +297,66 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
|
|||||||
blockKeywords: words("catch class do else finally for forSome if match switch try while"),
|
blockKeywords: words("catch class do else finally for forSome if match switch try while"),
|
||||||
atoms: words("true false null"),
|
atoms: words("true false null"),
|
||||||
hooks: {
|
hooks: {
|
||||||
"@": function(stream, state) {
|
"@": function(stream) {
|
||||||
stream.eatWhile(/[\w\$_]/);
|
stream.eatWhile(/[\w\$_]/);
|
||||||
return "meta";
|
return "meta";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
mimes(["x-shader/x-vertex", "x-shader/x-fragment"], {
|
||||||
|
name: "clike",
|
||||||
|
keywords: words("float int bool void " +
|
||||||
|
"vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
|
||||||
|
"mat2 mat3 mat4 " +
|
||||||
|
"sampler1D sampler2D sampler3D samplerCube " +
|
||||||
|
"sampler1DShadow sampler2DShadow" +
|
||||||
|
"const attribute uniform varying " +
|
||||||
|
"break continue discard return " +
|
||||||
|
"for while do if else struct " +
|
||||||
|
"in out inout"),
|
||||||
|
blockKeywords: words("for while do if else struct"),
|
||||||
|
builtin: words("radians degrees sin cos tan asin acos atan " +
|
||||||
|
"pow exp log exp2 sqrt inversesqrt " +
|
||||||
|
"abs sign floor ceil fract mod min max clamp mix step smootstep " +
|
||||||
|
"length distance dot cross normalize ftransform faceforward " +
|
||||||
|
"reflect refract matrixCompMult " +
|
||||||
|
"lessThan lessThanEqual greaterThan greaterThanEqual " +
|
||||||
|
"equal notEqual any all not " +
|
||||||
|
"texture1D texture1DProj texture1DLod texture1DProjLod " +
|
||||||
|
"texture2D texture2DProj texture2DLod texture2DProjLod " +
|
||||||
|
"texture3D texture3DProj texture3DLod texture3DProjLod " +
|
||||||
|
"textureCube textureCubeLod " +
|
||||||
|
"shadow1D shadow2D shadow1DProj shadow2DProj " +
|
||||||
|
"shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
|
||||||
|
"dFdx dFdy fwidth " +
|
||||||
|
"noise1 noise2 noise3 noise4"),
|
||||||
|
atoms: words("true false " +
|
||||||
|
"gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
|
||||||
|
"gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
|
||||||
|
"gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
|
||||||
|
"gl_FogCoord " +
|
||||||
|
"gl_Position gl_PointSize gl_ClipVertex " +
|
||||||
|
"gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
|
||||||
|
"gl_TexCoord gl_FogFragCoord " +
|
||||||
|
"gl_FragCoord gl_FrontFacing " +
|
||||||
|
"gl_FragColor gl_FragData gl_FragDepth " +
|
||||||
|
"gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
|
||||||
|
"gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
|
||||||
|
"gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
|
||||||
|
"gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
|
||||||
|
"gl_ProjectionMatrixInverseTranspose " +
|
||||||
|
"gl_ModelViewProjectionMatrixInverseTranspose " +
|
||||||
|
"gl_TextureMatrixInverseTranspose " +
|
||||||
|
"gl_NormalScale gl_DepthRange gl_ClipPlane " +
|
||||||
|
"gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
|
||||||
|
"gl_FrontLightModelProduct gl_BackLightModelProduct " +
|
||||||
|
"gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
|
||||||
|
"gl_FogParameters " +
|
||||||
|
"gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
|
||||||
|
"gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
|
||||||
|
"gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
|
||||||
|
"gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
|
||||||
|
"gl_MaxDrawBuffers"),
|
||||||
|
hooks: {"#": cppHook}
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
|
|||||||
+110
-17
@@ -1,18 +1,32 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>CodeMirror: C-like mode</title>
|
|
||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
|
||||||
<script src="../../lib/codemirror.js"></script>
|
|
||||||
<script src="clike.js"></script>
|
|
||||||
<link rel="stylesheet" href="../../doc/docs.css">
|
|
||||||
<style>.CodeMirror {border: 2px inset #dee;}</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>CodeMirror: C-like mode</h1>
|
|
||||||
|
|
||||||
<form><textarea id="code" name="code">
|
<title>CodeMirror: C-like mode</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<link rel=stylesheet href="../../doc/docs.css">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
|
<script src="../../lib/codemirror.js"></script>
|
||||||
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
|
<script src="clike.js"></script>
|
||||||
|
<style>.CodeMirror {border: 2px inset #dee;}</style>
|
||||||
|
<div id=nav>
|
||||||
|
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><a href="../../index.html">Home</a>
|
||||||
|
<li><a href="../../doc/manual.html">Manual</a>
|
||||||
|
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li><a href="../index.html">Language modes</a>
|
||||||
|
<li><a class=active href="#">C-like</a>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<h2>C-like mode</h2>
|
||||||
|
|
||||||
|
<div><textarea id="c-code">
|
||||||
/* C demo code */
|
/* C demo code */
|
||||||
|
|
||||||
#include <zmq.h>
|
#include <zmq.h>
|
||||||
@@ -78,14 +92,94 @@ void* zmq_thread_init(void* zmq_context, int signal_fd) {
|
|||||||
pthread_detach(thread);
|
pthread_detach(thread);
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
</textarea></form>
|
</textarea></div>
|
||||||
|
|
||||||
|
<h2>C++ example</h2>
|
||||||
|
|
||||||
|
<div><textarea id="cpp-code">
|
||||||
|
#include <iostream>
|
||||||
|
#include "mystuff/util.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
enum Enum {
|
||||||
|
VAL1, VAL2, VAL3
|
||||||
|
};
|
||||||
|
|
||||||
|
int Helper(const MyType& param) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
class ForwardDec;
|
||||||
|
|
||||||
|
template <class T, class V>
|
||||||
|
class Class : public BaseClass {
|
||||||
|
const MyType<T, V> member_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
const MyType<T, V>& Method() const {
|
||||||
|
return member_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Method2(MyType<T, V>* value);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T, class V>
|
||||||
|
void Class::Method2(MyType<T, V>* value) {
|
||||||
|
std::out << 1 >> method();
|
||||||
|
value->Method3(member_);
|
||||||
|
member_ = value;
|
||||||
|
}
|
||||||
|
</textarea></div>
|
||||||
|
|
||||||
|
<h2>Java example</h2>
|
||||||
|
|
||||||
|
<div><textarea id="java-code">
|
||||||
|
import com.demo.util.MyType;
|
||||||
|
import com.demo.util.MyInterface;
|
||||||
|
|
||||||
|
public enum Enum {
|
||||||
|
VAL1, VAL2, VAL3
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Class<T, V> implements MyInterface {
|
||||||
|
public static final MyType<T, V> member;
|
||||||
|
|
||||||
|
private class InnerClass {
|
||||||
|
public int zero() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MyType method() {
|
||||||
|
return member;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void method2(MyType<T, V> value) {
|
||||||
|
method();
|
||||||
|
value.method3();
|
||||||
|
member = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</textarea></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
var editor = CodeMirror.fromTextArea(document.getElementById("c-code"), {
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
mode: "text/x-csrc"
|
mode: "text/x-csrc"
|
||||||
});
|
});
|
||||||
|
var editor = CodeMirror.fromTextArea(document.getElementById("cpp-code"), {
|
||||||
|
lineNumbers: true,
|
||||||
|
matchBrackets: true,
|
||||||
|
mode: "text/x-c++src"
|
||||||
|
});
|
||||||
|
var javaEditor = CodeMirror.fromTextArea(document.getElementById("java-code"), {
|
||||||
|
lineNumbers: true,
|
||||||
|
matchBrackets: true,
|
||||||
|
mode: "text/x-java"
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p>Simple mode that tries to handle C-like languages as well as it
|
<p>Simple mode that tries to handle C-like languages as well as it
|
||||||
@@ -98,5 +192,4 @@ void* zmq_thread_init(void* zmq_context, int signal_fd) {
|
|||||||
(C code), <code>text/x-c++src</code> (C++
|
(C code), <code>text/x-c++src</code> (C++
|
||||||
code), <code>text/x-java</code> (Java
|
code), <code>text/x-java</code> (Java
|
||||||
code), <code>text/x-csharp</code> (C#).</p>
|
code), <code>text/x-csharp</code> (C#).</p>
|
||||||
</body>
|
</article>
|
||||||
</html>
|
|
||||||
|
|||||||
+27
-26
@@ -1,28 +1,30 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
|
||||||
<head>
|
<title>CodeMirror: Scala mode</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8"/>
|
||||||
<title>CodeMirror: C-like mode</title>
|
<link rel=stylesheet href="../../doc/docs.css">
|
||||||
<link rel="stylesheet" href="../../lib/codemirror.css">
|
|
||||||
<link rel="stylesheet" href="../../theme/ambiance.css">
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
<script src="../../lib/codemirror.js"></script>
|
<link rel="stylesheet" href="../../theme/ambiance.css">
|
||||||
<script src="clike.js"></script>
|
<script src="../../lib/codemirror.js"></script>
|
||||||
<link rel="stylesheet" href="../../doc/docs.css">
|
<script src="../../addon/edit/matchbrackets.js"></script>
|
||||||
<style>
|
<script src="clike.js"></script>
|
||||||
body
|
<div id=nav>
|
||||||
{
|
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
<ul>
|
||||||
max-width:inherit;
|
<li><a href="../../index.html">Home</a>
|
||||||
height: 100%;
|
<li><a href="../../doc/manual.html">Manual</a>
|
||||||
}
|
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||||
html, form, .CodeMirror, .CodeMirror-scroll
|
</ul>
|
||||||
{
|
<ul>
|
||||||
height: 100%;
|
<li><a href="../index.html">Language modes</a>
|
||||||
}
|
<li><a class=active href="#">Scala</a>
|
||||||
</style>
|
</ul>
|
||||||
</head>
|
</div>
|
||||||
<body>
|
|
||||||
|
<article>
|
||||||
|
<h2>Scala mode</h2>
|
||||||
<form>
|
<form>
|
||||||
<textarea id="code" name="code">
|
<textarea id="code" name="code">
|
||||||
|
|
||||||
@@ -762,5 +764,4 @@
|
|||||||
mode: "text/x-scala"
|
mode: "text/x-scala"
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</article>
|
||||||
</html>
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,88 @@
|
|||||||
|
<!doctype html>
|
||||||
|
|
||||||
|
<title>CodeMirror: Clojure mode</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<link rel=stylesheet href="../../doc/docs.css">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../../lib/codemirror.css">
|
||||||
|
<script src="../../lib/codemirror.js"></script>
|
||||||
|
<script src="clojure.js"></script>
|
||||||
|
<style>.CodeMirror {background: #f8f8f8;}</style>
|
||||||
|
<div id=nav>
|
||||||
|
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><a href="../../index.html">Home</a>
|
||||||
|
<li><a href="../../doc/manual.html">Manual</a>
|
||||||
|
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li><a href="../index.html">Language modes</a>
|
||||||
|
<li><a class=active href="#">Clojure</a>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<h2>Clojure mode</h2>
|
||||||
|
<form><textarea id="code" name="code">
|
||||||
|
; Conway's Game of Life, based on the work of:
|
||||||
|
;; Laurent Petit https://gist.github.com/1200343
|
||||||
|
;; Christophe Grand http://clj-me.cgrand.net/2011/08/19/conways-game-of-life
|
||||||
|
|
||||||
|
(ns ^{:doc "Conway's Game of Life."}
|
||||||
|
game-of-life)
|
||||||
|
|
||||||
|
;; Core game of life's algorithm functions
|
||||||
|
|
||||||
|
(defn neighbours
|
||||||
|
"Given a cell's coordinates, returns the coordinates of its neighbours."
|
||||||
|
[[x y]]
|
||||||
|
(for [dx [-1 0 1] dy (if (zero? dx) [-1 1] [-1 0 1])]
|
||||||
|
[(+ dx x) (+ dy y)]))
|
||||||
|
|
||||||
|
(defn step
|
||||||
|
"Given a set of living cells, computes the new set of living cells."
|
||||||
|
[cells]
|
||||||
|
(set (for [[cell n] (frequencies (mapcat neighbours cells))
|
||||||
|
:when (or (= n 3) (and (= n 2) (cells cell)))]
|
||||||
|
cell)))
|
||||||
|
|
||||||
|
;; Utility methods for displaying game on a text terminal
|
||||||
|
|
||||||
|
(defn print-board
|
||||||
|
"Prints a board on *out*, representing a step in the game."
|
||||||
|
[board w h]
|
||||||
|
(doseq [x (range (inc w)) y (range (inc h))]
|
||||||
|
(if (= y 0) (print "\n"))
|
||||||
|
(print (if (board [x y]) "[X]" " . "))))
|
||||||
|
|
||||||
|
(defn display-grids
|
||||||
|
"Prints a squence of boards on *out*, representing several steps."
|
||||||
|
[grids w h]
|
||||||
|
(doseq [board grids]
|
||||||
|
(print-board board w h)
|
||||||
|
(print "\n")))
|
||||||
|
|
||||||
|
;; Launches an example board
|
||||||
|
|
||||||
|
(def
|
||||||
|
^{:doc "board represents the initial set of living cells"}
|
||||||
|
board #{[2 1] [2 2] [2 3]})
|
||||||
|
|
||||||
|
(display-grids (take 3 (iterate step board)) 5 5)
|
||||||
|
|
||||||
|
;; Let's play with characters
|
||||||
|
(println \1 \a \# \\
|
||||||
|
\" \( \newline
|
||||||
|
\} \" \space
|
||||||
|
\tab \return \backspace
|
||||||
|
\u1000 \uAaAa \u9F9F)
|
||||||
|
|
||||||
|
</textarea></form>
|
||||||
|
<script>
|
||||||
|
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p><strong>MIME types defined:</strong> <code>text/x-clojure</code>.</p>
|
||||||
|
|
||||||
|
</article>
|
||||||
@@ -0,0 +1,240 @@
|
|||||||
|
/**
|
||||||
|
* Author: Gautam Mehta
|
||||||
|
* Branched from CodeMirror's Scheme mode
|
||||||
|
*/
|
||||||
|
CodeMirror.defineMode("cobol", function () {
|
||||||
|
var BUILTIN = "builtin", COMMENT = "comment", STRING = "string",
|
||||||
|
ATOM = "atom", NUMBER = "number", KEYWORD = "keyword", MODTAG = "header",
|
||||||
|
COBOLLINENUM = "def", PERIOD = "link";
|
||||||
|
function makeKeywords(str) {
|
||||||
|
var obj = {}, words = str.split(" ");
|
||||||
|
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
var atoms = makeKeywords("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES ");
|
||||||
|
var keywords = makeKeywords(
|
||||||
|
"ACCEPT ACCESS ACQUIRE ADD ADDRESS " +
|
||||||
|
"ADVANCING AFTER ALIAS ALL ALPHABET " +
|
||||||
|
"ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED " +
|
||||||
|
"ALSO ALTER ALTERNATE AND ANY " +
|
||||||
|
"ARE AREA AREAS ARITHMETIC ASCENDING " +
|
||||||
|
"ASSIGN AT ATTRIBUTE AUTHOR AUTO " +
|
||||||
|
"AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS " +
|
||||||
|
"B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP " +
|
||||||
|
"BEFORE BELL BINARY BIT BITS " +
|
||||||
|
"BLANK BLINK BLOCK BOOLEAN BOTTOM " +
|
||||||
|
"BY CALL CANCEL CD CF " +
|
||||||
|
"CH CHARACTER CHARACTERS CLASS CLOCK-UNITS " +
|
||||||
|
"CLOSE COBOL CODE CODE-SET COL " +
|
||||||
|
"COLLATING COLUMN COMMA COMMIT COMMITMENT " +
|
||||||
|
"COMMON COMMUNICATION COMP COMP-0 COMP-1 " +
|
||||||
|
"COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 " +
|
||||||
|
"COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 " +
|
||||||
|
"COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 " +
|
||||||
|
"COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE " +
|
||||||
|
"CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS " +
|
||||||
|
"CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS " +
|
||||||
|
"CONVERTING COPY CORR CORRESPONDING COUNT " +
|
||||||
|
"CRT CRT-UNDER CURRENCY CURRENT CURSOR " +
|
||||||
|
"DATA DATE DATE-COMPILED DATE-WRITTEN DAY " +
|
||||||
|
"DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION " +
|
||||||
|
"DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS " +
|
||||||
|
"DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE " +
|
||||||
|
"DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING " +
|
||||||
|
"DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED " +
|
||||||
|
"DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION " +
|
||||||
|
"DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 " +
|
||||||
|
"DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 " +
|
||||||
|
"DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION " +
|
||||||
|
"DOWN DROP DUPLICATE DUPLICATES DYNAMIC " +
|
||||||
|
"EBCDIC EGI EJECT ELSE EMI " +
|
||||||
|
"EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. " +
|
||||||
|
"END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY " +
|
||||||
|
"END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY " +
|
||||||
|
"END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN " +
|
||||||
|
"END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT " +
|
||||||
|
"END-UNSTRING END-WRITE END-XML ENTER ENTRY " +
|
||||||
|
"ENVIRONMENT EOP EQUAL EQUALS ERASE " +
|
||||||
|
"ERROR ESI EVALUATE EVERY EXCEEDS " +
|
||||||
|
"EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL " +
|
||||||
|
"EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL " +
|
||||||
|
"FILE-STREAM FILES FILLER FINAL FIND " +
|
||||||
|
"FINISH FIRST FOOTING FOR FOREGROUND-COLOR " +
|
||||||
|
"FOREGROUND-COLOUR FORMAT FREE FROM FULL " +
|
||||||
|
"FUNCTION GENERATE GET GIVING GLOBAL " +
|
||||||
|
"GO GOBACK GREATER GROUP HEADING " +
|
||||||
|
"HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL " +
|
||||||
|
"ID IDENTIFICATION IF IN INDEX " +
|
||||||
|
"INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 " +
|
||||||
|
"INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED " +
|
||||||
|
"INDIC INDICATE INDICATOR INDICATORS INITIAL " +
|
||||||
|
"INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT " +
|
||||||
|
"INSTALLATION INTO INVALID INVOKE IS " +
|
||||||
|
"JUST JUSTIFIED KANJI KEEP KEY " +
|
||||||
|
"LABEL LAST LD LEADING LEFT " +
|
||||||
|
"LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY " +
|
||||||
|
"LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER " +
|
||||||
|
"LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE " +
|
||||||
|
"LOCALE LOCALLY LOCK " +
|
||||||
|
"MEMBER MEMORY MERGE MESSAGE METACLASS " +
|
||||||
|
"MODE MODIFIED MODIFY MODULES MOVE " +
|
||||||
|
"MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE " +
|
||||||
|
"NEXT NO NO-ECHO NONE NOT " +
|
||||||
|
"NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER " +
|
||||||
|
"NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS " +
|
||||||
|
"OF OFF OMITTED ON ONLY " +
|
||||||
|
"OPEN OPTIONAL OR ORDER ORGANIZATION " +
|
||||||
|
"OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL " +
|
||||||
|
"PADDING PAGE PAGE-COUNTER PARSE PERFORM " +
|
||||||
|
"PF PH PIC PICTURE PLUS " +
|
||||||
|
"POINTER POSITION POSITIVE PREFIX PRESENT " +
|
||||||
|
"PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES " +
|
||||||
|
"PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID " +
|
||||||
|
"PROMPT PROTECTED PURGE QUEUE QUOTE " +
|
||||||
|
"QUOTES RANDOM RD READ READY " +
|
||||||
|
"REALM RECEIVE RECONNECT RECORD RECORD-NAME " +
|
||||||
|
"RECORDS RECURSIVE REDEFINES REEL REFERENCE " +
|
||||||
|
"REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE " +
|
||||||
|
"REMAINDER REMOVAL RENAMES REPEATED REPLACE " +
|
||||||
|
"REPLACING REPORT REPORTING REPORTS REPOSITORY " +
|
||||||
|
"REQUIRED RERUN RESERVE RESET RETAINING " +
|
||||||
|
"RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO " +
|
||||||
|
"REVERSED REWIND REWRITE RF RH " +
|
||||||
|
"RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED " +
|
||||||
|
"RUN SAME SCREEN SD SEARCH " +
|
||||||
|
"SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT " +
|
||||||
|
"SELECT SEND SENTENCE SEPARATE SEQUENCE " +
|
||||||
|
"SEQUENTIAL SET SHARED SIGN SIZE " +
|
||||||
|
"SKIP1 SKIP2 SKIP3 SORT SORT-MERGE " +
|
||||||
|
"SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL " +
|
||||||
|
"SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 " +
|
||||||
|
"START STARTING STATUS STOP STORE " +
|
||||||
|
"STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA " +
|
||||||
|
"SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS " +
|
||||||
|
"SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT " +
|
||||||
|
"TABLE TALLYING TAPE TENANT TERMINAL " +
|
||||||
|
"TERMINATE TEST TEXT THAN THEN " +
|
||||||
|
"THROUGH THRU TIME TIMES TITLE " +
|
||||||
|
"TO TOP TRAILING TRAILING-SIGN TRANSACTION " +
|
||||||
|
"TYPE TYPEDEF UNDERLINE UNEQUAL UNIT " +
|
||||||
|
"UNSTRING UNTIL UP UPDATE UPON " +
|
||||||
|
"USAGE USAGE-MODE USE USING VALID " +
|
||||||
|
"VALIDATE VALUE VALUES VARYING VLR " +
|
||||||
|
"WAIT WHEN WHEN-COMPILED WITH WITHIN " +
|
||||||
|
"WORDS WORKING-STORAGE WRITE XML XML-CODE " +
|
||||||
|
"XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL " );
|
||||||
|
|
||||||
|
var builtins = makeKeywords("- * ** / + < <= = > >= ");
|
||||||
|
var tests = {
|
||||||
|
digit: /\d/,
|
||||||
|
digit_or_colon: /[\d:]/,
|
||||||
|
hex: /[0-9a-f]/i,
|
||||||
|
sign: /[+-]/,
|
||||||
|
exponent: /e/i,
|
||||||
|
keyword_char: /[^\s\(\[\;\)\]]/,
|
||||||
|
symbol: /[\w*+\-]/
|
||||||
|
};
|
||||||
|
function isNumber(ch, stream){
|
||||||
|
// hex
|
||||||
|
if ( ch === '0' && stream.eat(/x/i) ) {
|
||||||
|
stream.eatWhile(tests.hex);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// leading sign
|
||||||
|
if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) {
|
||||||
|
stream.eat(tests.sign);
|
||||||
|
ch = stream.next();
|
||||||
|
}
|
||||||
|
if ( tests.digit.test(ch) ) {
|
||||||
|
stream.eat(ch);
|
||||||
|
stream.eatWhile(tests.digit);
|
||||||
|
if ( '.' == stream.peek()) {
|
||||||
|
stream.eat('.');
|
||||||
|
stream.eatWhile(tests.digit);
|
||||||
|
}
|
||||||
|
if ( stream.eat(tests.exponent) ) {
|
||||||
|
stream.eat(tests.sign);
|
||||||
|
stream.eatWhile(tests.digit);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
startState: function () {
|
||||||
|
return {
|
||||||
|
indentStack: null,
|
||||||
|
indentation: 0,
|
||||||
|
mode: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
token: function (stream, state) {
|
||||||
|
if (state.indentStack == null && stream.sol()) {
|
||||||
|
// update indentation, but only if indentStack is empty
|
||||||
|
state.indentation = 6 ; //stream.indentation();
|
||||||
|
}
|
||||||
|
// skip spaces
|
||||||
|
if (stream.eatSpace()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
var returnType = null;
|
||||||
|
switch(state.mode){
|
||||||
|
case "string": // multi-line string parsing mode
|
||||||
|
var next = false;
|
||||||
|
while ((next = stream.next()) != null) {
|
||||||
|
if (next == "\"" || next == "\'") {
|
||||||
|
state.mode = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
returnType = STRING; // continue on in string mode
|
||||||
|
break;
|
||||||
|
default: // default parsing mode
|
||||||
|
var ch = stream.next();
|
||||||
|
var col = stream.column();
|
||||||
|
if (col >= 0 && col <= 5) {
|
||||||
|
returnType = COBOLLINENUM;
|
||||||
|
} else if (col >= 72 && col <= 79) {
|
||||||
|
stream.skipToEnd();
|
||||||
|
returnType = MODTAG;
|
||||||
|
} else if (ch == "*" && col == 6) { // comment
|
||||||
|
stream.skipToEnd(); // rest of the line is a comment
|
||||||
|
returnType = COMMENT;
|
||||||
|
} else if (ch == "\"" || ch == "\'") {
|
||||||
|
state.mode = "string";
|
||||||
|
returnType = STRING;
|
||||||
|
} else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) {
|
||||||
|
returnType = ATOM;
|
||||||
|
} else if (ch == ".") {
|
||||||
|
returnType = PERIOD;
|
||||||
|
} else if (isNumber(ch,stream)){
|
||||||
|
returnType = NUMBER;
|
||||||
|
} else {
|
||||||
|
if (stream.current().match(tests.symbol)) {
|
||||||
|
while (col < 71) {
|
||||||
|
if (stream.eat(tests.symbol) === undefined) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
col++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) {
|
||||||
|
returnType = KEYWORD;
|
||||||
|
} else if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) {
|
||||||
|
returnType = BUILTIN;
|
||||||
|
} else if (atoms && atoms.propertyIsEnumerable(stream.current().toUpperCase())) {
|
||||||
|
returnType = ATOM;
|
||||||
|
} else returnType = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnType;
|
||||||
|
},
|
||||||
|
indent: function (state) {
|
||||||
|
if (state.indentStack == null) return state.indentation;
|
||||||
|
return state.indentStack.indent;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
CodeMirror.defineMIME("text/x-cobol", "cobol");
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user