mirror of
https://github.com/Mibew/mibew.git
synced 2025-04-21 06:07:24 +03:00
Compare commits
839 Commits
v2.0-alpha
...
master
Author | SHA1 | Date | |
---|---|---|---|
320d814df4 | |||
8953017b9d | |||
874e896178 | |||
973632b4ae | |||
5fa9663d99 | |||
1ed31ad638 | |||
da94f781b3 | |||
d4640219a6 | |||
1fc048fec9 | |||
d6d5477022 | |||
691bcfa061 | |||
3148db54b5 | |||
|
58ee240c80 | ||
ca090638da | |||
4f05231b04 | |||
730577b4a4 | |||
51f2c41b31 | |||
|
2de3ac9044 | ||
|
09f632cc6d | ||
339da62a23 | |||
5a4d3d420f | |||
cd1e8adce3 | |||
|
e676ca47dc | ||
637758c13e | |||
6a0c067cef | |||
a956f85fc7 | |||
1a137bb683 | |||
57eacfb953 | |||
88247f0de3 | |||
eb0bc9ae5c | |||
7f133f17f7 | |||
944b0fe6c5 | |||
eae2b3df81 | |||
3b3abe615d | |||
756014d568 | |||
6d4c438d62 | |||
5c2743c01a | |||
eeb660293c | |||
01261f8c92 | |||
06078cc8e7 | |||
a37ea34670 | |||
56418b1551 | |||
dc9f128b79 | |||
2533b362ab | |||
0c416c7d7c | |||
fd94b0108c | |||
99fb30b0ec | |||
81e2e345a7 | |||
ce5071c3e3 | |||
1210561448 | |||
9294697d58 | |||
3a92a54cd5 | |||
b6a70659b1 | |||
cd22f3e9d8 | |||
8aba48a1d2 | |||
|
423ef8d36f | ||
098abccde7 | |||
|
75aaaf21b7 | ||
622027302f | |||
5b999eff2d | |||
562eeceac2 | |||
f9e0755b23 | |||
74b9faf7af | |||
|
9978074fbc | ||
2df50d9096 | |||
14aba49194 | |||
17df9c8dbc | |||
6dae66540d | |||
0317979c92 | |||
a4b3824a42 | |||
f1200c4999 | |||
d7365d719f | |||
42f5c1a20a | |||
74e69aa520 | |||
20da5d2f36 | |||
fe951ad050 | |||
|
8edcc7e57f | ||
|
62ad932aa7 | ||
33fb35bd34 | |||
|
003f98b18c | ||
6e3720f8e4 | |||
|
4f3d0a57f9 | ||
|
f28659a025 | ||
|
026b463fb7 | ||
bfe0065f1c | |||
91a1b1872c | |||
cf67b11295 | |||
dd4169f815 | |||
dbe04bb342 | |||
98f2b68560 | |||
805bb610a5 | |||
3148d0eb2a | |||
67439317c4 | |||
5e90541918 | |||
704862faad | |||
c8df65baee | |||
49d86a55be | |||
de3db5527b | |||
d115befab9 | |||
6b20d0c8b6 | |||
b296525e39 | |||
7a16536341 | |||
aa94e21602 | |||
bb932e5b9c | |||
a9ca845c80 | |||
b8bad36510 | |||
1c3d9c98b4 | |||
dc9577ff6a | |||
2336e406f4 | |||
84f5bca0a9 | |||
fb35d4fff9 | |||
ace1423a13 | |||
3b9a8e5456 | |||
c60b247ef7 | |||
89f0f5c688 | |||
7bdf01d344 | |||
c0d9a461af | |||
1844d91893 | |||
1a3594311b | |||
8b6dcf4db0 | |||
9d8e057410 | |||
8a2586d01b | |||
be5d5d182b | |||
38b653d075 | |||
88a1b978ce | |||
a2946bd67d | |||
410b925b8d | |||
4f9b48135c | |||
5bc4698520 | |||
0f64ad3674 | |||
93f949d914 | |||
b971d2d85c | |||
edd279ca8e | |||
525b7de7e2 | |||
b6bfc39cbf | |||
3f4420181c | |||
94eaed0b2c | |||
|
d747568575 | ||
2cda0cbb66 | |||
d41db57211 | |||
bc99761b7a | |||
fc2c9d791a | |||
f9b6eeb92c | |||
2d60df2417 | |||
6dc0bc8d34 | |||
110322ab47 | |||
e40be770c3 | |||
d32f9c02ce | |||
83185a6b32 | |||
a9644ddec1 | |||
e9b29737c9 | |||
4f03a73f9a | |||
647bd84995 | |||
eb60d6b39f | |||
4d038b0777 | |||
67b0a6005e | |||
d605c80332 | |||
98954281d5 | |||
58e0ddc952 | |||
f1030c0298 | |||
9cb71e62c1 | |||
60ff2c853c | |||
6c4e883a8a | |||
25a4a3db40 | |||
5f2aab1501 | |||
8a2fbc6f38 | |||
2b6779af8f | |||
efa1372cdc | |||
|
64e902c5a1 | ||
ee97a2f932 | |||
4960397655 | |||
da03edb665 | |||
712117dfc4 | |||
048e2dd3f0 | |||
3beed6b2ec | |||
c62a98b22a | |||
20d97e5bce | |||
2581119295 | |||
95c55aa931 | |||
059bc5ac39 | |||
324a85fb7f | |||
28e968b15f | |||
9d2c4404c0 | |||
d61b142e40 | |||
d1a1f51bf0 | |||
0cf963ac5e | |||
5921115af0 | |||
87d7478864 | |||
3179d5b669 | |||
8ced21fe86 | |||
84e4de1e7a | |||
39309d1914 | |||
194b396788 | |||
7dd32257d1 | |||
6de62a6929 | |||
1c6433eb73 | |||
762998cd4b | |||
73abafebac | |||
81cd6f75fe | |||
42f28a72da | |||
69916d8f6d | |||
ec2e29083b | |||
98a5570ef6 | |||
3ec1610fff | |||
bc39c22c29 | |||
2e3b718fe2 | |||
be8182ffcc | |||
dfaaffcff4 | |||
de782c7fea | |||
3ea37e0e11 | |||
0f1407682e | |||
e40e821b5f | |||
31ad9138ef | |||
9cd07fe829 | |||
4dec01bdaa | |||
e64670e5aa | |||
7c07d7f3e2 | |||
f9c5d4dbaf | |||
52f203b43d | |||
35d80bdcee | |||
a6b7367002 | |||
75c04cae38 | |||
915b6786d9 | |||
b561f7eec8 | |||
89556ae68f | |||
33149aafb9 | |||
edf8850952 | |||
393bf21f30 | |||
03a2051ad7 | |||
51ad3e70d3 | |||
9417960281 | |||
a312bc5e8f | |||
a617eebeec | |||
38e53aaa6a | |||
8b6d411d58 | |||
1b436f9535 | |||
64fccc272c | |||
ead790853e | |||
|
47e7a81f6f | ||
|
73b11b48af | ||
|
5bb282b3bd | ||
|
9608c5a83d | ||
568e539e49 | |||
|
8c99b13e12 | ||
35bbb22c56 | |||
|
169b8d3b76 | ||
d8a63bc2cd | |||
f105a0b5d2 | |||
843a6e11ae | |||
a5320b07d7 | |||
3eafe870bc | |||
82704cfbd6 | |||
88ba0f148e | |||
|
19376e7f6c | ||
|
3ae6e5cdb4 | ||
29c9d8dc7d | |||
7c822661e6 | |||
3a85c9060b | |||
834e75cdd6 | |||
6ea5f5af11 | |||
e2099735e1 | |||
|
8b1e218862 | ||
e718518698 | |||
cc55a13151 | |||
0fc11b3885 | |||
16b7297d19 | |||
1683b7c72a | |||
f4ad0a2351 | |||
7f6b193656 | |||
15dbe153f5 | |||
547efb38e4 | |||
f44ccdc4e1 | |||
1549125665 | |||
cf76dd744d | |||
57afba72e8 | |||
3f97ad09df | |||
00213f806c | |||
d0f1c50f51 | |||
bc16b7c25f | |||
5424424eaf | |||
7aed881f08 | |||
ca169c5bc7 | |||
7041adcdfb | |||
ffcdb223cc | |||
c70bdfcd90 | |||
d512573af8 | |||
0527a9def1 | |||
09ef31e750 | |||
9213453bc3 | |||
|
8c3cbf0489 | ||
|
45ac4ec1ee | ||
e3123d7c45 | |||
680059dece | |||
e9526daf1c | |||
a2774b8fb9 | |||
5618a334d9 | |||
|
8b32bebdc2 | ||
788a18f7f1 | |||
ad186da482 | |||
345cb1748a | |||
e8f07d27ef | |||
e64fe1eb17 | |||
|
e6dfd1dfec | ||
|
a56e775ab9 | ||
|
ce3a59b13c | ||
|
85d1acad5e | ||
|
13dd999158 | ||
|
cb3bd91b76 | ||
|
d5130ed655 | ||
|
199438285c | ||
|
a149731c46 | ||
|
2e629df611 | ||
|
fcdc1021af | ||
|
ce5cbaa850 | ||
dcd243505d | |||
|
4d32e942a3 | ||
|
95909d7ed4 | ||
|
fad8ca5854 | ||
|
cd3778ca0d | ||
|
8fe1498847 | ||
|
0edc9657b4 | ||
9fe423db62 | |||
|
a9e7114375 | ||
|
e150bd1d26 | ||
|
4c9f963aa7 | ||
|
9d81661cfe | ||
fcd3cacfbc | |||
|
3edc959096 | ||
|
d656d8fe38 | ||
|
eccbb59bcc | ||
|
8457e51717 | ||
|
227c7a9410 | ||
|
9c92fda11b | ||
|
896f090aba | ||
|
5363698020 | ||
|
aa0c213cc3 | ||
|
5009f51342 | ||
|
b340206d3a | ||
|
2cbb0c4134 | ||
|
8c574ec88c | ||
|
5af9f92102 | ||
|
6bf331b355 | ||
|
4b74ceb854 | ||
|
25054c4e0f | ||
|
fbe53e3b29 | ||
|
5397f7014a | ||
|
ebb3cf8ab1 | ||
|
55e7dbe704 | ||
|
f13d938bde | ||
|
0ff5c7c28a | ||
|
fc789e6ef9 | ||
|
9f3ce28877 | ||
|
4e7f9eac50 | ||
|
2fc85b1068 | ||
|
930ea9a6ac | ||
|
d4ebd68052 | ||
|
e9d41c4869 | ||
|
577c2be622 | ||
|
8e7fe6bcd7 | ||
|
973cc5746e | ||
|
8326eb3ebf | ||
|
e9baceb039 | ||
|
720b72f8e4 | ||
a3ebe57f1f | |||
|
d9dc5e0ed7 | ||
|
bc024c3253 | ||
|
137d92624e | ||
|
5d13afd8f6 | ||
|
5628f42782 | ||
|
eae5b8bb06 | ||
|
40fef4e360 | ||
|
ab35143e18 | ||
|
f176ac628b | ||
|
7a09546198 | ||
|
47672a5eb6 | ||
|
3307ba01dc | ||
7d3558460b | |||
|
2fdb7e4525 | ||
|
48d8805605 | ||
|
e4a104f52e | ||
|
ff09ea09cc | ||
|
a4ce7ffea7 | ||
0f8b5da18a | |||
|
1a358c2f09 | ||
|
b56881bf01 | ||
|
59de37a12b | ||
|
2a819b1b98 | ||
|
a9eb9f8cf2 | ||
|
70f630d125 | ||
|
0075e2169c | ||
|
f47a67fd57 | ||
|
b2bb9cfb92 | ||
|
a3f68852ce | ||
|
2031d82600 | ||
|
31b09570f9 | ||
|
b18aef404a | ||
|
6fb71835bf | ||
|
22aaedd3be | ||
|
758203b6d3 | ||
|
57182b0589 | ||
|
0f44076e48 | ||
|
094139dead | ||
|
30fd4bad7c | ||
|
9fef4b2871 | ||
|
db702e43c9 | ||
|
93c5cb995a | ||
|
5fada43676 | ||
|
adac8fb3fd | ||
|
0eef94a164 | ||
|
3c0c880661 | ||
|
e122d020eb | ||
|
a8629df5ec | ||
|
415005e2f6 | ||
|
6e78c45c67 | ||
|
6ac77e629a | ||
|
313e854723 | ||
|
4332d9c205 | ||
|
833d2a9096 | ||
|
6e71f0542b | ||
f6fe379a54 | |||
|
cc5adc17b2 | ||
284318a287 | |||
|
edcd348bca | ||
|
21ae86958d | ||
|
0dca0bb57d | ||
|
933ced4575 | ||
|
232d69cf72 | ||
|
c1850f0bb3 | ||
|
ebd6684d4a | ||
|
62f958622c | ||
|
626145340e | ||
|
84b0d891e0 | ||
|
ef98d5056a | ||
|
ea0b6a0cd5 | ||
|
f015b5b820 | ||
|
6d3810b7ba | ||
|
e273b04dab | ||
|
9799fb5e3f | ||
|
c27a0e1aea | ||
47ee6edaad | |||
b8d2af4c67 | |||
|
8faa0d9f4e | ||
|
9ef0739b80 | ||
|
ad7f3d6167 | ||
|
78dfb230ed | ||
|
854a4ca010 | ||
|
7fde2eb9cd | ||
8c6d98ddbd | |||
c2229a6c79 | |||
|
120abce028 | ||
|
a6d6f2bea2 | ||
|
3f6a95f7a6 | ||
|
090f650ac1 | ||
|
06109eb0c4 | ||
|
f6938b2f13 | ||
|
9467525dac | ||
|
1914b23c74 | ||
|
e333ff3d27 | ||
|
a5b7002239 | ||
|
9faf346634 | ||
|
67a0db5349 | ||
|
e5b8c84736 | ||
|
090383bc95 | ||
|
52107afc1a | ||
|
3b9ded0b29 | ||
c51a3ee5a1 | |||
ba9c01b82c | |||
|
132ca02cdf | ||
|
9cd082b878 | ||
|
efbf92b012 | ||
|
ff1940cdc5 | ||
|
6a17db4e04 | ||
|
5a2e48eeef | ||
|
b9fd28f20f | ||
|
1a8f50adb0 | ||
|
31d602986e | ||
|
fb83027a1e | ||
|
19edc91dfd | ||
|
27a23f68c0 | ||
|
1306efd380 | ||
|
b19473f658 | ||
|
53c60eed76 | ||
|
1fae58c350 | ||
|
0c00a697ec | ||
|
7e8ea1cdbf | ||
|
a39d0fa6cf | ||
|
b40e1deb89 | ||
|
ee751b471d | ||
|
782e9895e5 | ||
|
8552881f7d | ||
|
9bfd6a29fb | ||
|
f5c80e7b5c | ||
|
d7a5c1d9c1 | ||
|
e66e0c1452 | ||
|
21daf749f0 | ||
|
1e46d6fabd | ||
|
8b34ca34c7 | ||
|
964e917f4a | ||
|
210e82e798 | ||
|
243fa1a1d9 | ||
|
506425a9e1 | ||
|
a72a602120 | ||
|
bcd2bb9242 | ||
|
a6e6993a65 | ||
054133e013 | |||
2d875ba623 | |||
|
e6f6fd7d38 | ||
792acd7b17 | |||
|
30d884b699 | ||
|
bc14d1f0ef | ||
|
062a4c1090 | ||
134bbb9984 | |||
|
a441bed2a2 | ||
|
f5ee6448e4 | ||
|
3e77eddb33 | ||
|
ad8c815b3c | ||
|
96724464e2 | ||
|
8f346ae0b7 | ||
|
8a47afef58 | ||
|
6768fe96c2 | ||
|
c4a47928a8 | ||
|
ec06357535 | ||
|
bb1b6c377c | ||
|
9c87fadb7d | ||
|
db7aa3d12a | ||
304de4ab71 | |||
|
3e5f589972 | ||
|
6fbee71173 | ||
07c015856e | |||
|
17b7bf6757 | ||
|
e0716bbeb2 | ||
|
4e4f0adfd6 | ||
|
a66e23fe9b | ||
80565efefb | |||
3a325ecc6c | |||
|
aa28272dbd | ||
|
097ec6ef1a | ||
|
2bdfebc428 | ||
|
5282e789ba | ||
|
b0aa66c7cf | ||
|
772aa904d9 | ||
|
459f75727a | ||
|
e2d4ab3715 | ||
|
80f5873d9a | ||
|
abdfa54f36 | ||
|
361e424acd | ||
|
7ac85ac412 | ||
|
80077be185 | ||
014a7fabcb | |||
a2fee28bba | |||
|
f7434502b7 | ||
|
a4361fe8ce | ||
|
48978fb060 | ||
|
03a8eab3d1 | ||
|
428c592139 | ||
|
dca7c2c520 | ||
|
c9c1ffca4e | ||
|
ad5554bb52 | ||
|
bf7642dab3 | ||
|
a63f4ced3d | ||
|
b896d43db7 | ||
|
f4b08ff0a3 | ||
|
c70764dab2 | ||
|
542b830577 | ||
|
bfe902e062 | ||
|
c205c9ff94 | ||
|
2d702f5542 | ||
|
d68b0bdb0c | ||
|
07b25a2fc3 | ||
|
a43d46f5f5 | ||
|
47851c9ed2 | ||
|
f82d42e729 | ||
|
c43fccf297 | ||
|
d446b9a78f | ||
|
1deebaff20 | ||
|
df66227729 | ||
|
bcbb02f52f | ||
|
f5470239e4 | ||
|
f8909d5e8c | ||
d27633fc28 | |||
|
6066b9312e | ||
|
fe0d2f2760 | ||
|
2c0d88c4d5 | ||
|
2c9a6830c8 | ||
|
6b3b5d6fec | ||
|
b4ab5d8cd1 | ||
|
bffc2fd799 | ||
|
3f36afc285 | ||
|
18e9cf7039 | ||
|
43f7df6c76 | ||
|
03328b9293 | ||
|
3dd80070c7 | ||
|
3984c260b0 | ||
|
82a4d7a2a2 | ||
|
3b43090bda | ||
|
f0c4299ba3 | ||
|
f10079497c | ||
|
07fc4a3666 | ||
|
38bc096444 | ||
|
146c4b7ac1 | ||
|
9d854e9642 | ||
|
6e200bf956 | ||
|
b3c9a02660 | ||
|
22699f1ed5 | ||
|
c0232e6fce | ||
|
96c9bf2a93 | ||
|
b5020645be | ||
|
bf483e4abc | ||
|
a37018aab6 | ||
|
be7d49c0f5 | ||
|
336d8c1faa | ||
|
ab942731e6 | ||
|
168336a20b | ||
|
297377b0fd | ||
|
65d7cb3823 | ||
|
1d9a837e37 | ||
|
05f5a606d1 | ||
|
614f02a108 | ||
|
32a134f31a | ||
|
4ae850d529 | ||
|
3f27aea2ea | ||
|
30da4ae75e | ||
|
b7bf41a191 | ||
|
38769615ac | ||
|
6cc94bcb33 | ||
|
7f6a9c6513 | ||
|
7e371a20d9 | ||
|
28270d7d18 | ||
|
d6084f035f | ||
|
816323a154 | ||
|
0a3207e879 | ||
|
7af300b8f5 | ||
|
9753081407 | ||
|
c83fd59763 | ||
|
445a5866ad | ||
|
f070a121fe | ||
|
c2f0fb24c3 | ||
|
7eea7c09d4 | ||
|
6263f3a2f4 | ||
|
ada83c629a | ||
|
1dea407037 | ||
|
b83cb193f1 | ||
|
5ad1044dc0 | ||
|
09b3d77b19 | ||
|
7ce1add5dc | ||
|
34341ef01c | ||
|
1aec37b6f6 | ||
|
9b05509ec4 | ||
|
53450ea9d6 | ||
|
60bd21bf42 | ||
|
d05fe335b8 | ||
|
55b1476139 | ||
|
de1d5d6d51 | ||
|
e61b91dd5e | ||
|
1814298f4f | ||
|
5c52ec61da | ||
|
86f6d6429e | ||
|
31c4afe751 | ||
|
a34cb53e91 | ||
|
2dca8f236e | ||
|
55b7b28eb1 | ||
|
919c71a1c1 | ||
|
2d5d4b0e46 | ||
|
2703f72de8 | ||
|
7f071cbe80 | ||
|
55587f67fe | ||
|
ae7ee06031 | ||
|
3fbc5fa262 | ||
|
397786991d | ||
|
1a82e11b5e | ||
|
71d2b234c6 | ||
|
f8d4d074d5 | ||
|
6ac121bc01 | ||
|
452446a375 | ||
|
dcd17ed01c | ||
|
8eaf93a916 | ||
|
0d1efa5a87 | ||
|
d92b88b65a | ||
|
aee1aa6904 | ||
|
5dafbd2997 | ||
|
54b4814389 | ||
|
d01bd8a080 | ||
|
3081dcc8db | ||
|
c86d7569f3 | ||
|
e8b35a6971 | ||
|
3339153ad3 | ||
|
ed6252bb38 | ||
|
01e2d8f2a7 | ||
|
dd71e6bc70 | ||
|
46ee9df63a | ||
|
922edc96d7 | ||
|
a671caeb79 | ||
|
3088481d6d | ||
|
00bba6c05a | ||
|
5b09b3e52c | ||
|
3772274ca3 | ||
|
7ce4d812bd | ||
|
2ed44e874c | ||
|
9898fb0cbe | ||
|
bc45a6d3be | ||
|
e320dcd1bb | ||
|
54840e96ad | ||
|
406e11a38e | ||
|
a61b48252c | ||
|
952ebf8b9d | ||
|
b6d472d62f | ||
|
0cd01e2c03 | ||
|
c3956be558 | ||
|
6e6920851d | ||
|
022fe7d6f4 | ||
|
ba103d5636 | ||
|
a2e2f1b194 | ||
|
e514b1590b | ||
|
2bb6899c33 | ||
|
cb4bd3acaa | ||
|
fa615bc2e0 | ||
|
957e67686a | ||
|
911487871d | ||
|
c397a953a1 | ||
|
e7b0201e0a | ||
|
340c0f9213 | ||
|
db4e8ee0db | ||
|
95caad6b59 | ||
|
ae9de7aa92 | ||
|
ce6761755e | ||
|
6154992f4f | ||
|
0b9fdeceb8 | ||
|
34017d54db | ||
|
aa12eceeea | ||
|
9805b4bb18 | ||
|
333f769a16 | ||
|
75276ab2da | ||
|
814869ec77 | ||
|
3f3abb4255 | ||
|
55a33cf012 | ||
|
accfbe0acd | ||
94c1859a01 | |||
|
bbf1cec98c | ||
|
ff72960382 | ||
|
61ee2d0af6 | ||
|
933d03e45a | ||
|
86085a0c31 | ||
|
7c969e495e | ||
|
97ab17ce7a | ||
|
58959cf866 | ||
|
7201dfd113 | ||
|
a314bca69b | ||
|
cb98a6fc94 | ||
|
f107ae4556 | ||
|
3a3b7f362b | ||
|
ff917b25ad | ||
|
dfbbc11cfb | ||
|
7c1e123ad6 | ||
|
84094ad38b | ||
|
5a3a4d959f | ||
|
83f6c31dd6 | ||
|
e5031f9987 | ||
|
0253f8e67e | ||
|
c207f0507d | ||
|
6ceecb42aa | ||
|
f8bd639f39 | ||
|
cf6e7f625a | ||
|
cbc119382b | ||
|
c08ab3a456 | ||
|
09c7b15656 | ||
|
5ee217accb | ||
|
eba2eadaca | ||
|
7021cb983e | ||
|
37cc5cb178 | ||
|
a5d7c6ccd4 | ||
|
766be1f051 | ||
|
f61ef23e3f | ||
|
896e0d924b | ||
|
1c1d479474 | ||
|
ee492a0c23 | ||
|
da54de32b9 | ||
|
4ba7804b88 | ||
|
928328f2b0 | ||
|
730dd2f2df | ||
|
8b1b38dddc | ||
|
57770e76cf | ||
|
aad2f6a34f | ||
|
3802e1bf0f | ||
|
c9e7971c41 | ||
|
e97f3d1fbf | ||
|
21c0ee9134 | ||
|
96df4dc857 | ||
|
c32628e2b2 | ||
|
df4b6f214e | ||
|
f0f41cbfb6 | ||
|
e9f480e3ef | ||
|
82a3cb7dd5 | ||
|
34a8a2eee4 | ||
|
e6b9635e22 | ||
|
154e891cb4 | ||
4fc223a6a6 | |||
|
22a34c3315 | ||
|
51e076aafc | ||
|
46a8345de2 | ||
|
17d7014da9 | ||
|
7128870ef6 | ||
|
48408c6547 | ||
|
3ca9395d69 | ||
|
95d2593b28 | ||
|
02874adbd0 | ||
|
f583aa6439 | ||
|
547cd5abb6 | ||
|
51fcdcd1a5 | ||
|
58aec22fc3 | ||
|
ac55ecc545 | ||
|
f8b5cdafa2 | ||
|
5feb4535d6 | ||
|
6d90246bbe | ||
|
c086ba176f | ||
|
c2aeeb07f9 | ||
|
a9cd400834 | ||
|
4594619a4a | ||
|
668e724a01 | ||
|
cabdaed21d | ||
|
38bdf1318f | ||
|
4ccd67e28a | ||
|
6cdfb4a7bc | ||
|
a99a839998 | ||
|
ef5c919803 | ||
|
fdfb945ed0 | ||
|
bee65e50f7 | ||
|
324f5bf94e | ||
|
a8e98c1e08 | ||
9e08c6f2a5 | |||
|
074f4652d1 | ||
|
650faf25f6 | ||
|
4670851505 | ||
|
48bcea8f65 | ||
|
2ddae8e300 | ||
|
d04f703f35 | ||
|
86f8cb5100 | ||
|
c4592d242a | ||
|
6a1ac9ada4 | ||
|
62b8b3ceff |
29
.gitignore
vendored
29
.gitignore
vendored
@ -1,6 +1,11 @@
|
|||||||
|
# IDE folders
|
||||||
|
.idea
|
||||||
|
|
||||||
src/mibew/install/package
|
src/mibew/install/package
|
||||||
src/absent_*
|
src/absent_*
|
||||||
src/release*
|
src/release*
|
||||||
|
src/upload*
|
||||||
|
src/*.po
|
||||||
|
|
||||||
# Do not index actual configuration files
|
# Do not index actual configuration files
|
||||||
src/mibew/configs/config.yml
|
src/mibew/configs/config.yml
|
||||||
@ -10,6 +15,11 @@ src/tests/server_side/mibew/libs/config.php
|
|||||||
src/mibew/files/avatar/*
|
src/mibew/files/avatar/*
|
||||||
!src/mibew/files/avatar/.keep
|
!src/mibew/files/avatar/.keep
|
||||||
|
|
||||||
|
# Do not index cache files
|
||||||
|
src/mibew/cache/*
|
||||||
|
!src/mibew/cache/.keep
|
||||||
|
!src/mibew/cache/.htaccess
|
||||||
|
|
||||||
# Do not index plugins
|
# Do not index plugins
|
||||||
src/mibew/plugins/*
|
src/mibew/plugins/*
|
||||||
!src/mibew/plugins/.keep
|
!src/mibew/plugins/.keep
|
||||||
@ -24,3 +34,22 @@ src/composer.lock
|
|||||||
|
|
||||||
# Do not index third-party libraries
|
# Do not index third-party libraries
|
||||||
src/mibew/vendor
|
src/mibew/vendor
|
||||||
|
src/mibew/js/vendor
|
||||||
|
|
||||||
|
# Do not index node.js modules that are used for building
|
||||||
|
src/node_modules
|
||||||
|
src/package-lock.json
|
||||||
|
|
||||||
|
# Do not index compiled js files of the core
|
||||||
|
src/mibew/js/compiled/*
|
||||||
|
!src/mibew/js/compiled/.keep
|
||||||
|
|
||||||
|
# Do not index compiled files of chat styles
|
||||||
|
src/mibew/styles/chats/*/templates_compiled/client_side/*
|
||||||
|
!src/mibew/styles/chats/*/templates_compiled/client_side/.keep
|
||||||
|
src/mibew/styles/chats/*/js/compiled/*
|
||||||
|
!src/mibew/styles/chats/*/js/compiled/.keep
|
||||||
|
|
||||||
|
# Do not index compiled files of page styles
|
||||||
|
src/mibew/styles/pages/*/templates_compiled/client_side/*
|
||||||
|
!src/mibew/styles/pages/*/templates_compiled/client_side/.keep
|
||||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "src/i18n"]
|
||||||
|
path = src/i18n
|
||||||
|
url = git@github.com:Mibew/i18n.git
|
12
ISSUE_TEMPLATE.md
Normal file
12
ISSUE_TEMPLATE.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
### Environment
|
||||||
|
* Mibew Messenger version:
|
||||||
|
* OS:
|
||||||
|
* Web server:
|
||||||
|
* PHP:
|
||||||
|
* PHP extensions:
|
||||||
|
* MySQL:
|
||||||
|
### Expected behavior
|
||||||
|
|
||||||
|
### Actual behavior
|
||||||
|
|
||||||
|
### Steps to reproduce the behavior
|
8
PULL_REQUEST_TEMPLATE.md
Normal file
8
PULL_REQUEST_TEMPLATE.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Fixes # .
|
||||||
|
|
||||||
|
Changes proposed in this pull request:
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-
|
||||||
|
|
||||||
|
@Mibew/core-developers
|
51
README.md
51
README.md
@ -11,16 +11,61 @@ This repository contains the core of Mibew Messenger application.
|
|||||||
## Server requirements
|
## Server requirements
|
||||||
|
|
||||||
1. A webserver or web hosting account running on any major Operating System
|
1. A webserver or web hosting account running on any major Operating System
|
||||||
2. PHP (5.3.3 and above) with MySQL support
|
2. PHP (7.2.5 and above) with PDO, pdo_mysql, cURL, mbstring and gd extensions
|
||||||
3. MySQL 5.0 and above
|
3. MySQL 5.0 and above
|
||||||
|
|
||||||
|
## Build from sources
|
||||||
|
|
||||||
|
There are several actions one should do before use the latest version of Mibew from the repository:
|
||||||
|
|
||||||
|
1. Obtain a copy of the repository using `git clone`, download button, or another way.
|
||||||
|
2. Install [node.js](http://nodejs.org/) and [npm](https://www.npmjs.org/).
|
||||||
|
3. Install [Gulp](http://gulpjs.com/).
|
||||||
|
4. Navigate to `src/` directory of the local copy of the repository.
|
||||||
|
5. Install npm dependencies using `npm install`.
|
||||||
|
6. Run Gulp to build Mibew using `gulp default`.
|
||||||
|
|
||||||
|
Finally `.tar.gz` and `.zip` archives of the ready-to-use Mibew will be available in `src/release` directory.
|
||||||
|
|
||||||
## Terms of Use
|
## Terms of Use
|
||||||
|
|
||||||
Mibew Messenger is licensed under the terms of [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
Mibew Messenger is licensed under the terms of [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
||||||
|
|
||||||
## Other repositories of the Mibew project
|
## Other repositories of the Mibew project
|
||||||
|
|
||||||
|
### Actual
|
||||||
1. [Mibew Messenger i18n repository](https://github.com/Mibew/i18n)
|
1. [Mibew Messenger i18n repository](https://github.com/Mibew/i18n)
|
||||||
2. [Mibew Messenger design repository](https://github.com/Mibew/design)
|
2. [Mibew Messenger design repository](https://github.com/Mibew/design)
|
||||||
3. [Mibew Java applications repository](https://github.com/Mibew/java)
|
3. [Mibew documentation repository](https://github.com/Mibew/docs.mibew.org)
|
||||||
4. [Mibew Tray repository](https://github.com/Mibew/tray)
|
|
||||||
|
### Obsolete
|
||||||
|
1. [Mibew Java applications repository](https://github.com/Mibew/java)
|
||||||
|
2. [Mibew Tray repository](https://github.com/Mibew/tray)
|
||||||
|
|
||||||
|
### Plugins
|
||||||
|
|
||||||
|
1. [Mibew Boilerplate plugin](https://github.com/Mibew/boilerplate-plugin) - a template for a real plugin
|
||||||
|
|
||||||
|
#### Ready for production use
|
||||||
|
|
||||||
|
1. [Mibew Advanced Button plugin](https://github.com/Mibew/advanced-button-plugin)
|
||||||
|
2. [Mibew Auto Invite plugin](https://github.com/Mibew/auto-invite-plugin)
|
||||||
|
3. [Mibew Auto Reply plugin](https://github.com/Mibew/auto-reply-plugin)
|
||||||
|
4. [Mibew Broadcast plugin](https://github.com/Mibew/broadcast-plugin)
|
||||||
|
5. [Mibew Bulk Logs Operations plugin](https://github.com/Mibew/bulk-logs-operations-plugin)
|
||||||
|
6. [Mibew Button Refresh plugin](https://github.com/Mibew/button-refresh-plugin)
|
||||||
|
7. [Mibew Emoji plugin](https://github.com/Mibew/emoji-plugin)
|
||||||
|
8. [Mibew Filter Visitors By Operator Code plugin](https://github.com/Mibew/filter-visitors-by-operator-code-plugin)
|
||||||
|
9. [Mibew First Message plugin](https://github.com/Mibew/first-message-plugin)
|
||||||
|
10. [Mibew Geo IP plugin](https://github.com/Mibew/geo-ip-plugin)
|
||||||
|
11. [Mibew Google Maps plugin](https://github.com/Mibew/google-maps-plugin)
|
||||||
|
12. [Mibew Open Street Map plugin](https://github.com/Mibew/open-street-map-plugin)
|
||||||
|
13. [Mibew Operator Status plugin](https://github.com/Mibew/mibew-operator-status-plugin)
|
||||||
|
14. [Mibew Purge History plugin](https://github.com/Mibew/purge-history-plugin)
|
||||||
|
15. [Mibew Real Ban plugin](https://github.com/Mibew/real-ban-plugin)
|
||||||
|
16. [Mibew Slack plugin](https://github.com/Mibew/mibew_slack)
|
||||||
|
17. [Mibew Title Notification plugin](https://github.com/Mibew/title-notification-plugin)
|
||||||
|
|
||||||
|
#### Not ready for production use (not stable, broken, obsolete, etc.)
|
||||||
|
|
||||||
|
1. [Mibew External API plugin](https://github.com/Mibew/external-api-plugin)
|
||||||
|
4
src/.bowerrc
Normal file
4
src/.bowerrc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"directory": "./mibew/js/vendor",
|
||||||
|
"analytics": false
|
||||||
|
}
|
27
src/.eslintrc
Normal file
27
src/.eslintrc
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"rules": {
|
||||||
|
"indent": ["error", 4, {"SwitchCase": 1}],
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
"semi": ["error", "always"],
|
||||||
|
"guard-for-in": "error",
|
||||||
|
"no-unused-vars": ["error", {"caughtErrors": "none", "args": "none"}]
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"Mibew": true,
|
||||||
|
"MibewAPI": true,
|
||||||
|
"MibewAPIInteraction": true,
|
||||||
|
"MibewAPIChatInteraction": true,
|
||||||
|
"MibewAPIUsersInteraction": true,
|
||||||
|
"MibewAPIExecutionContext": true,
|
||||||
|
"Handlebars": true,
|
||||||
|
"_": true,
|
||||||
|
"Backbone": true,
|
||||||
|
"jQuery": true,
|
||||||
|
"vex": true,
|
||||||
|
"validator": true
|
||||||
|
},
|
||||||
|
"env":{
|
||||||
|
"browser": true
|
||||||
|
}
|
||||||
|
}
|
17
src/bower.json
Normal file
17
src/bower.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "mibew",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"underscore": "1.8.2",
|
||||||
|
"json": "https://github.com/douglascrockford/JSON-js.git#c98948ae1944a28e2e8ebc3717894e580aeaaa05",
|
||||||
|
"jquery": "1.11.3",
|
||||||
|
"backbone": "1.1.2",
|
||||||
|
"marionette": "2.4.1",
|
||||||
|
"handlebars": "4.3.0",
|
||||||
|
"vex": "2.3.2",
|
||||||
|
"validator-js": "3.40.0"
|
||||||
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"underscore": "1.8.2"
|
||||||
|
}
|
||||||
|
}
|
427
src/build.xml
427
src/build.xml
@ -1,427 +0,0 @@
|
|||||||
<project name="mibew messenger" default="all">
|
|
||||||
|
|
||||||
|
|
||||||
<property name="mibew_path" value="mibew" />
|
|
||||||
<property name="closure.c" value="/opt/closure/compiler.jar" />
|
|
||||||
<property name="handlebars" value="handlebars" />
|
|
||||||
<property name="dialogs_styles_path" value="${mibew_path}/styles/dialogs" />
|
|
||||||
<property name="pages_styles_path" value="${mibew_path}/styles/pages" />
|
|
||||||
<property name="js_path" value="${mibew_path}/js" />
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Compile Handlebars templates for dialogs styles -->
|
|
||||||
<target name="dialogs_handlebars" description="Compile Handlebars templates for dialogs styles">
|
|
||||||
<echo>Flatten templates directory structure</echo>
|
|
||||||
|
|
||||||
<!-- Use system 'mkdir' instead of ant 'mkdir' task because it do not
|
|
||||||
work with dirsets -->
|
|
||||||
<apply executable="mkdir" addsourcefile="false">
|
|
||||||
<targetfile />
|
|
||||||
<dirset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/templates_src/client_side" />
|
|
||||||
</dirset>
|
|
||||||
<mapper type="glob" from="*/templates_src/client_side" to="*/templates_compiled/client_side_tmp" />
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<!-- Flatten templates directory structure -->
|
|
||||||
<apply executable="tools/flat_cp" force="true">
|
|
||||||
<srcfile />
|
|
||||||
<targetfile />
|
|
||||||
<arg value="client_side" />
|
|
||||||
<fileset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/templates_src/client_side/**/*.handlebars" />
|
|
||||||
</fileset>
|
|
||||||
<mapper type="regexp" from="^(.*)/templates_src/client_side/(.*)$$" to="\1/templates_compiled/client_side_tmp" />
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<echo>Compile templates</echo>
|
|
||||||
|
|
||||||
<!-- Compile templates -->
|
|
||||||
<apply executable="${handlebars}">
|
|
||||||
<arg value="-f"/>
|
|
||||||
<targetfile />
|
|
||||||
<dirset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/templates_compiled/client_side_tmp" />
|
|
||||||
</dirset>
|
|
||||||
<mapper type="glob" from="*/client_side_tmp" to="*/client_side/templates_tmp.js" />
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<!-- Use closule compiler instead of handlebars minifyer (-m flag)
|
|
||||||
because of handlebars does not insert line breaks.
|
|
||||||
Very long lines are cutted by ant and this brings problems -->
|
|
||||||
<apply executable="java">
|
|
||||||
<arg value="-jar" />
|
|
||||||
<arg value="${closure.c}" />
|
|
||||||
<arg value="--js" />
|
|
||||||
<srcfile />
|
|
||||||
<arg value="--js_output_file" />
|
|
||||||
<targetfile />
|
|
||||||
<fileset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/templates_compiled/client_side/templates_tmp.js" />
|
|
||||||
</fileset>
|
|
||||||
<mapper type="glob" from="*_tmp.js" to="*_tmp.c.js" />
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<!-- Add license info. Use move because of it is the best way to append
|
|
||||||
some info to files -->
|
|
||||||
<move todir="${dialogs_styles_path}" overwrite="true">
|
|
||||||
<fileset dir="${dialogs_styles_path}"/>
|
|
||||||
<mapper type="glob" from="*/templates_compiled/client_side/templates_tmp.c.js" to="*/templates_compiled/client_side/templates.js"/>
|
|
||||||
|
|
||||||
<filterchain>
|
|
||||||
<!-- Add header -->
|
|
||||||
<concatfilter prepend="tools/compiled_templates_header.txt" />
|
|
||||||
<!-- Skip empty lines -->
|
|
||||||
<linecontainsregexp negate="true">
|
|
||||||
<regexp pattern="^\s+$$" />
|
|
||||||
</linecontainsregexp>
|
|
||||||
</filterchain>
|
|
||||||
</move>
|
|
||||||
|
|
||||||
<!-- Remove all temporary files -->
|
|
||||||
<!-- Use system 'rm' instead of ant
|
|
||||||
'delete' task because it does not work with dirsets -->
|
|
||||||
<echo>Remove temporary files</echo>
|
|
||||||
<apply executable="rm">
|
|
||||||
<arg value="-r" />
|
|
||||||
<arg value="-f" />
|
|
||||||
<dirset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/templates_compiled/client_side_tmp" />
|
|
||||||
</dirset>
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<delete>
|
|
||||||
<fileset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/templates_compiled/client_side/templates_tmp.js" />
|
|
||||||
</fileset>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<echo>Done</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- Compile Handlebars templates for pages styles -->
|
|
||||||
<target name="pages_handlebars" description="Compile Handlebars templates for pages styles">
|
|
||||||
<!-- Compile applications templates -->
|
|
||||||
<apply executable="${handlebars}">
|
|
||||||
<arg value="-f"/>
|
|
||||||
<targetfile />
|
|
||||||
<dirset dir=".">
|
|
||||||
<include name="${pages_styles_path}/*/templates_src/client_side/*" />
|
|
||||||
</dirset>
|
|
||||||
<mapper
|
|
||||||
type="regexp"
|
|
||||||
from="^(.*)/templates_src/client_side/(.*)$$"
|
|
||||||
to="\1/templates_compiled/client_side/\2_app_tmp.tpl.js"
|
|
||||||
/>
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<!-- Use closule compiler instead of handlebars minifyer (-m flag)
|
|
||||||
because of handlebars does not insert line breaks.
|
|
||||||
Very long lines are cutted by ant and this brings problems -->
|
|
||||||
<apply executable="java">
|
|
||||||
<arg value="-jar" />
|
|
||||||
<arg value="${closure.c}" />
|
|
||||||
<arg value="--js" />
|
|
||||||
<srcfile />
|
|
||||||
<arg value="--js_output_file" />
|
|
||||||
<targetfile />
|
|
||||||
<fileset dir=".">
|
|
||||||
<include name="${pages_styles_path}/*/templates_compiled/client_side/*_app_tmp.tpl.js" />
|
|
||||||
</fileset>
|
|
||||||
<mapper type="glob" from="*_app_tmp.tpl.js" to="*_app_tmp.c.tpl.js" />
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<!-- Add license info. Use move because of it is the best way to append
|
|
||||||
some info to files -->
|
|
||||||
<move todir="${pages_styles_path}" overwrite="true">
|
|
||||||
<fileset dir="${pages_styles_path}">
|
|
||||||
<include name="*/templates_compiled/client_side/*_tmp.c.tpl.js" />
|
|
||||||
</fileset>
|
|
||||||
<!--<mapper type="glob" from="*/templates_compiled/client_side/*_tmp.c.tpl.js" to="*.tpl.js"/>-->
|
|
||||||
<mapper type="glob" from="*_tmp.c.tpl.js" to="*.tpl.js"/>
|
|
||||||
|
|
||||||
<filterchain>
|
|
||||||
<!-- Add header -->
|
|
||||||
<concatfilter prepend="tools/compiled_templates_header.txt" />
|
|
||||||
<!-- Skip empty lines -->
|
|
||||||
<linecontainsregexp negate="true">
|
|
||||||
<regexp pattern="^\s+$$" />
|
|
||||||
</linecontainsregexp>
|
|
||||||
</filterchain>
|
|
||||||
</move>
|
|
||||||
|
|
||||||
<!-- Remove all temporary files. -->
|
|
||||||
<delete>
|
|
||||||
<fileset dir="${pages_styles_path}">
|
|
||||||
<include name="*/templates_compiled/client_side/*_tmp.tpl.js" />
|
|
||||||
</fileset>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<echo>Done</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Compile Handlebars templates for all styles (both dialogs and pages) -->
|
|
||||||
<target name="styles_handlebars" depends="pages_handlebars,dialogs_handlebars" description="Compile Handlebars templates for all styles">
|
|
||||||
<echo>Handlebars templates from all styles are built.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Compile and concatenate JavaScript files for dialog styles -->
|
|
||||||
<target name="styles_js" description="Compile JavaScript files for all dialogs styles">
|
|
||||||
<echo>Compile and concatenate JavaScript files for dialogs styles:</echo>
|
|
||||||
|
|
||||||
<!-- Create temporary directories for compiled JavaScript files -->
|
|
||||||
<echo>Create temporary directories</echo>
|
|
||||||
<apply executable="mkdir" addsourcefile="false">
|
|
||||||
<targetfile />
|
|
||||||
<dirset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/js/source" />
|
|
||||||
</dirset>
|
|
||||||
<mapper type="glob" from="*/source" to="*/tmp" />
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<!-- Compile JavaScript files -->
|
|
||||||
<echo>Compile JavaScript files</echo>
|
|
||||||
<apply executable="java">
|
|
||||||
<arg value="-jar" />
|
|
||||||
<arg value="${closure.c}" />
|
|
||||||
<arg value="--js" />
|
|
||||||
<srcfile />
|
|
||||||
<arg value="--js_output_file" />
|
|
||||||
<targetfile />
|
|
||||||
<fileset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/js/source/*.js" />
|
|
||||||
</fileset>
|
|
||||||
<mapper type="regexp" from="^(.+)/source/(.+)$$" to="\1/tmp/\2" />
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<!-- Concatenate all scripts in one file. Use special script for
|
|
||||||
expanding wildcards. -->
|
|
||||||
<echo>Concatenate JavaScript files</echo>
|
|
||||||
<apply executable="tools/cat">
|
|
||||||
<srcfile suffix="/*.js"/>
|
|
||||||
<targetfile />
|
|
||||||
<dirset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/js/tmp" />
|
|
||||||
</dirset>
|
|
||||||
<mapper type="glob" from="*/tmp" to="*/compiled/scripts.js" />
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<!-- Remove temporary directories -->
|
|
||||||
<echo>Remove temporary directories</echo>
|
|
||||||
<apply executable="rm">
|
|
||||||
<arg value="-r" />
|
|
||||||
<arg value="-f" />
|
|
||||||
<dirset dir=".">
|
|
||||||
<include name="${dialogs_styles_path}/*/js/tmp" />
|
|
||||||
</dirset>
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<echo>Done</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Build all stuff related to dialogs styles -->
|
|
||||||
<target name="styles_all" depends="styles_handlebars,styles_js" description="Run styles_handlebars and styles_js targets">
|
|
||||||
<echo>Styles built.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Compile all JavaScript files of the Mibew Core -->
|
|
||||||
<target name="core_js">
|
|
||||||
<echo>Compile JavaScript files of the Mibew Core</echo>
|
|
||||||
|
|
||||||
<!-- Copy directory tree from source to compiled -->
|
|
||||||
<echo>Copy directory tree</echo>
|
|
||||||
<copy todir="${js_path}/compiled">
|
|
||||||
<dirset dir="${js_path}/source">
|
|
||||||
<include name="**" />
|
|
||||||
</dirset>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Compile JavaScript files -->
|
|
||||||
<echo>Compile JavaScript files</echo>
|
|
||||||
<apply executable="java">
|
|
||||||
<arg value="-jar" />
|
|
||||||
<arg value="${closure.c}" />
|
|
||||||
<arg value="--js" />
|
|
||||||
<srcfile />
|
|
||||||
<arg value="--js_output_file" />
|
|
||||||
<targetfile />
|
|
||||||
<fileset dir=".">
|
|
||||||
<include name="${js_path}/source/**/*.js" />
|
|
||||||
</fileset>
|
|
||||||
<mapper type="regexp" from="^(.+)/source/(.+)$$" to="\1/compiled/\2" />
|
|
||||||
</apply>
|
|
||||||
|
|
||||||
<echo>Done</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Build JavaScript application -->
|
|
||||||
<target name="app_js">
|
|
||||||
<echo>Build "${app_name}" JavaScript application</echo>
|
|
||||||
|
|
||||||
<!-- Remove old application file -->
|
|
||||||
<delete file="${js_path}/compiled/${app_name}_app.js" />
|
|
||||||
|
|
||||||
<!-- Append application files to the result file -->
|
|
||||||
<concat destfile="${js_path}/compiled/${app_name}_app.js" eol="lf">
|
|
||||||
<!-- Append application static initialization code -->
|
|
||||||
<filelist dir="${js_path}/compiled/${app_name}" files="init.js" />
|
|
||||||
|
|
||||||
<!-- Include files from ${js_path}/compiled/${app_name}/ -->
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="*.js" />
|
|
||||||
<exclude name="init.js" />
|
|
||||||
<exclude name="app.js" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Include models files -->
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="models/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="models/**/*.js" />
|
|
||||||
<!-- Exclude base files -->
|
|
||||||
<exclude name="models/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Include collections files -->
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="collections/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="collections/**/*.js" />
|
|
||||||
<!-- Exclude base files -->
|
|
||||||
<exclude name="collections/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Include models views files -->
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="model_views/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="model_views/**/*.js" />
|
|
||||||
<!-- Exclude base files -->
|
|
||||||
<exclude name="model_views/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Include collections views files -->
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="collection_views/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="collection_views/**/*.js" />
|
|
||||||
<!-- Exclude base files -->
|
|
||||||
<exclude name="collection_views/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Include regions files -->
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="regions/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="regions/**/*.js" />
|
|
||||||
<!-- Exclude base files -->
|
|
||||||
<exclude name="regions/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Include layouts files -->
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="layouts/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="layouts/**/*.js" />
|
|
||||||
<!-- Exclude base files -->
|
|
||||||
<exclude name="layouts/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Include all other files -->
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="**/base*.js" />
|
|
||||||
<exclude name="models/**/base*.js" />
|
|
||||||
<exclude name="collections/**/base*.js" />
|
|
||||||
<exclude name="model_views/**/base*.js" />
|
|
||||||
<exclude name="collection_views/**/base*.js" />
|
|
||||||
<exclude name="regions/**/base*.js" />
|
|
||||||
<exclude name="layouts/**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="**/*.js" />
|
|
||||||
<!-- Exclude files from ${js_path}/compiled/${app_name}/ -->
|
|
||||||
<exclude name="*.js" />
|
|
||||||
<!-- Exclude models, collections, views, regions and layouts
|
|
||||||
files -->
|
|
||||||
<exclude name="models/**/*.js" />
|
|
||||||
<exclude name="collections/**/*.js" />
|
|
||||||
<exclude name="model_views/**/*.js" />
|
|
||||||
<exclude name="collection_views/**/*.js" />
|
|
||||||
<exclude name="regions/**/*.js" />
|
|
||||||
<exclude name="layouts/**/*.js" />
|
|
||||||
<!-- Exclude base files -->
|
|
||||||
<exclude name="**/base*.js" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
|
||||||
<include name="app.js" />
|
|
||||||
</fileset>
|
|
||||||
|
|
||||||
<!-- Apply filters -->
|
|
||||||
<filterchain>
|
|
||||||
<!-- Skip empty lines -->
|
|
||||||
<linecontainsregexp negate="true">
|
|
||||||
<regexp pattern="^\s+$$" />
|
|
||||||
</linecontainsregexp>
|
|
||||||
</filterchain>
|
|
||||||
</concat>
|
|
||||||
|
|
||||||
<echo>Done</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Build JavaScript files related to default application -->
|
|
||||||
<target name="default_app_js" depends="core_js" description="Build JavaScript files related to default application">
|
|
||||||
<antcall target="app_js">
|
|
||||||
<param name="app_name" value="default" />
|
|
||||||
</antcall>
|
|
||||||
<echo>Default JavaScript application built.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Compile and concatenate JavaScript files related to chat application -->
|
|
||||||
<target name="chat_app_js" depends="default_app_js" description="Build JavaScript files related to chat application">
|
|
||||||
<antcall target="app_js">
|
|
||||||
<param name="app_name" value="chat" />
|
|
||||||
</antcall>
|
|
||||||
<echo>Chat JavaScript application built.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Compile and concatenate JavaScript files related to users application -->
|
|
||||||
<target name="users_app_js" depends="default_app_js" description="Build JavaScript files related to users application">
|
|
||||||
<antcall target="app_js">
|
|
||||||
<param name="app_name" value="users" />
|
|
||||||
</antcall>
|
|
||||||
<echo>Users JavaScript application built.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Compile and concatenate JavaScript files related to thread log application -->
|
|
||||||
<target name="thread_log_app_js" depends="default_app_js" description="Build JavaScript files related to thread log application">
|
|
||||||
<antcall target="app_js">
|
|
||||||
<param name="app_name" value="thread_log" />
|
|
||||||
</antcall>
|
|
||||||
<echo>Thread log JavaScript application built.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Build all project -->
|
|
||||||
<target name="all" depends="chat_app_js,thread_log_app_js,users_app_js,styles_all" description="Build everything">
|
|
||||||
<echo>Mibew Messenger built.</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
</project>
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
mibew/vendor/bin/phpcs --standard="PSR2" --extensions="php" --ignore="mibew/vendor/,mibew/plugins" -n mibew/
|
|
@ -1,56 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
sub read_transl($) {
|
|
||||||
my($from) = @_;
|
|
||||||
my %translation = ();
|
|
||||||
open(IN, "mibew/locales/$from/properties");
|
|
||||||
while(<IN>) {
|
|
||||||
chomp;
|
|
||||||
if(/^([\w\.]+)=(.*)$/) {
|
|
||||||
if($1 ne "encoding" && $1 ne "output_charset" && $1 ne "output_encoding") {
|
|
||||||
$translation{$1} = $2;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
die "wrong line in $from: $_\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(IN);
|
|
||||||
return %translation;
|
|
||||||
}
|
|
||||||
|
|
||||||
%tr_en = read_transl("en");
|
|
||||||
|
|
||||||
@all_keys = keys %tr_en;
|
|
||||||
|
|
||||||
sub check_transl($%) {
|
|
||||||
my($name,%tr) = @_;
|
|
||||||
print "checking $name...\n";
|
|
||||||
my @totransl = ();
|
|
||||||
for $key (@all_keys) {
|
|
||||||
unless(exists $tr{$key}) {
|
|
||||||
push @totransl, "$key=".$tr_en{$key};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for $key(keys %tr) {
|
|
||||||
unless(exists $tr_en{$key}) {
|
|
||||||
print "unknown key in $name: $key\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($#totransl >= 0) {
|
|
||||||
print "@{[$#totransl+1]} lines absent in locales/$name/properties\n";
|
|
||||||
open(OUT, "> absent_$name");
|
|
||||||
for(sort @totransl) {
|
|
||||||
print OUT "$_\n";
|
|
||||||
}
|
|
||||||
close(OUT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
check_transl("ru", read_transl("ru"));
|
|
||||||
check_transl("fr", read_transl("fr"));
|
|
||||||
check_transl("de", read_transl("de"));
|
|
||||||
check_transl("sp", read_transl("sp"));
|
|
||||||
check_transl("it", read_transl("it"));
|
|
||||||
check_transl("pl", read_transl("pl"));
|
|
||||||
check_transl("zh-tw", read_transl("zh-tw"));
|
|
||||||
|
|
@ -1,34 +1,51 @@
|
|||||||
{
|
{
|
||||||
"name": "mibew/mibew",
|
"name": "mibew/mibew",
|
||||||
"version": "2.0-dev",
|
"version": "3.6.0",
|
||||||
"description": "Mibew Messenger - open-source live support application",
|
"description": "Mibew Messenger - open-source live support application",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"homepage": "http://mibew.org",
|
"homepage": "https://mibew.org",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Mibew Messenger Project",
|
"name": "Mibew Messenger Project",
|
||||||
"homepage": "http://mibew.org/credits"
|
"homepage": "https://mibew.org/credits"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"email": "support@mibew.org",
|
"email": "support@mibew.org",
|
||||||
"issues": "https://github.com/mibew/mibew/issues",
|
"issues": "https://github.com/mibew/mibew/issues",
|
||||||
"forum": "http://mibew.org/forums",
|
"forum": "https://mibew.org/forums",
|
||||||
"source": "https://github.com/mibew/mibew"
|
"source": "https://github.com/mibew/mibew"
|
||||||
},
|
},
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "https://github.com/mibew/handlebars.php"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "https://github.com/mibew/handlebars.php-helpers"
|
||||||
|
}
|
||||||
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"xamin/handlebars.php": "dev-master#cd8cec42a048ba0d8c7dd0bfde39b973b6a14b3f",
|
"mibew/handlebars.php": "~0.10.5",
|
||||||
"symfony/http-foundation": "2.4.*",
|
"mibew/handlebars.php-helpers": "1.*",
|
||||||
"symfony/routing": "2.4.*",
|
"symfony/http-foundation": "4.4.*",
|
||||||
"symfony/config": "2.4.*",
|
"symfony/routing": "4.4.*",
|
||||||
"symfony/yaml": "2.4.*",
|
"symfony/config": "4.4.*",
|
||||||
"symfony/translation": "2.4.*"
|
"symfony/yaml": "^5.2",
|
||||||
|
"symfony/translation": "2.6.*",
|
||||||
|
"tedivm/stash": "0.12.*",
|
||||||
|
"mibew/html5": "1.1.*",
|
||||||
|
"vierbergenlars/php-semver": "3.0.*",
|
||||||
|
"swiftmailer/swiftmailer": "~5.4.0",
|
||||||
|
"ua-parser/uap-php": "^3.9",
|
||||||
|
"true/punycode": "~1.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"squizlabs/php_codesniffer": "1.*"
|
"squizlabs/php_codesniffer": "3.*"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"vendor-dir": "mibew/vendor"
|
"vendor-dir": "mibew/vendor"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,245 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
use Digest::MD5 qw(md5 md5_hex md5_base64);
|
|
||||||
|
|
||||||
@rules = (
|
|
||||||
["redirect(ed)?\\.tpl", 1],
|
|
||||||
["\\.tpl", 0],
|
|
||||||
|
|
||||||
["view/license.php", 0],
|
|
||||||
["view/themes.php", 2],
|
|
||||||
["view/translate.php", 2],
|
|
||||||
["view/translatelist.php", 2],
|
|
||||||
["view/settings.php", 2],
|
|
||||||
["view/updates.php", 2],
|
|
||||||
["view/features.php", 2],
|
|
||||||
["view/performance.php", 2],
|
|
||||||
["view/avatar.php", 2],
|
|
||||||
["view/permissions.php", 2],
|
|
||||||
["view/agent.php", 2],
|
|
||||||
["view/agents.php", 2],
|
|
||||||
["view/group.php", 2],
|
|
||||||
["view/groupmembers.php", 2],
|
|
||||||
["view/groups.php", 2],
|
|
||||||
["view/operator_groups.php", 2],
|
|
||||||
["view/gen_button.php", 2],
|
|
||||||
["view/install_err.php", 2],
|
|
||||||
["view/install_index.php", 2],
|
|
||||||
["view/.*\\.php", 1],
|
|
||||||
|
|
||||||
["install/.*\\.php", 2],
|
|
||||||
|
|
||||||
["operator/themes.php", 2],
|
|
||||||
["operator/translate.php", 2],
|
|
||||||
["operator/settings.php", 2],
|
|
||||||
["operator/updates.php", 2],
|
|
||||||
["operator/features.php", 2],
|
|
||||||
["operator/performance.php", 2],
|
|
||||||
["operator/avatar.php", 2],
|
|
||||||
["operator/permissions.php", 2],
|
|
||||||
["operator/operator.php", 2],
|
|
||||||
["operator/operators.php", 2],
|
|
||||||
["operator/group.php", 2],
|
|
||||||
["operator/groupmembers.php", 2],
|
|
||||||
["operator/groups.php", 2],
|
|
||||||
["operator/opgroups.php", 2],
|
|
||||||
["operator/getcode.php", 2],
|
|
||||||
["operator/.*\\.php", 1],
|
|
||||||
|
|
||||||
["mibew/client.php", 0],
|
|
||||||
["mibew/leavemessage.php", 0],
|
|
||||||
["mibew/captcha.php", 0],
|
|
||||||
["mibew/license.php", 0],
|
|
||||||
["mibew/mail.php", 0],
|
|
||||||
|
|
||||||
["libs/operator_settings.php", 2],
|
|
||||||
["mibew/libs/chat.php", 0],
|
|
||||||
["libs/pagination.php", 1],
|
|
||||||
["libs/settings.php", 2],
|
|
||||||
["libs/groups.php", 2],
|
|
||||||
["libs/demothread.php", 2],
|
|
||||||
|
|
||||||
["mibew/thread.php", 0],
|
|
||||||
["mibew/b.php", 0],
|
|
||||||
["mibew/button.php", 0],
|
|
||||||
["mibew/index.php", 0],
|
|
||||||
|
|
||||||
["mibew/libs/.*\\.php", 1],
|
|
||||||
);
|
|
||||||
|
|
||||||
%messagekeys = (
|
|
||||||
"localeid" => 0,
|
|
||||||
"output_charset" => 0,
|
|
||||||
"output_encoding" => 0,
|
|
||||||
"harderrors.header" => 0,
|
|
||||||
|
|
||||||
"errors.required" => 0,
|
|
||||||
"errors.wrong_field" => 0,
|
|
||||||
"errors.file.move.error" => 2,
|
|
||||||
"errors.invalid.file.type" => 2,
|
|
||||||
"errors.file.size.exceeded" => 2,
|
|
||||||
|
|
||||||
"permission.admin" => 1,
|
|
||||||
"permission.takeover" => 1,
|
|
||||||
"permission.viewthreads" => 1,
|
|
||||||
|
|
||||||
"chat.thread.state_chatting_with_agent" => 1,
|
|
||||||
"chat.thread.state_closed" => 1,
|
|
||||||
"chat.thread.state_loading" => 1,
|
|
||||||
"chat.thread.state_wait" => 1,
|
|
||||||
"chat.thread.state_wait_for_another_agent" => 1,
|
|
||||||
|
|
||||||
"clients.queue.chat" => 1,
|
|
||||||
"clients.queue.prio" => 1,
|
|
||||||
"clients.queue.wait" => 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$mibewPath = "mibew";
|
|
||||||
|
|
||||||
%urls = ();
|
|
||||||
|
|
||||||
%usermessages = ();
|
|
||||||
%operatormessages = ();
|
|
||||||
$current_level = 0;
|
|
||||||
|
|
||||||
sub usemsg($) {
|
|
||||||
my ($m) = @_;
|
|
||||||
$messagekeys{$m} = exists $messagekeys{$m} && $messagekeys{$m} < $current_level ? $messagekeys{$m} : $current_level;
|
|
||||||
if($current_level == -1) {
|
|
||||||
print " .. $m\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub file_content($) {
|
|
||||||
my $input = $_[0];
|
|
||||||
open( IN1, "< $input" ) or die "cannot find file $input";
|
|
||||||
my $oldslash = $/;
|
|
||||||
$/ = EOI;
|
|
||||||
$content = <IN1>;
|
|
||||||
close( IN1 );
|
|
||||||
if($content =~ s/\r//g) {
|
|
||||||
open( OUT1, "> $input") or die "cannot fix $input";
|
|
||||||
print OUT1 $content;
|
|
||||||
close(OUT1);
|
|
||||||
}
|
|
||||||
$/ = $oldslash;
|
|
||||||
return $content;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub process_tpl($) {
|
|
||||||
my ($filename) = @_;
|
|
||||||
my $m = file_content($filename);
|
|
||||||
while( $m =~ /\${msg:([\w\.]+)(,[\w\.]+)?}/g ) {
|
|
||||||
usemsg($1);
|
|
||||||
}
|
|
||||||
while( $m =~ /\${url:([\w\.]+)(,[\w\.]+)?}/g ) {
|
|
||||||
usemsg($1);
|
|
||||||
$urls{"%$1"} = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub process_php($) {
|
|
||||||
my ($source) = @_;
|
|
||||||
my $content = file_content($source);
|
|
||||||
$content =~ s/<\?xml version=\\"1\.0\\" encoding=\\"UTF-8\\"\?>//;
|
|
||||||
|
|
||||||
while( $content =~ s/<\?(?!xml)(.*?)\?>//s ) {
|
|
||||||
my $inner = $1;
|
|
||||||
while($inner =~ s/(getlocal|no_field)2?_?\((.*?)[,\)]//s) {
|
|
||||||
my $firstarg = $2;
|
|
||||||
if( $firstarg =~ /^["']([\w\.]+)['"]$/) {
|
|
||||||
usemsg($1);
|
|
||||||
} elsif($firstarg =~ /^\$\w+$/ || $firstarg eq '"$var.header"' || $firstarg eq '"permission.$permid"' || $firstarg eq '$threadstate_key[$thread[\'istate\']]') {
|
|
||||||
# skip
|
|
||||||
} else {
|
|
||||||
print "> unknown: $firstarg\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub file_checksum($) {
|
|
||||||
my ($source) = @_;
|
|
||||||
if($source =~ /\.(png|gif|jpg|ico|wav)$/ || $source =~ /config\.php$/) {
|
|
||||||
return "-";
|
|
||||||
}
|
|
||||||
|
|
||||||
my $content = file_content($source);
|
|
||||||
return md5_hex($content);
|
|
||||||
}
|
|
||||||
|
|
||||||
@allsources = ();
|
|
||||||
|
|
||||||
sub process_one($) {
|
|
||||||
my($source) = @_;
|
|
||||||
push @allsources, $source unless $source =~ /$mibewPath\/locales/ && $source !~ /$mibewPath\/locales\/(en|names)/ || $source =~ /\/package$/;
|
|
||||||
|
|
||||||
if($source !~ /\.(php|tpl)$/) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$current_level = -1;
|
|
||||||
|
|
||||||
A: foreach $rule (@rules) {
|
|
||||||
my $key = $$rule[0];
|
|
||||||
if($source =~ /$key/) {
|
|
||||||
$current_level = $$rule[1];
|
|
||||||
last A;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($current_level < 0 || $current_level > 2) {
|
|
||||||
print "not detected for: $source\n";
|
|
||||||
$current_level = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($source =~ /\.php$/) {
|
|
||||||
# print "$source ($current_level)\n";
|
|
||||||
process_php($source);
|
|
||||||
} elsif($source =~ /\.tpl$/) {
|
|
||||||
process_tpl($source);
|
|
||||||
} else {
|
|
||||||
#print ". $source\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sub process_files($) {
|
|
||||||
my($from) = @_;
|
|
||||||
opendir(DIR, $from) || die "can't opendir $from: $!";
|
|
||||||
my @content = readdir(DIR);
|
|
||||||
closedir DIR;
|
|
||||||
|
|
||||||
for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess") } @content) {
|
|
||||||
process_one("$from/$_");
|
|
||||||
}
|
|
||||||
for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) {
|
|
||||||
process_files("$from/$_");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
process_files($mibewPath);
|
|
||||||
|
|
||||||
# fix
|
|
||||||
$messagekeys{'page.analysis.userhistory.title'} = 1;
|
|
||||||
$messagekeys{'errors.failed.uploading.file'} = 2;
|
|
||||||
|
|
||||||
|
|
||||||
open( OUT, "> $mibewPath/locales/names/level1") or die "cannot write file, $!";
|
|
||||||
for $key(sort grep { $messagekeys{$_} == 0 } keys %messagekeys) {
|
|
||||||
print OUT "$key\n";
|
|
||||||
}
|
|
||||||
close( OUT );
|
|
||||||
|
|
||||||
open( OUT, "> $mibewPath/locales/names/level2") or die "cannot write file, $!";
|
|
||||||
for $key(sort grep { $messagekeys{$_} == 1 } keys %messagekeys) {
|
|
||||||
print OUT "$key\n";
|
|
||||||
}
|
|
||||||
close( OUT );
|
|
||||||
|
|
||||||
open( OUT, "> $mibewPath/install/package") or die "cannot write file, $!";
|
|
||||||
for $key(sort @allsources) {
|
|
||||||
$digest = file_checksum($key);
|
|
||||||
$key =~ s/$mibewPath\///;
|
|
||||||
print OUT "$key $digest\n";
|
|
||||||
}
|
|
||||||
close( OUT );
|
|
743
src/gulpfile.js
Normal file
743
src/gulpfile.js
Normal file
@ -0,0 +1,743 @@
|
|||||||
|
// Initialize requirements
|
||||||
|
var fs = require('fs'),
|
||||||
|
https = require('https'),
|
||||||
|
exec = require('child_process').exec,
|
||||||
|
eventStream = require('event-stream'),
|
||||||
|
runSequence = require('gulp4-run-sequence'),
|
||||||
|
through = require('through2'),
|
||||||
|
lodash = require('lodash'),
|
||||||
|
PoFile = require('pofile'),
|
||||||
|
strftime = require('strftime'),
|
||||||
|
del = require('del'),
|
||||||
|
bower = require('bower'),
|
||||||
|
gulp = require('gulp'),
|
||||||
|
uglify = require('gulp-uglify'),
|
||||||
|
concat = require('gulp-concat'),
|
||||||
|
phpcs = require('gulp-phpcs'),
|
||||||
|
order = require('gulp-order'),
|
||||||
|
handlebars = require('gulp-handlebars'),
|
||||||
|
handlebarsEngine = require('handlebars'),
|
||||||
|
defineModule = require('gulp-define-module'),
|
||||||
|
header = require('gulp-header'),
|
||||||
|
zip = require('gulp-zip'),
|
||||||
|
tar = require('gulp-tar'),
|
||||||
|
gzip = require('gulp-gzip'),
|
||||||
|
chmod = require('gulp-chmod'),
|
||||||
|
xgettext = require('gulp-xgettext'),
|
||||||
|
concatPo = require('gulp-concat-po'),
|
||||||
|
rename = require('gulp-rename'),
|
||||||
|
eslint = require('gulp-eslint'),
|
||||||
|
removeDuplicateHeaders = require('mibew-gulp-greh'),
|
||||||
|
mkdirp = require('mkdirp');
|
||||||
|
|
||||||
|
// Set global configuration
|
||||||
|
var config = {
|
||||||
|
mibewPath: 'mibew',
|
||||||
|
configsPath: 'mibew/configs',
|
||||||
|
phpVendorPath: 'mibew/vendor',
|
||||||
|
jsVendorPath: 'mibew/js/vendor',
|
||||||
|
pluginsPath: 'mibew/plugins',
|
||||||
|
avatarsPath: 'mibew/files/avatar',
|
||||||
|
cachePath: 'mibew/cache',
|
||||||
|
jsPath: 'mibew/js',
|
||||||
|
chatStylesPath: 'mibew/styles/chats',
|
||||||
|
pageStylesPath: 'mibew/styles/pages',
|
||||||
|
i18nPath: 'i18n',
|
||||||
|
i18nPrefix: 'mibew-i18n-',
|
||||||
|
releasePath: 'release',
|
||||||
|
uploadPath: 'upload',
|
||||||
|
compiledTemplatesHeader: fs.readFileSync('tools/compiled_templates_header.txt'),
|
||||||
|
getComposerUrl: 'https://getcomposer.org/installer',
|
||||||
|
phpBin: 'php -d "suhosin.executor.include.whitelist = phar" -d "memory_limit=512M"',
|
||||||
|
package: require('./composer.json'),
|
||||||
|
msginit: 'msginit',
|
||||||
|
msgcat: 'msgcat'
|
||||||
|
}
|
||||||
|
config.i18nSuffix = '-' + config.package.version + '-' + strftime('%Y%m%d');
|
||||||
|
|
||||||
|
// Tasks for cleaning //////////////////
|
||||||
|
|
||||||
|
// Cleans all built files
|
||||||
|
gulp.task('clean', function(callback) {
|
||||||
|
return del([
|
||||||
|
config.releasePath,
|
||||||
|
'composer.lock',
|
||||||
|
config.phpVendorPath,
|
||||||
|
config.jsVendorPath,
|
||||||
|
config.jsPath + '/compiled/**/*',
|
||||||
|
'!' + config.jsPath + '/compiled/.keep',
|
||||||
|
config.chatStylesPath + '/*/templates_compiled/client_side/*.js',
|
||||||
|
config.chatStylesPath + '/*/js/compiled/*.js',
|
||||||
|
config.pageStylesPath + '/*/templates_compiled/client_side/*.js'
|
||||||
|
], callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Cleans temporary English translation in the release dir
|
||||||
|
gulp.task('clean-tmp-po', function(callback) {
|
||||||
|
return del([config.releasePath + '/translation.po'], callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Cleans temporary files of translations in the release dir
|
||||||
|
gulp.task('clean-tmp-i18n-files', function(callback) {
|
||||||
|
return del([
|
||||||
|
config.releasePath + '/**/*',
|
||||||
|
'!' + config.releasePath + '/*.zip',
|
||||||
|
'!' + config.releasePath + '/*.tar.gz',
|
||||||
|
'!' + config.releasePath + '/*.pot'
|
||||||
|
], callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Cleans all files prepared for uploading to CDN
|
||||||
|
gulp.task('clean-upload', function(callback) {
|
||||||
|
return del([config.uploadPath], callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Cleans everything
|
||||||
|
gulp.task('clean-all', function(callback) {
|
||||||
|
runSequence( ['clean', 'clean-upload'],
|
||||||
|
callback );
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Watcher tasks ///////////////////////
|
||||||
|
|
||||||
|
// Watch styles
|
||||||
|
gulp.task('watch', function() {
|
||||||
|
gulp.watch(config.pageStylesPath + '/**/*.handlebars', gulp.series('page-styles'));
|
||||||
|
gulp.watch(config.chatStylesPath + '/**/js/source/**/*.js', gulp.series('chat-styles-js'));
|
||||||
|
gulp.watch(config.chatStylesPath + '/**/*.handlebars', gulp.series('chat-styles-handlebars'));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Service tasks //////////////////
|
||||||
|
|
||||||
|
// Get and install PHP Composer
|
||||||
|
gulp.task('get-composer', function(callback) {
|
||||||
|
// Check whether Composer is already in place
|
||||||
|
if (fs.existsSync('./composer.phar')) {
|
||||||
|
callback(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get installer from the Internet
|
||||||
|
https.get(config.getComposerUrl, function(response) {
|
||||||
|
// Run PHP to install Composer
|
||||||
|
var php = exec(config.phpBin, function(error, stdout, stderr) {
|
||||||
|
callback(error ? stderr : null);
|
||||||
|
});
|
||||||
|
// Pass installer code to PHP via STDIN
|
||||||
|
response.pipe(php.stdin);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Install Composer dependencies excluding development ones
|
||||||
|
gulp.task('composer-install', gulp.series('get-composer', function(callback) {
|
||||||
|
exec(config.phpBin + ' composer.phar install --no-dev',
|
||||||
|
function(error, stdout, stderr) {
|
||||||
|
callback(error ? stderr : null);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Install all Composer dependencies
|
||||||
|
gulp.task('composer-install-dev', gulp.series('get-composer', function(callback) {
|
||||||
|
exec(config.phpBin + ' composer.phar install',
|
||||||
|
function(error, stdout, stderr) {
|
||||||
|
callback(error ? stderr : null);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Installs bower dependencies
|
||||||
|
gulp.task('bower-install', function(callback) {
|
||||||
|
bower.commands.install([], {}, {})
|
||||||
|
.on('error', function(error) {
|
||||||
|
callback(error);
|
||||||
|
})
|
||||||
|
.on('end', function() {
|
||||||
|
// We should manually minify JavaScript files that was not minified
|
||||||
|
// by bower packages' authors
|
||||||
|
// TODO: This is a temproary workaround and should be removed once
|
||||||
|
// the packages will be fixed
|
||||||
|
var stream = eventStream.merge(
|
||||||
|
gulp.src(config.jsVendorPath + '/backbone/backbone.js',
|
||||||
|
{base: config.jsVendorPath})
|
||||||
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
|
// There are neither "@license" tag nor "!preserve" in the
|
||||||
|
// header. Add the header manually
|
||||||
|
.pipe(header(
|
||||||
|
"// Backbone.js 1.1.2\n"
|
||||||
|
+ "// (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n"
|
||||||
|
+ "// Backbone may be freely distributed under the MIT license.\n"
|
||||||
|
+ "// For all details and documentation:\n"
|
||||||
|
+ "// http://backbonejs.org\n"
|
||||||
|
))
|
||||||
|
.pipe(rename('backbone/backbone-min.js')),
|
||||||
|
gulp.src(config.jsVendorPath + '/json/json2.js',
|
||||||
|
{base: config.jsVendorPath})
|
||||||
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
|
// There are neither "@license" tag nor "!preserve" in the
|
||||||
|
// header, add the header manually
|
||||||
|
.pipe(header("// json2.js. Public Domain. See http://www.JSON.org/js.html\n"))
|
||||||
|
.pipe(rename('json/json2.min.js'))
|
||||||
|
)
|
||||||
|
.pipe(gulp.dest(config.jsVendorPath));
|
||||||
|
|
||||||
|
stream
|
||||||
|
.on('error', callback)
|
||||||
|
.on('end', callback);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Tasks for checking //////////////////
|
||||||
|
|
||||||
|
// Checks all PHP files with PHP Code Sniffer
|
||||||
|
gulp.task('phpcs', gulp.series('composer-install-dev', function() {
|
||||||
|
return gulp.src([
|
||||||
|
config.mibewPath + '/**/*.php',
|
||||||
|
'!' + config.phpVendorPath + '/**/*.*',
|
||||||
|
'!' + config.pluginsPath + '/**/*.*',
|
||||||
|
'!' + config.cachePath + '/**/*.*'
|
||||||
|
], {
|
||||||
|
// Content of the cache directory is readable only for webserver.
|
||||||
|
// Thus we must to set "strict" option to false to prevent "EACCES"
|
||||||
|
// errors. At the same we need to see all errors that take place.
|
||||||
|
strict: false,
|
||||||
|
silent: false
|
||||||
|
})
|
||||||
|
.pipe(phpcs({
|
||||||
|
bin: config.phpVendorPath + '/bin/phpcs',
|
||||||
|
standard: 'PSR2',
|
||||||
|
warningSeverity: 0
|
||||||
|
}))
|
||||||
|
.pipe(phpcs.reporter('log'))
|
||||||
|
.pipe(phpcs.reporter('fail'));
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Checks all JavaScript Source files with ESLint
|
||||||
|
gulp.task('eslint', function() {
|
||||||
|
return gulp.src(config.jsPath + '/source/**/*.js')
|
||||||
|
.pipe(eslint())
|
||||||
|
.pipe(eslint.format())
|
||||||
|
.pipe(eslint.failAfterError());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Restore empty English translation in the source code
|
||||||
|
gulp.task('post-pack-cleanup', function(callback) {
|
||||||
|
gulp.src('translation.po')
|
||||||
|
.pipe(gulp.dest(config.mibewPath + '/locales/en/'));
|
||||||
|
|
||||||
|
del(['translation.po', config.releasePath + '/translation.po'], callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Tasks of compiling //////////////////
|
||||||
|
|
||||||
|
// Compile all JavaScript files of the Mibew Messenger Core
|
||||||
|
gulp.task('js', function() {
|
||||||
|
return eventStream.merge(
|
||||||
|
getClientSideApp('default'),
|
||||||
|
getClientSideApp('chat'),
|
||||||
|
getClientSideApp('thread_log'),
|
||||||
|
getClientSideApp('users'),
|
||||||
|
gulp.src(config.jsPath + '/source/**/*.js')
|
||||||
|
)
|
||||||
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
|
.pipe(removeDuplicateHeaders())
|
||||||
|
.pipe(gulp.dest(config.jsPath + '/compiled'));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Compile and concatenate Handlebars templates for all chat styles
|
||||||
|
gulp.task('chat-styles-handlebars', function() {
|
||||||
|
return getChildDirs(config.chatStylesPath)
|
||||||
|
.then(function (dirs) {
|
||||||
|
return Promise.all(dirs.map(function (dir) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
gulp.src(config.chatStylesPath + '/' + dir
|
||||||
|
+ '/templates_src/client_side/**/*.handlebars')
|
||||||
|
.pipe(handlebars({
|
||||||
|
// Use specific version of Handlebars.js
|
||||||
|
handlebars: handlebarsEngine
|
||||||
|
}))
|
||||||
|
.pipe(wrapHandlebarsTemplate())
|
||||||
|
.pipe(concat('templates.js'))
|
||||||
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
|
.pipe(header(config.compiledTemplatesHeader))
|
||||||
|
.pipe(gulp.dest(config.chatStylesPath + '/' + dir
|
||||||
|
+ '/templates_compiled/client_side'))
|
||||||
|
.on('end', resolve)
|
||||||
|
.on('error', reject);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Compile and concatenate js files for all chat styles
|
||||||
|
gulp.task('chat-styles-js', function() {
|
||||||
|
return getChildDirs(config.chatStylesPath)
|
||||||
|
.then(function (dirs) {
|
||||||
|
return Promise.all(dirs.map(function (dir) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
gulp.src(config.chatStylesPath + '/' + dir
|
||||||
|
+ '/js/source/**/*.js')
|
||||||
|
.pipe(concat('scripts.js'))
|
||||||
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
|
.pipe(gulp.dest(config.chatStylesPath + '/' + dir
|
||||||
|
+ '/js/compiled'))
|
||||||
|
.on('end', resolve)
|
||||||
|
.on('error', reject);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Performs all job related to pages styles
|
||||||
|
gulp.task('page-styles', function() {
|
||||||
|
return getChildDirs(config.pageStylesPath)
|
||||||
|
.then(function (dirs) {
|
||||||
|
return Promise.all(dirs.map(function (dir) {
|
||||||
|
return new Promise(function(resolve, reject){
|
||||||
|
gulp.src(config.pageStylesPath + '/' + dir
|
||||||
|
+ '/templates_src/client_side/**/*.handlebars')
|
||||||
|
.pipe(handlebars({
|
||||||
|
// Use specific version of Handlebars.js
|
||||||
|
handlebars: handlebarsEngine
|
||||||
|
}))
|
||||||
|
.pipe(wrapHandlebarsTemplate())
|
||||||
|
.pipe(concat('templates.js'))
|
||||||
|
.pipe(uglify({preserveComments: 'some'}))
|
||||||
|
.pipe(header(config.compiledTemplatesHeader))
|
||||||
|
.pipe(gulp.dest(config.pageStylesPath + '/' + dir
|
||||||
|
+ '/templates_compiled/client_side'))
|
||||||
|
.on('end', resolve)
|
||||||
|
.on('error', reject);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Performs all job related to chat styles
|
||||||
|
gulp.task('chat-styles', gulp.series('chat-styles-handlebars', 'chat-styles-js'));
|
||||||
|
|
||||||
|
// Prepares ready to use development version of Mibew Messenger without
|
||||||
|
// packing or validating it
|
||||||
|
gulp.task('rebuild', function(callback) {
|
||||||
|
runSequence(
|
||||||
|
'clean',
|
||||||
|
['js', 'chat-styles', 'page-styles', 'composer-install',
|
||||||
|
'bower-install'],
|
||||||
|
callback
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Tasks for localization issues ///////
|
||||||
|
|
||||||
|
// Generate POT-file based upon the source code
|
||||||
|
gulp.task('generate-pot', function() {
|
||||||
|
return eventStream.merge(
|
||||||
|
gulp.src([
|
||||||
|
config.mibewPath + '/**/*.php',
|
||||||
|
'!' + config.phpVendorPath + '/**/*.*',
|
||||||
|
'!' + config.pluginsPath + '/**/*.*',
|
||||||
|
'!' + config.cachePath + '/**/*.*'
|
||||||
|
], {
|
||||||
|
// Content of the cache directory is readable only for
|
||||||
|
// webserver. Thus we must to set "strict" option to false
|
||||||
|
// to prevent "EACCES" errors. At the same we need to see all
|
||||||
|
// errors that take place.
|
||||||
|
strict: false,
|
||||||
|
silent: false
|
||||||
|
})
|
||||||
|
.pipe(xgettext({
|
||||||
|
language: 'PHP',
|
||||||
|
keywords: [
|
||||||
|
{name: 'getlocal'},
|
||||||
|
{name: 'no_field'},
|
||||||
|
{name: 'wrong_field'},
|
||||||
|
{name: 'failed_uploading_file', singular: 2}
|
||||||
|
]
|
||||||
|
})),
|
||||||
|
gulp.src(config.jsPath + '/source/**/*.js', {base: config.mibewPath})
|
||||||
|
.pipe(xgettext({
|
||||||
|
language: 'JavaScript',
|
||||||
|
keywords: [
|
||||||
|
{name: 'trans'}
|
||||||
|
]
|
||||||
|
})),
|
||||||
|
gulp.src([
|
||||||
|
config.chatStylesPath + '/default/templates_src/**/*.handlebars',
|
||||||
|
config.pageStylesPath + '/default/templates_src/**/*.handlebars'
|
||||||
|
], {base: config.mibewPath})
|
||||||
|
.pipe(xgettextHandlebars())
|
||||||
|
)
|
||||||
|
.pipe(concatPo(config.i18nPrefix + 'translation'
|
||||||
|
+ config.i18nSuffix + '.pot',
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Project-Id-Version': 'Mibew Messenger '
|
||||||
|
+ config.package.version,
|
||||||
|
'Report-Msgid-Bugs-To': config.package.support.email,
|
||||||
|
'POT-Creation-Date': strftime('%Y-%m-%d %H:%M%z'),
|
||||||
|
'PO-Revision-Date': '',
|
||||||
|
'Last-Translator': '',
|
||||||
|
'Language-Team': '',
|
||||||
|
'Content-Type': 'text/plain; charset=UTF-8'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.pipe(gulp.dest(config.releasePath));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Generate temporary English translation to be used in the release
|
||||||
|
gulp.task('generate-tmp-po', gulp.series('generate-pot', function(callback) {
|
||||||
|
return exec(config.msginit + ' --no-translator --no-wrap -i '
|
||||||
|
+ config.releasePath + '/' + config.i18nPrefix + 'translation'
|
||||||
|
+ config.i18nSuffix + '.pot' + ' -l en -o '
|
||||||
|
+ config.releasePath + '/translation.po',
|
||||||
|
function(error, stdout, stderr) {
|
||||||
|
callback(error ? stderr : null);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Generate complete translations (that includes missed strings) to be used
|
||||||
|
// in the release
|
||||||
|
gulp.task('generate-pos', gulp.series('generate-tmp-po', function(callback) {
|
||||||
|
|
||||||
|
return getChildDirs(config.i18nPath + '/translations')
|
||||||
|
.then(function (dirs) {
|
||||||
|
return Promise.all(dirs.map(function (dir) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
mkdirp(config.releasePath + '/' + dir, function (error) {
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
exec(config.msgcat + ' ' + config.i18nPath + '/translations/'
|
||||||
|
+ dir + '/translation.po ' + config.releasePath
|
||||||
|
+ '/translation.po --no-location --no-wrap --use-first'
|
||||||
|
+ ' -o ' + config.releasePath + '/' + dir
|
||||||
|
+ '/translation.po',
|
||||||
|
function(error, stdout, stderr) {
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var sources = [
|
||||||
|
config.i18nPath + '/translations/' + dir + '/**/*',
|
||||||
|
'!' + config.i18nPath + '/translations/' + dir
|
||||||
|
+ '/translation.po'
|
||||||
|
];
|
||||||
|
|
||||||
|
gulp.src(sources)
|
||||||
|
.pipe(gulp.dest(config.releasePath + '/' + dir))
|
||||||
|
.on('error', reject)
|
||||||
|
.on('end', resolve);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Packaging tasks /////////////////////
|
||||||
|
|
||||||
|
// Pack sources for release as .zip and .tar.gz archives
|
||||||
|
gulp.task('pack-sources', gulp.series('composer-install', 'bower-install', function() {
|
||||||
|
gulp.src(config.mibewPath + '/locales/en/translation.po')
|
||||||
|
.pipe(gulp.dest('.'));
|
||||||
|
gulp.src(config.releasePath + '/translation.po')
|
||||||
|
.pipe(gulp.dest(config.mibewPath + '/locales/en/'));
|
||||||
|
|
||||||
|
var sources = [
|
||||||
|
config.mibewPath + '/**/*',
|
||||||
|
// Exclude user's config
|
||||||
|
'!' + config.configsPath + '/config.yml',
|
||||||
|
// Exclude cache files but not the ".keep" file.
|
||||||
|
'!' + config.cachePath + '/**/!(.keep)',
|
||||||
|
// Exclude avatars but not the ".keep" file.
|
||||||
|
'!' + config.avatarsPath + '/!(.keep)',
|
||||||
|
// Exclude plugins but not the ".keep" file.
|
||||||
|
'!' + config.pluginsPath + '/!(.keep)',
|
||||||
|
'!' + config.pluginsPath + '/*/**/*',
|
||||||
|
// Exclude Git repositories that can be shipped with third-party libs
|
||||||
|
'!' + config.phpVendorPath + '/**/.git',
|
||||||
|
'!' + config.phpVendorPath + '/**/.git/**/*',
|
||||||
|
// Exclude vendors binaries
|
||||||
|
'!' + config.phpVendorPath + '/bin/**/*',
|
||||||
|
// Exclude JavaScript sources
|
||||||
|
'!' + config.jsPath + '/source/**/*',
|
||||||
|
// Actually we does not need backbone.babysitter and backbone.wreqr
|
||||||
|
// dependencies because they embed into marionette.js. So we exclude
|
||||||
|
// "backbone.babysitter" and "backbone.wreqr" directories and all their
|
||||||
|
// contents.
|
||||||
|
'!' + config.jsVendorPath + '/backbone.babysitter{,/**}',
|
||||||
|
'!' + config.jsVendorPath + '/backbone.wreqr{,/**}',
|
||||||
|
// Exclude dot files within third-party JS libraries.
|
||||||
|
'!' + config.jsVendorPath + '/**/.*',
|
||||||
|
// Exclude config files of various package systems
|
||||||
|
'!' + config.jsVendorPath + '/**/{bower,component,package,composer}.json',
|
||||||
|
// Exclude config files of various build systems
|
||||||
|
'!' + config.jsVendorPath + '/**/Gruntfile.*',
|
||||||
|
'!' + config.jsVendorPath + '/**/gulpfile.*',
|
||||||
|
'!' + config.jsVendorPath + '/**/Makefile',
|
||||||
|
// Exclude HTML files from third-party JS libraries. Such files can be
|
||||||
|
// used for docs or for tests, we need none of them.
|
||||||
|
'!' + config.jsVendorPath + '/**/*.html',
|
||||||
|
// There are too many useless files in Vex.js library. Exclude them.
|
||||||
|
'!' + config.jsVendorPath + '/vex/sass{,/**}',
|
||||||
|
'!' + config.jsVendorPath + '/vex/docs{,/**}',
|
||||||
|
'!' + config.jsVendorPath + '/vex/docs{,/**}',
|
||||||
|
'!' + config.jsVendorPath + '/vex/coffee{,/**}'
|
||||||
|
];
|
||||||
|
var srcOptions = {
|
||||||
|
// Dot files (.htaccess, .keep, etc.) must be included in the package
|
||||||
|
dot: true,
|
||||||
|
// Content of the cache directory is readable only for webserver. Thus
|
||||||
|
// we must to set "strict" option to false to prevent "EACCES" errors.
|
||||||
|
// At the same we need to see all errors that take place.
|
||||||
|
strict: false,
|
||||||
|
silent: false,
|
||||||
|
// Preserve root directory name (i.e. 'mibew/')
|
||||||
|
base: '.'
|
||||||
|
}
|
||||||
|
var version = config.package.version;
|
||||||
|
|
||||||
|
return eventStream.merge(
|
||||||
|
gulp.src(sources, srcOptions)
|
||||||
|
.pipe(zip('mibew-' + version + '.zip')),
|
||||||
|
gulp.src(sources, srcOptions)
|
||||||
|
.pipe(tar('mibew-' + version + '.tar'))
|
||||||
|
.pipe(gzip())
|
||||||
|
)
|
||||||
|
.pipe(chmod(644))
|
||||||
|
.pipe(gulp.dest(config.releasePath));
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Pack translations for release as .zip and .tar.gz archives
|
||||||
|
gulp.task('pack-i18n', function(callback) {
|
||||||
|
return getChildDirs(config.i18nPath + '/translations')
|
||||||
|
.then(function (dirs) {
|
||||||
|
return Promise.all(dirs.map(function (dir) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
|
||||||
|
var srcOptions = {
|
||||||
|
base: config.releasePath
|
||||||
|
};
|
||||||
|
|
||||||
|
eventStream.merge(
|
||||||
|
gulp.src(config.releasePath + '/' + dir
|
||||||
|
+ '/**/*', srcOptions)
|
||||||
|
.pipe(zip(config.i18nPrefix + dir
|
||||||
|
+ config.i18nSuffix + '.zip')),
|
||||||
|
gulp.src(config.releasePath + '/' + dir
|
||||||
|
+ '/**/*', srcOptions)
|
||||||
|
.pipe(tar(config.i18nPrefix + dir
|
||||||
|
+ config.i18nSuffix + '.tar'))
|
||||||
|
.pipe(gzip())
|
||||||
|
)
|
||||||
|
.pipe(chmod(644))
|
||||||
|
.pipe(gulp.dest(config.releasePath))
|
||||||
|
.on('error', reject)
|
||||||
|
.on('end', resolve);
|
||||||
|
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Tasks of releasing //////////////////
|
||||||
|
|
||||||
|
// Prepare release of Mibew Messenger
|
||||||
|
gulp.task('prepare-release', function(callback) {
|
||||||
|
runSequence(
|
||||||
|
'clean',
|
||||||
|
['phpcs', 'js', 'chat-styles', 'page-styles', 'generate-pot',
|
||||||
|
'generate-tmp-po'],
|
||||||
|
'pack-sources',
|
||||||
|
'post-pack-cleanup',
|
||||||
|
callback
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Prepare releases of translations for Mibew Messenger
|
||||||
|
gulp.task('prepare-i18n-release', function(callback) {
|
||||||
|
runSequence( 'clean-tmp-po',
|
||||||
|
'generate-pos',
|
||||||
|
'pack-i18n',
|
||||||
|
'clean-tmp-i18n-files',
|
||||||
|
callback
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Mirror prepared releases of Mibew Messenger and its translations in a form
|
||||||
|
// intended for uploading into the CDN
|
||||||
|
gulp.task('prepare-for-upload', function(callback) {
|
||||||
|
gulp.src(config.releasePath + '/mibew-' + config.package.version + '.*')
|
||||||
|
.pipe(gulp.dest(config.uploadPath + '/core/' + config.package.version + '/'));
|
||||||
|
|
||||||
|
gulp.src(config.releasePath + '/mibew-i18n-translation-' + config.package.version + '-*.pot')
|
||||||
|
.pipe(gulp.dest(config.uploadPath + '/i18n/_pot/' + config.package.version + '/'));
|
||||||
|
|
||||||
|
return getChildDirs(config.i18nPath + '/translations')
|
||||||
|
.then(function (dirs) {
|
||||||
|
return Promise.all(dirs.map(function (dir) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
gulp.src(config.releasePath + '/mibew-i18n-' + dir + '-' + config.package.version + '-*.*')
|
||||||
|
.pipe(gulp.dest(config.uploadPath + '/i18n/' + dir + '/' + config.package.version + '/'))
|
||||||
|
.on('error', reject)
|
||||||
|
.on('end', resolve);
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Perform all preparations before uploading the release of Mibew Messenger and
|
||||||
|
// its translations into the CDN
|
||||||
|
gulp.task('prepare-all', function(callback) {
|
||||||
|
runSequence('clean-all', 'prepare-release', 'prepare-i18n-release',
|
||||||
|
'prepare-for-upload', callback);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Prepare release archives of the development version of Mibew Messenger
|
||||||
|
gulp.task('default', function(callback) {
|
||||||
|
runSequence(
|
||||||
|
'clean',
|
||||||
|
['js', 'chat-styles', 'page-styles', 'generate-tmp-po'],
|
||||||
|
'pack-sources',
|
||||||
|
['post-pack-cleanup', 'clean-tmp-po'],
|
||||||
|
callback
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads and prepare js file for a client side application with the specified
|
||||||
|
* name.
|
||||||
|
*
|
||||||
|
* @param {String} name Application name.
|
||||||
|
* @returns A files stream that can be piped to any gulp plugin.
|
||||||
|
*/
|
||||||
|
var getClientSideApp = function(name) {
|
||||||
|
var appSource = config.jsPath + '/source/' + name;
|
||||||
|
|
||||||
|
return gulp.src(appSource + '/**/*.js')
|
||||||
|
.pipe(order(
|
||||||
|
[
|
||||||
|
appSource + '/init.js',
|
||||||
|
// The following line is equivalent to
|
||||||
|
// gulp.src([appSource + '/*.js', '!' + appSource + '/app.js']);
|
||||||
|
appSource + '/!(app).js',
|
||||||
|
appSource + '/models/**/base*.js',
|
||||||
|
appSource + '/models/**/*.js',
|
||||||
|
appSource + '/collections/**/base*.js',
|
||||||
|
appSource + '/collections/**/*.js',
|
||||||
|
appSource + '/model_views/**/base*.js',
|
||||||
|
appSource + '/model_views/**/*.js',
|
||||||
|
appSource + '/collection_views/**/base*.js',
|
||||||
|
appSource + '/collection_views/**/*.js',
|
||||||
|
appSource + '/regions/**/base*.js',
|
||||||
|
appSource + '/regions/**/*.js',
|
||||||
|
appSource + '/layouts/**/base*.js',
|
||||||
|
appSource + '/layouts/**/*.js',
|
||||||
|
appSource + '/**/base*.js',
|
||||||
|
// The following line is equivalent to
|
||||||
|
// gulp.src([appSource + '/**/*.js', '!' + appSource + '/app.js']);
|
||||||
|
'!' + appSource + '/app.js',
|
||||||
|
appSource + '/app.js'
|
||||||
|
],
|
||||||
|
{base: process.cwd()}
|
||||||
|
))
|
||||||
|
.pipe(concat(name + '_app.js'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wraps a handlebars template with a function and attach it to the
|
||||||
|
* Handlebars.templates object.
|
||||||
|
*
|
||||||
|
* @returns {Function} A function that can be used in pipe() method of a file
|
||||||
|
* stream right after gulp-handlebars plugin.
|
||||||
|
*/
|
||||||
|
var wrapHandlebarsTemplate = function() {
|
||||||
|
return defineModule('plain', {
|
||||||
|
wrapper: '(function() {\n'
|
||||||
|
+ 'var templates = Handlebars.templates = Handlebars.templates || {};\n'
|
||||||
|
+ 'Handlebars.templates["<%= relative %>"] = <%= handlebars %>;\n'
|
||||||
|
+ '})()',
|
||||||
|
context: function(context) {
|
||||||
|
return {relative: context.file.relative.replace(/\.js$/, '').replace(/\\/g, '/')};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts gettext messages from handlebars templates.
|
||||||
|
*
|
||||||
|
* @returns {Function} A function that can be used in pipe() method of a file
|
||||||
|
* stream.
|
||||||
|
*/
|
||||||
|
var xgettextHandlebars = function() {
|
||||||
|
var helperRegExp = /\{{2}l10n\s*('|")(.*?[^\\])\1.*?\}{2}/g;
|
||||||
|
|
||||||
|
return through.obj(function (file, enc, callback) {
|
||||||
|
var po = new PoFile();
|
||||||
|
match = false,
|
||||||
|
contents = file.contents.toString();
|
||||||
|
|
||||||
|
while (match = helperRegExp.exec(contents)) {
|
||||||
|
// Try to find item in the .po file by its name
|
||||||
|
var item = lodash.find(po.items, function(item) {
|
||||||
|
return match[2] === item.msgid;
|
||||||
|
});
|
||||||
|
|
||||||
|
var line = contents.substr(0, match.index).split(/\r?\n|\r/g).length;
|
||||||
|
|
||||||
|
if (!item) {
|
||||||
|
// There is no such item, create new one
|
||||||
|
item = new PoFile.Item();
|
||||||
|
item.msgid = match[2].replace(/\\'/g, "'").replace(/\\"/g, '"');
|
||||||
|
po.items.push(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add new reference
|
||||||
|
item.references.push(file.relative + ':' + line);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update file contents
|
||||||
|
file.contents = Buffer.from(po.toString());
|
||||||
|
this.push(file);
|
||||||
|
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves list of all dirs which are placed in the specified one.
|
||||||
|
*
|
||||||
|
* @param {String} srcDir A dir to search.
|
||||||
|
* @returns Promise A promise which will be resolved with list of child dirs or
|
||||||
|
* rejected with the occured error.
|
||||||
|
*/
|
||||||
|
var getChildDirs = function(srcDir) {
|
||||||
|
return (new Promise(function(resolve, reject) {
|
||||||
|
fs.readdir(srcDir, function (err, files) {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
} else {
|
||||||
|
resolve(files);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})).then(function (files) {
|
||||||
|
// Replace all files that are not a directory with nulls.
|
||||||
|
return Promise.all(files.map(function (file) {
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
fs.lstat(srcDir + '/' + file, function (err, stat) {
|
||||||
|
if (err) {
|
||||||
|
reject(err);
|
||||||
|
} else {
|
||||||
|
resolve(stat.isDirectory() ? file : null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
}).then(function(dirs) {
|
||||||
|
// Remove all nulls from the array.
|
||||||
|
return dirs.filter(function (dir) {
|
||||||
|
return null !== dir;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
1
src/i18n
Submodule
1
src/i18n
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 55868d9973f531c3550575481bde4233cc625b91
|
@ -1,12 +1,14 @@
|
|||||||
# Set default handler for incoming requests
|
|
||||||
DirectoryIndex index.php
|
|
||||||
|
|
||||||
# Disable directory listing
|
# Disable directory listing
|
||||||
Options -Indexes
|
Options -Indexes
|
||||||
|
|
||||||
# Follow symbolic links in the directory
|
# Follow symbolic links in the directory
|
||||||
Options +FollowSymLinks
|
Options +FollowSymLinks
|
||||||
|
|
||||||
|
<IfModule mod_negotiation.c>
|
||||||
|
# Forbid apache to guess file extensions
|
||||||
|
Options -MultiViews
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
# Disable mod_security for Apache 1.x
|
# Disable mod_security for Apache 1.x
|
||||||
<IfModule mod_security.c>
|
<IfModule mod_security.c>
|
||||||
SecFilterEngine Off
|
SecFilterEngine Off
|
||||||
@ -26,12 +28,15 @@ Options +FollowSymLinks
|
|||||||
|
|
||||||
# Redirect requests to the front controller
|
# Redirect requests to the front controller
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
|
# Use the front controller as a default handler
|
||||||
|
DirectoryIndex index.php
|
||||||
|
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
|
|
||||||
# Use separate front controller for the system installator
|
# Use separate front controller for the system installator
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteRule ^install(|/(.*))$ install.php [QSA,L]
|
RewriteRule ^install(/(.*))?$ install.php [QSA,L]
|
||||||
|
|
||||||
# Rewrite all other requests for files and directories that do not exist to
|
# Rewrite all other requests for files and directories that do not exist to
|
||||||
# the main front controller
|
# the main front controller
|
||||||
@ -40,7 +45,20 @@ Options +FollowSymLinks
|
|||||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule !mod_rewrite.c>
|
||||||
|
# There is no mod_rewrite in the system. For the root Mibew Messenger
|
||||||
|
# directory index_fallback.php should be loaded first to activate
|
||||||
|
# old-fashioned URLs. For all other directories index.php is just a
|
||||||
|
# directory index file.
|
||||||
|
DirectoryIndex index_fallback.php index.php
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
# Deny access to internal system files
|
# Deny access to internal system files
|
||||||
<FilesMatch "\.(yml|po|ini|handlebars|keep)$">
|
<FilesMatch "\.(yml|po|ini|handlebars|keep)$">
|
||||||
Deny from all
|
Deny from all
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
|
|
||||||
|
# Deny access to CLI cron worker from the outside
|
||||||
|
<Files "cron.php">
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
Mibew Messenger
|
Mibew Messenger
|
||||||
Copyright 2005-2014 the original author or authors.
|
Copyright 2005-2023 the original author or authors.
|
||||||
|
|
||||||
REQUIREMENTS
|
REQUIREMENTS
|
||||||
|
|
||||||
* Apache web server 1.3.34 or above
|
* Apache web server 1.3.34 or above with the ability to use local .htaccess
|
||||||
|
files (mod_rewrite module is optional, but recommended)
|
||||||
* MySQL database 5.0 or above
|
* MySQL database 5.0 or above
|
||||||
* PHP 5.3.3 or above with MySQL support
|
* PHP 7.2.5 or above with PDO, pdo_mysql, cURL, mbstring and gd extensions
|
||||||
|
|
||||||
INSTALLATION
|
INSTALLATION
|
||||||
|
|
||||||
1. Create folder with name 'mibew' in the root of your website.
|
1. Create folder with name 'mibew' in the root of your website.
|
||||||
2. Upload all the files contained in this archive (retaining the directory structure) into created folder.
|
2. Upload all the files contained in this archive (retaining the directory
|
||||||
Be sure to chmod the mibew folder to 755.
|
structure) into created folder.
|
||||||
|
Be sure to chmod the mibew folder to 0755.
|
||||||
3. Add a MySQL database with the name 'mibew'
|
3. Add a MySQL database with the name 'mibew'
|
||||||
4. Copy /mibew/configs/default_config.yml to /mibew/configs/config.yml
|
4. Copy /mibew/configs/default_config.yml to /mibew/configs/config.yml
|
||||||
5. Edit /mibew/configs/config.yml to the information needed to connect to the database
|
5. Edit /mibew/configs/config.yml to the information needed to connect to the database
|
||||||
@ -22,10 +24,33 @@ INSTALLATION
|
|||||||
user: admin
|
user: admin
|
||||||
password: <your password>
|
password: <your password>
|
||||||
9. Get button code and setup it on your site.
|
9. Get button code and setup it on your site.
|
||||||
10. Change your name.
|
10. Configure periodically running tasks by setting up an automated
|
||||||
11. Wait for your visitors on 'Pending users' page.
|
process to visit the page http://<yourdomain>/cron?cron_key=<key>
|
||||||
|
|
||||||
|
The full URL including the secret "cron key" used to protect against
|
||||||
|
unauthorized access can be seen on the 'General' tab at the 'Settings' page.
|
||||||
|
11. Change your name.
|
||||||
|
12. Wait for your visitors on 'Pending users' page.
|
||||||
|
|
||||||
|
On unix/linux platforms change the owner of /mibew/files/avatar and
|
||||||
|
/mibew/cache folders to the user, under which the web server is running
|
||||||
|
(for instance, www). The owner should have all rights on the folders
|
||||||
|
/mibew/files/avatar and /mibew/cache
|
||||||
|
(chmod 0700 /mibew/files/avatar && chmod 0700 /mibew/cache).
|
||||||
|
|
||||||
|
UPDATE
|
||||||
|
|
||||||
|
1. Backup your actual installation (i.e. code and database).
|
||||||
|
2. Disable all plugins.
|
||||||
|
3. Delete all items in your Mibew Messenger directory on the server.
|
||||||
|
4. Unpack the archive with the official distrubition in that directory.
|
||||||
|
5. Remove install.php file.
|
||||||
|
6. Restore configuration (configs/ directory), plugins (plugins/ directory),
|
||||||
|
(maybe) custom styles (if you have any), (maybe) additional
|
||||||
|
locales (if you use any), and avatars (files/avatar/ directory) from the
|
||||||
|
backup you've made at the step 1.
|
||||||
|
7. Visit http://<yourdomain>/<path to your Mibew Messenger>/update and follow
|
||||||
|
the instructions to update the database tables (if needed).
|
||||||
|
8. Enable disabled plugins.
|
||||||
|
|
||||||
|
|
||||||
On unix/linux platforms change the owner of /mibew/files/avatar folder
|
|
||||||
to the user, under which the web server is running (for instance, www).
|
|
||||||
The owner should have all rights on the folder /mibew/files/avatar
|
|
||||||
(chmod 700 /mibew/files/avatar).
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Mibew/2.0
|
Mibew/3.6.0
|
0
src/mibew/cache/.keep
vendored
Normal file
0
src/mibew/cache/.keep
vendored
Normal file
@ -72,7 +72,7 @@ thread:
|
|||||||
useragent: "varchar(255)"
|
useragent: "varchar(255)"
|
||||||
# Total count of user's messages related with the thread.
|
# Total count of user's messages related with the thread.
|
||||||
messagecount: "varchar(16)"
|
messagecount: "varchar(16)"
|
||||||
# ID of the group at Mibew side related with the thread.
|
# ID of the group at Mibew Messenger side related with the thread.
|
||||||
groupid: "int references {opgroup}(groupid)"
|
groupid: "int references {opgroup}(groupid)"
|
||||||
|
|
||||||
# Contains "by thread" statistics
|
# Contains "by thread" statistics
|
||||||
@ -104,7 +104,7 @@ requestcallback:
|
|||||||
fields:
|
fields:
|
||||||
callbackid: "int NOT NULL auto_increment PRIMARY KEY"
|
callbackid: "int NOT NULL auto_increment PRIMARY KEY"
|
||||||
token: "varchar(64) NOT NULL DEFAULT ''"
|
token: "varchar(64) NOT NULL DEFAULT ''"
|
||||||
function: "varchar(64) NOT NULL"
|
func: "varchar(64) NOT NULL"
|
||||||
arguments: "varchar(1024)"
|
arguments: "varchar(1024)"
|
||||||
indexes:
|
indexes:
|
||||||
token: [token]
|
token: [token]
|
||||||
@ -129,12 +129,23 @@ translation:
|
|||||||
# Contains locales info
|
# Contains locales info
|
||||||
locale:
|
locale:
|
||||||
fields:
|
fields:
|
||||||
# Artificial primary key
|
# Artificial primary key.
|
||||||
localeid: "int NOT NULL auto_increment PRIMARY KEY"
|
localeid: "int NOT NULL auto_increment PRIMARY KEY"
|
||||||
# Locale code
|
# Locale code
|
||||||
code: "varchar(5) NOT NULL"
|
code: "varchar(5) NOT NULL"
|
||||||
# Indicates if a locale is enabled or not.
|
# Human readable name of the locale.
|
||||||
|
name: "varchar(128) NOT NULL DEFAULT ''"
|
||||||
|
# Indicates if the locale is enabled or not.
|
||||||
enabled: "tinyint NOT NULL DEFAULT 0"
|
enabled: "tinyint NOT NULL DEFAULT 0"
|
||||||
|
# Indicates if the locale uses RTL writing.
|
||||||
|
rtl: "tinyint NOT NULL DEFAULT 0"
|
||||||
|
# Name of the locale which is used with PHP's setlocale to format dates.
|
||||||
|
time_locale: "varchar(128) NOT NULL DEFAULT 'en_US'"
|
||||||
|
# Serialized array of various date formats.
|
||||||
|
date_format: "text"
|
||||||
|
unique_keys:
|
||||||
|
# Make sure locale code can be duplicated
|
||||||
|
code: [code]
|
||||||
|
|
||||||
# Contains localized mail templates
|
# Contains localized mail templates
|
||||||
mailtemplate:
|
mailtemplate:
|
||||||
@ -190,7 +201,6 @@ operator:
|
|||||||
istatus: "int DEFAULT 0"
|
istatus: "int DEFAULT 0"
|
||||||
idisabled: "int DEFAULT 0"
|
idisabled: "int DEFAULT 0"
|
||||||
vcavatar: "varchar(255)"
|
vcavatar: "varchar(255)"
|
||||||
vcjabbername: "varchar(255)"
|
|
||||||
# Operators privileges bitmask.
|
# Operators privileges bitmask.
|
||||||
iperm: "int DEFAULT 0"
|
iperm: "int DEFAULT 0"
|
||||||
dtmrestore: "int NOT NULL DEFAULT 0"
|
dtmrestore: "int NOT NULL DEFAULT 0"
|
||||||
@ -216,7 +226,7 @@ operatorstatistics:
|
|||||||
|
|
||||||
revision:
|
revision:
|
||||||
fields:
|
fields:
|
||||||
id: "INT NOT NULL"
|
id: "INT NOT NULL PRIMARY KEY"
|
||||||
|
|
||||||
# Contains relations between operators and groups
|
# Contains relations between operators and groups
|
||||||
operatortoopgroup:
|
operatortoopgroup:
|
||||||
@ -235,7 +245,6 @@ ban:
|
|||||||
dtmtill: "int NOT NULL DEFAULT 0"
|
dtmtill: "int NOT NULL DEFAULT 0"
|
||||||
address: "varchar(255)"
|
address: "varchar(255)"
|
||||||
comment: "varchar(255)"
|
comment: "varchar(255)"
|
||||||
blockedcount: "int DEFAULT 0"
|
|
||||||
|
|
||||||
# Contains dynamic configs
|
# Contains dynamic configs
|
||||||
config:
|
config:
|
||||||
@ -291,3 +300,37 @@ visitedpagestatistics:
|
|||||||
acceptedinvitations: "int NOT NULL DEFAULT 0"
|
acceptedinvitations: "int NOT NULL DEFAULT 0"
|
||||||
rejectedinvitations: "int NOT NULL DEFAULT 0"
|
rejectedinvitations: "int NOT NULL DEFAULT 0"
|
||||||
ignoredinvitations: "int NOT NULL DEFAULT 0"
|
ignoredinvitations: "int NOT NULL DEFAULT 0"
|
||||||
|
|
||||||
|
# Contains info about installed plugins
|
||||||
|
plugin:
|
||||||
|
fields:
|
||||||
|
# Artificial ID
|
||||||
|
id: "INT NOT NULL auto_increment PRIMARY KEY"
|
||||||
|
# Plugin name in "<Vendor>:<Name>" format.
|
||||||
|
name: "varchar(255) NOT NULL"
|
||||||
|
# Installed version of the plugin.
|
||||||
|
version: "varchar(255) NOT NULL"
|
||||||
|
# Indicates if the plugin is installed or not.
|
||||||
|
installed: "tinyint NOT NULL DEFAULT 0"
|
||||||
|
# Indicates if the plugin is enabled or not.
|
||||||
|
enabled: "tinyint NOT NULL DEFAULT 0"
|
||||||
|
# Indicates if the plugin is initialized or not.
|
||||||
|
initialized: "tinyint NOT NULL DEFAULT 0"
|
||||||
|
unique_keys:
|
||||||
|
name: [name]
|
||||||
|
|
||||||
|
# Contains info about all available updates
|
||||||
|
availableupdate:
|
||||||
|
fields:
|
||||||
|
# Artificial ID
|
||||||
|
id: "INT NOT NULL auto_increment PRIMARY KEY"
|
||||||
|
# Can be either "core" or fully qualified plugin's name
|
||||||
|
target: "varchar(255) NOT NULL"
|
||||||
|
# The latest available version of the plugin
|
||||||
|
version: "varchar(255) NOT NULL"
|
||||||
|
# A URL where the new version can be downloaded
|
||||||
|
url: "text"
|
||||||
|
# Description of the update
|
||||||
|
description: "text"
|
||||||
|
unique_keys:
|
||||||
|
target: [target]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# IMPORTANT: Before install mibew copy this file to config.yml and fill it with
|
# IMPORTANT: Before install Mibew Messenger copy this file to config.yml and
|
||||||
# your own settings!
|
# fill it with your own settings!
|
||||||
|
|
||||||
|
|
||||||
# MySQL Database parameters
|
# MySQL Database parameters
|
||||||
@ -12,26 +12,87 @@ database:
|
|||||||
tables_prefix: ""
|
tables_prefix: ""
|
||||||
use_persistent_connection: false
|
use_persistent_connection: false
|
||||||
|
|
||||||
# Mailbox
|
# Mail
|
||||||
|
## This value will be used as sender address in all e-mails Mibew Messenger send.
|
||||||
mailbox: mibew@yourdomain.com
|
mailbox: mibew@yourdomain.com
|
||||||
|
|
||||||
|
## Mailer parameters
|
||||||
|
mailer:
|
||||||
|
# This value determines what kind of mailer will be used. Possible values
|
||||||
|
# are "mail" and "smtp".
|
||||||
|
#
|
||||||
|
# To use standard PHP mail function just set this option to "mail". No
|
||||||
|
# additional configs are required in this case.
|
||||||
|
#
|
||||||
|
# To use SMTP-based solution set this option "smtp". This approach require
|
||||||
|
# some extra configuration to be done (see below).
|
||||||
|
transport: mail
|
||||||
|
|
||||||
|
# The lines below represents default SMTP mailer configurations. They will
|
||||||
|
# be used only if the "transport" option is set to "smtp".
|
||||||
|
host: localhost
|
||||||
|
port: 25
|
||||||
|
user: user
|
||||||
|
pass: ""
|
||||||
|
# The following option determines what kind of encryption should be used.
|
||||||
|
# false means no encyption at all. Another values once can use are "ssl" and
|
||||||
|
# "tls".
|
||||||
|
encryption: false
|
||||||
|
|
||||||
|
# Cache subsystem
|
||||||
|
cache:
|
||||||
|
# This value determines where the cached data will be stored. Possible
|
||||||
|
# values are "none", "file_system" and "memcached".
|
||||||
|
#
|
||||||
|
# If "none" is used the caching will be disabled. This option should be used
|
||||||
|
# only if none of the other options works.
|
||||||
|
#
|
||||||
|
# If "file_system" is used the cached data will be stored in files within
|
||||||
|
# the "cache/" directory. Notice, that the file system storage does not work
|
||||||
|
# on NFS systems bucause exclusive file locks are not supported where.
|
||||||
|
#
|
||||||
|
# If "memcached" is used the cached data will be stored in Memcached
|
||||||
|
# storage. Before using this kind of storage make sure PHP's memcached
|
||||||
|
# extension is installed and enabled.
|
||||||
|
storage: file_system
|
||||||
|
|
||||||
|
# The lines below represents default Memcached server configurations. They
|
||||||
|
# will be used only if the "storage" option is set to "memcached".
|
||||||
|
memcached_servers:
|
||||||
|
- host: localhost
|
||||||
|
port: 11211
|
||||||
|
# The "weight" field is optional and can be omitted and it's only positive int number.
|
||||||
|
weight: 1
|
||||||
|
# Actually, one can use any number of memcached servers he wants. Just
|
||||||
|
# add servers description like the one above.
|
||||||
|
|
||||||
# Locales
|
# Locales
|
||||||
## Native name will be used in this locale
|
## Native name will be used in this locale
|
||||||
home_locale: en
|
home_locale: en
|
||||||
## If user does not provide known lang
|
## If user does not provide known lang
|
||||||
default_locale: en
|
default_locale: en
|
||||||
|
|
||||||
|
# A timezone to use. Leave this value empty to use the default timezone from the
|
||||||
|
# system settings. For the details about available timezones see
|
||||||
|
# http://php.net/manual/en/timezones.php
|
||||||
|
timezone: ""
|
||||||
|
|
||||||
|
# List of proxy's IP Mibew Messenger should trust. You should set this option
|
||||||
|
# if you use Mibew Messenger with a load balancer or behind a proxy.
|
||||||
|
trusted_proxies: []
|
||||||
|
# Here is an example of what values this option can take:
|
||||||
|
# trusted_proxies:
|
||||||
|
# - 127.0.0.1
|
||||||
|
# - ::1
|
||||||
|
# - 10.0.0.0/8
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
plugins: []
|
plugins: []
|
||||||
|
|
||||||
## Exapmle of plugins configuration
|
## Example of plugins configuration
|
||||||
# plugins:
|
# plugins:
|
||||||
# -
|
# "VendorName:PluginName":
|
||||||
# name: "VendorName:PluginName"
|
# weight: 100
|
||||||
# config:
|
# some_configurable_value: value
|
||||||
# weight: 100
|
# "VendorName:AnotherPluginName":
|
||||||
# some_configurable_value: value
|
# very_important_value: "$3.50"
|
||||||
# -
|
|
||||||
# name: "VendorName:AnotherPluginName"
|
|
||||||
# config:
|
|
||||||
# very_important_value: "$3.50"
|
|
||||||
|
@ -49,6 +49,14 @@ chat_user:
|
|||||||
thread_id: \d{1,10}
|
thread_id: \d{1,10}
|
||||||
token: \d{1,10}
|
token: \d{1,10}
|
||||||
|
|
||||||
|
chat_user_check:
|
||||||
|
path: /chat/{thread_id}/{token}/check
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Chat\UserChatController::checkAction
|
||||||
|
requirements:
|
||||||
|
thread_id: \d{1,10}
|
||||||
|
token: \d{1,10}
|
||||||
|
|
||||||
chat_user_invitation:
|
chat_user_invitation:
|
||||||
path: /chat/invitation
|
path: /chat/invitation
|
||||||
defaults:
|
defaults:
|
||||||
@ -72,11 +80,33 @@ chat_user_mail_send:
|
|||||||
token: \d{1,10}
|
token: \d{1,10}
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
|
|
||||||
|
chat_user_popup_style:
|
||||||
|
path: /chat/style/popup/{style}
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Chat\StyleController::loadPopupStyleAction
|
||||||
|
style: ""
|
||||||
|
requirements:
|
||||||
|
style: "[0-9A-Za-z_]*"
|
||||||
|
|
||||||
|
chat_user_popup_style_force_secure:
|
||||||
|
path: /chat/style/popup/{style}/force_secure
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Chat\StyleController::loadPopupStyleAction
|
||||||
|
style: ""
|
||||||
|
force_secure: on
|
||||||
|
requirements:
|
||||||
|
style: "[0-9A-Za-z_]*"
|
||||||
|
|
||||||
chat_user_start:
|
chat_user_start:
|
||||||
path: /chat
|
path: /chat
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\Chat\UserChatController::startAction
|
_controller: Mibew\Controller\Chat\UserChatController::startAction
|
||||||
|
|
||||||
|
chat_user_cookie_set_permission:
|
||||||
|
path: /chat/cookies-set-permission
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Chat\UserChatController::cookieSetPermissionAction
|
||||||
|
|
||||||
# Pages that are available for all users
|
# Pages that are available for all users
|
||||||
button:
|
button:
|
||||||
path: /b
|
path: /b
|
||||||
@ -90,9 +120,12 @@ cron:
|
|||||||
path: /cron
|
path: /cron
|
||||||
defaults: { _controller: Mibew\Controller\CronController::runAction }
|
defaults: { _controller: Mibew\Controller\CronController::runAction }
|
||||||
|
|
||||||
license:
|
# A set of localization constants for the client side applications is generated
|
||||||
path: /license
|
# dynamically
|
||||||
defaults: { _controller: Mibew\Controller\LicenseController::indexAction }
|
js_translation:
|
||||||
|
path: /locales/{locale}/translation.js
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Localization\JsTranslationController::indexAction
|
||||||
|
|
||||||
widget_gateway:
|
widget_gateway:
|
||||||
path: /widget
|
path: /widget
|
||||||
@ -100,6 +133,13 @@ widget_gateway:
|
|||||||
|
|
||||||
# Operators' pages
|
# Operators' pages
|
||||||
|
|
||||||
|
## About page
|
||||||
|
about:
|
||||||
|
path: /operator/about
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\AboutController::indexAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
||||||
|
|
||||||
## Banned visitors
|
## Banned visitors
|
||||||
ban_add:
|
ban_add:
|
||||||
path: /operator/ban/add
|
path: /operator/ban/add
|
||||||
@ -160,21 +200,24 @@ canned_message_add:
|
|||||||
path: /operator/canned-message/add
|
path: /operator/canned-message/add
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
|
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
|
|
||||||
canned_message_add_save:
|
canned_message_add_save:
|
||||||
path: /operator/canned-message/add
|
path: /operator/canned-message/add
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
|
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
|
|
||||||
canned_message_delete:
|
canned_message_delete:
|
||||||
path: /operator/canned-message/{message_id}/delete
|
path: /operator/canned-message/{message_id}/delete
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::deleteAction
|
_controller: Mibew\Controller\CannedMessageController::deleteAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
message_id: \d{1,10}
|
message_id: \d{1,10}
|
||||||
|
|
||||||
@ -182,7 +225,8 @@ canned_message_edit:
|
|||||||
path: /operator/canned-message/{message_id}/edit
|
path: /operator/canned-message/{message_id}/edit
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
|
_controller: Mibew\Controller\CannedMessageController::showEditFormAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
message_id: \d{1,10}
|
message_id: \d{1,10}
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
@ -191,7 +235,8 @@ canned_message_edit_save:
|
|||||||
path: /operator/canned-message/{message_id}/edit
|
path: /operator/canned-message/{message_id}/edit
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
|
_controller: Mibew\Controller\CannedMessageController::submitEditFormAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
message_id: \d{1,10}
|
message_id: \d{1,10}
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
@ -200,7 +245,8 @@ canned_messages:
|
|||||||
path: /operator/canned-message
|
path: /operator/canned-message
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\CannedMessageController::indexAction
|
_controller: Mibew\Controller\CannedMessageController::indexAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
## Groups
|
## Groups
|
||||||
group_add:
|
group_add:
|
||||||
@ -331,7 +377,27 @@ locale_disable:
|
|||||||
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
_access_permissions: [CAN_ADMINISTRATE]
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
locale: "[a-z\-]{2,5}"
|
locale: "[a-z\\-]{2,5}"
|
||||||
|
|
||||||
|
locale_edit:
|
||||||
|
path: /operator/locale/{locale}/edit
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Localization\LocaleController::showEditFormAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
requirements:
|
||||||
|
locale: "[a-z\\-]{2,5}"
|
||||||
|
methods: [GET]
|
||||||
|
|
||||||
|
locale_edit_save:
|
||||||
|
path: /operator/locale/{locale}/edit
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Localization\LocaleController::submitEditFormAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
requirements:
|
||||||
|
locale: "[a-z\\-]{2,5}"
|
||||||
|
methods: [POST]
|
||||||
|
|
||||||
locale_enable:
|
locale_enable:
|
||||||
path: /operator/locale/{locale}/enable
|
path: /operator/locale/{locale}/enable
|
||||||
@ -340,7 +406,7 @@ locale_enable:
|
|||||||
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
_access_permissions: [CAN_ADMINISTRATE]
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
locale: "[a-z\-]{2,5}"
|
locale: "[a-z\\-]{2,5}"
|
||||||
|
|
||||||
locales:
|
locales:
|
||||||
path: /operator/locale
|
path: /operator/locale
|
||||||
@ -541,6 +607,42 @@ password_recovery_reset:
|
|||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\PasswordRecoveryController::resetAction
|
_controller: Mibew\Controller\PasswordRecoveryController::resetAction
|
||||||
|
|
||||||
|
## Plugins
|
||||||
|
plugin_enable:
|
||||||
|
path: /operator/plugin/{plugin_name}/enable
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\PluginController::enableAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
|
plugin_disable:
|
||||||
|
path: /operator/plugin/{plugin_name}/disable
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\PluginController::disableAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
|
plugin_uninstall:
|
||||||
|
path: /operator/plugin/{plugin_name}/uninstall
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\PluginController::uninstallAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
|
plugin_update:
|
||||||
|
path: /operator/plugin/{plugin_name}/update
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\PluginController::updateAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
path: /operator/plugin
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\PluginController::indexAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
settings_common:
|
settings_common:
|
||||||
path: /operator/settings
|
path: /operator/settings
|
||||||
@ -596,7 +698,8 @@ statistics:
|
|||||||
defaults:
|
defaults:
|
||||||
type: "by-date"
|
type: "by-date"
|
||||||
_controller: Mibew\Controller\StatisticsController::indexAction
|
_controller: Mibew\Controller\StatisticsController::indexAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_VIEWSTATISTICS]
|
||||||
requirements:
|
requirements:
|
||||||
type: by-date|by-operator|by-page
|
type: by-date|by-operator|by-page
|
||||||
|
|
||||||
@ -618,7 +721,7 @@ translation_edit:
|
|||||||
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
_access_permissions: [CAN_ADMINISTRATE]
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
string_id: "\d{1,10}"
|
string_id: "\\d{1,10}"
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
|
|
||||||
translation_edit_save:
|
translation_edit_save:
|
||||||
@ -628,7 +731,23 @@ translation_edit_save:
|
|||||||
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
_access_permissions: [CAN_ADMINISTRATE]
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
requirements:
|
requirements:
|
||||||
string_id: "\d{1,10}"
|
string_id: "\\d{1,10}"
|
||||||
|
methods: [POST]
|
||||||
|
|
||||||
|
translation_export:
|
||||||
|
path: /operator/translation/export
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Localization\TranslationExportController::showFormAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
methods: [GET]
|
||||||
|
|
||||||
|
translation_export_process:
|
||||||
|
path: /operator/translation/export
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\Localization\TranslationExportController::submitFormAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
|
|
||||||
translation_import:
|
translation_import:
|
||||||
@ -655,11 +774,26 @@ translations:
|
|||||||
_access_permissions: [CAN_ADMINISTRATE]
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
## Updates
|
## Updates
|
||||||
updates:
|
update:
|
||||||
path: /operator/updates
|
path: /update
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Mibew\Controller\UpdatesController::indexAction
|
_controller: Mibew\Controller\UpdateController::indexAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
|
update_run:
|
||||||
|
path: /update/run
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\UpdateController::runUpdateAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
|
update_check:
|
||||||
|
path: /update/check
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\UpdateController::checkUpdatesAction
|
||||||
|
_access_check: Mibew\AccessControl\Check\PermissionsCheck
|
||||||
|
_access_permissions: [CAN_ADMINISTRATE]
|
||||||
|
|
||||||
## Users (visitors avaiting page)
|
## Users (visitors avaiting page)
|
||||||
users:
|
users:
|
||||||
@ -674,7 +808,17 @@ users_update:
|
|||||||
_controller: Mibew\Controller\UsersController::updateAction
|
_controller: Mibew\Controller\UsersController::updateAction
|
||||||
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
_access_check: Mibew\AccessControl\Check\LoggedInCheck
|
||||||
|
|
||||||
# Remove trailing slashe. This route is the last one because previous rotes can
|
# System routes and includes
|
||||||
|
|
||||||
|
# The following route is a fake and is used only to load plugins routes. It can
|
||||||
|
# have any unique name.
|
||||||
|
_include_pluign_routes:
|
||||||
|
# Resource name has no meaning and can be any value.
|
||||||
|
resource: .
|
||||||
|
# The type actually indicates that plugins routes should be included.
|
||||||
|
type: plugin
|
||||||
|
|
||||||
|
# Remove trailing slashes. This route is the last one because previous rotes can
|
||||||
# (but definitely should not) have trailing slashes.
|
# (but definitely should not) have trailing slashes.
|
||||||
remove_trailing_slash:
|
remove_trailing_slash:
|
||||||
path: /{url}
|
path: /{url}
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
# The following route is a fake and is used only to load routes of the core. It
|
||||||
|
# can have any unique name.
|
||||||
|
_include_core_routes:
|
||||||
|
resource: routing.yml
|
||||||
|
type: yaml
|
||||||
|
|
||||||
|
# Override the home route to allow users use <mibew root>/install.php path to
|
||||||
|
# the installer.
|
||||||
|
home:
|
||||||
|
path: /
|
||||||
|
defaults:
|
||||||
|
_controller: Mibew\Controller\InstallController::indexAction
|
||||||
|
|
||||||
install:
|
install:
|
||||||
path: /install
|
path: /install
|
||||||
defaults:
|
defaults:
|
||||||
|
52
src/mibew/cron.php
Normal file
52
src/mibew/cron.php
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* This file is a part of Mibew Messenger.
|
||||||
|
*
|
||||||
|
* Copyright 2005-2023 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Initialize libraries
|
||||||
|
require_once(dirname(__FILE__) . '/libs/init.php');
|
||||||
|
|
||||||
|
use Mibew\Cache\CacheFactory;
|
||||||
|
use Mibew\Maintenance\CronWorker;
|
||||||
|
use Mibew\Plugin\PluginManager;
|
||||||
|
|
||||||
|
$configs = load_system_configs();
|
||||||
|
|
||||||
|
// Prepare the cache. It is initialized in the same way as in index.php
|
||||||
|
$cache_factory = new CacheFactory($configs['cache']);
|
||||||
|
// For now directory for cache files cannot be changed via the configs file.
|
||||||
|
$cache_factory->setOption('path', MIBEW_FS_ROOT . '/cache/stash');
|
||||||
|
|
||||||
|
// Run plugins
|
||||||
|
if (get_maintenance_mode() === false) {
|
||||||
|
$plugin_manager = PluginManager::getInstance();
|
||||||
|
$plugin_manager->setCache($cache_factory->getCache());
|
||||||
|
$plugin_manager->loadPlugins($configs['plugins']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do the job.
|
||||||
|
$worker = new CronWorker($cache_factory->getCache());
|
||||||
|
$success = $worker->run();
|
||||||
|
|
||||||
|
if ($success) {
|
||||||
|
echo("All cron jobs done\n");
|
||||||
|
} else {
|
||||||
|
echo("Cron job failed. Here are the errors:\n");
|
||||||
|
foreach ($worker->getErrors() as $error) {
|
||||||
|
echo(' ' . $error . "\n");
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright 2005-2014 the original author or authors.
|
* This file is a part of Mibew Messenger.
|
||||||
|
*
|
||||||
|
* Copyright 2005-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -20,24 +22,53 @@ require_once(dirname(__FILE__) . '/libs/init.php');
|
|||||||
|
|
||||||
use Mibew\Application;
|
use Mibew\Application;
|
||||||
use Mibew\Authentication\AuthenticationManager;
|
use Mibew\Authentication\AuthenticationManager;
|
||||||
use Mibew\Routing\RouteCollectionLoader;
|
use Mibew\Cache\CacheFactory;
|
||||||
|
use Mibew\Mail\MailerFactory;
|
||||||
|
use Mibew\Plugin\PluginManager;
|
||||||
use Mibew\Routing\Router;
|
use Mibew\Routing\Router;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Mibew\Routing\Loader\CacheLoader;
|
||||||
|
use Mibew\Routing\Loader\PluginLoader;
|
||||||
use Symfony\Component\Config\FileLocator;
|
use Symfony\Component\Config\FileLocator;
|
||||||
|
use Symfony\Component\Config\Loader\LoaderResolver;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\Routing\Loader\YamlFileLoader;
|
||||||
|
|
||||||
$file_locator = new FileLocator(array(MIBEW_FS_ROOT));
|
$configs = load_system_configs();
|
||||||
$router = new Router(new RouteCollectionLoader($file_locator));
|
|
||||||
$router->setOption(
|
// Prepare the cache
|
||||||
'route_collection',
|
$cache_factory = new CacheFactory($configs['cache']);
|
||||||
RouteCollectionLoader::ROUTES_CORE | RouteCollectionLoader::ROUTES_PLUGINS
|
// For now directory for cache files cannot be changed via the configs file.
|
||||||
);
|
// TODO: Evaluate possibility of using custom cache directory.
|
||||||
|
$cache_factory->setOption('path', MIBEW_FS_ROOT . '/cache/stash');
|
||||||
|
|
||||||
|
// Run plugins
|
||||||
|
if (get_maintenance_mode() === false) {
|
||||||
|
$plugin_manager = PluginManager::getInstance();
|
||||||
|
$plugin_manager->setCache($cache_factory->getCache());
|
||||||
|
$plugin_manager->loadPlugins($configs['plugins']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The main route loader which loads nothig but works as a cache proxy for other
|
||||||
|
// loaders.
|
||||||
|
$route_loader = new CacheLoader($cache_factory->getCache());
|
||||||
|
// Real loaders are attached via the resolver.
|
||||||
|
$loader_resolver = new LoaderResolver(array(
|
||||||
|
$route_loader,
|
||||||
|
new YamlFileLoader(new FileLocator(array(MIBEW_FS_ROOT))),
|
||||||
|
new PluginLoader(),
|
||||||
|
));
|
||||||
|
|
||||||
|
$router = new Router($route_loader, 'configs/routing.yml');
|
||||||
|
|
||||||
$application = new Application($router, new AuthenticationManager());
|
$application = new Application($router, new AuthenticationManager());
|
||||||
|
$application->setCache($cache_factory->getCache());
|
||||||
|
|
||||||
|
// Use custom config-dependent mailer factory
|
||||||
|
$application->setMailerFactory(new MailerFactory($configs['mailer']));
|
||||||
|
|
||||||
// Process request
|
// Process request
|
||||||
$request = Request::createFromGlobals();
|
$request = Request::createFromGlobals();
|
||||||
$response = $application->handleRequest($request);
|
$response = $application->handleRequest($request);
|
||||||
|
|
||||||
// Send response to the user
|
// Send response to the user
|
||||||
$response->prepare($request);
|
|
||||||
$response->send();
|
$response->send();
|
||||||
|
23
src/mibew/index_fallback.php
Normal file
23
src/mibew/index_fallback.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* This file is a part of Mibew Messenger.
|
||||||
|
*
|
||||||
|
* Copyright 2005-2023 the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Force the user to specify the entry point. This should be done only when
|
||||||
|
// mod_rewrite is not used by apache.
|
||||||
|
header('HTTP/1.0 301 Moved Permanently');
|
||||||
|
header('Location: index.php');
|
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright 2005-2014 the original author or authors.
|
* This file is a part of Mibew Messenger.
|
||||||
|
*
|
||||||
|
* Copyright 2005-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -15,24 +17,28 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('INSTALLATION_IN_PROGRESS', true);
|
define('MAINTENANCE_MODE', 'install');
|
||||||
|
|
||||||
// Initialize libraries
|
// Initialize libraries
|
||||||
require_once(dirname(__FILE__) . '/libs/init.php');
|
require_once(dirname(__FILE__) . '/libs/init.php');
|
||||||
|
|
||||||
use Mibew\Application;
|
use Mibew\Application;
|
||||||
use Mibew\Authentication\DummyAuthenticationManager;
|
use Mibew\Authentication\DummyAuthenticationManager;
|
||||||
use Mibew\Routing\RouteCollectionLoader;
|
use Mibew\Routing\Loader\DummyPluginLoader;
|
||||||
use Mibew\Routing\Router;
|
use Mibew\Routing\Router;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
use Symfony\Component\Config\FileLocator;
|
use Symfony\Component\Config\FileLocator;
|
||||||
|
use Symfony\Component\Config\Loader\LoaderResolver;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\Routing\Loader\YamlFileLoader;
|
||||||
|
|
||||||
|
// Prepare router
|
||||||
$file_locator = new FileLocator(array(MIBEW_FS_ROOT));
|
$file_locator = new FileLocator(array(MIBEW_FS_ROOT));
|
||||||
$router = new Router(new RouteCollectionLoader($file_locator));
|
$route_loader = new YamlFileLoader($file_locator);
|
||||||
$router->setOption(
|
$loader_resolver = new LoaderResolver(array(
|
||||||
'route_collection',
|
$route_loader,
|
||||||
RouteCollectionLoader::ROUTES_CORE | RouteCollectionLoader::ROUTES_INSTALLATION
|
new DummyPluginLoader(),
|
||||||
);
|
));
|
||||||
|
$router = new Router($route_loader, 'configs/routing_install.yml');
|
||||||
|
|
||||||
$application = new Application($router, new DummyAuthenticationManager());
|
$application = new Application($router, new DummyAuthenticationManager());
|
||||||
|
|
||||||
@ -41,5 +47,4 @@ $request = Request::createFromGlobals();
|
|||||||
$response = $application->handleRequest($request);
|
$response = $application->handleRequest($request);
|
||||||
|
|
||||||
// Send response to the user
|
// Send response to the user
|
||||||
$response->prepare($request);
|
|
||||||
$response->send();
|
$response->send();
|
||||||
|
0
src/mibew/js/compiled/.keep
Normal file
0
src/mibew/js/compiled/.keep
Normal file
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
var myAgent="",myVer=0,myRealAgent="";function detectAgent(){for(var a="opera msie safari firefox netscape mozilla".split(" "),d=navigator.userAgent.toLowerCase(),b=0;b<a.length;b++){var c=a[b];if(-1!=d.indexOf(c)){myAgent=c;if(!window.RegExp)break;null!=RegExp(c+"[ /]?([0-9]+(.[0-9]+)?)").exec(d)&&(myVer=parseFloat(RegExp.$1));break}}myRealAgent=myAgent;"Gecko"==navigator.product&&(myAgent="moz")}detectAgent();function getEl(a){return document.getElementById(a)};
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d){var c=b.Application;c.addRegions({mainRegion:"#main-region"});c.addInitializer(function(a){b.PluginOptions=a.plugins||{};b.Objects.server=new b.Server(d.extend({interactionType:MibewAPIChatInteraction},a.server));b.Objects.Models.page=new b.Models.Page(a.page);switch(a.startFrom){case "chat":c.Chat.start(a.chatOptions);break;case "survey":c.Survey.start(a.surveyOptions);break;case "leaveMessage":c.LeaveMessage.start(a.leaveMessageOptions);break;case "invitation":c.Invitation.start(a.invitationOptions);
|
|
||||||
break;default:throw Error("Dont know how to start!");}});c.on("start",function(){b.Objects.server.runUpdater()})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection"})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Views.StatusCollection=a.Views.CollectionBase.extend({itemView:a.Views.Status,className:"status-collection"})})(Mibew);
|
|
@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,j){b.Collections.Messages=d.Collection.extend({model:b.Models.Message,initialize:function(){this.periodicallyCalled=[];this.periodicallyCalled.push(b.Objects.server.callFunctionsPeriodically(j.bind(this.updateMessagesFunctionBuilder,this),j.bind(this.updateMessages,this)))},finalize:function(){for(var a=0;a<this.periodicallyCalled.length;a++)b.Objects.server.stopCallFunctionsPeriodically(this.periodicallyCalled[a])},updateMessages:function(a){a.lastId&&b.Objects.Models.thread.set({lastId:a.lastId});
|
|
||||||
for(var k=b.Models.Message.prototype.KIND_PLUGIN,g=[],c,f,e,h=0,d=a.messages.length;h<d;h++)c=a.messages[h],c.kind!=k?g.push(new b.Models.Message(c)):"object"!=typeof c.data||null===c.data||(f=c.plugin||!1,f="process:"+(!1!==f?f+":":"")+"plugin:message",e={messageData:c,model:!1},this.trigger(f,e),e.model&&(e.model.get("id")||e.model.set({id:c.id}),g.push(e.model)));0<g.length&&this.add(g)},updateMessagesFunctionBuilder:function(){var a=b.Objects.Models.thread,d=b.Objects.Models.user;return[{"function":"updateMessages",
|
|
||||||
arguments:{"return":{messages:"messages",lastId:"lastId"},references:{},threadId:a.get("id"),token:a.get("token"),lastId:a.get("lastId"),user:!d.get("isAgent")}}]},add:function(){var a=Array.prototype.slice.apply(arguments),a=d.Collection.prototype.add.apply(this,a);this.trigger("multiple:add");return a}})})(Mibew,Backbone,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Collections.Status=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Regions={};a.Layouts={};a.Application=new Backbone.Marionette.Application})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,c){a.Layouts.Chat=c.Marionette.Layout.extend({template:Handlebars.templates.chat_layout,regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:a.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region"},serializeData:function(){var b=a.Objects.Models;return{page:b.page.toJSON(),user:b.user.toJSON()}}})})(Mibew,Backbone);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Layouts.Invitation=b.Marionette.Layout.extend({template:Handlebars.templates.invitation_layout,regions:{messagesRegion:{selector:"#invitation-messages-region",regionType:a.Regions.Messages}}})})(Mibew,Backbone);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Layouts.LeaveMessage=b.Marionette.Layout.extend({template:Handlebars.templates.leave_message_layout,regions:{leaveMessageFormRegion:"#content-wrapper",descriptionRegion:"#description-region"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Layouts.Survey=b.Marionette.Layout.extend({template:Handlebars.templates.survey_layout,regions:{surveyFormRegion:"#content-wrapper"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
MibewAPIChatInteraction=function(){this.mandatoryArguments=function(){return{"*":{threadId:null,token:null,"return":{},references:{}},result:{errorCode:0}}};this.getReservedFunctionsNames=function(){return["result"]}};MibewAPIChatInteraction.prototype=new MibewAPIInteraction;
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.Avatar=b.Marionette.ItemView.extend({template:c.templates.chat_avatar,className:"avatar",modelEvents:{change:"render"}})})(Mibew,Backbone,Handlebars);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,c,d){a.Views.CloseControl=a.Views.Control.extend({template:c.templates.chat_controls_close,events:d.extend({},a.Views.Control.prototype.events,{click:"closeThread"}),closeThread:function(){var b=a.Localization.get("Are you sure want to leave chat?");(!1===b||confirm(b))&&this.model.closeThread()}})})(Mibew,Handlebars,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,e){b.Views.HistoryControl=b.Views.Control.extend({template:d.templates.chat_controls_history,events:e.extend({},b.Views.Control.prototype.events,{click:"showHistory"}),showHistory:function(){var c=b.Objects.Models.user,a=this.model.get("link");c.get("isAgent")&&a&&(c=this.model.get("windowParams"),a=a.replace("&","&","g"),a=window.open(a,"UserHistory",c),null!==a&&(a.focus(),a.opener=window))}})})(Mibew,Handlebars,_);
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,e,f){b.Views.RedirectControl=b.Views.Control.extend({template:e.templates.chat_controls_redirect,events:f.extend({},b.Views.Control.prototype.events,{click:"redirect"}),initialize:function(){b.Objects.Models.user.on("change",this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},redirect:function(){var a=b.Objects.Models.user;if(a.get("isAgent")&&a.get("canPost")&&(a=this.model.get("link"))){var c=b.Objects.Models.page.get("style"),
|
|
||||||
d="";c&&(d=(-1===a.indexOf("?")?"?":"&")+"style="+c);window.location.href=a.replace(/\&\;/g,"&")+d}}})})(Mibew,Handlebars,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.RefreshControl=a.Views.Control.extend({template:b.templates.chat_controls_refresh,events:c.extend({},a.Views.Control.prototype.events,{click:"refresh"}),refresh:function(){this.model.refresh()}})})(Mibew,Handlebars,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,d,e){a.Views.SecureModeControl=a.Views.Control.extend({template:d.templates.chat_controls_secure_mode,events:e.extend({},a.Views.Control.prototype.events,{click:"secure"}),secure:function(){var b=this.model.get("link");if(b){var c=a.Objects.Models.page.get("style");window.location.href=b.replace(/\&\;/g,"&")+(c?"&style="+c:"")}}})})(Mibew,Handlebars,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,f){b.Views.SendMailControl=b.Views.Control.extend({template:d.templates.chat_controls_send_mail,events:f.extend({},b.Views.Control.prototype.events,{click:"sendMail"}),sendMail:function(){var a=this.model.get("link"),c=b.Objects.Models.page;if(a){var d=this.model.get("windowParams"),c=c.get("style"),e="";c&&(e=(-1===a.indexOf("?")?"?":"&")+"style="+c);a=a.replace(/\&\;/g,"&")+e;a=window.open(a,"ForwardMail",d);null!==a&&(a.focus(),a.opener=window)}}})})(Mibew,Handlebars,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.SoundControl=a.Views.Control.extend({template:b.templates.chat_controls_sound,events:c.extend({},a.Views.Control.prototype.events,{click:"toggle"}),toggle:function(){this.model.toggle()}})})(Mibew,Handlebars,_);
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,c,d){b.Views.UserNameControl=b.Views.Control.extend({template:c.templates.chat_controls_user_name,events:d.extend({},b.Views.Control.prototype.events,{"click .user-name-control-set":"changeName","click .user-name-control-change":"showNameInput","keydown #user-name-control-input":"inputKeyDown"}),ui:{nameInput:"#user-name-control-input"},initialize:function(){b.Objects.Models.user.on("change:name",this.hideNameInput,this);this.nameInput=b.Objects.Models.user.get("defaultName")},serializeData:function(){var a=
|
|
||||||
this.model.toJSON();a.user=b.Objects.Models.user.toJSON();a.nameInput=this.nameInput;return a},inputKeyDown:function(a){a=a.which;(13==a||10==a)&&this.changeName()},hideNameInput:function(){this.nameInput=!1;this.render()},showNameInput:function(){this.nameInput=!0;this.render()},changeName:function(){var a=this.ui.nameInput.val();this.model.changeName(a)}})})(Mibew,Handlebars,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.LeaveMessageDescription=b.Marionette.ItemView.extend({template:c.templates.leave_message_description,serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(d,e,b){var c=d.Views.BaseSurveyForm;d.Views.LeaveMessageForm=c.extend({template:e.templates.leave_message_form,events:b.extend({},c.prototype.events,{"click #send-message":"submitForm"}),ui:b.extend({},c.prototype.ui,{captcha:'input[name="captcha"]',captchaImg:"#captcha-img"}),modelEvents:b.extend({},c.prototype.modelEvents,{"submit:error":"hideAjaxLoader showError submitError"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());
|
|
||||||
a.name=this.ui.name.val()||"";a.email=this.ui.email.val()||"";a.message=this.ui.message.val()||"";this.model.get("showCaptcha")&&(a.captcha=this.ui.captcha.val()||"");this.model.set(a,{validate:!0});this.model.submit()},submitError:function(a,c){if(c.code==a.ERROR_WRONG_CAPTCHA&&a.get("showCaptcha")){var b=this.ui.captchaImg.attr("src"),b=b.replace(/\?d\=[0-9]+/,"");this.ui.captchaImg.attr("src",b+"?d="+(new Date).getTime())}}})})(Mibew,Handlebars,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.LeaveMessageSentDescription=b.Marionette.ItemView.extend({template:c.templates.leave_message_sent_description,serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Views.Message=a.Views.Message.extend({template:b.templates.chat_message})})(Mibew,Handlebars);
|
|
@ -1,11 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,e){b.Views.MessageForm=d.Marionette.ItemView.extend({template:e.templates.chat_message_form,events:{"click #send-message":"postMessage","keydown #message-input":"messageKeyDown","keyup #message-input":"checkUserTyping","change #message-input":"checkUserTyping","change #predefined":"selectPredefinedAnswer","focus #message-input":"setFocus","blur #message-input":"dropFocus"},modelEvents:{change:"render"},ui:{message:"#message-input",send:"#send-message",predefinedAnswer:"#predefined"},
|
|
||||||
initialize:function(){b.Objects.Models.user.on("change:canPost",this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},postMessage:function(){var a=this.ui.message.val();""!=a&&(this.disableInput(),this.model.postMessage(a));b.Objects.Collections.messages.on("multiple:add",this.postMessageComplete,this)},messageKeyDown:function(a){var c=a.which;a=a.ctrlKey;(13==c&&(a||this.model.get("ignoreCtrl"))||10==c)&&this.postMessage()},enableInput:function(){this.ui.message.removeAttr("disabled")},
|
|
||||||
disableInput:function(){this.ui.message.attr("disabled","disabled")},clearInput:function(){this.ui.message.val("").change()},postMessageComplete:function(){this.clearInput();this.enableInput();this.focused&&this.ui.focus();b.Objects.Collections.messages.off("multiple:add",this.postMessageComplete,this)},selectPredefinedAnswer:function(){var a=this.ui.message,c=this.ui.predefinedAnswer,b=c.get(0).selectedIndex;b&&(a.val(this.model.get("predefinedAnswers")[b-1].full).change(),a.focus(),c.get(0).selectedIndex=
|
|
||||||
0)},checkUserTyping:function(){var a=b.Objects.Models.user,c=""!=this.ui.message.val();c!=a.get("typing")&&a.set({typing:c})},setFocus:function(){this.focused=!0},dropFocus:function(){this.focused=!1}})})(Mibew,Backbone,Handlebars);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.Status=b.Marionette.ItemView.extend({template:c.templates.chat_status_base,className:"status",modelEvents:{change:"render"},onBeforeRender:function(){this.model.get("visible")?this.$el.show():this.$el.hide()}})})(Mibew,Backbone,Handlebars);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Views.StatusMessage=a.Views.Status.extend({template:b.templates.chat_status_message})})(Mibew,Handlebars);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Views.StatusTyping=a.Views.Status.extend({template:b.templates.chat_status_typing})})(Mibew,Handlebars);
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(c,d){c.Views.BaseSurveyForm=d.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors",ajaxLoader:"#ajax-loader"},modelEvents:{invalid:"hideAjaxLoader showError","submit:error":"hideAjaxLoader showError"},preventSubmit:function(a){a.preventDefault()},
|
|
||||||
changeGroupDescription:function(){var a=this.ui.groupSelect.prop("selectedIndex"),a=this.model.get("groups")[a].description||"";this.ui.groupDescription.text(a)},showError:function(a,b){this.ui.errors.html("string"==typeof b?b:b.message)},serializeData:function(){var a=this.model.toJSON();a.page=c.Objects.Models.page.toJSON();return a},showAjaxLoader:function(){this.ui.ajaxLoader.show()},hideAjaxLoader:function(){this.ui.ajaxLoader.hide()}})})(Mibew,Backbone);
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,e){var c=b.Views.BaseSurveyForm;b.Views.SurveyForm=c.extend({template:d.templates.survey_form,events:e.extend({},c.prototype.events,{"click #submit-survey":"submitForm"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());this.model.get("canChangeName")&&(a.name=this.ui.name.val()||"");this.model.get("showEmail")&&(a.email=this.ui.email.val()||"");this.model.get("showMessage")&&(a.message=this.ui.message.val()||"");this.model.set(a,
|
|
||||||
{validate:!0});this.model.submit()}})})(Mibew,Handlebars,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,c){b.Models.Avatar=b.Models.Base.extend({defaults:{imageLink:!1},initialize:function(){this.registeredFunctions=[];this.registeredFunctions.push(b.Objects.server.registerFunction("setupAvatar",c.bind(this.apiSetupAvatar,this)))},finalize:function(){for(var a=0;a<this.registeredFunctions.length;a++)b.Objects.server.unregisterFunction(this.registeredFunctions[a])},apiSetupAvatar:function(a){a.imageLink&&this.set({imageLink:a.imageLink})}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.ChatUser=a.Models.User.extend({defaults:b.extend({},a.Models.User.prototype.defaults,{canPost:!0,typing:!1,canChangeName:!1,dafaultName:!0})})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.CloseControl=a.Models.Control.extend({getModelType:function(){return"CloseControl"},closeThread:function(){var b=a.Objects.Models.thread,c=a.Objects.Models.user;a.Objects.server.callFunctions([{"function":"close",arguments:{references:{},"return":{closed:"closed"},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),user:!c.get("isAgent")}}],function(b){b.closed?window.close():a.Objects.Models.Status.message.setMessage(b.errorMessage||"Cannot close")},!0)}})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.HistoryControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1,windowParams:""}),getModelType:function(){return"HistoryControl"}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.RedirectControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1}),getModelType:function(){return"RedirectControl"}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.RefreshControl=a.Models.Control.extend({getModelType:function(){return"RefreshControl"},refresh:function(){a.Objects.server.restartUpdater()}})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.SecureModeControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1}),getModelType:function(){return"SecureModeControl"}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.SendMailControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1,windowParams:""}),getModelType:function(){return"SendMailControl"}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,c){a.Models.SoundControl=a.Models.Control.extend({defaults:c.extend({},a.Models.Control.prototype.defaults,{enabled:!0}),toggle:function(){var b=!this.get("enabled");a.Objects.Models.soundManager.set({enabled:b});this.set({enabled:b})},getModelType:function(){return"SoundControl"}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b){b.Models.UserNameControl=b.Models.Control.extend({getModelType:function(){return"UserNameControl"},changeName:function(a){var c=b.Objects.Models.user,d=b.Objects.Models.thread,e=c.get("name");a&&e!=a&&(b.Objects.server.callFunctions([{"function":"rename",arguments:{references:{},"return":{},threadId:d.get("id"),token:d.get("token"),name:a}}],function(a){a.errorCode&&(b.Objects.Models.Status.message.setMessage(a.errorMessage||"Cannot rename"),c.set({name:e}))},!0),c.set({name:a}))}})})(Mibew);
|
|
@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(c,e){var d=c.Models.BaseSurveyForm;c.Models.LeaveMessageForm=d.extend({defaults:e.extend({},d.prototype.defaults,{showCaptcha:!1,captcha:""}),validate:function(a){var b=c.Localization;if("undefined"!=typeof a.email){if(!a.email)return b.get("leavemessage.error.email.required");if(!c.Utils.checkEmail(a.email))return b.get("leavemessage.error.wrong.email")}if("undefined"!=typeof a.name&&!a.name)return b.get("leavemessage.error.name.required");if("undefined"!=typeof a.message&&!a.message)return b.get("leavemessage.error.message.required");
|
|
||||||
if(this.get("showCaptcha")&&"undefined"!=typeof a.captcha&&!a.captcha)return b.get("The letters you typed don't match the letters that were shown in the picture.")},submit:function(){if(!this.validate(this.attributes)){var a=this;c.Objects.server.callFunctions([{"function":"processLeaveMessage",arguments:{references:{},"return":{},groupId:a.get("groupId"),name:a.get("name"),info:a.get("info"),email:a.get("email"),message:a.get("message"),referrer:a.get("referrer"),captcha:a.get("captcha"),threadId:null,token:null}}],function(b){0==b.errorCode?a.trigger("submit:complete",
|
|
||||||
a):a.trigger("submit:error",a,{code:b.errorCode,message:b.errorMessage||""})},!0)}},ERROR_WRONG_CAPTCHA:10})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.MessageForm=a.Models.Base.extend({defaults:{predefinedAnswers:[],ignoreCtrl:!1},postMessage:function(e){var b=a.Objects.Models.thread,c=a.Objects.Models.user;if(c.get("canPost")){this.trigger("before:post",this);var d=this;a.Objects.server.callFunctions([{"function":"post",arguments:{references:{},"return":{},message:e,threadId:b.get("id"),token:b.get("token"),user:!c.get("isAgent")}}],function(){d.trigger("after:post",d)},!0)}}})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,a){b.Models.BaseSoundManager=a.Model.extend({defaults:{enabled:!0},play:function(a){this.get("enabled")&&b.Utils.playSound(a)}})})(Mibew,Backbone);
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,c){a.Models.ChatSoundManager=a.Models.BaseSoundManager.extend({defaults:c.extend({},a.Models.BaseSoundManager.prototype.defaults,{skipNextMessageSound:!1}),initialize:function(){var b=a.Objects,c=this;b.Collections.messages.on("multiple:add",this.playNewMessageSound,this);b.Models.messageForm.on("before:post",function(){c.set({skipNextMessageSound:!0})})},playNewMessageSound:function(){if(!this.get("skipNextMessageSound")){var b=a.Objects.Models.page.get("mibewRoot");"undefined"!==typeof b&&
|
|
||||||
this.play(b+"/sounds/new_message")}this.set({skipNextMessageSound:!1})}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,c){b.Models.Status=b.Models.Base.extend({defaults:{visible:!0,weight:0,hideTimeout:4E3,title:""},initialize:function(){this.hideTimer=null},autoHide:function(a){a=a||this.get("hideTimeout");this.hideTimer&&clearTimeout(this.hideTimer);this.hideTimer=setTimeout(c.bind(function(){this.set({visible:!1})},this),a)}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.StatusMessage=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{message:"",visible:!1}),getModelType:function(){return"StatusMessage"},setMessage:function(a){this.set({message:a,visible:!0});this.autoHide()}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.StatusTyping=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{visible:!1,hideTimeout:2E3}),getModelType:function(){return"StatusTyping"},show:function(){this.set({visible:!0});this.autoHide()}})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.BaseSurveyForm=a.Models.Base.extend({defaults:{name:"",email:"",message:"",info:"",referrer:"",groupId:null,groups:null}})})(Mibew);
|
|
@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,e){var d=b.Models.BaseSurveyForm;b.Models.SurveyForm=d.extend({defaults:e.extend({},d.prototype.defaults,{showEmail:!1,showMessage:!1,canChangeName:!1}),validate:function(a){if(this.get("showEmail")&&"undefined"!=typeof a.email&&!b.Utils.checkEmail(a.email))return b.Localization.get("Wrong email address.")},submit:function(){if(!this.validate(this.attributes)){var a=this;b.Objects.server.callFunctions([{"function":"processSurvey",arguments:{references:{},"return":{next:"next",options:"options"},
|
|
||||||
groupId:a.get("groupId"),name:a.get("name"),info:a.get("info"),email:a.get("email"),message:a.get("message"),referrer:a.get("referrer"),threadId:null,token:null}}],function(c){if(0==c.errorCode)switch(a.trigger("submit:complete",a),b.Application.Survey.stop(),c.next){case "chat":b.Application.Chat.start(c.options);break;case "leaveMessage":b.Application.LeaveMessage.start(c.options);break;default:throw Error("Do not know how to continue!");}else a.trigger("submit:error",a,{code:c.errorCode,message:c.errorMessage||
|
|
||||||
""})},!0)}}})})(Mibew,_);
|
|
@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Objects.Models.Controls={};a.Objects.Models.Status={};var j=[],l=a.Application,k=l.module("Chat",{startWithParent:!1});k.addInitializer(function(b){var f=a.Objects,d=a.Objects.Models,c=a.Objects.Models.Controls,h=a.Objects.Models.Status;b.page&&d.page.set(b.page);d.thread=new a.Models.Thread(b.thread);d.user=new a.Models.ChatUser(b.user);var g=new a.Layouts.Chat;f.chatLayout=g;l.mainRegion.show(g);var e=new a.Collections.Controls;d.user.get("isAgent")||(c.userName=new a.Models.UserNameControl({weight:220}),
|
|
||||||
e.add(c.userName),c.sendMail=new a.Models.SendMailControl({weight:200,link:b.links.mail,windowParams:b.windowsParams.mail}),e.add(c.sendMail));d.user.get("isAgent")&&(c.redirect=new a.Models.RedirectControl({weight:200,link:b.links.redirect}),e.add(c.redirect),c.history=new a.Models.HistoryControl({weight:180,link:b.links.history,windowParams:b.windowsParams.history}),e.add(c.history));c.sound=new a.Models.SoundControl({weight:160});e.add(c.sound);c.refresh=new a.Models.RefreshControl({weight:140});
|
|
||||||
e.add(c.refresh);b.links.ssl&&(c.secureMode=new a.Models.SecureModeControl({weight:120,link:b.links.ssl}),e.add(c.secureMode));c.close=new a.Models.CloseControl({weight:100});e.add(c.close);f.Collections.controls=e;g.controlsRegion.show(new a.Views.ControlsCollection({collection:e}));h.message=new a.Models.StatusMessage({hideTimeout:5E3});h.typing=new a.Models.StatusTyping({hideTimeout:5E3});f.Collections.status=new a.Collections.Status([h.message,h.typing]);g.statusRegion.show(new a.Views.StatusCollection({collection:f.Collections.status}));
|
|
||||||
d.user.get("isAgent")||(d.avatar=new a.Models.Avatar,g.avatarRegion.show(new a.Views.Avatar({model:d.avatar})));f.Collections.messages=new a.Collections.Messages;d.messageForm=new a.Models.MessageForm(b.messageForm);g.messageFormRegion.show(new a.Views.MessageForm({model:d.messageForm}));g.messagesRegion.show(new a.Views.MessagesCollection({collection:f.Collections.messages}));d.soundManager=new a.Models.ChatSoundManager;j.push(f.server.callFunctionsPeriodically(function(){var b=a.Objects.Models.thread,
|
|
||||||
c=a.Objects.Models.user;return[{"function":"update",arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:c.get("typing"),user:!c.get("isAgent")}}]},function(b){b.errorCode?a.Objects.Models.Status.message.setMessage(b.errorMessage||"refresh failed"):(b.typing&&a.Objects.Models.Status.typing.show(),a.Objects.Models.user.set({canPost:b.canPost||!1}))}))});k.on("start",function(){a.Objects.server.restartUpdater()});
|
|
||||||
k.addFinalizer(function(){a.Objects.chatLayout.close();for(var b=0;b<j.length;b++)a.Objects.server.stopCallFunctionsPeriodically(j[b]);"undefined"!=typeof a.Objects.Models.avatar&&a.Objects.Models.avatar.finalize();a.Objects.Collections.messages.finalize();delete a.Objects.chatLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;delete a.Objects.Models.page;delete a.Objects.Models.avatar;delete a.Objects.Models.messageForm;delete a.Objects.Models.Controls;delete a.Objects.Models.Status;
|
|
||||||
delete a.Objects.Collections.messages;delete a.Objects.Collections.controls;delete a.Objects.Collections.status})})(Mibew);
|
|
@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){var d=[],e=a.Application,b=e.module("Invitation",{startWithParent:!1});b.addInitializer(function(f){var c=a.Objects,b=a.Objects.Models;b.thread=new a.Models.Thread(f.thread);b.user=new a.Models.ChatUser(f.user);c.invitationLayout=new a.Layouts.Invitation;e.mainRegion.show(c.invitationLayout);c.Collections.messages=new a.Collections.Messages;c.invitationLayout.messagesRegion.show(new a.Views.MessagesCollection({collection:c.Collections.messages}));d.push(c.server.callFunctionsPeriodically(function(){var b=
|
|
||||||
a.Objects.Models.thread;return[{"function":"update",arguments:{"return":{},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:!1,user:!0}}]},function(){}))});b.on("start",function(){a.Objects.server.restartUpdater()});b.addFinalizer(function(){a.Objects.invitationLayout.close();for(var b=0;b<d.length;b++)a.Objects.server.stopCallFunctionsPeriodically(d[b]);a.Objects.Collections.messages.finalize();delete a.Objects.invitationLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;
|
|
||||||
delete a.Objects.Collections.messages})})(Mibew);
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){var e=a.Application,f=e.module("LeaveMessage",{startWithParent:!1});f.addInitializer(function(d){var b=a.Objects,c=a.Objects.Models;d.page&&c.page.set(d.page);b.leaveMessageLayout=new a.Layouts.LeaveMessage;e.mainRegion.show(b.leaveMessageLayout);c.leaveMessageForm=new a.Models.LeaveMessageForm(d.leaveMessageForm);b.leaveMessageLayout.leaveMessageFormRegion.show(new a.Views.LeaveMessageForm({model:c.leaveMessageForm}));b.leaveMessageLayout.descriptionRegion.show(new a.Views.LeaveMessageDescription);
|
|
||||||
c.leaveMessageForm.on("submit:complete",function(){b.leaveMessageLayout.leaveMessageFormRegion.close();b.leaveMessageLayout.descriptionRegion.close();b.leaveMessageLayout.descriptionRegion.show(new a.Views.LeaveMessageSentDescription)})});f.addFinalizer(function(){a.Objects.leaveMessageLayout.close();delete a.Objects.Models.leaveMessageForm})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){var d=a.Application,b=d.module("Survey",{startWithParent:!1});b.addInitializer(function(b){var c=a.Objects,e=a.Objects.Models;c.surveyLayout=new a.Layouts.Survey;d.mainRegion.show(c.surveyLayout);e.surveyForm=new a.Models.SurveyForm(b.surveyForm);c.surveyLayout.surveyFormRegion.show(new a.Views.SurveyForm({model:e.surveyForm}))});b.addFinalizer(function(){a.Objects.surveyLayout.close();delete a.Objects.Models.surveyForm})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Regions.Messages=b.Marionette.Region.extend({onShow:function(a){a.on("after:item:added",this.scrollToBottom,this)},scrollToBottom:function(){this.$el.scrollTop(this.$el.prop("scrollHeight"))}})})(Mibew,Backbone);
|
|
@ -1,403 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Regions={};a.Layouts={};a.Application=new Backbone.Marionette.Application})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
MibewAPIChatInteraction=function(){this.mandatoryArguments=function(){return{"*":{threadId:null,token:null,"return":{},references:{}},result:{errorCode:0}}};this.getReservedFunctionsNames=function(){return["result"]}};MibewAPIChatInteraction.prototype=new MibewAPIInteraction;
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,a){b.Models.BaseSoundManager=a.Model.extend({defaults:{enabled:!0},play:function(a){this.get("enabled")&&b.Utils.playSound(a)}})})(Mibew,Backbone);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,c){b.Models.Status=b.Models.Base.extend({defaults:{visible:!0,weight:0,hideTimeout:4E3,title:""},initialize:function(){this.hideTimer=null},autoHide:function(a){a=a||this.get("hideTimeout");this.hideTimer&&clearTimeout(this.hideTimer);this.hideTimer=setTimeout(c.bind(function(){this.set({visible:!1})},this),a)}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.BaseSurveyForm=a.Models.Base.extend({defaults:{name:"",email:"",message:"",info:"",referrer:"",groupId:null,groups:null}})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,c){b.Models.Avatar=b.Models.Base.extend({defaults:{imageLink:!1},initialize:function(){this.registeredFunctions=[];this.registeredFunctions.push(b.Objects.server.registerFunction("setupAvatar",c.bind(this.apiSetupAvatar,this)))},finalize:function(){for(var a=0;a<this.registeredFunctions.length;a++)b.Objects.server.unregisterFunction(this.registeredFunctions[a])},apiSetupAvatar:function(a){a.imageLink&&this.set({imageLink:a.imageLink})}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.ChatUser=a.Models.User.extend({defaults:b.extend({},a.Models.User.prototype.defaults,{canPost:!0,typing:!1,canChangeName:!1,dafaultName:!0})})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.CloseControl=a.Models.Control.extend({getModelType:function(){return"CloseControl"},closeThread:function(){var b=a.Objects.Models.thread,c=a.Objects.Models.user;a.Objects.server.callFunctions([{"function":"close",arguments:{references:{},"return":{closed:"closed"},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),user:!c.get("isAgent")}}],function(b){b.closed?window.close():a.Objects.Models.Status.message.setMessage(b.errorMessage||"Cannot close")},!0)}})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.HistoryControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1,windowParams:""}),getModelType:function(){return"HistoryControl"}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.RedirectControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1}),getModelType:function(){return"RedirectControl"}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.RefreshControl=a.Models.Control.extend({getModelType:function(){return"RefreshControl"},refresh:function(){a.Objects.server.restartUpdater()}})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.SecureModeControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1}),getModelType:function(){return"SecureModeControl"}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.SendMailControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1,windowParams:""}),getModelType:function(){return"SendMailControl"}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,c){a.Models.SoundControl=a.Models.Control.extend({defaults:c.extend({},a.Models.Control.prototype.defaults,{enabled:!0}),toggle:function(){var b=!this.get("enabled");a.Objects.Models.soundManager.set({enabled:b});this.set({enabled:b})},getModelType:function(){return"SoundControl"}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b){b.Models.UserNameControl=b.Models.Control.extend({getModelType:function(){return"UserNameControl"},changeName:function(a){var c=b.Objects.Models.user,d=b.Objects.Models.thread,e=c.get("name");a&&e!=a&&(b.Objects.server.callFunctions([{"function":"rename",arguments:{references:{},"return":{},threadId:d.get("id"),token:d.get("token"),name:a}}],function(a){a.errorCode&&(b.Objects.Models.Status.message.setMessage(a.errorMessage||"Cannot rename"),c.set({name:e}))},!0),c.set({name:a}))}})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(c,e){var d=c.Models.BaseSurveyForm;c.Models.LeaveMessageForm=d.extend({defaults:e.extend({},d.prototype.defaults,{showCaptcha:!1,captcha:""}),validate:function(a){var b=c.Localization;if("undefined"!=typeof a.email){if(!a.email)return b.get("leavemessage.error.email.required");if(!c.Utils.checkEmail(a.email))return b.get("leavemessage.error.wrong.email")}if("undefined"!=typeof a.name&&!a.name)return b.get("leavemessage.error.name.required");if("undefined"!=typeof a.message&&!a.message)return b.get("leavemessage.error.message.required");
|
|
||||||
if(this.get("showCaptcha")&&"undefined"!=typeof a.captcha&&!a.captcha)return b.get("The letters you typed don't match the letters that were shown in the picture.")},submit:function(){if(!this.validate(this.attributes)){var a=this;c.Objects.server.callFunctions([{"function":"processLeaveMessage",arguments:{references:{},"return":{},groupId:a.get("groupId"),name:a.get("name"),info:a.get("info"),email:a.get("email"),message:a.get("message"),referrer:a.get("referrer"),captcha:a.get("captcha"),threadId:null,token:null}}],function(b){0==b.errorCode?a.trigger("submit:complete",
|
|
||||||
a):a.trigger("submit:error",a,{code:b.errorCode,message:b.errorMessage||""})},!0)}},ERROR_WRONG_CAPTCHA:10})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.MessageForm=a.Models.Base.extend({defaults:{predefinedAnswers:[],ignoreCtrl:!1},postMessage:function(e){var b=a.Objects.Models.thread,c=a.Objects.Models.user;if(c.get("canPost")){this.trigger("before:post",this);var d=this;a.Objects.server.callFunctions([{"function":"post",arguments:{references:{},"return":{},message:e,threadId:b.get("id"),token:b.get("token"),user:!c.get("isAgent")}}],function(){d.trigger("after:post",d)},!0)}}})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,c){a.Models.ChatSoundManager=a.Models.BaseSoundManager.extend({defaults:c.extend({},a.Models.BaseSoundManager.prototype.defaults,{skipNextMessageSound:!1}),initialize:function(){var b=a.Objects,c=this;b.Collections.messages.on("multiple:add",this.playNewMessageSound,this);b.Models.messageForm.on("before:post",function(){c.set({skipNextMessageSound:!0})})},playNewMessageSound:function(){if(!this.get("skipNextMessageSound")){var b=a.Objects.Models.page.get("mibewRoot");"undefined"!==typeof b&&
|
|
||||||
this.play(b+"/sounds/new_message")}this.set({skipNextMessageSound:!1})}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.StatusMessage=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{message:"",visible:!1}),getModelType:function(){return"StatusMessage"},setMessage:function(a){this.set({message:a,visible:!0});this.autoHide()}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.StatusTyping=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{visible:!1,hideTimeout:2E3}),getModelType:function(){return"StatusTyping"},show:function(){this.set({visible:!0});this.autoHide()}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,e){var d=b.Models.BaseSurveyForm;b.Models.SurveyForm=d.extend({defaults:e.extend({},d.prototype.defaults,{showEmail:!1,showMessage:!1,canChangeName:!1}),validate:function(a){if(this.get("showEmail")&&"undefined"!=typeof a.email&&!b.Utils.checkEmail(a.email))return b.Localization.get("Wrong email address.")},submit:function(){if(!this.validate(this.attributes)){var a=this;b.Objects.server.callFunctions([{"function":"processSurvey",arguments:{references:{},"return":{next:"next",options:"options"},
|
|
||||||
groupId:a.get("groupId"),name:a.get("name"),info:a.get("info"),email:a.get("email"),message:a.get("message"),referrer:a.get("referrer"),threadId:null,token:null}}],function(c){if(0==c.errorCode)switch(a.trigger("submit:complete",a),b.Application.Survey.stop(),c.next){case "chat":b.Application.Chat.start(c.options);break;case "leaveMessage":b.Application.LeaveMessage.start(c.options);break;default:throw Error("Do not know how to continue!");}else a.trigger("submit:error",a,{code:c.errorCode,message:c.errorMessage||
|
|
||||||
""})},!0)}}})})(Mibew,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,j){b.Collections.Messages=d.Collection.extend({model:b.Models.Message,initialize:function(){this.periodicallyCalled=[];this.periodicallyCalled.push(b.Objects.server.callFunctionsPeriodically(j.bind(this.updateMessagesFunctionBuilder,this),j.bind(this.updateMessages,this)))},finalize:function(){for(var a=0;a<this.periodicallyCalled.length;a++)b.Objects.server.stopCallFunctionsPeriodically(this.periodicallyCalled[a])},updateMessages:function(a){a.lastId&&b.Objects.Models.thread.set({lastId:a.lastId});
|
|
||||||
for(var k=b.Models.Message.prototype.KIND_PLUGIN,g=[],c,f,e,h=0,d=a.messages.length;h<d;h++)c=a.messages[h],c.kind!=k?g.push(new b.Models.Message(c)):"object"!=typeof c.data||null===c.data||(f=c.plugin||!1,f="process:"+(!1!==f?f+":":"")+"plugin:message",e={messageData:c,model:!1},this.trigger(f,e),e.model&&(e.model.get("id")||e.model.set({id:c.id}),g.push(e.model)));0<g.length&&this.add(g)},updateMessagesFunctionBuilder:function(){var a=b.Objects.Models.thread,d=b.Objects.Models.user;return[{"function":"updateMessages",
|
|
||||||
arguments:{"return":{messages:"messages",lastId:"lastId"},references:{},threadId:a.get("id"),token:a.get("token"),lastId:a.get("lastId"),user:!d.get("isAgent")}}]},add:function(){var a=Array.prototype.slice.apply(arguments),a=d.Collection.prototype.add.apply(this,a);this.trigger("multiple:add");return a}})})(Mibew,Backbone,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Collections.Status=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.Status=b.Marionette.ItemView.extend({template:c.templates.chat_status_base,className:"status",modelEvents:{change:"render"},onBeforeRender:function(){this.model.get("visible")?this.$el.show():this.$el.hide()}})})(Mibew,Backbone,Handlebars);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(c,d){c.Views.BaseSurveyForm=d.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors",ajaxLoader:"#ajax-loader"},modelEvents:{invalid:"hideAjaxLoader showError","submit:error":"hideAjaxLoader showError"},preventSubmit:function(a){a.preventDefault()},
|
|
||||||
changeGroupDescription:function(){var a=this.ui.groupSelect.prop("selectedIndex"),a=this.model.get("groups")[a].description||"";this.ui.groupDescription.text(a)},showError:function(a,b){this.ui.errors.html("string"==typeof b?b:b.message)},serializeData:function(){var a=this.model.toJSON();a.page=c.Objects.Models.page.toJSON();return a},showAjaxLoader:function(){this.ui.ajaxLoader.show()},hideAjaxLoader:function(){this.ui.ajaxLoader.hide()}})})(Mibew,Backbone);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.Avatar=b.Marionette.ItemView.extend({template:c.templates.chat_avatar,className:"avatar",modelEvents:{change:"render"}})})(Mibew,Backbone,Handlebars);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,c,d){a.Views.CloseControl=a.Views.Control.extend({template:c.templates.chat_controls_close,events:d.extend({},a.Views.Control.prototype.events,{click:"closeThread"}),closeThread:function(){var b=a.Localization.get("Are you sure want to leave chat?");(!1===b||confirm(b))&&this.model.closeThread()}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,e){b.Views.HistoryControl=b.Views.Control.extend({template:d.templates.chat_controls_history,events:e.extend({},b.Views.Control.prototype.events,{click:"showHistory"}),showHistory:function(){var c=b.Objects.Models.user,a=this.model.get("link");c.get("isAgent")&&a&&(c=this.model.get("windowParams"),a=a.replace("&","&","g"),a=window.open(a,"UserHistory",c),null!==a&&(a.focus(),a.opener=window))}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,e,f){b.Views.RedirectControl=b.Views.Control.extend({template:e.templates.chat_controls_redirect,events:f.extend({},b.Views.Control.prototype.events,{click:"redirect"}),initialize:function(){b.Objects.Models.user.on("change",this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},redirect:function(){var a=b.Objects.Models.user;if(a.get("isAgent")&&a.get("canPost")&&(a=this.model.get("link"))){var c=b.Objects.Models.page.get("style"),
|
|
||||||
d="";c&&(d=(-1===a.indexOf("?")?"?":"&")+"style="+c);window.location.href=a.replace(/\&\;/g,"&")+d}}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.RefreshControl=a.Views.Control.extend({template:b.templates.chat_controls_refresh,events:c.extend({},a.Views.Control.prototype.events,{click:"refresh"}),refresh:function(){this.model.refresh()}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,d,e){a.Views.SecureModeControl=a.Views.Control.extend({template:d.templates.chat_controls_secure_mode,events:e.extend({},a.Views.Control.prototype.events,{click:"secure"}),secure:function(){var b=this.model.get("link");if(b){var c=a.Objects.Models.page.get("style");window.location.href=b.replace(/\&\;/g,"&")+(c?"&style="+c:"")}}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,f){b.Views.SendMailControl=b.Views.Control.extend({template:d.templates.chat_controls_send_mail,events:f.extend({},b.Views.Control.prototype.events,{click:"sendMail"}),sendMail:function(){var a=this.model.get("link"),c=b.Objects.Models.page;if(a){var d=this.model.get("windowParams"),c=c.get("style"),e="";c&&(e=(-1===a.indexOf("?")?"?":"&")+"style="+c);a=a.replace(/\&\;/g,"&")+e;a=window.open(a,"ForwardMail",d);null!==a&&(a.focus(),a.opener=window)}}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.SoundControl=a.Views.Control.extend({template:b.templates.chat_controls_sound,events:c.extend({},a.Views.Control.prototype.events,{click:"toggle"}),toggle:function(){this.model.toggle()}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,c,d){b.Views.UserNameControl=b.Views.Control.extend({template:c.templates.chat_controls_user_name,events:d.extend({},b.Views.Control.prototype.events,{"click .user-name-control-set":"changeName","click .user-name-control-change":"showNameInput","keydown #user-name-control-input":"inputKeyDown"}),ui:{nameInput:"#user-name-control-input"},initialize:function(){b.Objects.Models.user.on("change:name",this.hideNameInput,this);this.nameInput=b.Objects.Models.user.get("defaultName")},serializeData:function(){var a=
|
|
||||||
this.model.toJSON();a.user=b.Objects.Models.user.toJSON();a.nameInput=this.nameInput;return a},inputKeyDown:function(a){a=a.which;(13==a||10==a)&&this.changeName()},hideNameInput:function(){this.nameInput=!1;this.render()},showNameInput:function(){this.nameInput=!0;this.render()},changeName:function(){var a=this.ui.nameInput.val();this.model.changeName(a)}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.LeaveMessageDescription=b.Marionette.ItemView.extend({template:c.templates.leave_message_description,serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(d,e,b){var c=d.Views.BaseSurveyForm;d.Views.LeaveMessageForm=c.extend({template:e.templates.leave_message_form,events:b.extend({},c.prototype.events,{"click #send-message":"submitForm"}),ui:b.extend({},c.prototype.ui,{captcha:'input[name="captcha"]',captchaImg:"#captcha-img"}),modelEvents:b.extend({},c.prototype.modelEvents,{"submit:error":"hideAjaxLoader showError submitError"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());
|
|
||||||
a.name=this.ui.name.val()||"";a.email=this.ui.email.val()||"";a.message=this.ui.message.val()||"";this.model.get("showCaptcha")&&(a.captcha=this.ui.captcha.val()||"");this.model.set(a,{validate:!0});this.model.submit()},submitError:function(a,c){if(c.code==a.ERROR_WRONG_CAPTCHA&&a.get("showCaptcha")){var b=this.ui.captchaImg.attr("src"),b=b.replace(/\?d\=[0-9]+/,"");this.ui.captchaImg.attr("src",b+"?d="+(new Date).getTime())}}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b,c){a.Views.LeaveMessageSentDescription=b.Marionette.ItemView.extend({template:c.templates.leave_message_sent_description,serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Views.Message=a.Views.Message.extend({template:b.templates.chat_message})})(Mibew,Handlebars);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,e){b.Views.MessageForm=d.Marionette.ItemView.extend({template:e.templates.chat_message_form,events:{"click #send-message":"postMessage","keydown #message-input":"messageKeyDown","keyup #message-input":"checkUserTyping","change #message-input":"checkUserTyping","change #predefined":"selectPredefinedAnswer","focus #message-input":"setFocus","blur #message-input":"dropFocus"},modelEvents:{change:"render"},ui:{message:"#message-input",send:"#send-message",predefinedAnswer:"#predefined"},
|
|
||||||
initialize:function(){b.Objects.Models.user.on("change:canPost",this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},postMessage:function(){var a=this.ui.message.val();""!=a&&(this.disableInput(),this.model.postMessage(a));b.Objects.Collections.messages.on("multiple:add",this.postMessageComplete,this)},messageKeyDown:function(a){var c=a.which;a=a.ctrlKey;(13==c&&(a||this.model.get("ignoreCtrl"))||10==c)&&this.postMessage()},enableInput:function(){this.ui.message.removeAttr("disabled")},
|
|
||||||
disableInput:function(){this.ui.message.attr("disabled","disabled")},clearInput:function(){this.ui.message.val("").change()},postMessageComplete:function(){this.clearInput();this.enableInput();this.focused&&this.ui.focus();b.Objects.Collections.messages.off("multiple:add",this.postMessageComplete,this)},selectPredefinedAnswer:function(){var a=this.ui.message,c=this.ui.predefinedAnswer,b=c.get(0).selectedIndex;b&&(a.val(this.model.get("predefinedAnswers")[b-1].full).change(),a.focus(),c.get(0).selectedIndex=
|
|
||||||
0)},checkUserTyping:function(){var a=b.Objects.Models.user,c=""!=this.ui.message.val();c!=a.get("typing")&&a.set({typing:c})},setFocus:function(){this.focused=!0},dropFocus:function(){this.focused=!1}})})(Mibew,Backbone,Handlebars);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Views.StatusMessage=a.Views.Status.extend({template:b.templates.chat_status_message})})(Mibew,Handlebars);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Views.StatusTyping=a.Views.Status.extend({template:b.templates.chat_status_typing})})(Mibew,Handlebars);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d,e){var c=b.Views.BaseSurveyForm;b.Views.SurveyForm=c.extend({template:d.templates.survey_form,events:e.extend({},c.prototype.events,{"click #submit-survey":"submitForm"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());this.model.get("canChangeName")&&(a.name=this.ui.name.val()||"");this.model.get("showEmail")&&(a.email=this.ui.email.val()||"");this.model.get("showMessage")&&(a.message=this.ui.message.val()||"");this.model.set(a,
|
|
||||||
{validate:!0});this.model.submit()}})})(Mibew,Handlebars,_);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection"})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Views.StatusCollection=a.Views.CollectionBase.extend({itemView:a.Views.Status,className:"status-collection"})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Regions.Messages=b.Marionette.Region.extend({onShow:function(a){a.on("after:item:added",this.scrollToBottom,this)},scrollToBottom:function(){this.$el.scrollTop(this.$el.prop("scrollHeight"))}})})(Mibew,Backbone);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,c){a.Layouts.Chat=c.Marionette.Layout.extend({template:Handlebars.templates.chat_layout,regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:a.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region"},serializeData:function(){var b=a.Objects.Models;return{page:b.page.toJSON(),user:b.user.toJSON()}}})})(Mibew,Backbone);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Layouts.Invitation=b.Marionette.Layout.extend({template:Handlebars.templates.invitation_layout,regions:{messagesRegion:{selector:"#invitation-messages-region",regionType:a.Regions.Messages}}})})(Mibew,Backbone);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Layouts.LeaveMessage=b.Marionette.Layout.extend({template:Handlebars.templates.leave_message_layout,regions:{leaveMessageFormRegion:"#content-wrapper",descriptionRegion:"#description-region"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Layouts.Survey=b.Marionette.Layout.extend({template:Handlebars.templates.survey_layout,regions:{surveyFormRegion:"#content-wrapper"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Objects.Models.Controls={};a.Objects.Models.Status={};var j=[],l=a.Application,k=l.module("Chat",{startWithParent:!1});k.addInitializer(function(b){var f=a.Objects,d=a.Objects.Models,c=a.Objects.Models.Controls,h=a.Objects.Models.Status;b.page&&d.page.set(b.page);d.thread=new a.Models.Thread(b.thread);d.user=new a.Models.ChatUser(b.user);var g=new a.Layouts.Chat;f.chatLayout=g;l.mainRegion.show(g);var e=new a.Collections.Controls;d.user.get("isAgent")||(c.userName=new a.Models.UserNameControl({weight:220}),
|
|
||||||
e.add(c.userName),c.sendMail=new a.Models.SendMailControl({weight:200,link:b.links.mail,windowParams:b.windowsParams.mail}),e.add(c.sendMail));d.user.get("isAgent")&&(c.redirect=new a.Models.RedirectControl({weight:200,link:b.links.redirect}),e.add(c.redirect),c.history=new a.Models.HistoryControl({weight:180,link:b.links.history,windowParams:b.windowsParams.history}),e.add(c.history));c.sound=new a.Models.SoundControl({weight:160});e.add(c.sound);c.refresh=new a.Models.RefreshControl({weight:140});
|
|
||||||
e.add(c.refresh);b.links.ssl&&(c.secureMode=new a.Models.SecureModeControl({weight:120,link:b.links.ssl}),e.add(c.secureMode));c.close=new a.Models.CloseControl({weight:100});e.add(c.close);f.Collections.controls=e;g.controlsRegion.show(new a.Views.ControlsCollection({collection:e}));h.message=new a.Models.StatusMessage({hideTimeout:5E3});h.typing=new a.Models.StatusTyping({hideTimeout:5E3});f.Collections.status=new a.Collections.Status([h.message,h.typing]);g.statusRegion.show(new a.Views.StatusCollection({collection:f.Collections.status}));
|
|
||||||
d.user.get("isAgent")||(d.avatar=new a.Models.Avatar,g.avatarRegion.show(new a.Views.Avatar({model:d.avatar})));f.Collections.messages=new a.Collections.Messages;d.messageForm=new a.Models.MessageForm(b.messageForm);g.messageFormRegion.show(new a.Views.MessageForm({model:d.messageForm}));g.messagesRegion.show(new a.Views.MessagesCollection({collection:f.Collections.messages}));d.soundManager=new a.Models.ChatSoundManager;j.push(f.server.callFunctionsPeriodically(function(){var b=a.Objects.Models.thread,
|
|
||||||
c=a.Objects.Models.user;return[{"function":"update",arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:c.get("typing"),user:!c.get("isAgent")}}]},function(b){b.errorCode?a.Objects.Models.Status.message.setMessage(b.errorMessage||"refresh failed"):(b.typing&&a.Objects.Models.Status.typing.show(),a.Objects.Models.user.set({canPost:b.canPost||!1}))}))});k.on("start",function(){a.Objects.server.restartUpdater()});
|
|
||||||
k.addFinalizer(function(){a.Objects.chatLayout.close();for(var b=0;b<j.length;b++)a.Objects.server.stopCallFunctionsPeriodically(j[b]);"undefined"!=typeof a.Objects.Models.avatar&&a.Objects.Models.avatar.finalize();a.Objects.Collections.messages.finalize();delete a.Objects.chatLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;delete a.Objects.Models.page;delete a.Objects.Models.avatar;delete a.Objects.Models.messageForm;delete a.Objects.Models.Controls;delete a.Objects.Models.Status;
|
|
||||||
delete a.Objects.Collections.messages;delete a.Objects.Collections.controls;delete a.Objects.Collections.status})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){var d=[],e=a.Application,b=e.module("Invitation",{startWithParent:!1});b.addInitializer(function(f){var c=a.Objects,b=a.Objects.Models;b.thread=new a.Models.Thread(f.thread);b.user=new a.Models.ChatUser(f.user);c.invitationLayout=new a.Layouts.Invitation;e.mainRegion.show(c.invitationLayout);c.Collections.messages=new a.Collections.Messages;c.invitationLayout.messagesRegion.show(new a.Views.MessagesCollection({collection:c.Collections.messages}));d.push(c.server.callFunctionsPeriodically(function(){var b=
|
|
||||||
a.Objects.Models.thread;return[{"function":"update",arguments:{"return":{},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:!1,user:!0}}]},function(){}))});b.on("start",function(){a.Objects.server.restartUpdater()});b.addFinalizer(function(){a.Objects.invitationLayout.close();for(var b=0;b<d.length;b++)a.Objects.server.stopCallFunctionsPeriodically(d[b]);a.Objects.Collections.messages.finalize();delete a.Objects.invitationLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;
|
|
||||||
delete a.Objects.Collections.messages})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){var e=a.Application,f=e.module("LeaveMessage",{startWithParent:!1});f.addInitializer(function(d){var b=a.Objects,c=a.Objects.Models;d.page&&c.page.set(d.page);b.leaveMessageLayout=new a.Layouts.LeaveMessage;e.mainRegion.show(b.leaveMessageLayout);c.leaveMessageForm=new a.Models.LeaveMessageForm(d.leaveMessageForm);b.leaveMessageLayout.leaveMessageFormRegion.show(new a.Views.LeaveMessageForm({model:c.leaveMessageForm}));b.leaveMessageLayout.descriptionRegion.show(new a.Views.LeaveMessageDescription);
|
|
||||||
c.leaveMessageForm.on("submit:complete",function(){b.leaveMessageLayout.leaveMessageFormRegion.close();b.leaveMessageLayout.descriptionRegion.close();b.leaveMessageLayout.descriptionRegion.show(new a.Views.LeaveMessageSentDescription)})});f.addFinalizer(function(){a.Objects.leaveMessageLayout.close();delete a.Objects.Models.leaveMessageForm})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){var d=a.Application,b=d.module("Survey",{startWithParent:!1});b.addInitializer(function(b){var c=a.Objects,e=a.Objects.Models;c.surveyLayout=new a.Layouts.Survey;d.mainRegion.show(c.surveyLayout);e.surveyForm=new a.Models.SurveyForm(b.surveyForm);c.surveyLayout.surveyFormRegion.show(new a.Views.SurveyForm({model:e.surveyForm}))});b.addFinalizer(function(){a.Objects.surveyLayout.close();delete a.Objects.Models.surveyForm})})(Mibew);
|
|
||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d){var c=b.Application;c.addRegions({mainRegion:"#main-region"});c.addInitializer(function(a){b.PluginOptions=a.plugins||{};b.Objects.server=new b.Server(d.extend({interactionType:MibewAPIChatInteraction},a.server));b.Objects.Models.page=new b.Models.Page(a.page);switch(a.startFrom){case "chat":c.Chat.start(a.chatOptions);break;case "survey":c.Survey.start(a.surveyOptions);break;case "leaveMessage":c.LeaveMessage.start(a.leaveMessageOptions);break;case "invitation":c.Invitation.start(a.invitationOptions);
|
|
||||||
break;default:throw Error("Dont know how to start!");}});c.on("start",function(){b.Objects.server.runUpdater()})})(Mibew,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(d,a,f){var e=function(b,a,c){c=f.extend({model:b},c);return"function"!=typeof b.getModelType?new a(c):(b=b.getModelType())&&d.Views[b]?new d.Views[b](c):new a(c)};d.Views.CollectionBase=a.Marionette.CollectionView.extend({itemView:a.Marionette.ItemView,buildItemView:e});d.Views.CompositeBase=a.Marionette.CompositeView.extend({buildItemView:e})})(Mibew,Backbone,_);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Views.ControlsCollection=a.Views.CollectionBase.extend({itemView:a.Views.Control,className:"controls-collection"})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Collections.Controls=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone);
|
|
@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(e,c){c.registerHelper("apply",function(a,b){var f=a,e=/^[0-9A-z_]+$/;b=b.split(/\s*,\s*/);for(var d in b)if(b.hasOwnProperty(d)&&e.test(b[d])){if("function"!=typeof c.helpers[b[d]])throw Error("Unregistered helper '"+b[d]+"'!");f=c.helpers[b[d]](f).toString()}return new c.SafeString(f)});c.registerHelper("allowTags",function(a){a=a.replace(/<(span|strong)>(.*?)<\/\1>/g,"<$1>$2</$1>");a=a.replace(/<span class="(.*?)">(.*?)<\/span>/g,'<span class="$1">$2</span>');
|
|
||||||
return new c.SafeString(a)});c.registerHelper("formatTime",function(a){var b=new Date(1E3*a);a=b.getHours().toString();var c=b.getMinutes().toString(),b=b.getSeconds().toString();return(10>a?"0"+a:a)+":"+(10>c?"0"+c:c)+":"+(10>b?"0"+b:b)});c.registerHelper("urlReplace",function(a){return new c.SafeString(a.replace(/((?:https?|ftp):\/\/\S*)/g,'<a href="$1" target="_blank">$1</a>'))});c.registerHelper("nl2br",function(a){return new c.SafeString(a.replace(/\n/g,"<br/>"))});c.registerHelper("l10n",function(a){return e.Localization.get(a)||
|
|
||||||
""});c.registerHelper("ifEven",function(a,b){return 0===a%2?b.fn(this):b.inverse(this)});c.registerHelper("ifOdd",function(a,b){return 0!==a%2?b.fn(this):b.inverse(this)})})(Mibew,Handlebars);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
var Mibew={};(function(a,d,b){d.Marionette.TemplateCache.prototype.compileTemplate=function(a){return b.compile(a)};for(var c in b.templates)b.templates.hasOwnProperty(c)&&b.registerPartial(c,b.templates[c]);a.Models={};a.Collections={};a.Views={};a.Objects={};a.Objects.Models={};a.Objects.Collections={}})(Mibew,Backbone,Handlebars);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,d){b.Localization={};var c={};b.Localization.get=function(a){return!c.hasOwnProperty(a)?!1:c[a]};b.Localization.set=function(a){d.extend(c,a)}})(Mibew,_);
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(b,c,d){b.Views.Control=c.Marionette.ItemView.extend({template:d.templates.default_control,modelEvents:{change:"render"},events:{mouseover:"mouseOver",mouseleave:"mouseLeave"},attributes:function(){var a=[];a.push("control");this.className&&(a.push(this.className),this.className="");var b=this.getDashedControlType();b&&a.push(b);return{"class":a.join(" ")}},mouseOver:function(){var a=this.getDashedControlType();this.$el.addClass("active"+(a?"-"+a:""))},mouseLeave:function(){var a=this.getDashedControlType();
|
|
||||||
this.$el.removeClass("active"+(a?"-"+a:""))},getDashedControlType:function(){"undefined"==typeof this.dashedControlType&&(this.dashedControlType=b.Utils.toDashFormat(this.model.getModelType())||"");return this.dashedControlType}})})(Mibew,Backbone,Handlebars);
|
|
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(c,d,e){var f={"<":"<",">":">","&":"&",'"':""","'":"'","`":"`"},g=/[&<>'"`]/g;c.Views.Message=d.Marionette.ItemView.extend({template:e.templates.message,className:"message",modelEvents:{change:"render"},serializeData:function(){var a=this.model.toJSON(),b=this.model.get("kind");a.allowFormatting=b!=this.model.KIND_USER&&b!=this.model.KIND_AGENT;a.kindName=this.kindToString(b);a.message=this.escapeString(a.message);return a},kindToString:function(a){return a==this.model.KIND_USER?
|
|
||||||
"user":a==this.model.KIND_AGENT?"agent":a==this.model.KIND_FOR_AGENT?"hidden":a==this.model.KIND_INFO?"inf":a==this.model.KIND_CONN?"conn":a==this.model.KIND_EVENTS?"event":a==this.model.KIND_PLUGIN?"plugin":""},escapeString:function(a){return a.replace(g,function(a){return f[a]||"&"})}})})(Mibew,Backbone,Handlebars);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.Base=b.Model.extend({getModelType:function(){return""}})})(Mibew,Backbone);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.Control=a.Models.Base.extend({defaults:{title:"",weight:0}})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.Message=a.Models.Base.extend({defaults:{kind:null,created:0,name:"",message:"",plugin:"",data:{}},KIND_USER:1,KIND_AGENT:2,KIND_FOR_AGENT:3,KIND_INFO:4,KIND_CONN:5,KIND_EVENTS:6,KIND_PLUGIN:7})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a,b){a.Models.Page=b.Model.extend()})(Mibew,Backbone);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.Thread=a.Models.Base.extend({defaults:{id:0,token:0,lastId:0,state:null},STATE_QUEUE:0,STATE_WAITING:1,STATE_CHATTING:2,STATE_CLOSED:3,STATE_LOADING:4,STATE_LEFT:5,STATE_INVITED:6})})(Mibew);
|
|
@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2005-2014 the original author or authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License").
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
(function(a){a.Models.User=a.Models.Base.extend({defaults:{isAgent:!1,name:""}})})(Mibew);
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user