Compare commits
268 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d955e44167 | ||
|
088bba7985 | ||
|
48ca102d0a | ||
|
34e147e5ac | ||
|
1f01b67297 | ||
|
d3dd58fdc5 | ||
|
1993040520 | ||
|
6950f7f715 | ||
|
9f79d8f40a | ||
|
2d3493b648 | ||
|
72b5685fce | ||
|
bd3f1b39b2 | ||
|
15c13a8f4f | ||
|
91f85139ca | ||
|
513781272e | ||
|
d0dd1bb288 | ||
|
4107e8e61c | ||
|
5ca5a93eb3 | ||
|
8c807398a4 | ||
|
3ee4bdd019 | ||
|
0d20938506 | ||
|
ff6ff266c5 | ||
|
9e08a50c2d | ||
|
75b89e1c7f | ||
|
350fb5d2ab | ||
|
2baf8c92fe | ||
|
645be7afb3 | ||
|
65cc84e062 | ||
|
4ea1bf6f71 | ||
|
3770c0cac6 | ||
|
fc213d5745 | ||
|
00ab6fd61a | ||
|
8202248bad | ||
|
6e5ec59137 | ||
|
429f335001 | ||
|
60fed4ef8a | ||
|
728e8d7f38 | ||
|
e5b1e17e1f | ||
|
a814366058 | ||
|
6de0b2d183 | ||
|
fdd3b484fc | ||
|
10c596e95c | ||
|
b83e45e406 | ||
|
5412e1aaaa | ||
|
98d9d877a2 | ||
|
27149b0870 | ||
|
8b0bd46f4d | ||
|
e65eb3131b | ||
|
5a863734a0 | ||
|
4987f1030d | ||
|
3026504110 | ||
|
81468c2e04 | ||
|
ac27edae21 | ||
|
412518f264 | ||
|
4642352fc1 | ||
|
2b3fdf1196 | ||
|
6a0605b6ac | ||
|
4c94f44f3c | ||
|
b7e5500e96 | ||
|
0dc7ead2a9 | ||
|
e23ef8d9d0 | ||
|
23f5603460 | ||
|
00e0959855 | ||
|
144a5061a3 | ||
|
ae1e8a2625 | ||
|
4a0f39fb07 | ||
|
400f3963f5 | ||
|
687657bab3 | ||
|
7c31954b19 | ||
|
71b9357a9f | ||
|
0f8b7ca662 | ||
|
4f1f111432 | ||
|
08d2403133 | ||
|
28660e3400 | ||
|
fb3a82222b | ||
|
7abd37a138 | ||
|
5c9b6f735d | ||
|
b9b3eb43f7 | ||
|
5b7bbf2e72 | ||
|
ded8dae982 | ||
|
f1c6c845b8 | ||
|
dcb4de0e0e | ||
|
943a1ddbd7 | ||
|
802c9d3375 | ||
|
81b138cf62 | ||
|
25ee14b7aa | ||
|
014d9334b3 | ||
|
7ee42468bd | ||
|
c83f4bd213 | ||
|
b0a6e7fac5 | ||
|
0c9d11c731 | ||
|
4a27a7479a | ||
|
7d973c7a87 | ||
|
d8e255cac8 | ||
|
b45f874ce4 | ||
|
8b6764af17 | ||
|
a6a79e9f94 | ||
|
94e76fad9c | ||
|
020dd0a876 | ||
|
3c9573c93e | ||
|
663310b388 | ||
|
4641c3cc5a | ||
|
be044840a1 | ||
|
1ff3cf2127 | ||
|
7b512ea2f6 | ||
|
9844fb156e | ||
|
72a47b76bb | ||
|
8318e897fe | ||
|
99c909c69b | ||
|
704fb02d1a | ||
|
8686eb0ad4 | ||
|
4aa0d22ebe | ||
|
f6464b6e37 | ||
|
c925bd757b | ||
|
5d6ace0852 | ||
|
ba638f06a1 | ||
|
f24dcc4a5e | ||
|
1ec921efde | ||
|
75739389cc | ||
|
4ac182f0d9 | ||
|
df9f865e04 | ||
|
f9a5ac64b6 | ||
|
ac8d2a179b | ||
|
9230c186e1 | ||
|
c8cbd42fe3 | ||
|
19e949010f | ||
|
92e47fb98b | ||
|
f51480731a | ||
|
b9b4c380b2 | ||
|
954f242a63 | ||
|
e80f4f6518 | ||
|
9fbe471585 | ||
|
80ba57e5d3 | ||
|
3a83430771 | ||
|
039da8e73d | ||
|
c1b678c1aa | ||
|
5081311f7d | ||
|
f2b0eb74ea | ||
|
3655df6cb8 | ||
|
d4f72f3633 | ||
|
9afb13b02f | ||
|
5de02c8d51 | ||
|
8263b1abeb | ||
|
b5d1bbaa5b | ||
|
fff27e1bb7 | ||
|
beaac8196d | ||
|
332ef31597 | ||
|
a862a8ec3d | ||
|
8f3b55b650 | ||
|
a5344c8400 | ||
|
9d1ca21b67 | ||
|
49da037936 | ||
|
c0abb0a71c | ||
|
3476c1cc95 | ||
|
7406aa8e5b | ||
|
1b682bc3c2 | ||
|
f817167a7b | ||
|
001f62b539 | ||
|
f1a63fbd09 | ||
|
64f8c87577 | ||
|
5923d01791 | ||
|
2302116214 | ||
|
58f3061b66 | ||
|
e6daae3ee8 | ||
|
9cb881faaa | ||
|
4f74576ae7 | ||
|
9d0ba4b30d | ||
|
faf34707d1 | ||
|
25b1199160 | ||
|
b692355b04 | ||
|
ef9b0ed227 | ||
|
d0304ff210 | ||
|
9b9ab78839 | ||
|
e273c52f59 | ||
|
d23bff3f09 | ||
|
d609f6f3d7 | ||
|
1d6adf177f | ||
|
06004f73a8 | ||
|
4414e0943d | ||
|
0e4d01475d | ||
|
bb39a9a9d7 | ||
|
8542ef8b13 | ||
|
72034aad1e | ||
|
9efa963ec8 | ||
|
55ab0f280f | ||
|
a42811630d | ||
|
5dd2440a73 | ||
|
d7ca087182 | ||
|
d2a99998b5 | ||
|
52968d435c | ||
|
efd8c6e867 | ||
|
3d2c251b03 | ||
|
6a786a46e0 | ||
|
12a90cc820 | ||
|
64ec947157 | ||
|
47241c38f3 | ||
|
02b6ea66dd | ||
|
2f82ce6d54 | ||
|
65286f0443 | ||
|
ff9cd9466e | ||
|
1416ff2d11 | ||
|
356ccfe115 | ||
|
cb6d691ee2 | ||
|
66bf71fbc7 | ||
|
cd5ed0414e | ||
|
7e36425aad | ||
|
0c80f8f544 | ||
|
a47232d6df | ||
|
776f2e968d | ||
|
5803d46fa6 | ||
|
c385603454 | ||
|
0348662bf6 | ||
|
52fa7679b9 | ||
|
31671d1c5e | ||
|
7ecee63edd | ||
|
4dd9d89a5e | ||
|
b911e4d916 | ||
|
690b653092 | ||
|
d4b8754c05 | ||
|
cf085f1af9 | ||
|
9c2f303acd | ||
|
eb861b56fd | ||
|
bc880497b4 | ||
|
454354f9cd | ||
|
dccc1c8c88 | ||
|
3ea4d56604 | ||
|
2ab488bfa6 | ||
|
a0e3c74921 | ||
|
a438eca3da | ||
|
48c7fe2a96 | ||
|
bd70f3b609 | ||
|
43898f6878 | ||
|
51d4510241 | ||
|
5be0a547b6 | ||
|
e1a357c8c9 | ||
|
4bcea1363e | ||
|
7b5835f2e9 | ||
|
8115b50556 | ||
|
3e0d84392b | ||
|
18584e8c9f | ||
|
3969097d21 | ||
|
1edb15cfe1 | ||
|
f4773c4ce7 | ||
|
c89a27e62e | ||
|
d2176a49a7 | ||
|
fde613e24a | ||
|
1706c25cfd | ||
|
dca67ecd79 | ||
|
e5186688ab | ||
|
255f50eda8 | ||
|
3cf3b857a3 | ||
|
b46ad170fb | ||
|
0d0db68038 | ||
|
1580d20e31 | ||
|
d9cd33c487 | ||
|
88369dfb53 | ||
|
4c83b27e6f | ||
|
4c6484ff00 | ||
|
6048b6ae14 | ||
|
0e0e3ec29e | ||
|
4efd64fac1 | ||
|
f8f8892dbb | ||
|
f3f03be007 | ||
|
e386a571d3 | ||
|
f14fe84a85 | ||
|
ef164cc831 | ||
|
ac50c6633c | ||
|
f339ed777e |
@@ -6,42 +6,5 @@ INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemappin
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (2, 'Admin', 'User', 'admin', 1237, CURDATE(), 1,'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (3, 'homer@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (3, 'Homer', 'Simpson', 'homer', 1237, CURDATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (4, 'marge@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (4, 'Marge', 'Bouvier', 'marge', 1237, CURDATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (5, 'bart@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (5, 'Bart', 'Simpson', 'bart', 1237, CURDATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (6, 'lisa@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (6, 'Lisa', 'Simpson', 'lisa', 1237, CURDATE(), 1, 'D');
|
||||
|
||||
INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id)
|
||||
VALUES (1, 'Welcome Test', x'504B0304140008080800ED036F4400000000000000000000000007000000636F6E74656E74AD57DD8EDA3814BEEF53B8E9452F360CF985B0C0542C43D5B960355259ED45558D9CC464AC3176E43843A76FB3CFD0479817DB1393F0938442871A09417EFC7DE7F83BDFB1472B9C228E57646CE4194E88819E88CCA8E06343619E08E3FA0D82315222A5118A08571233B827737854916F6A6C4CC54A20F822FC3B96E88381683C366C032D05579FD53383A987C377448FE17068A030990A26E4D8786761F8042586C6A191E07A828C26FCFE81B0D4E8EEDDDED048454695E668F76DB3E3590612322630A35591BA93F02489714C321413B478F9012F8AAC24D760E7E95163E7F856485C638B5E8E506EE90796EF0FF6E8B78410611E11B61F446B20CEC0373B03671B885D053249244920AF7F0B854BFAAE5D83D43372A1C8F5E8ED97E9CD6431F932CB9440107BCEB17E15BDFDFAF57AD4D50F1D32E96A2A27E8B90EE4D9B68366A22B7E33CE70048018DDE184729CA17F49B8E1DB3F9EED963818E58F289720B207A5D23FBBDDF57A7D9508913072158915E03EA7855A6533A9E785625B108AB78DC4AD2299E74CD194410C903CCA8416CEC71C244F1A1A28865E0AA72D843AA46739ED2AD5422A17D5AD6769B9B4601459EA9E8B61BB4D0195C194287E0D65180A160FA9C28C46E70259A6BD13AA53E12C687A90B20D5EEF006F4157241BF6862D419DB97810A5BB53A157817F14720592BBA14B220B7408377BC0854E24891406ED6CF804AD2B794C9DA78B36303BBD5E3317B7600155CA3DB74D225B935842D5DCAF41F32713D2BC50E7D3B18343423B11C434A22F3F38FA27C33C0667606841228663B121E938C76BB4E17F5B83C4716C2FFB47FDEF01CBF8FE913C87027E9C4C66C7F582C26306FB65A2B9F57EC93F8A80773E38174F4411702725775D00BA15473386A6B9CC84D4C6A8DF7A85203BAE0FCE18047B296F53D8B653D2A24B8249CEB248D2904A704B09FF62A84009660DABF24D556BE2FD56B102D3BED9290CA06E7C7792141DBF303E281D89D28252E5EB05A74DDAD0270245C6C5513374EAE6F24BECFA60CBBD165F29D96134559275E744E13FDA697ECEC38AEA718ACD767E614EA16DB7F8D1FCE5BF0C7DB8429FA0BA5104DEFA882847EF2711B4C8C22569614B227B8FB00419E0CD82FBD6C15EE764B9DBAE670E5A32063283DC285A76969F94CF5E2DC35E295C2EEBB5DC703CDF357B7EB391DDF22750309AAC68228A3D00CC8A4321714961F07A61384ECF6CDB17CD562109410584A3BF9848AA9D9D750112D4C7BEFDEC149887B08218A91CCD715AEDC2ECF3D47E8E6BF703B36F37EB529BB6D87AF65CE459D9C65EE5D6F120F4EDE0E76EBDD218A765EFF44DC7A91BB577814FDF88901134D595024BBAE73AE99E416A77BCD0AF3DDBF4FBFB7AD2FB94DF475DF39D4A52D02DFBCD858C21D98765AECDE202C61329710607B95D43D4A4EF00B3101CBEB425BA3DD821BA4D418390F5CE43081656D6E0F48F56CBE11F49182E00B2079AA24C468BE2DE6DB97781639EDA5D30101C22C8429F13009CF0182216EBEAD89A819454796589D946F0A32E9C84AFDFFC0F504B070890C15C185C040000100F0000504B01021400140008080800ED036F4490C15C185C040000100F0000070000000000000000000000000000000000636F6E74656E74504B0506000000000100010035000000910400000000', '', 0, now(), now(), 1, NULL, 1);
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (1, 0, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (1, 1, 1, 1, 0);
|
||||
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (2, 1, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (2, 2, 2, 1, 1);
|
||||
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (1, 'test label', 1, NULL, '#ff0000', 'glyphicon glyphicon-tag');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (1,1);
|
||||
|
||||
INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id)
|
||||
VALUES (2, 'Welcome Admin', x'504B0304140008080800ED036F4400000000000000000000000007000000636F6E74656E74AD57DD8EDA3814BEEF53B8E9452F360CF985B0C0542C43D5B960355259ED45558D9CC464AC3176E43843A76FB3CFD0479817DB1393F0938442871A09417EFC7DE7F83BDFB1472B9C228E57646CE4194E88819E88CCA8E06343619E08E3FA0D82315222A5118A08571233B827737854916F6A6C4CC54A20F822FC3B96E88381683C366C032D05579FD53383A987C377448FE17068A030990A26E4D8786761F8042586C6A191E07A828C26FCFE81B0D4E8EEDDDED048454695E668F76DB3E3590612322630A35591BA93F02489714C321413B478F9012F8AAC24D760E7E95163E7F856485C638B5E8E506EE90796EF0FF6E8B78410611E11B61F446B20CEC0373B03671B885D053249244920AF7F0B854BFAAE5D83D43372A1C8F5E8ED97E9CD6431F932CB9440107BCEB17E15BDFDFAF57AD4D50F1D32E96A2A27E8B90EE4D9B68366A22B7E33CE70048018DDE184729CA17F49B8E1DB3F9EED963818E58F289720B207A5D23FBBDDF57A7D9508913072158915E03EA7855A6533A9E785625B108AB78DC4AD2299E74CD194410C903CCA8416CEC71C244F1A1A28865E0AA72D843AA46739ED2AD5422A17D5AD6769B9B4601459EA9E8B61BB4D0195C194287E0D65180A160FA9C28C46E70259A6BD13AA53E12C687A90B20D5EEF006F4157241BF6862D419DB97810A5BB53A157817F14720592BBA14B220B7408377BC0854E24891406ED6CF804AD2B794C9DA78B36303BBD5E3317B7600155CA3DB74D225B935842D5DCAF41F32713D2BC50E7D3B18343423B11C434A22F3F38FA27C33C0667606841228663B121E938C76BB4E17F5B83C4716C2FFB47FDEF01CBF8FE913C87027E9C4C66C7F582C26306FB65A2B9F57EC93F8A80773E38174F4411702725775D00BA15473386A6B9CC84D4C6A8DF7A85203BAE0FCE18047B296F53D8B653D2A24B8249CEB248D2904A704B09FF62A84009660DABF24D556BE2FD56B102D3BED9290CA06E7C7792141DBF303E281D89D28252E5EB05A74DDAD0270245C6C5513374EAE6F24BECFA60CBBD165F29D96134559275E744E13FDA697ECEC38AEA718ACD767E614EA16DB7F8D1FCE5BF0C7DB8429FA0BA5104DEFA882847EF2711B4C8C22569614B227B8FB00419E0CD82FBD6C15EE764B9DBAE670E5A32063283DC285A76969F94CF5E2DC35E295C2EEBB5DC703CDF357B7EB391DDF22750309AAC68228A3D00CC8A4321714961F07A61384ECF6CDB17CD562109410584A3BF9848AA9D9D750112D4C7BEFDEC149887B08218A91CCD715AEDC2ECF3D47E8E6BF703B36F37EB529BB6D87AF65CE459D9C65EE5D6F120F4EDE0E76EBDD218A765EFF44DC7A91BB577814FDF88901134D595024BBAE73AE99E416A77BCD0AF3DDBF4FBFB7AD2FB94DF475DF39D4A52D02DFBCD858C21D98765AECDE202C61329710607B95D43D4A4EF00B3101CBEB425BA3DD821BA4D418390F5CE43081656D6E0F48F56CBE11F49182E00B2079AA24C468BE2DE6DB97781639EDA5D30101C22C8429F13009CF0182216EBEAD89A819454796589D946F0A32E9C84AFDFFC0F504B070890C15C185C040000100F0000504B01021400140008080800ED036F4490C15C185C040000100F0000070000000000000000000000000000000000636F6E74656E74504B0506000000000100010035000000910400000000', 'This is a short description', 0, now(), now(), 2, NULL, 2);
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (3, 1, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (3, 2, 3, 2, 0);
|
||||
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (2, 'admin label', 2, NULL, '#0000ff', 'glyphicon glyphicon-star');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (2,2);
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00', 'glyphicon glyphicon-share');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (3,1);
|
||||
|
||||
COMMIT;
|
||||
SHUTDOWN;
|
||||
SHUTDOWN;
|
||||
|
@@ -10,41 +10,4 @@ INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemappin
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1,'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (3, 'homer@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (3, 'Homer', 'Simpson', 'homer', 1237, CURRENT_DATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (4, 'marge@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (4, 'Marge', 'Bouvier', 'marge', 1237, CURRENT_DATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (5, 'bart@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (5, 'Bart', 'Simpson', 'bart', 1237, CURRENT_DATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (6, 'lisa@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (6, 'Lisa', 'Simpson', 'lisa', 1237, CURRENT_DATE(), 1, 'D');
|
||||
|
||||
INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id)
|
||||
VALUES (1, 'Welcome Test', 0x504B0304140008080800ED036F4400000000000000000000000007000000636F6E74656E74AD57DD8EDA3814BEEF53B8E9452F360CF985B0C0542C43D5B960355259ED45558D9CC464AC3176E43843A76FB3CFD0479817DB1393F0938442871A09417EFC7DE7F83BDFB1472B9C228E57646CE4194E88819E88CCA8E06343619E08E3FA0D82315222A5118A08571233B827737854916F6A6C4CC54A20F822FC3B96E88381683C366C032D05579FD53383A987C377448FE17068A030990A26E4D8786761F8042586C6A191E07A828C26FCFE81B0D4E8EEDDDED048454695E668F76DB3E3590612322630A35591BA93F02489714C321413B478F9012F8AAC24D760E7E95163E7F856485C638B5E8E506EE90796EF0FF6E8B78410611E11B61F446B20CEC0373B03671B885D053249244920AF7F0B854BFAAE5D83D43372A1C8F5E8ED97E9CD6431F932CB9440107BCEB17E15BDFDFAF57AD4D50F1D32E96A2A27E8B90EE4D9B68366A22B7E33CE70048018DDE184729CA17F49B8E1DB3F9EED963818E58F289720B207A5D23FBBDDF57A7D9508913072158915E03EA7855A6533A9E785625B108AB78DC4AD2299E74CD194410C903CCA8416CEC71C244F1A1A28865E0AA72D843AA46739ED2AD5422A17D5AD6769B9B4601459EA9E8B61BB4D0195C194287E0D65180A160FA9C28C46E70259A6BD13AA53E12C687A90B20D5EEF006F4157241BF6862D419DB97810A5BB53A157817F14720592BBA14B220B7408377BC0854E24891406ED6CF804AD2B794C9DA78B36303BBD5E3317B7600155CA3DB74D225B935842D5DCAF41F32713D2BC50E7D3B18343423B11C434A22F3F38FA27C33C0667606841228663B121E938C76BB4E17F5B83C4716C2FFB47FDEF01CBF8FE913C87027E9C4C66C7F582C26306FB65A2B9F57EC93F8A80773E38174F4411702725775D00BA15473386A6B9CC84D4C6A8DF7A85203BAE0FCE18047B296F53D8B653D2A24B8249CEB248D2904A704B09FF62A84009660DABF24D556BE2FD56B102D3BED9290CA06E7C7792141DBF303E281D89D28252E5EB05A74DDAD0270245C6C5513374EAE6F24BECFA60CBBD165F29D96134559275E744E13FDA697ECEC38AEA718ACD767E614EA16DB7F8D1FCE5BF0C7DB8429FA0BA5104DEFA882847EF2711B4C8C22569614B227B8FB00419E0CD82FBD6C15EE764B9DBAE670E5A32063283DC285A76969F94CF5E2DC35E295C2EEBB5DC703CDF357B7EB391DDF22750309AAC68228A3D00CC8A4321714961F07A61384ECF6CDB17CD562109410584A3BF9848AA9D9D750112D4C7BEFDEC149887B08218A91CCD715AEDC2ECF3D47E8E6BF703B36F37EB529BB6D87AF65CE459D9C65EE5D6F120F4EDE0E76EBDD218A765EFF44DC7A91BB577814FDF88901134D595024BBAE73AE99E416A77BCD0AF3DDBF4FBFB7AD2FB94DF475DF39D4A52D02DFBCD858C21D98765AECDE202C61329710607B95D43D4A4EF00B3101CBEB425BA3DD821BA4D418390F5CE43081656D6E0F48F56CBE11F49182E00B2079AA24C468BE2DE6DB97781639EDA5D30101C22C8429F13009CF0182216EBEAD89A819454796589D946F0A32E9C84AFDFFC0F504B070890C15C185C040000100F0000504B01021400140008080800ED036F4490C15C185C040000100F0000070000000000000000000000000000000000636F6E74656E74504B0506000000000100010035000000910400000000, '', 0, now(), now(), 1, NULL, 1);
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (1, 0, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (1, 1, 1, 1, 0);
|
||||
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (2, 1, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (2, 2, 2, 1, 1);
|
||||
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (1, 'test label', 1, NULL, '#ff0000', 'glyphicon glyphicon-tag');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (1,1);
|
||||
|
||||
INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id)
|
||||
VALUES (2, 'Welcome Admin', 0x504B0304140008080800ED036F4400000000000000000000000007000000636F6E74656E74AD57DD8EDA3814BEEF53B8E9452F360CF985B0C0542C43D5B960355259ED45558D9CC464AC3176E43843A76FB3CFD0479817DB1393F0938442871A09417EFC7DE7F83BDFB1472B9C228E57646CE4194E88819E88CCA8E06343619E08E3FA0D82315222A5118A08571233B827737854916F6A6C4CC54A20F822FC3B96E88381683C366C032D05579FD53383A987C377448FE17068A030990A26E4D8786761F8042586C6A191E07A828C26FCFE81B0D4E8EEDDDED048454695E668F76DB3E3590612322630A35591BA93F02489714C321413B478F9012F8AAC24D760E7E95163E7F856485C638B5E8E506EE90796EF0FF6E8B78410611E11B61F446B20CEC0373B03671B885D053249244920AF7F0B854BFAAE5D83D43372A1C8F5E8ED97E9CD6431F932CB9440107BCEB17E15BDFDFAF57AD4D50F1D32E96A2A27E8B90EE4D9B68366A22B7E33CE70048018DDE184729CA17F49B8E1DB3F9EED963818E58F289720B207A5D23FBBDDF57A7D9508913072158915E03EA7855A6533A9E785625B108AB78DC4AD2299E74CD194410C903CCA8416CEC71C244F1A1A28865E0AA72D843AA46739ED2AD5422A17D5AD6769B9B4601459EA9E8B61BB4D0195C194287E0D65180A160FA9C28C46E70259A6BD13AA53E12C687A90B20D5EEF006F4157241BF6862D419DB97810A5BB53A157817F14720592BBA14B220B7408377BC0854E24891406ED6CF804AD2B794C9DA78B36303BBD5E3317B7600155CA3DB74D225B935842D5DCAF41F32713D2BC50E7D3B18343423B11C434A22F3F38FA27C33C0667606841228663B121E938C76BB4E17F5B83C4716C2FFB47FDEF01CBF8FE913C87027E9C4C66C7F582C26306FB65A2B9F57EC93F8A80773E38174F4411702725775D00BA15473386A6B9CC84D4C6A8DF7A85203BAE0FCE18047B296F53D8B653D2A24B8249CEB248D2904A704B09FF62A84009660DABF24D556BE2FD56B102D3BED9290CA06E7C7792141DBF303E281D89D28252E5EB05A74DDAD0270245C6C5513374EAE6F24BECFA60CBBD165F29D96134559275E744E13FDA697ECEC38AEA718ACD767E614EA16DB7F8D1FCE5BF0C7DB8429FA0BA5104DEFA882847EF2711B4C8C22569614B227B8FB00419E0CD82FBD6C15EE764B9DBAE670E5A32063283DC285A76969F94CF5E2DC35E295C2EEBB5DC703CDF357B7EB391DDF22750309AAC68228A3D00CC8A4321714961F07A61384ECF6CDB17CD562109410584A3BF9848AA9D9D750112D4C7BEFDEC149887B08218A91CCD715AEDC2ECF3D47E8E6BF703B36F37EB529BB6D87AF65CE459D9C65EE5D6F120F4EDE0E76EBDD218A765EFF44DC7A91BB577814FDF88901134D595024BBAE73AE99E416A77BCD0AF3DDBF4FBFB7AD2FB94DF475DF39D4A52D02DFBCD858C21D98765AECDE202C61329710607B95D43D4A4EF00B3101CBEB425BA3DD821BA4D418390F5CE43081656D6E0F48F56CBE11F49182E00B2079AA24C468BE2DE6DB97781639EDA5D30101C22C8429F13009CF0182216EBEAD89A819454796589D946F0A32E9C84AFDFFC0F504B070890C15C185C040000100F0000504B01021400140008080800ED036F4490C15C185C040000100F0000070000000000000000000000000000000000636F6E74656E74504B0506000000000100010035000000910400000000, 'This is a short description', 0, now(), now(), 2, NULL, 2);
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (3, 1, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (3, 2, 3, 2, 0);
|
||||
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (2, 'admin label', 2, NULL, '#0000ff', 'glyphicon glyphicon-star');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (2,2);
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00', 'glyphicon glyphicon-share');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (3,1);
|
||||
|
||||
COMMIT;
|
||||
|
@@ -31,4 +31,7 @@ CREATE TABLE R_LABEL_MINDMAP (
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
ALTER TABLE `LABEL`
|
||||
ADD COLUMN iconName VARCHAR(50) NOT NULL;
|
||||
|
||||
UPDATE LABEL SET iconName = 'glyphicon glyphicon-tag';
|
@@ -9,8 +9,11 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
<version>4.0.0</version>
|
||||
</parent>
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@bitbucket.org:wisemapping/wisemapping-open-source.git</developerConnection>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
@@ -32,6 +35,28 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.github.searls</groupId>
|
||||
<artifactId>jasmine-maven-plugin</artifactId>
|
||||
<version>1.3.1.5</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<sourceIncludes>
|
||||
<include>Functions.js</include>
|
||||
</sourceIncludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.alchim31.maven</groupId>
|
||||
<artifactId>yuicompressor-maven-plugin</artifactId>
|
||||
@@ -51,19 +76,9 @@
|
||||
<include>${basedir}/target/tmp/header-min.js</include>
|
||||
<include>${basedir}/target/tmp/Functions-min.js</include>
|
||||
<include>${basedir}/target/tmp/Utils-min.js</include>
|
||||
<!-- @Todo:Review this -->
|
||||
<include>
|
||||
${basedir}/../mindplot/src/main/javascript/libraries/moodialog/Overlay.js
|
||||
</include>
|
||||
<include>
|
||||
${basedir}/../mindplot/src/main/javascript/libraries/moodialog/MooDialog.js
|
||||
</include>
|
||||
<include>
|
||||
${basedir}/../mindplot/src/main/javascript/libraries/moodialog/MooDialog.Request.js
|
||||
</include>
|
||||
<include>
|
||||
${basedir}/../mindplot/src/main/javascript/libraries/moodialog/MooDialog.Fx.js
|
||||
</include>
|
||||
<include>${basedir}/../mindplot/src/main/javascript/Options.js</include>
|
||||
<include>${basedir}/../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.js</include>
|
||||
<include>${basedir}/../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request.js</include>
|
||||
</includes>
|
||||
</aggregation>
|
||||
</aggregations>
|
||||
|
10
core-js/src/test/javascript/testSuite.js
Normal file
@@ -0,0 +1,10 @@
|
||||
describe("Functions suite test", function() {
|
||||
it("$defined() test spec", function() {
|
||||
var testVariable = undefined;
|
||||
expect($defined(testVariable)).toBe(false);
|
||||
testVariable = 1;
|
||||
expect($defined(testVariable)).toBe(true);
|
||||
testVariable = null;
|
||||
expect($defined(testVariable)).toBe(false);
|
||||
});
|
||||
});
|
@@ -8,7 +8,7 @@ BASE_DIR=`pwd`
|
||||
TARGET_DIR=$BASE_DIR/target
|
||||
JETTY_DIR=$TARGET_DIR/wisemapping-$WISE_VERSION
|
||||
WISE_WEBAPP_DIR=$JETTY_DIR/webapps/wisemapping
|
||||
JETTY_VERSION=8.1.14.v20131031
|
||||
JETTY_VERSION=8.1.16.v20140903
|
||||
JETTY_DIST_DIR=jetty-distribution-${JETTY_VERSION}
|
||||
JETTY_ZIP=${JETTY_DIST_DIR}.zip
|
||||
|
||||
@@ -53,6 +53,7 @@ cp $BASE_DIR/wisemapping.xml $JETTY_DIR/contexts/
|
||||
# Distribute scripts
|
||||
cp -r $BASE_DIR/../config/ $TARGET_DIR/wisemapping-$WISE_VERSION/config
|
||||
cp ./start.sh ${JETTY_DIR}/
|
||||
cp -r $BASE_DIR/service $TARGET_DIR/wisemapping-$WISE_VERSION/service
|
||||
|
||||
# Store version
|
||||
echo $1 > $WISE_WEBAPP_DIR/version
|
||||
|
72
distribution/service/wisemapping
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
### BEGIN INIT INFO
|
||||
# Provides: wisemapping
|
||||
# Required-Start: $all
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: wisemapping
|
||||
# Description: www.wisemapping.com
|
||||
### END INIT INFO
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
#environmental variables
|
||||
JAVA_HOME="/usr/lib/jvm/java7"
|
||||
JDK_HOME=$JAVA_HOME
|
||||
export PATH=$JAVA_HOME/bin:$PATH
|
||||
WISE_HOME="/opt/wisemapping"
|
||||
PID_FILE="$WISE_HOME/.pid"
|
||||
SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
|
||||
|
||||
preInitChecks() {
|
||||
MYSQL_STATUS=`pgrep mysql`
|
||||
if [ -z $MYSQL_STATUS ]; then
|
||||
service mysql start >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
wiseStatus() {
|
||||
echo `pgrep -f "$WISE_HOME/start.jar"`
|
||||
}
|
||||
|
||||
case "${1:-''}" in
|
||||
'start')
|
||||
#preInitChecks
|
||||
cd $WISE_HOME
|
||||
echo "Starting Wisemapping..."
|
||||
java -Xmx256m -Dorg.apache.jasper.compiler.disablejsr199=true -jar $WISE_HOME/start.jar > $WISE_HOME/logs/start.log 2>&1 &
|
||||
PID=$!
|
||||
cd - >/dev/null 2>&1
|
||||
echo "proccess id: $PID"
|
||||
echo "$PID" > $PID_FILE
|
||||
;;
|
||||
'stop')
|
||||
if [ ! -f $PID_FILE ]; then
|
||||
PID=$(wiseStatus)
|
||||
else
|
||||
PID=`cat $PID_FILE`
|
||||
rm $PID_FILE >/dev/null 2>&1
|
||||
fi
|
||||
kill $PID
|
||||
echo "Wisemapping stopped"
|
||||
;;
|
||||
'restart')
|
||||
set +e; $SELF stop; set -e
|
||||
$SELF start
|
||||
;;
|
||||
'status')
|
||||
STATUS=$(wiseStatus)
|
||||
if [ -n "$STATUS" ]; then
|
||||
echo "Wisemapping server is running, pid: $STATUS"
|
||||
else
|
||||
echo "Wisemapping is stopped"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $SELF start|stop|restart|status"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
153
mindplot/pom.xml
@@ -9,7 +9,7 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
<version>4.0.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -124,6 +124,8 @@
|
||||
<inputDir>${basedir}/target/compress</inputDir>
|
||||
<includes>
|
||||
<include>header.js</include>
|
||||
<include>Events.js</include>
|
||||
<include>Options.js</include>
|
||||
<include>${basedir}/../web2d/target/classes/web2d.svg-min.js</include>
|
||||
<include>Messages.js</include>
|
||||
<include>TopicEventDispatcher.js</include>
|
||||
@@ -139,7 +141,9 @@
|
||||
<include>ScreenManager.js</include>
|
||||
<include>Workspace.js</include>
|
||||
<include>ShrinkConnector.js</include>
|
||||
<include>Keyboard.js</include>
|
||||
<include>DesignerKeyboard.js</include>
|
||||
<include>Keyboard.js</include>
|
||||
<include>TopicStyle.js</include>
|
||||
<include>NodeGraph.js</include>
|
||||
<include>Topic.js</include>
|
||||
@@ -250,6 +254,153 @@
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.github.searls</groupId>
|
||||
<artifactId>jasmine-maven-plugin</artifactId>
|
||||
<version>1.3.1.5</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<!--goal>test</goal-->
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.htmlunit</groupId>
|
||||
<artifactId>htmlunit</artifactId>
|
||||
<version>2.15</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<preloadSources>
|
||||
<source>libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js</source>
|
||||
<source>lib/jquery-1.8.2.js</source>
|
||||
<source>lib/core.js/</source>
|
||||
<source>lib/web2d.svg-min.js</source>
|
||||
<source>libraries/hotkeys/jquery.hotkeys.js</source>
|
||||
<source>libraries/underscorejs/underscore-min.js</source>
|
||||
<source>libraries/bootstrap/js/bootstrap.js</source>
|
||||
</preloadSources>
|
||||
<sourceIncludes>
|
||||
<include>header.js</include>
|
||||
<include>Events.js</include>
|
||||
<include>Messages.js</include>
|
||||
<include>TopicEventDispatcher.js</include>
|
||||
<include>model/IMindmap.js</include>
|
||||
<include>model/Mindmap.js</include>
|
||||
<include>model/INodeModel.js</include>
|
||||
<include>model/NodeModel.js</include>
|
||||
<include>model/RelationshipModel.js</include>
|
||||
<include>ActionDispatcher.js</include>
|
||||
<include>StandaloneActionDispatcher.js</include>
|
||||
<include>DesignerModel.js</include>
|
||||
<include>Designer.js</include>
|
||||
<include>ScreenManager.js</include>
|
||||
<include>Workspace.js</include>
|
||||
<include>ShrinkConnector.js</include>
|
||||
<include>Keyboard.js</include>
|
||||
<include>DesignerKeyboard.js</include>
|
||||
<include>Keyboard.js</include>
|
||||
<include>TopicStyle.js</include>
|
||||
<include>NodeGraph.js</include>
|
||||
<include>Topic.js</include>
|
||||
<include>CentralTopic.js</include>
|
||||
<include>MainTopic.js</include>
|
||||
<include>DragTopic.js</include>
|
||||
<include>DragManager.js</include>
|
||||
<include>DragPivot.js</include>
|
||||
<include>ConnectionLine.js</include>
|
||||
<include>Relationship.js</include>
|
||||
<include>DragConnector.js</include>
|
||||
<include>TextEditor.js</include>
|
||||
<include>MultilineTextEditor.js</include>
|
||||
<include>TextEditorFactory.js</include>
|
||||
<include>util/Shape.js</include>
|
||||
<include>util/FadeEffect.js</include>
|
||||
<include>persistence/ModelCodeName.js</include>
|
||||
<include>persistence/XMLSerializer_Pela.js</include>
|
||||
<include>persistence/XMLSerializer_Tango.js</include>
|
||||
<include>persistence/Pela2TangoMigrator.js</include>
|
||||
<include>persistence/XMLSerializer_Beta.js</include>
|
||||
<include>persistence/Beta2PelaMigrator.js</include>
|
||||
<include>persistence/XMLSerializerFactory.js</include>
|
||||
<include>PersistenceManager.js</include>
|
||||
<include>RestPersistenceManager.js</include>
|
||||
<include>LocalStorageManager.js</include>
|
||||
<include>EditorProperties.js</include>
|
||||
<include>IconGroup.js</include>
|
||||
<include>Icon.js</include>
|
||||
<include>LinkIcon.js</include>
|
||||
<include>NoteIcon.js</include>
|
||||
<include>ActionIcon.js</include>
|
||||
<include>ImageIcon.js</include>
|
||||
<include>model/FeatureModel.js</include>
|
||||
<include>model/IconModel.js</include>
|
||||
<include>model/LinkModel.js</include>
|
||||
<include>model/NoteModel.js</include>
|
||||
<include>Command.js</include>
|
||||
<include>DesignerActionRunner.js</include>
|
||||
<include>DesignerUndoManager.js</include>
|
||||
<include>ControlPoint.js</include>
|
||||
<include>EditorOptions.js</include>
|
||||
<include>RelationshipPivot.js</include>
|
||||
<include>TopicFeature.js</include>
|
||||
<include>commands/GenericFunctionCommand.js</include>
|
||||
<include>commands/DeleteCommand.js</include>
|
||||
<include>commands/DragTopicCommand.js</include>
|
||||
<include>commands/AddTopicCommand.js</include>
|
||||
<include>commands/ChangeFeatureToTopicCommand.js</include>
|
||||
<include>commands/RemoveFeatureFromTopicCommand.js</include>
|
||||
<include>commands/AddFeatureToTopicCommand.js</include>
|
||||
<include>commands/AddRelationshipCommand.js</include>
|
||||
<include>commands/MoveControlPointCommand.js</include>
|
||||
<include>widget/ModalDialogNotifier.js</include>
|
||||
<include>widget/ToolbarNotifier.js</include>
|
||||
<include>widget/ToolbarItem.js</include>
|
||||
<include>widget/ToolbarPaneItem.js</include>
|
||||
<include>widget/NoteEditor.js</include>
|
||||
<include>widget/LinkEditor.js</include>
|
||||
<include>widget/FloatingTip.js</include>
|
||||
<include>widget/LinkIconTooltip.js</include>
|
||||
<include>widget/KeyboardShortcutTooltip.js</include>
|
||||
<include>widget/ColorPalettePanel.js</include>
|
||||
<include>widget/ListToolbarPanel.js</include>
|
||||
<include>widget/FontFamilyPanel.js</include>
|
||||
<include>widget/FontSizePanel.js</include>
|
||||
<include>widget/TopicShapePanel.js</include>
|
||||
<include>widget/IconPanel.js</include>
|
||||
<include>widget/IMenu.js</include>
|
||||
<include>widget/Menu.js</include>
|
||||
<include>TopicFeature.js</include>
|
||||
<include>layout/EventBusDispatcher.js</include>
|
||||
<include>layout/ChangeEvent.js</include>
|
||||
<include>layout/LayoutManager.js</include>
|
||||
<include>layout/Node.js</include>
|
||||
<include>layout/RootedTreeSet.js</include>
|
||||
<include>layout/ChildrenSorterStrategy.js</include>
|
||||
<include>layout/AbstractBasicSorter.js</include>
|
||||
<include>layout/BalancedSorter.js</include>
|
||||
<include>layout/SymmetricSorter.js</include>
|
||||
<include>layout/GridSorter.js</include>
|
||||
<include>layout/OriginalLayout.js</include>
|
||||
<include>layout/EventBus.js</include>
|
||||
<include>MessageBundle_en.js</include>
|
||||
<include>MessageBundle_es.js</include>
|
||||
<include>MessageBundle_de.js</include>
|
||||
<include>MessageBundle_fr.js</include>
|
||||
<include>MessageBundle_pt_BR.js</include>
|
||||
<include>MessageBundle_zh_CN.js</include>
|
||||
<include>MessageBundle_zh_TW.js</include>
|
||||
<include>MessageBundle_ca.js</include>
|
||||
<include>footer.js</include>
|
||||
</sourceIncludes>
|
||||
<specExcludes>
|
||||
<exclude>static/test/*.js</exclude>
|
||||
<exclude>simpleTest.js</exclude>
|
||||
</specExcludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
//noinspection JSUnusedLocalSymbols
|
||||
mindplot.ActionDispatcher = new Class({
|
||||
Implements:[Events],
|
||||
Implements:[mindplot.Events],
|
||||
initialize: function(commandContext) {
|
||||
$assert(commandContext, "commandContext can not be null");
|
||||
},
|
||||
|
@@ -36,7 +36,7 @@ mindplot.ActionIcon = new Class({
|
||||
},
|
||||
|
||||
addToGroup:function(group) {
|
||||
group.appendChild(this.getImage());
|
||||
group.append(this.getImage());
|
||||
},
|
||||
|
||||
setVisibility:function(visible) {
|
||||
|
@@ -61,6 +61,6 @@ mindplot.CentralTopic = new Class({
|
||||
var pos = this.getPosition();
|
||||
var isAtRight = mindplot.util.Shape.isAtRight(targetPosition, pos);
|
||||
var size = this.getSize();
|
||||
return mindplot.util.Shape.calculateRectConnectionPoint(pos, size, !isAtRight);
|
||||
return mindplot.util.Shape.calculateRectConnectionPoint(pos, size, !isAtRight);
|
||||
}
|
||||
});
|
@@ -145,7 +145,7 @@ mindplot.ConnectionLine = new Class({
|
||||
},
|
||||
|
||||
addToWorkspace:function (workspace) {
|
||||
workspace.appendChild(this._line2d);
|
||||
workspace.append(this._line2d);
|
||||
this._line2d.moveToBack();
|
||||
},
|
||||
|
||||
|
@@ -29,30 +29,26 @@ mindplot.ControlPoint = new Class({
|
||||
new web2d.Line({strokeColor:"#6589de", strokeWidth:1, opacity:0.3})];
|
||||
|
||||
this._isBinded = false;
|
||||
var me = this;
|
||||
this._controlPointsController[0].addEvent('mousedown', function(event) {
|
||||
(this._mouseDown.bind(this))(event, mindplot.ControlPoint.FROM);
|
||||
}.bind(this));
|
||||
(me._mouseDown)(event, mindplot.ControlPoint.FROM, me);
|
||||
});
|
||||
this._controlPointsController[0].addEvent('click', function(event) {
|
||||
(this._mouseClick.bind(this))(event);
|
||||
}.bind(this));
|
||||
(me._mouseClick)(event);
|
||||
});
|
||||
this._controlPointsController[0].addEvent('dblclick', function(event) {
|
||||
(this._mouseClick.bind(this))(event);
|
||||
}.bind(this));
|
||||
(me._mouseClick)(event);
|
||||
});
|
||||
|
||||
this._controlPointsController[1].addEvent('mousedown', function(event) {
|
||||
(this._mouseDown.bind(this))(event, mindplot.ControlPoint.TO);
|
||||
}.bind(this));
|
||||
(me._mouseDown)(event, mindplot.ControlPoint.TO, me);
|
||||
});
|
||||
this._controlPointsController[1].addEvent('click', function(event) {
|
||||
(this._mouseClick.bind(this))(event);
|
||||
}.bind(this));
|
||||
(me._mouseClick)(event);
|
||||
});
|
||||
this._controlPointsController[1].addEvent('dblclick', function(event) {
|
||||
(this._mouseClick.bind(this))(event);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
|
||||
setSide : function(side) {
|
||||
this._side = side;
|
||||
(me._mouseClick)(event);
|
||||
});
|
||||
},
|
||||
|
||||
setLine : function(line) {
|
||||
@@ -91,22 +87,21 @@ mindplot.ControlPoint = new Class({
|
||||
|
||||
},
|
||||
|
||||
_mouseDown : function(event, point) {
|
||||
_mouseDown : function(event, point, me) {
|
||||
if (!this._isBinded) {
|
||||
this._isBinded = true;
|
||||
|
||||
this._mouseMoveFunction = function(event) {
|
||||
(this._mouseMoveEvent.bind(this))(event, point);
|
||||
}.bind(this);
|
||||
(me._mouseMoveEvent)(event, point, me);
|
||||
};
|
||||
|
||||
this._workspace.getScreenManager().addEvent('mousemove', this._mouseMoveFunction);
|
||||
this._mouseUpFunction = function(event) {
|
||||
(this._mouseUp.bind(this))(event, point);
|
||||
}.bind(this);
|
||||
(me._mouseUp)(event, point, me);
|
||||
};
|
||||
this._workspace.getScreenManager().addEvent('mouseup', this._mouseUpFunction);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stop();
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
},
|
||||
|
||||
@@ -143,7 +138,7 @@ mindplot.ControlPoint = new Class({
|
||||
|
||||
_mouseClick : function(event) {
|
||||
event.preventDefault();
|
||||
event.stop();
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
},
|
||||
|
||||
@@ -162,10 +157,10 @@ mindplot.ControlPoint = new Class({
|
||||
|
||||
addToWorkspace : function(workspace) {
|
||||
this._workspace = workspace;
|
||||
workspace.appendChild(this._controlPointsController[0]);
|
||||
workspace.appendChild(this._controlPointsController[1]);
|
||||
workspace.appendChild(this._controlLines[0]);
|
||||
workspace.appendChild(this._controlLines[1]);
|
||||
workspace.append(this._controlPointsController[0]);
|
||||
workspace.append(this._controlPointsController[1]);
|
||||
workspace.append(this._controlLines[0]);
|
||||
workspace.append(this._controlLines[1]);
|
||||
},
|
||||
|
||||
removeFromWorkspace : function(workspace) {
|
||||
|
@@ -17,10 +17,11 @@
|
||||
*/
|
||||
|
||||
mindplot.Designer = new Class({
|
||||
Extends:Events,
|
||||
Extends: mindplot.Events,
|
||||
initialize:function (options, divElement) {
|
||||
$assert(options, "options must be defined");
|
||||
$assert(options.zoom, "zoom must be defined");
|
||||
$assert(options.size, "size must be defined");
|
||||
$assert(divElement, "divElement must be defined");
|
||||
|
||||
// Set up i18n location ...
|
||||
@@ -29,15 +30,16 @@ mindplot.Designer = new Class({
|
||||
this._options = options;
|
||||
|
||||
// Set full div elem render area ...
|
||||
divElement.setStyles(options.size);
|
||||
divElement.css(options.size);
|
||||
|
||||
// Dispatcher manager ...
|
||||
var commandContext = new mindplot.CommandContext(this);
|
||||
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
|
||||
|
||||
var me = this;
|
||||
this._actionDispatcher.addEvent("modelUpdate", function (event) {
|
||||
this.fireEvent("modelUpdate", event);
|
||||
}.bind(this));
|
||||
me.fireEvent("modelUpdate", event);
|
||||
});
|
||||
|
||||
mindplot.ActionDispatcher.setInstance(this._actionDispatcher);
|
||||
this._model = new mindplot.DesignerModel(options);
|
||||
@@ -80,13 +82,12 @@ mindplot.Designer = new Class({
|
||||
|
||||
_registerWheelEvents:function () {
|
||||
var workspace = this._workspace;
|
||||
var screenManager = workspace.getScreenManager();
|
||||
|
||||
var me = this;
|
||||
// Zoom In and Zoom Out must active event
|
||||
$(document).addEvent('mousewheel', function (event) {
|
||||
$(document).on('mousewheel', function (event) {
|
||||
// Change mousewheel handling so we let the default
|
||||
//event happen if we are outside the container.
|
||||
var coords = screenManager.getContainer().getCoordinates();
|
||||
// event happen if we are outside the container. -> FIXME: it still happening?
|
||||
/*var coords = screenManager.getContainer().getCoordinates();
|
||||
var isOutsideContainer = event.client.y < coords.top ||
|
||||
event.client.y > coords.bottom ||
|
||||
event.client.x < coords.left ||
|
||||
@@ -100,8 +101,15 @@ mindplot.Designer = new Class({
|
||||
this.zoomOut(1.05);
|
||||
}
|
||||
event.preventDefault();
|
||||
}*/
|
||||
if (event.deltaY > 0) {
|
||||
me.zoomIn(1.05);
|
||||
}
|
||||
}.bind(this));
|
||||
else {
|
||||
me.zoomOut(1.05);
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -124,37 +132,34 @@ mindplot.Designer = new Class({
|
||||
_registerMouseEvents:function () {
|
||||
var workspace = this._workspace;
|
||||
var screenManager = workspace.getScreenManager();
|
||||
|
||||
var me = this;
|
||||
// Initialize workspace event listeners.
|
||||
screenManager.addEvent('update', function () {
|
||||
// Topic must be set to his original state. All editors must be closed.
|
||||
var topics = this.getModel().getTopics();
|
||||
topics.each(function (object) {
|
||||
var topics = me.getModel().getTopics();
|
||||
_.each(topics, function(object){
|
||||
object.closeEditors();
|
||||
});
|
||||
|
||||
// Clean some selected nodes on event ..
|
||||
if (this._cleanScreen)
|
||||
this._cleanScreen();
|
||||
|
||||
}.bind(this));
|
||||
if (me._cleanScreen)
|
||||
me._cleanScreen();
|
||||
});
|
||||
|
||||
// Deselect on click ...
|
||||
screenManager.addEvent('click', function (event) {
|
||||
this.onObjectFocusEvent(null, event);
|
||||
}.bind(this));
|
||||
me.onObjectFocusEvent(null, event);
|
||||
});
|
||||
|
||||
// Create nodes on double click...
|
||||
screenManager.addEvent('dblclick', function (event) {
|
||||
if (workspace.isWorkspaceEventsEnabled()) {
|
||||
|
||||
var mousePos = screenManager.getWorkspaceMousePosition(event);
|
||||
|
||||
var centralTopic = this.getModel().getCentralTopic();
|
||||
var model = this._createChildModel(centralTopic, mousePos);
|
||||
var centralTopic = me.getModel().getCentralTopic();
|
||||
var model = me._createChildModel(centralTopic, mousePos);
|
||||
this._actionDispatcher.addTopics([model], [centralTopic.getId()]);
|
||||
}
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
// Register mouse drag and drop event ...
|
||||
function noopHandler(evt) {
|
||||
@@ -248,13 +253,13 @@ mindplot.Designer = new Class({
|
||||
// Create node graph ...
|
||||
var topic = mindplot.NodeGraph.create(model, {readOnly:readOnly});
|
||||
this.getModel().addTopic(topic);
|
||||
|
||||
var me = this;
|
||||
// Add Topic events ...
|
||||
if (!readOnly) {
|
||||
// If a node had gained focus, clean the rest of the nodes ...
|
||||
topic.addEvent('mousedown', function (event) {
|
||||
this.onObjectFocusEvent(topic, event);
|
||||
}.bind(this));
|
||||
me.onObjectFocusEvent(topic, event);
|
||||
});
|
||||
|
||||
// Register node listeners ...
|
||||
if (topic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
@@ -286,38 +291,38 @@ mindplot.Designer = new Class({
|
||||
}
|
||||
|
||||
topic.addEvent('ontblur', function () {
|
||||
var topics = this.getModel().filterSelectedTopics();
|
||||
var rels = this.getModel().filterSelectedRelationships();
|
||||
var topics = me.getModel().filterSelectedTopics();
|
||||
var rels = me.getModel().filterSelectedRelationships();
|
||||
|
||||
if (topics.length == 0 || rels.length == 0) {
|
||||
this.fireEvent('onblur');
|
||||
me.fireEvent('onblur');
|
||||
}
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
topic.addEvent('ontfocus', function () {
|
||||
var topics = this.getModel().filterSelectedTopics();
|
||||
var rels = this.getModel().filterSelectedRelationships();
|
||||
var topics = me.getModel().filterSelectedTopics();
|
||||
var rels = me.getModel().filterSelectedRelationships();
|
||||
|
||||
if (topics.length == 1 || rels.length == 1) {
|
||||
this.fireEvent('onfocus');
|
||||
me.fireEvent('onfocus');
|
||||
}
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
return topic;
|
||||
return topic;
|
||||
},
|
||||
|
||||
onObjectFocusEvent:function (currentObject, event) {
|
||||
// Close node editors ..
|
||||
var topics = this.getModel().getTopics();
|
||||
topics.each(function (topic) {
|
||||
_.each(topics, function(topic) {
|
||||
topic.closeEditors();
|
||||
});
|
||||
|
||||
var model = this.getModel();
|
||||
var objects = model.getEntities();
|
||||
objects.each(function (object) {
|
||||
_.each(objects, function(object) {
|
||||
// Disable all nodes on focus but not the current if Ctrl key isn't being pressed
|
||||
if (!$defined(event) || (!event.control && !event.meta)) {
|
||||
if (!$defined(event) || (!event.ctrlKey && !event.metaKey)) {
|
||||
if (object.isOnFocus() && object != currentObject) {
|
||||
object.setOnFocus(false);
|
||||
}
|
||||
@@ -329,14 +334,14 @@ mindplot.Designer = new Class({
|
||||
selectAll:function () {
|
||||
var model = this.getModel();
|
||||
var objects = model.getEntities();
|
||||
objects.each(function (object) {
|
||||
_.each(objects, function(object) {
|
||||
object.setOnFocus(true);
|
||||
});
|
||||
},
|
||||
|
||||
deselectAll:function () {
|
||||
var objects = this.getModel().getEntities();
|
||||
objects.each(function (object) {
|
||||
_.each(objects, function (object) {
|
||||
object.setOnFocus(false);
|
||||
});
|
||||
},
|
||||
@@ -506,6 +511,11 @@ mindplot.Designer = new Class({
|
||||
if(borderColor){
|
||||
targetModel.setBorderColor(borderColor)
|
||||
}
|
||||
|
||||
var backgroundColor = sourceModel.getBackgroundColor();
|
||||
if(backgroundColor){
|
||||
targetModel.setBackgroundColor(backgroundColor)
|
||||
}
|
||||
},
|
||||
|
||||
_createChildModel:function (topic, mousePos) {
|
||||
@@ -624,12 +634,13 @@ mindplot.Designer = new Class({
|
||||
// Init layout manager ...
|
||||
var size = {width:25, height:25};
|
||||
var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size);
|
||||
var me = this;
|
||||
layoutManager.addEvent('change', function (event) {
|
||||
var id = event.getId();
|
||||
var topic = this.getModel().findTopicById(id);
|
||||
var topic = me.getModel().findTopicById(id);
|
||||
topic.setPosition(event.getPosition());
|
||||
topic.setOrder(event.getOrder());
|
||||
}.bind(this));
|
||||
});
|
||||
this._eventBussDispatcher.setLayoutManager(layoutManager);
|
||||
|
||||
|
||||
@@ -686,7 +697,7 @@ mindplot.Designer = new Class({
|
||||
var nodeGraph = this._buildNodeGraph(nodeModel, this.isReadOnly());
|
||||
nodeGraph.setVisibility(false);
|
||||
|
||||
this._workspace.appendChild(nodeGraph);
|
||||
this._workspace.append(nodeGraph);
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
if ($defined(child))
|
||||
@@ -709,7 +720,7 @@ mindplot.Designer = new Class({
|
||||
|
||||
result.setVisibility(sourceTopic.isVisible() && targetTopic.isVisible());
|
||||
|
||||
this._workspace.appendChild(result);
|
||||
this._workspace.append(result);
|
||||
return result;
|
||||
},
|
||||
|
||||
@@ -747,24 +758,25 @@ mindplot.Designer = new Class({
|
||||
|
||||
// Build relationship line ....
|
||||
var result = new mindplot.Relationship(sourceTopic, targetTopic, model);
|
||||
var me = this;
|
||||
|
||||
result.addEvent('ontblur', function () {
|
||||
var topics = this.getModel().filterSelectedTopics();
|
||||
var rels = this.getModel().filterSelectedRelationships();
|
||||
var topics = me.getModel().filterSelectedTopics();
|
||||
var rels = me.getModel().filterSelectedRelationships();
|
||||
|
||||
if (topics.length == 0 || rels.length == 0) {
|
||||
this.fireEvent('onblur');
|
||||
me.fireEvent('onblur');
|
||||
}
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
result.addEvent('ontfocus', function () {
|
||||
var topics = this.getModel().filterSelectedTopics();
|
||||
var rels = this.getModel().filterSelectedRelationships();
|
||||
var topics = me.getModel().filterSelectedTopics();
|
||||
var rels = me.getModel().filterSelectedRelationships();
|
||||
|
||||
if (topics.length == 1 || rels.length == 1) {
|
||||
this.fireEvent('onfocus');
|
||||
me.fireEvent('onfocus');
|
||||
}
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
// Append it to the workspace ...
|
||||
dmodel.addRelationship(result);
|
||||
|
@@ -17,11 +17,10 @@
|
||||
*/
|
||||
|
||||
mindplot.DesignerKeyboard = new Class({
|
||||
Extends:Keyboard,
|
||||
Extends: mindplot.Keyboard,
|
||||
Static:{
|
||||
register:function (designer) {
|
||||
this._instance = new mindplot.DesignerKeyboard(designer);
|
||||
this._instance.activate();
|
||||
},
|
||||
|
||||
getInstance:function () {
|
||||
@@ -31,360 +30,250 @@ mindplot.DesignerKeyboard = new Class({
|
||||
|
||||
initialize:function (designer) {
|
||||
$assert(designer, "designer can not be null");
|
||||
this.parent({defaultEventType:'keydown'});
|
||||
this._registerEvents(designer);
|
||||
},
|
||||
|
||||
|
||||
_registerEvents:function (designer) {
|
||||
|
||||
// Try with the keyboard ..
|
||||
var model = designer.getModel();
|
||||
var keyboardEvents = {
|
||||
'backspace':function (event) {
|
||||
this.addShortcut(
|
||||
['backspace'], function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.deleteSelectedEntities();
|
||||
|
||||
}.bind(this),
|
||||
|
||||
'space':function () {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['space'], function() {
|
||||
designer.shrinkSelectedBranch();
|
||||
}.bind(this),
|
||||
|
||||
'f2':function () {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['f2'],function() {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
node.showTextEditor();
|
||||
}
|
||||
}.bind(this),
|
||||
|
||||
'delete':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['del'], function(event) {
|
||||
designer.deleteSelectedEntities();
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'enter':function () {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['enter'], function() {
|
||||
designer.createSiblingForSelectedNode();
|
||||
}.bind(this),
|
||||
|
||||
'insert':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['insert'], function(event) {
|
||||
designer.createChildForSelectedNode();
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'tab':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['tab'], function(event) {
|
||||
designer.createChildForSelectedNode();
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'-':function () { // "-" is a insert on several Browsers. Don't ask why ...
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
'-', function() { // "-" is a insert on several Browsers. Don't ask why ...
|
||||
designer.createChildForSelectedNode();
|
||||
}.bind(this),
|
||||
|
||||
'meta+enter':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['meta+enter'], function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
designer.createChildForSelectedNode();
|
||||
|
||||
}.bind(this),
|
||||
|
||||
'ctrl+z':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['ctrl+z', 'meta+z'], function(event) {
|
||||
event.preventDefault(event);
|
||||
event.stopPropagation();
|
||||
designer.undo();
|
||||
}.bind(this),
|
||||
|
||||
'meta+z':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.undo();
|
||||
|
||||
}.bind(this),
|
||||
|
||||
'ctrl+c':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['ctrl+c', 'meta+c'], function (event) {
|
||||
event.preventDefault(event);
|
||||
event.stopPropagation();
|
||||
designer.copyToClipboard();
|
||||
}.bind(this),
|
||||
|
||||
'meta+c':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.copyToClipboard();
|
||||
|
||||
}.bind(this),
|
||||
|
||||
'ctrl+v':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['ctrl+v', 'meta+v'], function (event) {
|
||||
event.preventDefault(event);
|
||||
event.stopPropagation();
|
||||
|
||||
designer.pasteClipboard();
|
||||
}.bind(this),
|
||||
|
||||
'meta+v':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['ctrl+shift+z', 'meta+shift+z', 'ctrl+y', 'meta+y'], function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.pasteClipboard();
|
||||
|
||||
}.bind(this),
|
||||
|
||||
'ctrl+z+shift':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.redo();
|
||||
}.bind(this),
|
||||
|
||||
'meta+z+shift':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['ctrl+a', 'meta+a'], function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.redo();
|
||||
}.bind(this),
|
||||
|
||||
'ctrl+y':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.redo();
|
||||
|
||||
}.bind(this),
|
||||
|
||||
'meta+y':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.redo();
|
||||
|
||||
}.bind(this),
|
||||
|
||||
'ctrl+a':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.selectAll();
|
||||
},
|
||||
|
||||
'ctrl+b':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['ctrl+b', 'meta+b'], function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.changeFontWeight();
|
||||
},
|
||||
|
||||
'meta+b':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['ctrl+s', 'meta+s'], function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.changeFontWeight();
|
||||
},
|
||||
|
||||
'ctrl+s':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$('save').fireEvent('click');
|
||||
},
|
||||
|
||||
'meta+s':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
$('save').fireEvent('click');
|
||||
},
|
||||
|
||||
'ctrl+i':function (event) {
|
||||
$(document).find('#save').trigger('click');
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['ctrl+i', 'meta+i'], function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.changeFontStyle();
|
||||
},
|
||||
|
||||
'meta+i':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.changeFontStyle();
|
||||
},
|
||||
|
||||
'meta+shift+a':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['ctrl+shift+a', 'meta+shift+a'], function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.deselectAll();
|
||||
},
|
||||
|
||||
'ctrl+shift+a':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.deselectAll();
|
||||
},
|
||||
|
||||
'meta+a':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.selectAll();
|
||||
},
|
||||
|
||||
'meta+=':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['meta+=', 'ctrl+='], function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.zoomIn();
|
||||
},
|
||||
|
||||
'meta+-':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
['meta+-', 'ctrl+-'], function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.zoomOut();
|
||||
},
|
||||
|
||||
'ctrl+=':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.zoomIn();
|
||||
},
|
||||
|
||||
'ctrl+-':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.zoomOut();
|
||||
},
|
||||
|
||||
|
||||
'right':function (event) {
|
||||
}
|
||||
);
|
||||
var me = this;
|
||||
this.addShortcut(
|
||||
'right', function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (node.isCentralTopic()) {
|
||||
this._goToSideChild(designer, node, 'RIGHT');
|
||||
me._goToSideChild(designer, node, 'RIGHT');
|
||||
}
|
||||
else {
|
||||
if (node.getPosition().x < 0) {
|
||||
this._goToParent(designer, node);
|
||||
me._goToParent(designer, node);
|
||||
}
|
||||
else if (!node.areChildrenShrunken()) {
|
||||
this._goToChild(designer, node);
|
||||
me._goToChild(designer, node);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var centralTopic = model.getCentralTopic();
|
||||
this._goToNode(designer, centralTopic);
|
||||
me._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'left':function (event) {
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
'left', function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (node.isCentralTopic()) {
|
||||
this._goToSideChild(designer, node, 'LEFT');
|
||||
me._goToSideChild(designer, node, 'LEFT');
|
||||
}
|
||||
else {
|
||||
if (node.getPosition().x > 0) {
|
||||
this._goToParent(designer, node);
|
||||
me._goToParent(designer, node);
|
||||
}
|
||||
else if (!node.areChildrenShrunken()) {
|
||||
this._goToChild(designer, node);
|
||||
me._goToChild(designer, node);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var centralTopic = model.getCentralTopic();
|
||||
this._goToNode(designer, centralTopic);
|
||||
me._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'up':function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (!node.isCentralTopic()) {
|
||||
this._goToBrother(designer, node, 'UP');
|
||||
}
|
||||
} else {
|
||||
var centralTopic = model.getCentralTopic();
|
||||
this._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'down':function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (!node.isCentralTopic()) {
|
||||
this._goToBrother(designer, node, 'DOWN');
|
||||
}
|
||||
} else {
|
||||
var centralTopic = model.getCentralTopic();
|
||||
this._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this)
|
||||
};
|
||||
this.addEvents(keyboardEvents);
|
||||
|
||||
var regex = /^(?:shift|control|ctrl|alt|meta)$/;
|
||||
var modifiers = ['shift', 'control', 'alt', 'meta'];
|
||||
|
||||
var excludes = ['esc', 'capslock', 'tab', 'f1', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12', 'backspace', 'down', 'up', 'left', 'right', 'control'];
|
||||
if (!Browser.Platform.mac) {
|
||||
// This is to avoid enter on edition mode in the node when alt+tab is pressed.
|
||||
excludes.push("alt");
|
||||
}
|
||||
|
||||
$(document).addEvent('keydown', function (event) {
|
||||
|
||||
// Convert key to mootools keyboard event format...
|
||||
var keys = [];
|
||||
modifiers.each(function (mod) {
|
||||
if (event[mod]) keys.push(mod);
|
||||
});
|
||||
if (!regex.test(event.key))
|
||||
keys.push(event.key);
|
||||
var key = keys.join('+');
|
||||
|
||||
// Is the pressed key one of the already registered in the keyboard ?
|
||||
var isRegistered = false;
|
||||
for (var eKey in keyboardEvents) {
|
||||
if (eKey == key) {
|
||||
isRegistered = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
'up', function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (!node.isCentralTopic()) {
|
||||
me._goToBrother(designer, node, 'UP');
|
||||
}
|
||||
} else {
|
||||
var centralTopic = model.getCentralTopic();
|
||||
me._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
);
|
||||
this.addShortcut(
|
||||
'down', function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (!node.isCentralTopic()) {
|
||||
me._goToBrother(designer, node, 'DOWN');
|
||||
}
|
||||
} else {
|
||||
var centralTopic = model.getCentralTopic();
|
||||
me._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
);
|
||||
|
||||
// If it's not registered, let's
|
||||
if (!isRegistered && !excludes.contains(key) && !excludes.contains(event.key) && !event.meta && !event.control) {
|
||||
$(document).on('keypress', function (event) {
|
||||
|
||||
var keyCode = event.keyCode;
|
||||
|
||||
var specialKey = jQuery.hotkeys.specialKeys[keyCode];
|
||||
if (["enter", "capslock"].indexOf(specialKey) == -1 && !jQuery.hotkeys.shiftNums[keyCode] && keyCode != 91 /*win key*/) {
|
||||
var nodes = designer.getModel().filterSelectedTopics();
|
||||
if (nodes.length > 0) {
|
||||
|
||||
// If a modifier is press, the key selected must be ignored.
|
||||
var pressKey = event.key;
|
||||
if (modifiers.contains(event.key)) {
|
||||
pressKey = "";
|
||||
var pressKey = String.fromCharCode(keyCode);
|
||||
if (event.ctrlKey || event.altKey || event.metaKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
nodes[0].showTextEditor(pressKey);
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
mindplot.DesignerModel = new Class({
|
||||
Implements:[Events],
|
||||
Implements:[mindplot.Events],
|
||||
initialize:function (options) {
|
||||
this._zoom = options.zoom;
|
||||
this._topics = [];
|
||||
|
@@ -84,15 +84,16 @@ mindplot.DragConnector = new Class({
|
||||
// - Horizontal proximity
|
||||
// - It's already connected.
|
||||
var currentConnection = dragTopic.getConnectedToTopic();
|
||||
var me = this;
|
||||
topics = topics.sort(function (a, b) {
|
||||
var aPos = a.getPosition();
|
||||
var bPos = b.getPosition();
|
||||
|
||||
var av = this._isVerticallyAligned(a.getSize(), aPos, sPos);
|
||||
var bv = this._isVerticallyAligned(b.getSize(), bPos, sPos);
|
||||
return this._proximityWeight(av, a, sPos, currentConnection) - this._proximityWeight(bv, b, sPos, currentConnection);
|
||||
var av = me._isVerticallyAligned(a.getSize(), aPos, sPos);
|
||||
var bv = me._isVerticallyAligned(b.getSize(), bPos, sPos);
|
||||
return me._proximityWeight(av, a, sPos, currentConnection) - me._proximityWeight(bv, b, sPos, currentConnection);
|
||||
|
||||
}.bind(this));
|
||||
});
|
||||
return topics;
|
||||
},
|
||||
|
||||
|
@@ -31,14 +31,14 @@ mindplot.DragManager = new Class({
|
||||
var workspace = this._workspace;
|
||||
var screen = workspace.getScreenManager();
|
||||
var dragManager = this;
|
||||
|
||||
var me = this;
|
||||
var mouseDownListener = function(event) {
|
||||
if (workspace.isWorkspaceEventsEnabled()) {
|
||||
// Disable double drag...
|
||||
workspace.enableWorkspaceEvents(false);
|
||||
|
||||
// Set initial position.
|
||||
var layoutManager = this._eventDispatcher.getLayoutManager();
|
||||
var layoutManager = me._eventDispatcher.getLayoutManager();
|
||||
var dragNode = node.createDragNode(layoutManager);
|
||||
|
||||
// Register mouse move listener ...
|
||||
@@ -52,7 +52,7 @@ mindplot.DragManager = new Class({
|
||||
// Change cursor.
|
||||
window.document.body.style.cursor = 'move';
|
||||
}
|
||||
}.bind(this);
|
||||
};
|
||||
node.addEvent('mousedown', mouseDownListener);
|
||||
},
|
||||
|
||||
@@ -70,18 +70,18 @@ mindplot.DragManager = new Class({
|
||||
|
||||
_buildMouseMoveListener : function(workspace, dragNode, dragManager) {
|
||||
var screen = workspace.getScreenManager();
|
||||
|
||||
var me = this;
|
||||
var result = function(event) {
|
||||
|
||||
if (!this._isDragInProcess) {
|
||||
if (!me._isDragInProcess) {
|
||||
// Execute Listeners ..
|
||||
var startDragListener = dragManager._listeners['startdragging'];
|
||||
startDragListener(event, dragNode);
|
||||
|
||||
// Add shadow node to the workspace.
|
||||
workspace.appendChild(dragNode);
|
||||
workspace.append(dragNode);
|
||||
|
||||
this._isDragInProcess = true;
|
||||
me._isDragInProcess = true;
|
||||
}
|
||||
|
||||
var pos = screen.getWorkspaceMousePosition(event);
|
||||
@@ -95,13 +95,14 @@ mindplot.DragManager = new Class({
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
}.bind(this);
|
||||
};
|
||||
dragManager._mouseMoveListener = result;
|
||||
return result;
|
||||
},
|
||||
|
||||
_buildMouseUpListener : function(workspace, node, dragNode, dragManager) {
|
||||
var screen = workspace.getScreenManager();
|
||||
var me = this;
|
||||
var result = function(event) {
|
||||
$assert(dragNode.isDragTopic, 'dragNode must be an DragTopic');
|
||||
|
||||
@@ -117,7 +118,7 @@ mindplot.DragManager = new Class({
|
||||
// Change the cursor to the default.
|
||||
window.document.body.style.cursor = 'default';
|
||||
|
||||
if (this._isDragInProcess) {
|
||||
if (me._isDragInProcess) {
|
||||
|
||||
// Execute Listeners only if the node has been moved.
|
||||
var endDragListener = dragManager._listeners['enddragging'];
|
||||
@@ -126,11 +127,11 @@ mindplot.DragManager = new Class({
|
||||
// Remove drag node from the workspace.
|
||||
dragNode.removeFromWorkspace(workspace);
|
||||
|
||||
this._isDragInProcess = false;
|
||||
me._isDragInProcess = false;
|
||||
}
|
||||
|
||||
|
||||
}.bind(this);
|
||||
};
|
||||
dragManager._mouseUpListener = result;
|
||||
return result;
|
||||
},
|
||||
|
@@ -146,27 +146,27 @@ mindplot.DragPivot = new Class({
|
||||
|
||||
addToWorkspace : function(workspace) {
|
||||
var pivotRect = this._getPivotRect();
|
||||
workspace.appendChild(pivotRect);
|
||||
workspace.append(pivotRect);
|
||||
|
||||
var connectToRect = this._connectRect;
|
||||
workspace.appendChild(connectToRect);
|
||||
workspace.append(connectToRect);
|
||||
|
||||
// Add a hidden straight line ...
|
||||
var straighLine = this._straightLine;
|
||||
straighLine.setVisibility(false);
|
||||
workspace.appendChild(straighLine);
|
||||
workspace.append(straighLine);
|
||||
straighLine.moveToBack();
|
||||
|
||||
// Add a hidden curved line ...
|
||||
var curvedLine = this._curvedLine;
|
||||
curvedLine.setVisibility(false);
|
||||
workspace.appendChild(curvedLine);
|
||||
workspace.append(curvedLine);
|
||||
curvedLine.moveToBack();
|
||||
|
||||
// Add a connect rect ...
|
||||
var connectRect = this._connectRect;
|
||||
connectRect.setVisibility(false);
|
||||
workspace.appendChild(connectRect);
|
||||
workspace.append(connectRect);
|
||||
connectRect.moveToBack();
|
||||
},
|
||||
|
||||
|
@@ -67,7 +67,7 @@ mindplot.DragTopic = new Class({
|
||||
},
|
||||
|
||||
updateFreeLayout:function (event) {
|
||||
var isFreeEnabled = (event.meta && Browser.Platform.mac) || (event.control && !Browser.Platform.mac);
|
||||
var isFreeEnabled = (event.metaKey && Browser.Platform.mac) || (event.ctrlKey && !Browser.Platform.mac);
|
||||
if (this.isFreeLayoutOn() != isFreeEnabled) {
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.setVisibility(!isFreeEnabled);
|
||||
@@ -133,7 +133,7 @@ mindplot.DragTopic = new Class({
|
||||
|
||||
addToWorkspace:function (workspace) {
|
||||
if (!this._isInWorkspace) {
|
||||
workspace.appendChild(this._elem2d);
|
||||
workspace.append(this._elem2d);
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.addToWorkspace(workspace);
|
||||
this._isInWorkspace = true;
|
||||
@@ -201,7 +201,7 @@ mindplot.DragTopic.init = function (workspace) {
|
||||
|
||||
$assert(workspace, "workspace can not be null");
|
||||
var pivot = mindplot.DragTopic.__getDragPivot();
|
||||
workspace.appendChild(pivot);
|
||||
workspace.append(pivot);
|
||||
};
|
||||
|
||||
mindplot.DragTopic.__getDragPivot = function () {
|
||||
|
41
mindplot/src/main/javascript/Events.js
Normal file
@@ -0,0 +1,41 @@
|
||||
mindplot.Events = new Class({
|
||||
|
||||
$events: {},
|
||||
|
||||
_removeOn: function(string){
|
||||
return string.replace(/^on([A-Z])/, function(full, first){
|
||||
return first.toLowerCase();
|
||||
});
|
||||
},
|
||||
|
||||
addEvent: function(type, fn, internal){
|
||||
type = this._removeOn(type);
|
||||
|
||||
this.$events[type] = (this.$events[type] || []).include(fn);
|
||||
if (internal) fn.internal = true;
|
||||
return this;
|
||||
},
|
||||
|
||||
fireEvent: function(type, args, delay){
|
||||
type = this._removeOn(type);
|
||||
var events = this.$events[type];
|
||||
if (!events) return this;
|
||||
args = Array.from(args);
|
||||
_.each(events, function(fn){
|
||||
if (delay) fn.delay(delay, this, args);
|
||||
else fn.apply(this, args);
|
||||
}, this);
|
||||
return this;
|
||||
},
|
||||
|
||||
removeEvent: function(type, fn){
|
||||
type = this._removeOn(type);
|
||||
var events = this.$events[type];
|
||||
if (events && !fn.internal){
|
||||
var index = events.indexOf(fn);
|
||||
if (index != -1) events.splice(index, 1);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
@@ -62,7 +62,7 @@ mindplot.IconGroup = new Class({
|
||||
this._positionIcon(icon, this._icons.length - 1);
|
||||
|
||||
var imageShape = icon.getImage();
|
||||
this._group.appendChild(imageShape);
|
||||
this._group.append(imageShape);
|
||||
|
||||
// Register event for the group ..
|
||||
if (remove) {
|
||||
@@ -72,7 +72,7 @@ mindplot.IconGroup = new Class({
|
||||
|
||||
_findIconFromModel:function (iconModel) {
|
||||
var result = null;
|
||||
this._icons.each(function (icon) {
|
||||
_.each(this._icons, function (icon) {
|
||||
var elModel = icon.getModel();
|
||||
if (elModel.getId() == iconModel.getId()) {
|
||||
result = icon;
|
||||
@@ -101,11 +101,11 @@ mindplot.IconGroup = new Class({
|
||||
|
||||
this._icons.erase(icon);
|
||||
this._resize(this._icons.length);
|
||||
|
||||
var me = this;
|
||||
// Add all again ...
|
||||
this._icons.each(function (elem, i) {
|
||||
this._positionIcon(elem, i);
|
||||
}.bind(this));
|
||||
_.each(this._icons, function (elem, i) {
|
||||
me._positionIcon(elem, i);
|
||||
});
|
||||
},
|
||||
|
||||
moveToFront:function () {
|
||||
@@ -166,16 +166,18 @@ mindplot.IconGroup.RemoveTip = new Class({
|
||||
icon.remove();
|
||||
});
|
||||
|
||||
var me = this;
|
||||
|
||||
widget.addEvent('mouseover', function () {
|
||||
this.show(topicId, icon);
|
||||
}.bind(this));
|
||||
me.show(topicId, icon);
|
||||
});
|
||||
|
||||
widget.addEvent('mouseout', function () {
|
||||
this.hide();
|
||||
}.bind(this));
|
||||
me.hide();
|
||||
});
|
||||
|
||||
widget.setPosition(pos.x + 80, pos.y - 50);
|
||||
this._fadeElem.appendChild(widget);
|
||||
this._fadeElem.append(widget);
|
||||
|
||||
// Setup current element ...
|
||||
this._activeIcon = icon;
|
||||
@@ -197,17 +199,15 @@ mindplot.IconGroup.RemoveTip = new Class({
|
||||
clearTimeout(this._closeTimeoutId)
|
||||
}
|
||||
|
||||
var me = this;
|
||||
if (this._activeIcon) {
|
||||
var widget = this._widget;
|
||||
var close = function () {
|
||||
|
||||
this._activeIcon = null;
|
||||
this._fadeElem.removeChild(widget);
|
||||
this._widget = null;
|
||||
|
||||
this._closeTimeoutId = null;
|
||||
|
||||
}.bind(this);
|
||||
me._activeIcon = null;
|
||||
me._fadeElem.removeChild(widget);
|
||||
me._widget = null;
|
||||
me._closeTimeoutId = null;
|
||||
};
|
||||
|
||||
if (!$defined(delay) || delay == 0) {
|
||||
close();
|
||||
@@ -236,7 +236,7 @@ mindplot.IconGroup.RemoveTip = new Class({
|
||||
stroke:'0',
|
||||
fillColor:'black'
|
||||
});
|
||||
result.appendChild(outerRect);
|
||||
result.append(outerRect);
|
||||
outerRect.setCursor('pointer');
|
||||
|
||||
var innerRect = new web2d.Rect(0, {
|
||||
@@ -247,17 +247,17 @@ mindplot.IconGroup.RemoveTip = new Class({
|
||||
stroke:'1 solid white',
|
||||
fillColor:'gray'
|
||||
});
|
||||
result.appendChild(innerRect);
|
||||
result.append(innerRect);
|
||||
|
||||
var line = new web2d.Line({stroke:'1 solid white'});
|
||||
line.setFrom(1, 1);
|
||||
line.setTo(9, 9);
|
||||
result.appendChild(line);
|
||||
result.append(line);
|
||||
|
||||
var line2 = new web2d.Line({stroke:'1 solid white'});
|
||||
line2.setFrom(1, 9);
|
||||
line2.setTo(9, 1);
|
||||
result.appendChild(line2);
|
||||
result.append(line2);
|
||||
|
||||
// Some events ...
|
||||
result.addEvent('mouseover', function () {
|
||||
@@ -273,14 +273,16 @@ mindplot.IconGroup.RemoveTip = new Class({
|
||||
|
||||
decorate:function (topicId, icon) {
|
||||
|
||||
var me = this;
|
||||
|
||||
if (!icon.__remove) {
|
||||
icon.addEvent('mouseover', function () {
|
||||
this.show(topicId, icon);
|
||||
}.bind(this));
|
||||
me.show(topicId, icon);
|
||||
});
|
||||
|
||||
icon.addEvent('mouseout', function () {
|
||||
this.hide();
|
||||
}.bind(this));
|
||||
me.hide();
|
||||
});
|
||||
icon.__remove = true;
|
||||
}
|
||||
}
|
||||
|
@@ -34,16 +34,17 @@ mindplot.ImageIcon = new Class({
|
||||
|
||||
//Icon
|
||||
var image = this.getImage();
|
||||
var me = this;
|
||||
image.addEvent('click', function () {
|
||||
|
||||
var iconType = iconModel.getIconType();
|
||||
var newIconType = this._getNextFamilyIconId(iconType);
|
||||
var newIconType = me._getNextFamilyIconId(iconType);
|
||||
iconModel.setIconType(newIconType);
|
||||
|
||||
var imgUrl = this._getImageUrl(newIconType);
|
||||
this._image.setHref(imgUrl);
|
||||
var imgUrl = me._getImageUrl(newIconType);
|
||||
me._image.setHref(imgUrl);
|
||||
|
||||
}.bind(this));
|
||||
});
|
||||
this._image.setCursor('pointer');
|
||||
}
|
||||
},
|
||||
|
33
mindplot/src/main/javascript/Keyboard.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
mindplot.Keyboard = new Class({
|
||||
|
||||
initialize:function () {
|
||||
},
|
||||
|
||||
addShortcut: function(shortcuts, callback) {
|
||||
if (!$.isArray(shortcuts)) {
|
||||
shortcuts = [shortcuts];
|
||||
}
|
||||
_.each(shortcuts, function(shortcut) {
|
||||
$(document).bind('keydown', shortcut, callback);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
@@ -33,16 +33,30 @@ mindplot.LinkIcon = new Class({
|
||||
|
||||
_registerEvents:function () {
|
||||
this._image.setCursor('pointer');
|
||||
this._tip = new mindplot.widget.LinkIconTooltip(this);
|
||||
|
||||
var me = this;
|
||||
if (!this._readOnly) {
|
||||
// Add on click event to open the editor ...
|
||||
this.addEvent('click', function (event) {
|
||||
this._topic.showLinkEditor();
|
||||
me._tip.hide();
|
||||
me._topic.showLinkEditor();
|
||||
event.stopPropagation();
|
||||
}.bind(this));
|
||||
});
|
||||
//FIXME: we shouldn't have timeout of that..
|
||||
this.addEvent("mouseleave", function(event) {
|
||||
window.setTimeout(function() {
|
||||
if (!$("#linkPopover:hover").length) {
|
||||
me._tip.hide();
|
||||
}
|
||||
event.stopPropagation();
|
||||
}, 100)
|
||||
});
|
||||
}
|
||||
|
||||
this._tip = new mindplot.widget.LinkIconTooltip(this);
|
||||
$(this.getImage()._peer._native).mouseenter(function() {
|
||||
me._tip.show();
|
||||
})
|
||||
},
|
||||
|
||||
getModel:function () {
|
||||
|
@@ -35,25 +35,23 @@ mindplot.LocalStorageManager = new Class({
|
||||
loadMapDom:function (mapId) {
|
||||
var xml = localStorage.getItem(mapId + "-xml");
|
||||
if (xml == null || this.forceLoad) {
|
||||
var xmlRequest = new Request({
|
||||
url:this.documentUrl.replace("{id}", mapId),
|
||||
$.ajax({
|
||||
url: this.documentUrl.replace("{id}", mapId),
|
||||
headers:{"Content-Type":"text/plain","Accept":"application/xml"},
|
||||
method:'get',
|
||||
async:false,
|
||||
onSuccess:function (responseText) {
|
||||
xml = responseText;
|
||||
type:'get',
|
||||
dataType: "text",
|
||||
async: false,
|
||||
success:function (response) {
|
||||
xml = response;
|
||||
}
|
||||
});
|
||||
xmlRequest.send();
|
||||
|
||||
// If I could not load it from a file, hard code one.
|
||||
if (xml == null) {
|
||||
throw new Error("Map could not be loaded");
|
||||
}
|
||||
}
|
||||
|
||||
var parser = new DOMParser();
|
||||
return parser.parseFromString(xml, "text/xml");
|
||||
return jQuery.parseXML(xml);
|
||||
},
|
||||
|
||||
unlockMap:function (mindmap) {
|
||||
|
@@ -42,7 +42,7 @@ mindplot.MainTopic = new Class({
|
||||
// Create group ...
|
||||
var groupAttributes = {width:100, height:100, coordSizeWidth:100, coordSizeHeight:100};
|
||||
var group = new web2d.Group(groupAttributes);
|
||||
group.appendChild(innerShape);
|
||||
group.append(innerShape);
|
||||
|
||||
// Add Text ...
|
||||
if (this.getShapeType() != mindplot.model.TopicShape.IMAGE) {
|
||||
@@ -50,7 +50,7 @@ mindplot.MainTopic = new Class({
|
||||
var text = this.getText();
|
||||
textShape.setText(text);
|
||||
textShape.setOpacity(0.5);
|
||||
group.appendChild(textShape);
|
||||
group.append(textShape);
|
||||
}
|
||||
return group;
|
||||
},
|
||||
|
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
mindplot.MultilineTextEditor = new Class({
|
||||
Extends:Events,
|
||||
Extends: mindplot.Events,
|
||||
initialize:function () {
|
||||
this._topic = null;
|
||||
this._timeoutId = -1;
|
||||
@@ -25,47 +25,42 @@ mindplot.MultilineTextEditor = new Class({
|
||||
|
||||
_buildEditor:function () {
|
||||
|
||||
var result = new Element('div');
|
||||
result.setStyles({
|
||||
position:"absolute",
|
||||
var result = $('<div></div>')
|
||||
.attr('id', 'textContainer')
|
||||
.css({
|
||||
display:"none",
|
||||
zIndex:"8",
|
||||
overflow:"hidden",
|
||||
border:"0 none"
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
var textareaElem = new Element('textarea',
|
||||
{ tabindex:'-1',
|
||||
value:"",
|
||||
wrap:'off'
|
||||
}
|
||||
);
|
||||
|
||||
textareaElem.setStyles({
|
||||
border:"1px gray dashed",
|
||||
background:"rgba(98, 135, 167, .3)",
|
||||
outline:'0 none',
|
||||
resize:'none',
|
||||
overflow:"hidden"
|
||||
});
|
||||
textareaElem.inject(result);
|
||||
var textareaElem = $('<textarea tabindex="-1" value="" wrap="off" ></textarea>')
|
||||
.css({
|
||||
border:"1px gray dashed",
|
||||
background:"rgba(98, 135, 167, .3)",
|
||||
outline:'0 none',
|
||||
resize:'none',
|
||||
overflow:"hidden"
|
||||
});
|
||||
|
||||
result.append(textareaElem);
|
||||
return result;
|
||||
},
|
||||
|
||||
_registerEvents:function (containerElem) {
|
||||
var textareaElem = this._getTextareaElem();
|
||||
|
||||
textareaElem.addEvent('keydown', function (event) {
|
||||
switch (event.key) {
|
||||
var me = this;
|
||||
textareaElem.on('keydown', function (event) {
|
||||
switch (jQuery.hotkeys.specialKeys[event.keyCode]) {
|
||||
case 'esc':
|
||||
this.close(false);
|
||||
me.close(false);
|
||||
break;
|
||||
case 'enter':
|
||||
if (event.meta || event.control) {
|
||||
if (event.metaKey || event.ctrlKey) {
|
||||
|
||||
// Add return ...
|
||||
var text = textareaElem.value;
|
||||
var text = textareaElem.val();
|
||||
var cursorPosition = text.length;
|
||||
if (textareaElem.selectionStart) {
|
||||
cursorPosition = textareaElem.selectionStart;
|
||||
@@ -76,12 +71,12 @@ mindplot.MultilineTextEditor = new Class({
|
||||
if (cursorPosition < text.length) {
|
||||
tail = text.substring(cursorPosition, text.length);
|
||||
}
|
||||
textareaElem.value = head + "\n" + tail;
|
||||
textareaElem.val(head + "\n" + tail);
|
||||
|
||||
// Position cursor ...
|
||||
if (textareaElem.setSelectionRange) {
|
||||
if (textareaElem[0].setSelectionRange) {
|
||||
textareaElem.focus();
|
||||
textareaElem.setSelectionRange(cursorPosition + 1, cursorPosition + 1);
|
||||
textareaElem[0].setSelectionRange(cursorPosition + 1, cursorPosition + 1);
|
||||
} else if (textareaElem.createTextRange) {
|
||||
var range = textareaElem.createTextRange();
|
||||
range.moveStart('character', cursorPosition + 1);
|
||||
@@ -90,31 +85,31 @@ mindplot.MultilineTextEditor = new Class({
|
||||
|
||||
}
|
||||
else {
|
||||
this.close(true);
|
||||
me.close(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
event.stopPropagation();
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
textareaElem.addEvent('keypress', function (event) {
|
||||
textareaElem.on('keypress', function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
textareaElem.addEvent('keyup', function (event) {
|
||||
var text = this._getTextareaElem().value;
|
||||
this.fireEvent('input', [event, text]);
|
||||
this._adjustEditorSize();
|
||||
}.bind(this));
|
||||
textareaElem.on('keyup', function (event) {
|
||||
var text = me._getTextareaElem().val();
|
||||
me.fireEvent('input', [event, text]);
|
||||
me._adjustEditorSize();
|
||||
});
|
||||
|
||||
// If the user clicks on the input, all event must be ignored ...
|
||||
containerElem.addEvent('click', function (event) {
|
||||
containerElem.on('click', function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
containerElem.addEvent('dblclick', function (event) {
|
||||
containerElem.on('dblclick', function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
containerElem.addEvent('mousedown', function (event) {
|
||||
containerElem.on('mousedown', function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
},
|
||||
@@ -124,25 +119,25 @@ mindplot.MultilineTextEditor = new Class({
|
||||
if (this.isVisible()) {
|
||||
var textElem = this._getTextareaElem();
|
||||
|
||||
var lines = textElem.value.split('\n');
|
||||
var lines = textElem.val().split('\n');
|
||||
var maxLineLength = 1;
|
||||
lines.each(function (line) {
|
||||
_.each(lines, function (line) {
|
||||
if (maxLineLength < line.length)
|
||||
maxLineLength = line.length;
|
||||
});
|
||||
|
||||
textElem.setAttribute('cols', maxLineLength);
|
||||
textElem.setAttribute('rows', lines.length);
|
||||
textElem.attr('cols', maxLineLength);
|
||||
textElem.attr('rows', lines.length);
|
||||
|
||||
this._containerElem.setStyles({
|
||||
this._containerElem.css({
|
||||
width:(maxLineLength + 3) + 'em',
|
||||
height:textElem.getSize().height
|
||||
height:textElem.height()
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
isVisible:function () {
|
||||
return $defined(this._containerElem) && this._containerElem.getStyle('display') == 'block';
|
||||
return $defined(this._containerElem) && this._containerElem.css('display') == 'block';
|
||||
},
|
||||
|
||||
_updateModel:function () {
|
||||
@@ -156,7 +151,7 @@ mindplot.MultilineTextEditor = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
show:function (topic, text) {
|
||||
show: function (topic, text) {
|
||||
// Close a previous node editor if it's opened ...
|
||||
if (this._topic) {
|
||||
this.close(false);
|
||||
@@ -166,7 +161,7 @@ mindplot.MultilineTextEditor = new Class({
|
||||
if (!this.isVisible()) {
|
||||
//Create editor ui
|
||||
var containerElem = this._buildEditor();
|
||||
containerElem.inject($(document.body));
|
||||
$('body').append(containerElem);
|
||||
|
||||
this._containerElem = containerElem;
|
||||
this._registerEvents(containerElem);
|
||||
@@ -187,26 +182,27 @@ mindplot.MultilineTextEditor = new Class({
|
||||
font.size = nodeText.getHtmlFontSize();
|
||||
font.color = nodeText.getColor();
|
||||
this._setStyle(font);
|
||||
|
||||
var me = this;
|
||||
// Set editor's initial size
|
||||
var displayFunc = function () {
|
||||
// Position the editor and set the size...
|
||||
var textShape = topic.getTextShape();
|
||||
textShape.positionRelativeTo(this._containerElem, {
|
||||
position:{x:'left', y:'top'},
|
||||
edge:{x:'left', y:'top'}
|
||||
});
|
||||
this._containerElem.setStyle('display', 'block');
|
||||
|
||||
me._containerElem.css('display', 'block');
|
||||
|
||||
//FIXME: Im not sure if this is best way...
|
||||
var shapePosition = textShape.getNativePosition();
|
||||
me._containerElem.offset(shapePosition);
|
||||
|
||||
// Set editor's initial text ...
|
||||
var text = $defined(defaultText) ? defaultText : topic.getText();
|
||||
this._setText(text);
|
||||
me._setText(text);
|
||||
|
||||
// Set the element focus and select the current text ...
|
||||
var inputElem = this._getTextareaElem();
|
||||
this._positionCursor(inputElem, !$defined(defaultText));
|
||||
var inputElem = me._getTextareaElem();
|
||||
me._positionCursor(inputElem, !$defined(defaultText));
|
||||
|
||||
}.bind(this);
|
||||
};
|
||||
|
||||
this._timeoutId = displayFunc.delay(10);
|
||||
},
|
||||
@@ -232,22 +228,22 @@ mindplot.MultilineTextEditor = new Class({
|
||||
fontWeight:fontStyle.weight,
|
||||
color:fontStyle.color
|
||||
};
|
||||
inputField.setStyles(style);
|
||||
this._containerElem.setStyles(style);
|
||||
inputField.css(style);
|
||||
this._containerElem.css(style);
|
||||
},
|
||||
|
||||
_setText:function (text) {
|
||||
var textareaElem = this._getTextareaElem();
|
||||
textareaElem.value = text;
|
||||
textareaElem.val(text);
|
||||
this._adjustEditorSize();
|
||||
},
|
||||
|
||||
_getText:function () {
|
||||
return this._getTextareaElem().value;
|
||||
return this._getTextareaElem().val();
|
||||
},
|
||||
|
||||
_getTextareaElem:function () {
|
||||
return this._containerElem.getElement('textarea');
|
||||
return this._containerElem.find('textarea');
|
||||
},
|
||||
|
||||
_positionCursor:function (textareaElem, selectText) {
|
||||
@@ -257,19 +253,19 @@ mindplot.MultilineTextEditor = new Class({
|
||||
if (textareaElem.createTextRange) {
|
||||
var rang = textareaElem.createTextRange();
|
||||
rang.select();
|
||||
rang.move("character", textareaElem.value.length);
|
||||
rang.move("character", textareaElem.val().length);
|
||||
}
|
||||
else {
|
||||
textareaElem.setSelectionRange(0, textareaElem.value.length);
|
||||
textareaElem[0].setSelectionRange(0, textareaElem.val().length);
|
||||
}
|
||||
|
||||
} else {
|
||||
// Move the cursor to the last character ..
|
||||
if (textareaElem.createTextRange) {
|
||||
var range = textareaElem.createTextRange();
|
||||
range.move("character", textareaElem.value.length);
|
||||
range.move("character", textareaElem.val().length);
|
||||
} else {
|
||||
textareaElem.selectionStart = textareaElem.value.length;
|
||||
textareaElem.selectionStart = textareaElem.val().length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +284,7 @@ mindplot.MultilineTextEditor = new Class({
|
||||
this._topic.getTextShape().setVisibility(true);
|
||||
|
||||
// Remove it form the screen ...
|
||||
this._containerElem.dispose();
|
||||
this._containerElem.remove();
|
||||
this._containerElem = null;
|
||||
this._timeoutId = -1;
|
||||
}
|
||||
|
@@ -24,7 +24,6 @@ mindplot.NodeGraph = new Class({
|
||||
this._mouseEvents = true;
|
||||
this.setModel(nodeModel);
|
||||
this._onFocus = false;
|
||||
this._event = new Events();
|
||||
this._size = {width:50,height:20};
|
||||
},
|
||||
|
||||
@@ -67,7 +66,7 @@ mindplot.NodeGraph = new Class({
|
||||
|
||||
fireEvent: function(type, event) {
|
||||
var elem = this.get2DElement();
|
||||
elem.fireEvent(type, event);
|
||||
elem.trigger(type, event);
|
||||
},
|
||||
|
||||
setMouseEventsEnabled : function(isEnabled) {
|
||||
|
@@ -31,50 +31,45 @@ mindplot.NoteIcon = new Class({
|
||||
|
||||
_registerEvents:function () {
|
||||
this._image.setCursor('pointer');
|
||||
var me = this;
|
||||
|
||||
if (!this._readOnly) {
|
||||
|
||||
// Add on click event to open the editor ...
|
||||
this.addEvent('click', function (event) {
|
||||
this._topic.showNoteEditor();
|
||||
me._topic.showNoteEditor();
|
||||
event.stopPropagation();
|
||||
}.bind(this));
|
||||
});
|
||||
}
|
||||
|
||||
this._tip = new mindplot.widget.FloatingTip(this.getImage()._peer._native, {
|
||||
this._tip = new mindplot.widget.FloatingTip($(me.getImage()._peer._native), {
|
||||
title: $msg('NOTE'),
|
||||
container: 'body',
|
||||
// Content can also be a function of the target element!
|
||||
content:function () {
|
||||
var result = new Element('div');
|
||||
result.setStyles({padding:'5px'});
|
||||
|
||||
var title = new Element('div', {text:$msg('NOTE')});
|
||||
title.setStyles({
|
||||
'font-weight':'bold',
|
||||
color:'black',
|
||||
'padding-bottom':'5px',
|
||||
width:'100px'
|
||||
});
|
||||
title.inject(result);
|
||||
|
||||
var text = new Element('div', {text:this._linksModel.getText()});
|
||||
text.setStyles({
|
||||
'white-space':'pre-wrap',
|
||||
'word-wrap':'break-word'
|
||||
}
|
||||
);
|
||||
text.inject(result);
|
||||
|
||||
|
||||
return result;
|
||||
}.bind(this),
|
||||
content: function() {
|
||||
return me._buildTooltipContent();
|
||||
},
|
||||
html:true,
|
||||
position:'bottom',
|
||||
arrowOffset:10,
|
||||
center:true,
|
||||
arrowSize:15,
|
||||
offset:{x:10, y:20},
|
||||
className:'notesTip'
|
||||
placement:'bottom',
|
||||
destroyOnExit: true
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
_buildTooltipContent: function() {
|
||||
if ($("body").find("#textPopoverNote").length == 1) {
|
||||
var text = $("body").find("#textPopoverNote");
|
||||
text.text(this._linksModel.getText());
|
||||
} else {
|
||||
var result = $('<div id="textPopoverNote"></div>').css({padding:'5px'});
|
||||
|
||||
var text = $('<div></div>').text(this._linksModel.getText())
|
||||
.css({
|
||||
'white-space':'pre-wrap',
|
||||
'word-wrap':'break-word'
|
||||
}
|
||||
);
|
||||
result.append(text);
|
||||
return result;
|
||||
}
|
||||
},
|
||||
|
||||
getModel:function () {
|
||||
|
13
mindplot/src/main/javascript/Options.js
Normal file
@@ -0,0 +1,13 @@
|
||||
Options = new Class({
|
||||
|
||||
setOptions: function(){
|
||||
var options = this.options = Object.merge.apply(null, [{}, this.options].append(arguments));
|
||||
if (this.addEvent) for (var option in options){
|
||||
if (typeOf(options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue;
|
||||
this.addEvent(option, options[option]);
|
||||
delete options[option];
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
@@ -42,7 +42,7 @@ mindplot.PersistenceManager = new Class({
|
||||
var domMap = serializer.toXML(mindmap);
|
||||
var mapXml = core.Utils.innerXML(domMap);
|
||||
|
||||
var pref = JSON.encode(editorProperties);
|
||||
var pref = JSON.stringify(editorProperties);
|
||||
try {
|
||||
this.saveMapXml(mapId, mapXml, pref, saveHistory, events, sync);
|
||||
} catch (e) {
|
||||
|
@@ -160,16 +160,16 @@ mindplot.Relationship = new Class({
|
||||
},
|
||||
|
||||
addToWorkspace:function (workspace) {
|
||||
workspace.appendChild(this._focusShape);
|
||||
workspace.appendChild(this._controlPointsController);
|
||||
workspace.append(this._focusShape);
|
||||
workspace.append(this._controlPointsController);
|
||||
|
||||
this._controlPointControllerListener = this._initializeControlPointController.bind(this);
|
||||
this._line2d.addEvent('click', this._controlPointControllerListener);
|
||||
this._isInWorkspace = true;
|
||||
|
||||
workspace.appendChild(this._startArrow);
|
||||
workspace.append(this._startArrow);
|
||||
if (this._endArrow)
|
||||
workspace.appendChild(this._endArrow);
|
||||
workspace.append(this._endArrow);
|
||||
|
||||
this.parent(workspace);
|
||||
this._positionArrows();
|
||||
@@ -325,6 +325,6 @@ mindplot.Relationship = new Class({
|
||||
|
||||
fireEvent:function (type, event) {
|
||||
var elem = this._line2d;
|
||||
elem.fireEvent(type, event);
|
||||
elem.trigger(type, event);
|
||||
}
|
||||
});
|
||||
|
@@ -23,6 +23,7 @@ mindplot.RelationshipPivot = new Class({
|
||||
this._workspace = workspace;
|
||||
this._designer = designer;
|
||||
|
||||
//FIXME: the aim of the migration is remove .bind mootools method, please remove these!
|
||||
this._mouseMoveEvent = this._mouseMove.bind(this);
|
||||
this._onClickEvent = this._cleanOnMouseClick.bind(this);
|
||||
this._onTopicClick = this._connectOnFocus.bind(this);
|
||||
@@ -56,8 +57,8 @@ mindplot.RelationshipPivot = new Class({
|
||||
this._startArrow.setStrokeWidth(2);
|
||||
this._startArrow.setFrom(sourcePos.x, sourcePos.y);
|
||||
|
||||
this._workspace.appendChild(this._pivot);
|
||||
this._workspace.appendChild(this._startArrow);
|
||||
this._workspace.append(this._pivot);
|
||||
this._workspace.append(this._startArrow);
|
||||
|
||||
this._workspace.addEvent('mousemove', this._mouseMoveEvent);
|
||||
this._workspace.addEvent('click', this._onClickEvent);
|
||||
@@ -65,7 +66,7 @@ mindplot.RelationshipPivot = new Class({
|
||||
// Register focus events on all topics ...
|
||||
var model = this._designer.getModel();
|
||||
var topics = model.getTopics();
|
||||
topics.each(function (topic) {
|
||||
_.each(topics, function (topic) {
|
||||
topic.addEvent('ontfocus', this._onTopicClick);
|
||||
}.bind(this));
|
||||
}
|
||||
@@ -81,9 +82,10 @@ mindplot.RelationshipPivot = new Class({
|
||||
|
||||
var model = this._designer.getModel();
|
||||
var topics = model.getTopics();
|
||||
topics.each(function (topic) {
|
||||
topic.removeEvent('ontfocus', this._onTopicClick);
|
||||
}.bind(this));
|
||||
var me = this;
|
||||
_.each(topics, function (topic) {
|
||||
topic.removeEvent('ontfocus', me._onTopicClick);
|
||||
});
|
||||
|
||||
workspace.removeChild(this._pivot);
|
||||
workspace.removeChild(this._startArrow);
|
||||
@@ -139,7 +141,7 @@ mindplot.RelationshipPivot = new Class({
|
||||
return mindplot.util.Shape.calculateRelationShipPointCoordinates(this._sourceTopic, spoint);
|
||||
},
|
||||
|
||||
_connectOnFocus:function (targetTopic) {
|
||||
_connectOnFocus:function (event, targetTopic) {
|
||||
var sourceTopic = this._sourceTopic;
|
||||
var mindmap = this._designer.getMindmap();
|
||||
|
||||
|
@@ -55,38 +55,38 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
persistence.onSave = false;
|
||||
}, 10000);
|
||||
|
||||
var request = new Request({
|
||||
url:this.documentUrl.replace("{id}", mapId) + "?" + query,
|
||||
method:'put',
|
||||
$.ajax({
|
||||
url: this.documentUrl.replace("{id}", mapId) + "?" + query,
|
||||
type:'put',
|
||||
dataType:"json",
|
||||
data: JSON.stringify(data),
|
||||
contentType:"application/json; charset=utf-8",
|
||||
async:!sync,
|
||||
|
||||
onSuccess:function (responseText, responseXML) {
|
||||
persistence.timestamp = responseText;
|
||||
success: function (data, textStatus, jqXHRresponseText) {
|
||||
persistence.timestamp = data;
|
||||
events.onSuccess();
|
||||
},
|
||||
|
||||
onException:function (headerName, value) {
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
events.onError(persistence._buildError());
|
||||
},
|
||||
|
||||
onComplete:function () {
|
||||
complete: function () {
|
||||
// Clear event timeout ...
|
||||
if (persistence.clearTimeout) {
|
||||
clearTimeout(persistence.clearTimeout);
|
||||
}
|
||||
persistence.onSave = false;
|
||||
},
|
||||
|
||||
onFailure:function (xhr) {
|
||||
fail:function (xhr, textStatus) {
|
||||
|
||||
var responseText = xhr.responseText;
|
||||
var userMsg = {severity:"SEVERE", message:$msg('SAVE_COULD_NOT_BE_COMPLETED')};
|
||||
|
||||
var contentType = this.getHeader("Content-Type");
|
||||
var contentType = xhr.getResponseHeader("Content-Type");
|
||||
if (contentType != null && contentType.indexOf("application/json") != -1) {
|
||||
var serverMsg = null;
|
||||
try {
|
||||
serverMsg = JSON.decode(responseText);
|
||||
serverMsg = $.parseJSON(responseText);
|
||||
serverMsg = serverMsg.globalSeverity ? serverMsg : null;
|
||||
} catch (e) {
|
||||
// Message could not be decoded ...
|
||||
@@ -100,52 +100,29 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
}
|
||||
events.onError(userMsg);
|
||||
persistence.onSave = false;
|
||||
},
|
||||
|
||||
headers:{"Content-Type":"application/json; charset=utf-8", "Accept":"application/json"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
}
|
||||
});
|
||||
request.put(JSON.encode(data));
|
||||
}
|
||||
},
|
||||
|
||||
discardChanges:function (mapId) {
|
||||
var request = new Request({
|
||||
$.ajax({
|
||||
url:this.revertUrl.replace("{id}", mapId),
|
||||
async:false,
|
||||
method:'post',
|
||||
onSuccess:function () {
|
||||
},
|
||||
onException:function () {
|
||||
},
|
||||
onFailure:function () {
|
||||
},
|
||||
headers:{"Content-Type":"application/json; charset=utf-8", "Accept":"application/json"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
headers:{"Content-Type":"application/json; charset=utf-8", "Accept":"application/json"}
|
||||
});
|
||||
request.post();
|
||||
},
|
||||
|
||||
unlockMap:function (mindmap) {
|
||||
var mapId = mindmap.getId();
|
||||
var request = new Request({
|
||||
$.ajax({
|
||||
url:this.lockUrl.replace("{id}", mapId),
|
||||
async:false,
|
||||
method:'put',
|
||||
onSuccess:function () {
|
||||
|
||||
},
|
||||
onException:function () {
|
||||
},
|
||||
onFailure:function () {
|
||||
},
|
||||
headers:{"Content-Type":"text/plain"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
data: "false"
|
||||
});
|
||||
request.put("false");
|
||||
},
|
||||
|
||||
_buildError:function (jsonSeverResponse) {
|
||||
@@ -165,26 +142,22 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
loadMapDom:function (mapId) {
|
||||
// Let's try to open one from the local directory ...
|
||||
var xml;
|
||||
var xmlRequest = new Request({
|
||||
$.ajax({
|
||||
url:this.documentUrl.replace("{id}", mapId) + "/xml",
|
||||
method:'get',
|
||||
async:false,
|
||||
headers:{"Content-Type":"text/plain","Accept":"application/xml"},
|
||||
onSuccess:function (responseText) {
|
||||
success:function (responseText) {
|
||||
xml = responseText;
|
||||
}
|
||||
});
|
||||
xmlRequest.send();
|
||||
|
||||
// If I could not load it from a file, hard code one.
|
||||
if (xml == null) {
|
||||
throw new Error("Map could not be loaded");
|
||||
}
|
||||
|
||||
var parser = new DOMParser();
|
||||
return parser.parseFromString(xml, "text/xml");
|
||||
return xml;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
@@ -24,11 +24,11 @@ mindplot.ScreenManager = new Class({
|
||||
|
||||
// Ignore default click event propagation. Prevent 'click' event on drag.
|
||||
this._clickEvents = [];
|
||||
this._divContainer.addEvent('click', function(event) {
|
||||
this._divContainer.bind('click', function(event) {
|
||||
event.stopPropagation()
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
this._divContainer.addEvent('dblclick', function(event) {
|
||||
this._divContainer.bind('dblclick', function(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
});
|
||||
@@ -43,7 +43,7 @@ mindplot.ScreenManager = new Class({
|
||||
if (event == 'click')
|
||||
this._clickEvents.push(listener);
|
||||
else
|
||||
this._divContainer.addEvent(event, listener);
|
||||
this._divContainer.bind(event, listener);
|
||||
},
|
||||
|
||||
removeEvent : function(event, listener) {
|
||||
@@ -51,18 +51,18 @@ mindplot.ScreenManager = new Class({
|
||||
this._clickEvents.remove(listener);
|
||||
}
|
||||
else{
|
||||
this._divContainer.removeEvent(event, listener);
|
||||
this._divContainer.unbind(event, listener);
|
||||
}
|
||||
},
|
||||
|
||||
fireEvent : function(type, event) {
|
||||
if (type == 'click') {
|
||||
this._clickEvents.each(function(listener) {
|
||||
_.each(this._clickEvents, function(listener) {
|
||||
listener(type, event);
|
||||
});
|
||||
}
|
||||
else {
|
||||
this._divContainer.fireEvent(type, event);
|
||||
this._divContainer.trigger(type, event);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -118,13 +118,13 @@ mindplot.ScreenManager = new Class({
|
||||
|
||||
getWorkspaceMousePosition : function(event) {
|
||||
// Retrieve current mouse position.
|
||||
var x = event.client.x;
|
||||
var y = event.client.y;
|
||||
var x = event.clientX;
|
||||
var y = event.clientY;
|
||||
|
||||
// Subtract div position.
|
||||
var containerPosition = this.getContainer().getPosition();
|
||||
//FIXME: paulo: why? Subtract div position.
|
||||
/*var containerPosition = this.getContainer().position();
|
||||
x = x - containerPosition.x;
|
||||
y = y - containerPosition.y;
|
||||
y = y - containerPosition.y;*/
|
||||
|
||||
// Scale coordinate in order to be relative to the workspace. That's coordSize/size;
|
||||
x = x * this._scale;
|
||||
|
@@ -50,11 +50,11 @@ mindplot.ShirinkConnector = new Class({
|
||||
|
||||
ellipse.setFill('rgb(153, 0, 255)');
|
||||
});
|
||||
|
||||
var me = this;
|
||||
ellipse.addEvent('mouseout', function(event) {
|
||||
var color = topic.getBackgroundColor();
|
||||
this.setFill(color);
|
||||
}.bind(this));
|
||||
me.setFill(color);
|
||||
});
|
||||
|
||||
ellipse.setCursor('default');
|
||||
this._fillColor = '#f7f7f7';
|
||||
@@ -90,7 +90,7 @@ mindplot.ShirinkConnector = new Class({
|
||||
},
|
||||
|
||||
addToWorkspace: function(group) {
|
||||
group.appendChild(this._ellipse);
|
||||
group.append(this._ellipse);
|
||||
},
|
||||
|
||||
setPosition: function(x, y) {
|
||||
@@ -104,4 +104,4 @@ mindplot.ShirinkConnector = new Class({
|
||||
moveToFront: function() {
|
||||
this._ellipse.moveToFront();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@@ -68,14 +68,15 @@ mindplot.TextEditor = new Class({
|
||||
_registerEvents : function(divElem) {
|
||||
var inputElem = this._getTextareaElem();
|
||||
var spanElem = this._getSpanElem();
|
||||
var me = this;
|
||||
|
||||
divElem.addEvent('keydown', function (event) {
|
||||
switch (event.key) {
|
||||
case 'esc':
|
||||
this.close(false);
|
||||
me.close(false);
|
||||
break;
|
||||
case 'enter':
|
||||
this.close(true);
|
||||
me.close(true);
|
||||
break;
|
||||
default:
|
||||
spanElem.innerHTML = inputElem.value;
|
||||
@@ -87,7 +88,7 @@ mindplot.TextEditor = new Class({
|
||||
break;
|
||||
}
|
||||
event.stopPropagation();
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
// If the user clicks on the input, all event must be ignored ...
|
||||
divElem.addEvent('click', function(event) {
|
||||
@@ -121,7 +122,7 @@ mindplot.TextEditor = new Class({
|
||||
if (!this.isVisible()) {
|
||||
//Create editor ui
|
||||
var editorElem = this._buildEditor();
|
||||
editorElem.inject($(document.body));
|
||||
editorElem.inject($(document.body)[0]);
|
||||
|
||||
this._containerElem = editorElem;
|
||||
this._registerEvents(editorElem);
|
||||
@@ -147,25 +148,24 @@ mindplot.TextEditor = new Class({
|
||||
var text = $defined(defaultText) ? defaultText : topic.getText();
|
||||
this._setText(text);
|
||||
|
||||
var me = this;
|
||||
// Set editor's initial size
|
||||
var displayFunc = function() {
|
||||
// Position the editor and set the size...
|
||||
var textShape = this._topic.getTextShape();
|
||||
textShape.positionRelativeTo(this._containerElem, {
|
||||
position: {x: 'left',y:'top'},
|
||||
edge: {x: 'left', y: 'top'}
|
||||
});
|
||||
this._containerElem.setStyle('display', 'block');
|
||||
var textShape = me._topic.getTextShape();
|
||||
|
||||
me._containerElem.css('display', 'block');
|
||||
|
||||
me._containerElem.offset(textShape.getNativePosition());
|
||||
// Set size ...
|
||||
var elemSize = topic.getSize();
|
||||
this._setEditorSize(elemSize.width, elemSize.height);
|
||||
me._setEditorSize(elemSize.width, elemSize.height);
|
||||
|
||||
var textareaElem = this._getTextareaElem();
|
||||
var textareaElem = me._getTextareaElem();
|
||||
textareaElem.focus();
|
||||
this._positionCursor(textareaElem, !$defined(defaultText));
|
||||
me._positionCursor(textareaElem, !$defined(defaultText));
|
||||
|
||||
}.bind(this);
|
||||
};
|
||||
|
||||
displayFunc.delay(10);
|
||||
},
|
||||
|
@@ -47,11 +47,11 @@ mindplot.Topic = new Class({
|
||||
this.addEvent('click', function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
var me = this;
|
||||
this.addEvent('dblclick', function (event) {
|
||||
this._getTopicEventDispatcher().show(this);
|
||||
me._getTopicEventDispatcher().show(me);
|
||||
event.stopPropagation();
|
||||
}.bind(this));
|
||||
});
|
||||
},
|
||||
|
||||
setShapeType:function (type) {
|
||||
@@ -82,7 +82,7 @@ mindplot.Topic = new Class({
|
||||
this.setSize(size, true);
|
||||
|
||||
var group = this.get2DElement();
|
||||
group.appendChild(innerShape);
|
||||
group.append(innerShape);
|
||||
|
||||
// Move text to the front ...
|
||||
var text = this.getTextShape();
|
||||
@@ -246,7 +246,7 @@ mindplot.Topic = new Class({
|
||||
if (!$defined(this._iconsGroup)) {
|
||||
this._iconsGroup = this._buildIconGroup();
|
||||
var group = this.get2DElement();
|
||||
group.appendChild(this._iconsGroup.getNativeElement());
|
||||
group.append(this._iconsGroup.getNativeElement());
|
||||
this._iconsGroup.moveToFront();
|
||||
}
|
||||
return this._iconsGroup;
|
||||
@@ -458,7 +458,7 @@ mindplot.Topic = new Class({
|
||||
|
||||
setText:function (text) {
|
||||
// Avoid empty nodes ...
|
||||
if (!text || text.trim().length == 0) {
|
||||
if (!text || $.trim(text).length == 0) {
|
||||
text = null;
|
||||
}
|
||||
|
||||
@@ -542,9 +542,9 @@ mindplot.Topic = new Class({
|
||||
var textShape = this.getTextShape();
|
||||
|
||||
// Add to the group ...
|
||||
group.appendChild(outerShape);
|
||||
group.appendChild(innerShape);
|
||||
group.appendChild(textShape);
|
||||
group.append(outerShape);
|
||||
group.append(innerShape);
|
||||
group.append(textShape);
|
||||
|
||||
// Update figure size ...
|
||||
var model = this.getModel();
|
||||
@@ -576,24 +576,25 @@ mindplot.Topic = new Class({
|
||||
};
|
||||
elem.addEvent('mouseout', outout);
|
||||
|
||||
var me = this;
|
||||
// Focus events ...
|
||||
elem.addEvent('mousedown', function (event) {
|
||||
if (!this.isReadOnly()) {
|
||||
if (!me.isReadOnly()) {
|
||||
// Disable topic selection of readOnly mode ...
|
||||
var value = true;
|
||||
if ((event.meta && Browser.Platform.mac) || (event.control && !Browser.Platform.mac)) {
|
||||
value = !this.isOnFocus();
|
||||
if ((event.metaKey && Browser.Platform.mac) || (event.ctrlKey && !Browser.Platform.mac)) {
|
||||
value = !me.isOnFocus();
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
topic.setOnFocus(value);
|
||||
}
|
||||
|
||||
var eventDispatcher = this._getTopicEventDispatcher();
|
||||
eventDispatcher.process(mindplot.TopicEvent.CLICK, this);
|
||||
var eventDispatcher = me._getTopicEventDispatcher();
|
||||
eventDispatcher.process(mindplot.TopicEvent.CLICK, me);
|
||||
event.stopPropagation();
|
||||
|
||||
}.bind(this));
|
||||
});
|
||||
},
|
||||
|
||||
areChildrenShrunken:function () {
|
||||
@@ -626,10 +627,11 @@ mindplot.Topic = new Class({
|
||||
// Do some fancy animation ....
|
||||
var elements = this._flatten2DElements(this);
|
||||
var fade = new mindplot.util.FadeEffect(elements, !value);
|
||||
var me = this;
|
||||
fade.addEvent('complete', function () {
|
||||
// Set focus on the parent node ...
|
||||
if (value) {
|
||||
this.setOnFocus(true);
|
||||
me.setOnFocus(true);
|
||||
}
|
||||
|
||||
// Set focus in false for all the children ...
|
||||
@@ -638,7 +640,7 @@ mindplot.Topic = new Class({
|
||||
elem.setOnFocus(false);
|
||||
}
|
||||
});
|
||||
}.bind(this));
|
||||
});
|
||||
fade.start();
|
||||
|
||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeShrinkEvent, model);
|
||||
@@ -887,7 +889,7 @@ mindplot.Topic = new Class({
|
||||
},
|
||||
|
||||
_setRelationshipLinesVisibility:function (value) {
|
||||
this._relationships.each(function (relationship) {
|
||||
_.each(this._relationships, function (relationship) {
|
||||
var sourceTopic = relationship.getSourceTopic();
|
||||
var targetTopic = relationship.getTargetTopic();
|
||||
|
||||
@@ -1043,7 +1045,7 @@ mindplot.Topic = new Class({
|
||||
$assert(workspace, 'Workspace can not be null');
|
||||
|
||||
// Connect Graphical Nodes ...
|
||||
targetTopic.appendChild(this);
|
||||
targetTopic.append(this);
|
||||
this._parent = targetTopic;
|
||||
|
||||
// Update model ...
|
||||
@@ -1056,7 +1058,7 @@ mindplot.Topic = new Class({
|
||||
outgoingLine.setVisibility(false);
|
||||
|
||||
this._outgoingLine = outgoingLine;
|
||||
workspace.appendChild(outgoingLine);
|
||||
workspace.append(outgoingLine);
|
||||
|
||||
// Update figure is necessary.
|
||||
this.updateTopicShape(targetTopic);
|
||||
@@ -1088,7 +1090,7 @@ mindplot.Topic = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
appendChild:function (child) {
|
||||
append:function (child) {
|
||||
var children = this.getChildren();
|
||||
children.push(child);
|
||||
},
|
||||
@@ -1120,7 +1122,7 @@ mindplot.Topic = new Class({
|
||||
|
||||
addToWorkspace:function (workspace) {
|
||||
var elem = this.get2DElement();
|
||||
workspace.appendChild(elem);
|
||||
workspace.append(elem);
|
||||
if (!this.isInWorkspace()) {
|
||||
if (!this.isCentralTopic()) {
|
||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeAdded, this.getModel());
|
||||
|
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
mindplot.TopicEventDispatcher = new Class({
|
||||
Extends: Events,
|
||||
Extends: mindplot.Events,
|
||||
Static: {
|
||||
_instance: null,
|
||||
|
||||
|
@@ -26,8 +26,8 @@ mindplot.Workspace = new Class({
|
||||
this._screenManager = screenManager;
|
||||
|
||||
var divContainer = screenManager.getContainer();
|
||||
this._screenWidth = parseInt(divContainer.getStyle('width'));
|
||||
this._screenHeight = parseInt(divContainer.getStyle('height'));
|
||||
this._screenWidth = parseInt(divContainer.css('width'));
|
||||
this._screenHeight = parseInt(divContainer.css('height'));
|
||||
|
||||
// Initialize web2d workspace.
|
||||
var workspace = this._createWorkspace();
|
||||
@@ -61,11 +61,11 @@ mindplot.Workspace = new Class({
|
||||
return new web2d.Workspace(workspaceProfile);
|
||||
},
|
||||
|
||||
appendChild: function(shape) {
|
||||
append: function(shape) {
|
||||
if ($defined(shape.addToWorkspace)) {
|
||||
shape.addToWorkspace(this);
|
||||
} else {
|
||||
this._workspace.appendChild(shape);
|
||||
this._workspace.append(shape);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -189,7 +189,7 @@ mindplot.Workspace = new Class({
|
||||
wasDragged = true;
|
||||
|
||||
|
||||
}.bind(this);
|
||||
};
|
||||
screenManager.addEvent('mousemove', workspace._mouseMoveListener);
|
||||
|
||||
// Register mouse up listeners ...
|
||||
|
@@ -29,19 +29,20 @@ mindplot.commands.AddTopicCommand = new Class({
|
||||
|
||||
execute:function (commandContext) {
|
||||
|
||||
this._models.each(function (model, index) {
|
||||
var me = this;
|
||||
_.each(this._models, function (model, index) {
|
||||
|
||||
// Add a new topic ...
|
||||
var topic = commandContext.createTopic(model);
|
||||
|
||||
// Connect to topic ...
|
||||
if (this._parentsIds) {
|
||||
var parentId = this._parentsIds[index];
|
||||
if (me._parentsIds) {
|
||||
var parentId = me._parentsIds[index];
|
||||
if ($defined(parentId)) {
|
||||
var parentTopic = commandContext.findTopics(parentId)[0];
|
||||
commandContext.connect(topic, parentTopic);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
commandContext.addTopic(topic);
|
||||
}
|
||||
|
||||
@@ -53,23 +54,23 @@ mindplot.commands.AddTopicCommand = new Class({
|
||||
// Render node ...
|
||||
topic.setVisibility(true);
|
||||
|
||||
}.bind(this));
|
||||
});
|
||||
},
|
||||
|
||||
undoExecute:function (commandContext) {
|
||||
// Delete disconnected the nodes. Create a copy of the topics ...
|
||||
var clonedModel = [];
|
||||
this._models.each(function (model) {
|
||||
_.each(this._models, function (model) {
|
||||
clonedModel.push(model.clone());
|
||||
});
|
||||
|
||||
// Finally, remove the nodes ...
|
||||
this._models.each(function (model) {
|
||||
_.each(this._models, function (model) {
|
||||
|
||||
var topicId = model.getId();
|
||||
var topic = commandContext.findTopics(topicId)[0];
|
||||
commandContext.deleteTopic(topic);
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
this._models = clonedModel;
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
var topics = this._filterChildren(this._topicIds, commandContext);
|
||||
|
||||
if (topics.length > 0) {
|
||||
topics.each(function (topic) {
|
||||
_.each(topics, function (topic) {
|
||||
// In case that it's editing text node, force close without update ...
|
||||
topic.closeEditors();
|
||||
|
||||
@@ -47,7 +47,7 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
return rel.getModel().clone();
|
||||
}));
|
||||
|
||||
relationships.each(function (relationship) {
|
||||
_.each(relationships, function (relationship) {
|
||||
commandContext.deleteRelationship(relationship);
|
||||
});
|
||||
|
||||
@@ -69,7 +69,7 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
|
||||
var rels = commandContext.findRelationships(this._relIds);
|
||||
if (rels.length > 0) {
|
||||
rels.each(function (rel) {
|
||||
_.each(rels, function (rel) {
|
||||
this._deletedRelModel.push(rel.getModel().clone());
|
||||
commandContext.deleteRelationship(rel);
|
||||
}, this);
|
||||
@@ -79,12 +79,12 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
undoExecute:function (commandContext) {
|
||||
|
||||
// Add all the topics ...
|
||||
this._deletedTopicModels.each(function (model) {
|
||||
_.each(this._deletedTopicModels, function (model) {
|
||||
commandContext.createTopic(model);
|
||||
}, this);
|
||||
|
||||
// Do they need to be connected ?
|
||||
this._deletedTopicModels.each(function (topicModel, index) {
|
||||
_.each(this._deletedTopicModels, function (topicModel, index) {
|
||||
var topics = commandContext.findTopics(topicModel.getId());
|
||||
|
||||
var parentId = this._parentTopicIds[index];
|
||||
@@ -95,12 +95,12 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
}, this);
|
||||
|
||||
// Add rebuild relationships ...
|
||||
this._deletedRelModel.each(function (model) {
|
||||
_.each(this._deletedRelModel, function (model) {
|
||||
commandContext.addRelationship(model);
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
// Finally display the topics ...
|
||||
this._deletedTopicModels.each(function (topicModel) {
|
||||
_.each(this._deletedTopicModels, function (topicModel) {
|
||||
var topics = commandContext.findTopics(topicModel.getId());
|
||||
topics[0].setBranchVisibility(true);
|
||||
}, this);
|
||||
@@ -121,7 +121,7 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
var topics = commandContext.findTopics(topicIds);
|
||||
|
||||
var result = [];
|
||||
topics.each(function (topic) {
|
||||
_.each(topics, function (topic) {
|
||||
var parent = topic.getParent();
|
||||
var found = false;
|
||||
while (parent != null && !found) {
|
||||
|
@@ -46,10 +46,11 @@ mindplot.commands.GenericFunctionCommand = new Class({
|
||||
}
|
||||
|
||||
if (topics != null) {
|
||||
topics.each(function (topic) {
|
||||
var oldValue = this._commandFunc(topic, this._value);
|
||||
this._oldValues.push(oldValue);
|
||||
}.bind(this));
|
||||
var me = this;
|
||||
_.each(topics, function (topic) {
|
||||
var oldValue = me._commandFunc(topic, me._value);
|
||||
me._oldValues.push(oldValue);
|
||||
});
|
||||
}
|
||||
this.applied = true;
|
||||
|
||||
@@ -62,10 +63,11 @@ mindplot.commands.GenericFunctionCommand = new Class({
|
||||
undoExecute:function (commandContext) {
|
||||
if (this.applied) {
|
||||
var topics = commandContext.findTopics(this._topicsId);
|
||||
topics.each(function (topic, index) {
|
||||
this._commandFunc(topic, this._oldValues[index]);
|
||||
var me = this;
|
||||
_.each(topics, function (topic, index) {
|
||||
me._commandFunc(topic, me._oldValues[index]);
|
||||
|
||||
}.bind(this));
|
||||
});
|
||||
|
||||
this.applied = false;
|
||||
this._oldValues = [];
|
||||
|
@@ -1 +1,5 @@
|
||||
$(document).fireEvent('loadcomplete', 'mind');
|
||||
try {
|
||||
$(document).trigger('loadcomplete', 'mind');
|
||||
} catch (e) {
|
||||
console.error(e.stack);
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ mindplot.layout.AbstractBasicSorter = new Class({
|
||||
result = height;
|
||||
} else {
|
||||
var childrenHeight = 0;
|
||||
children.each(function(child) {
|
||||
_.each(children, function(child) {
|
||||
childrenHeight += this._computeChildrenHeight(treeSet, child, heightCache);
|
||||
}, this);
|
||||
|
||||
|
@@ -77,7 +77,7 @@ mindplot.layout.BalancedSorter = new Class({
|
||||
var result = null;
|
||||
var last = children.getLast();
|
||||
position = position || {x:last.getPosition().x, y:last.getPosition().y + 1};
|
||||
children.each(function (child, index) {
|
||||
_.each(children, function (child, index) {
|
||||
var cpos = child.getPosition();
|
||||
if (position.y > cpos.y) {
|
||||
yOffset = child == last ?
|
||||
@@ -129,7 +129,7 @@ mindplot.layout.BalancedSorter = new Class({
|
||||
// Filter nodes on one side..
|
||||
var children = this._getChildrenForOrder(parent, treeSet, node.getOrder());
|
||||
|
||||
children.each(function (child, index) {
|
||||
_.each(children, function (child, index) {
|
||||
if (child.getOrder() > node.getOrder()) {
|
||||
child.setOrder(child.getOrder() - 2);
|
||||
}
|
||||
@@ -154,7 +154,7 @@ mindplot.layout.BalancedSorter = new Class({
|
||||
var totalPHeight = 0;
|
||||
var totalNHeight = 0;
|
||||
|
||||
heights.each(function (elem) {
|
||||
_.each(heights, function (elem) {
|
||||
if (elem.order % 2 == 0) {
|
||||
totalPHeight += elem.height;
|
||||
} else {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
mindplot.EventBus = new Class({
|
||||
Implements:Events,
|
||||
Implements: mindplot.Events,
|
||||
initialize: function() {
|
||||
}
|
||||
});
|
||||
|
@@ -26,9 +26,13 @@ mindplot.layout.GridSorter = new Class({
|
||||
var children = this._getSortedChildren(treeSet, node);
|
||||
|
||||
// Compute heights ...
|
||||
var me = this;
|
||||
var heights = children.map(function(child) {
|
||||
return {id:child.getId(),height:this._computeChildrenHeight(treeSet, child)};
|
||||
}.bind(this));
|
||||
return {
|
||||
id: child.getId(),
|
||||
height: me._computeChildrenHeight(treeSet, child)
|
||||
};
|
||||
});
|
||||
|
||||
// Calculate the offsets ...
|
||||
var result = {};
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
mindplot.layout.LayoutManager = new Class({
|
||||
Extends: Events,
|
||||
Extends: mindplot.Events,
|
||||
initialize: function(rootNodeId, rootSize) {
|
||||
$assert($defined(rootNodeId), "rootNodeId can not be null");
|
||||
$assert(rootSize, "rootSize can not be null");
|
||||
@@ -137,7 +137,7 @@ mindplot.layout.LayoutManager = new Class({
|
||||
// Collect changes ...
|
||||
this._collectChanges();
|
||||
|
||||
if (!$(fireEvents) || fireEvents) {
|
||||
if ($(fireEvents).length>0 || fireEvents) {
|
||||
this._flushEvents();
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ mindplot.layout.LayoutManager = new Class({
|
||||
},
|
||||
|
||||
_flushEvents: function() {
|
||||
this._events.each(function(event) {
|
||||
_.each(this._events, function(event) {
|
||||
this.fireEvent('change', event);
|
||||
}, this);
|
||||
this._events = [];
|
||||
@@ -155,7 +155,7 @@ mindplot.layout.LayoutManager = new Class({
|
||||
if (!nodes)
|
||||
nodes = this._treeSet.getTreeRoots();
|
||||
|
||||
nodes.each(function(node) {
|
||||
_.each(nodes, function(node) {
|
||||
if (node.hasOrderChanged() || node.hasPositionChanged()) {
|
||||
|
||||
// Find or create a event ...
|
||||
|
@@ -155,7 +155,7 @@ mindplot.layout.Node = new Class({
|
||||
}
|
||||
|
||||
// Only update if the property has changed ...
|
||||
if (JSON.encode(prop.value) != JSON.encode(value)) {
|
||||
if (JSON.stringify(prop.value) != JSON.stringify(value)) {
|
||||
prop.oldValue = prop.value;
|
||||
prop.value = value;
|
||||
prop.hasChanged = true;
|
||||
|
@@ -70,7 +70,7 @@ mindplot.layout.OriginalLayout = new Class({
|
||||
|
||||
layout:function () {
|
||||
var roots = this._treeSet.getTreeRoots();
|
||||
roots.each(function (node) {
|
||||
_.each(roots, function (node) {
|
||||
|
||||
// Calculate all node heights ...
|
||||
var sorter = node.getSorter();
|
||||
@@ -107,12 +107,12 @@ mindplot.layout.OriginalLayout = new Class({
|
||||
var sorter = node.getSorter();
|
||||
var offsetById = sorter.computeOffsets(this._treeSet, node);
|
||||
var parentPosition = node.getPosition();
|
||||
|
||||
children.each(function (child) {
|
||||
var me = this;
|
||||
_.each(children, function (child) {
|
||||
var offset = offsetById[child.getId()];
|
||||
|
||||
var childFreeDisplacement = child.getFreeDisplacement();
|
||||
var direction = node.getSorter().getChildDirection(this._treeSet, child);
|
||||
var direction = node.getSorter().getChildDirection(me._treeSet, child);
|
||||
|
||||
if ((direction > 0 && childFreeDisplacement.x < 0) || (direction < 0 && childFreeDisplacement.x > 0)) {
|
||||
child.resetFreeDisplacement();
|
||||
@@ -125,15 +125,15 @@ mindplot.layout.OriginalLayout = new Class({
|
||||
var parentX = parentPosition.x;
|
||||
var parentY = parentPosition.y;
|
||||
|
||||
var newPos = {x:parentX + offset.x, y:parentY + offset.y + this._calculateAlignOffset(node, child, heightById)};
|
||||
this._treeSet.updateBranchPosition(child, newPos);
|
||||
}.bind(this));
|
||||
var newPos = {x:parentX + offset.x, y:parentY + offset.y + me._calculateAlignOffset(node, child, heightById)};
|
||||
me._treeSet.updateBranchPosition(child, newPos);
|
||||
});
|
||||
|
||||
node._branchHeight = newBranchHeight;
|
||||
}
|
||||
|
||||
// Continue reordering the children nodes ...
|
||||
children.each(function (child) {
|
||||
_.each(children, function (child) {
|
||||
this._layoutChildren(child, heightById);
|
||||
}, this);
|
||||
},
|
||||
@@ -183,7 +183,7 @@ mindplot.layout.OriginalLayout = new Class({
|
||||
this._shiftBranches(node, heightById);
|
||||
}
|
||||
|
||||
children.each(function (child) {
|
||||
_.each(children, function (child) {
|
||||
this._fixOverlapping(child, heightById);
|
||||
}, this);
|
||||
},
|
||||
@@ -193,7 +193,7 @@ mindplot.layout.OriginalLayout = new Class({
|
||||
|
||||
var siblingsToShift = this._treeSet.getSiblingsInVerticalDirection(node, node.getFreeDisplacement().y);
|
||||
var last = node;
|
||||
siblingsToShift.each(function (sibling) {
|
||||
_.each(siblingsToShift, function (sibling) {
|
||||
var overlappingOccurs = shiftedBranches.some(function (shiftedBranch) {
|
||||
return this._branchesOverlap(shiftedBranch, sibling, heightById);
|
||||
}, this);
|
||||
@@ -209,7 +209,7 @@ mindplot.layout.OriginalLayout = new Class({
|
||||
return !shiftedBranches.contains(branch);
|
||||
});
|
||||
|
||||
branchesToShift.each(function (branch) {
|
||||
_.each(branchesToShift, function (branch) {
|
||||
var bAmount = node.getFreeDisplacement().y;
|
||||
this._treeSet.shiftBranchPosition(branch, 0, bAmount);
|
||||
shiftedBranches.push(branch);
|
||||
|
@@ -240,9 +240,10 @@ mindplot.layout.RootedTreeSet = new Class({
|
||||
var yOffset = oldPos.y - position.y;
|
||||
|
||||
var children = this.getChildren(node);
|
||||
children.each(function (child) {
|
||||
this.shiftBranchPosition(child, xOffset, yOffset);
|
||||
}.bind(this));
|
||||
var me = this;
|
||||
_.each(children, function (child) {
|
||||
me.shiftBranchPosition(child, xOffset, yOffset);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
@@ -251,9 +252,10 @@ mindplot.layout.RootedTreeSet = new Class({
|
||||
node.setPosition({x:position.x + xOffset, y:position.y + yOffset});
|
||||
|
||||
var children = this.getChildren(node);
|
||||
children.each(function (child) {
|
||||
this.shiftBranchPosition(child, xOffset, yOffset);
|
||||
}.bind(this));
|
||||
var me = this;
|
||||
_.each(children, function (child) {
|
||||
me.shiftBranchPosition(child, xOffset, yOffset);
|
||||
});
|
||||
},
|
||||
|
||||
getSiblingsInVerticalDirection:function (node, yOffset) {
|
||||
|
@@ -168,7 +168,7 @@ mindplot.layout.SymmetricSorter = new Class({
|
||||
|
||||
// Compute the center of the branch ...
|
||||
var totalHeight = 0;
|
||||
heights.each(function (elem) {
|
||||
_.each(heights, function (elem) {
|
||||
totalHeight += elem.height;
|
||||
});
|
||||
var ysum = totalHeight / 2;
|
||||
|
@@ -0,0 +1,49 @@
|
||||
BootstrapDialog.Request = new Class({
|
||||
|
||||
Extends: BootstrapDialog,
|
||||
|
||||
initialize: function(url, title, options) {
|
||||
this.parent(title, options);
|
||||
this.requestOptions = {};
|
||||
this.requestOptions.cache = false;
|
||||
var me = this;
|
||||
this.requestOptions.fail = function(xhr) {
|
||||
// Intercept form requests ...
|
||||
console.log("Failure:");
|
||||
console.log(xhr);
|
||||
};
|
||||
|
||||
this.requestOptions.success = function() {
|
||||
// Intercept form requests ...
|
||||
var forms = me._native.find('form');
|
||||
_.each(forms, function(form) {
|
||||
$(form).on('submit', function(event) {
|
||||
// Intercept form ...
|
||||
me.requestOptions.url = form.action;
|
||||
me.requestOptions.method = form.method ? form.method : 'post';
|
||||
$.ajax(me.requestOptions);
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
this._native.find('.modal-body').load(url, function () {
|
||||
me.acceptButton.unbind('click').click(function () {
|
||||
submitDialogForm();
|
||||
});
|
||||
me._native.on('hidden.bs.modal', function () {
|
||||
$(this).remove();
|
||||
});
|
||||
me.show();
|
||||
});
|
||||
},
|
||||
|
||||
onDialogShown: function() {
|
||||
if (typeof(onDialogShown) == "function") {
|
||||
onDialogShown();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
@@ -0,0 +1,114 @@
|
||||
var BootstrapDialog = new Class({
|
||||
Implements: Options,
|
||||
|
||||
options: {
|
||||
cancelButton: false,
|
||||
closeButton: false,
|
||||
acceptButton: true,
|
||||
removeButton:false,
|
||||
errorMessage: false,
|
||||
onEventData:{}
|
||||
},
|
||||
|
||||
initialize: function (title, options) {
|
||||
this.setOptions(options);
|
||||
this.options.onEventData.dialog = this;
|
||||
this._native = $('<div class="modal fade" tabindex="-1"></div>').append('<div class="modal-dialog"></div>');
|
||||
var content = $('<div class="modal-content"></div>');
|
||||
content.on('keydown', function(event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
var header = this._buildHeader(title);
|
||||
if (header) {
|
||||
content.append(header);
|
||||
}
|
||||
var body = $('<div class="modal-body"></div>');
|
||||
if(this.options.errorMessage){
|
||||
var error = $('<div class="alert alert-danger"></div>');
|
||||
error.hide();
|
||||
body.append(error);
|
||||
}
|
||||
content.append(body);
|
||||
var footer = this._buildFooter();
|
||||
if (footer) {
|
||||
content.append(footer);
|
||||
}
|
||||
this._native.find(".modal-dialog").append(content);
|
||||
this._native.on('hidden.bs.modal', function() {
|
||||
$(this).remove();
|
||||
});
|
||||
this._native.on('shown.bs.modal', this.onDialogShown);
|
||||
},
|
||||
|
||||
_buildFooter: function() {
|
||||
var footer = null;
|
||||
if (this.options.acceptButton || this.options.removeButton || this.options.cancelButton) {
|
||||
footer = $('<div class="modal-footer" style="paddingTop:5;textAlign:center">');
|
||||
}
|
||||
if (this.options.acceptButton) {
|
||||
this.acceptButton = $('<button type="button" class="btn btn-primary" id="acceptBtn" data-dismiss="modal">'+ $msg('ACCEPT') + '</button>');
|
||||
footer.append(this.acceptButton);
|
||||
this.acceptButton.unbind('click').on("click",this.options.onEventData, this.onAcceptClick)
|
||||
}
|
||||
if (this.options.removeButton) {
|
||||
this.removeButton = $('<button type="button" class="btn btn-secondary" id="removeBtn" data-dismiss="modal">'+ $msg('REMOVE') +'</button>');
|
||||
footer.append(this.removeButton);
|
||||
this.removeButton.on('click', this.options.onEventData, this.onRemoveClick);
|
||||
}
|
||||
if (this.options.cancelButton) {
|
||||
footer.append('<button type="button" class="btn btn-secondary" data-dismiss="modal">'+ $msg('CANCEL') +'</button>');
|
||||
}
|
||||
return footer;
|
||||
},
|
||||
|
||||
_buildHeader: function(title) {
|
||||
var header = null;
|
||||
if (this.options.closeButton || title) {
|
||||
header = $('<div class="modal-header"></div>');
|
||||
}
|
||||
if (this.options.closeButton) {
|
||||
header.append(
|
||||
'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>'
|
||||
);
|
||||
}
|
||||
if (title) {
|
||||
header.append('<h2 class="modal-title">' + title + '</h2>');
|
||||
}
|
||||
return header;
|
||||
},
|
||||
|
||||
onAcceptClick: function(event) {
|
||||
throw "Unsupported operation";
|
||||
},
|
||||
|
||||
onDialogShown: function() {},
|
||||
onRemoveClick: function(event) {
|
||||
throw "Unsupported operation";
|
||||
},
|
||||
|
||||
show: function () {
|
||||
this._native.modal();
|
||||
},
|
||||
|
||||
setContent: function(content) {
|
||||
var modalBody = this._native.find('.modal-body');
|
||||
modalBody.append(content);
|
||||
},
|
||||
|
||||
css: function(options){
|
||||
this._native.find('.modal-dialog').css(options);
|
||||
},
|
||||
|
||||
close: function() {
|
||||
this._native.modal('hide');
|
||||
},
|
||||
|
||||
alertError: function(message){
|
||||
this._native.find('.alert-danger').text(message);
|
||||
this._native.find('.alert-danger').show();
|
||||
},
|
||||
|
||||
cleanError: function(){
|
||||
this._native.find('.alert-danger').hide();
|
||||
}
|
||||
});
|
@@ -5333,7 +5333,7 @@ button.close {
|
||||
border-radius: 5px 5px 0 0;
|
||||
}
|
||||
.popover-content {
|
||||
padding: 9px 14px;
|
||||
padding: 4px 6px;
|
||||
}
|
||||
.popover > .arrow,
|
||||
.popover > .arrow:after {
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
110
mindplot/src/main/javascript/libraries/hotkeys/jquery.hotkeys.js
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* jQuery Hotkeys Plugin
|
||||
* Copyright 2010, John Resig
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*
|
||||
* Based upon the plugin by Tzury Bar Yochay:
|
||||
* http://github.com/tzuryby/hotkeys
|
||||
*
|
||||
* Original idea by:
|
||||
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
|
||||
*/
|
||||
|
||||
/*
|
||||
* One small change is: now keys are passed by object { keys: '...' }
|
||||
* Might be useful, when you want to pass some other data to your handler
|
||||
*/
|
||||
|
||||
(function(jQuery){
|
||||
|
||||
jQuery.hotkeys = {
|
||||
version: "0.8",
|
||||
|
||||
specialKeys: {
|
||||
8: "backspace", 9: "tab", 10: "return", 13: "enter", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
|
||||
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
|
||||
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
|
||||
96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
|
||||
104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
|
||||
112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
|
||||
120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 186: ";", 191: "/",
|
||||
220: "\\", 222: "'", 224: "meta"
|
||||
},
|
||||
|
||||
shiftNums: {
|
||||
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
|
||||
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
|
||||
".": ">", "/": "?", "\\": "|"
|
||||
}
|
||||
};
|
||||
|
||||
function keyHandler( handleObj ) {
|
||||
if ( typeof handleObj.data === "string" ) {
|
||||
handleObj.data = { keys: handleObj.data };
|
||||
}
|
||||
|
||||
// Only care when a possible input has been specified
|
||||
if ( !handleObj.data || !handleObj.data.keys || typeof handleObj.data.keys !== "string" ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var origHandler = handleObj.handler,
|
||||
keys = handleObj.data.keys.toLowerCase().split(" "),
|
||||
textAcceptingInputTypes = ["text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime", "datetime-local", "search", "color", "tel"];
|
||||
|
||||
handleObj.handler = function( event ) {
|
||||
// Don't fire in text-accepting inputs that we didn't directly bind to
|
||||
if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
|
||||
jQuery.inArray(event.target.type, textAcceptingInputTypes) > -1 ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var special = jQuery.hotkeys.specialKeys[ event.keyCode ],
|
||||
character = String.fromCharCode( event.which ).toLowerCase(),
|
||||
modif = "", possible = {};
|
||||
|
||||
// check combinations (alt|ctrl|shift+anything)
|
||||
if ( event.altKey && special !== "alt" ) {
|
||||
modif += "alt+";
|
||||
}
|
||||
|
||||
if ( event.ctrlKey && special !== "ctrl" ) {
|
||||
modif += "ctrl+";
|
||||
}
|
||||
|
||||
// TODO: Need to make sure this works consistently across platforms
|
||||
if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
|
||||
modif += "meta+";
|
||||
}
|
||||
|
||||
if ( event.shiftKey && special !== "shift" ) {
|
||||
modif += "shift+";
|
||||
}
|
||||
|
||||
if ( special ) {
|
||||
possible[ modif + special ] = true;
|
||||
}
|
||||
|
||||
if ( character ) {
|
||||
possible[ modif + character ] = true;
|
||||
possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
|
||||
|
||||
// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
|
||||
if ( modif === "shift+" ) {
|
||||
possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
|
||||
}
|
||||
}
|
||||
|
||||
for ( var i = 0, l = keys.length; i < l; i++ ) {
|
||||
if ( possible[ keys[i] ] ) {
|
||||
return origHandler.apply( this, arguments );
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
jQuery.each([ "keydown", "keyup", "keypress" ], function() {
|
||||
jQuery.event.special[ this ] = { add: keyHandler };
|
||||
});
|
||||
|
||||
})( this.jQuery );
|
9111
mindplot/src/main/javascript/libraries/jquery/jquery-2.1.0.js
vendored
Normal file
8
mindplot/src/main/javascript/libraries/jquery/jquery.mousewheel.min.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Version: 3.1.11
|
||||
*
|
||||
* Requires: jQuery 1.2.2+
|
||||
*/
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.11",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b)["offsetParent"in a.fn?"offsetParent":"parent"]();return c.length||(c=a("body")),parseInt(c.css("fontSize"),10)},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
|
@@ -1,971 +0,0 @@
|
||||
//
|
||||
// LESS - Leaner CSS v1.1.3
|
||||
// http://lesscss.org
|
||||
//
|
||||
// Copyright (c) 2009-2011, Alexis Sellier
|
||||
// Licensed under the Apache 2.0 License.
|
||||
//
|
||||
//
|
||||
// LESS - Leaner CSS v1.1.3
|
||||
// http://lesscss.org
|
||||
//
|
||||
// Copyright (c) 2009-2011, Alexis Sellier
|
||||
// Licensed under the Apache 2.0 License.
|
||||
//
|
||||
(function(a, b) {
|
||||
function v(a, b) {
|
||||
var c = "less-error-message:" + p(b),e = ["<ul>",'<li><label>[-1]</label><pre class="ctx">{0}</pre></li>',"<li><label>[0]</label><pre>{current}</pre></li>",'<li><label>[1]</label><pre class="ctx">{2}</pre></li>',"</ul>"].join("\n"),f = document.createElement("div"),g,h;
|
||||
f.id = c,f.className = "less-error-message",h = "<h3>" + (a.message || "There is an error in your .less file") + "</h3>" + '<p><a href="' + b + '">' + b + "</a> ",a.extract && (h += "on line " + a.line + ", column " + (a.column + 1) + ":</p>" + e.replace(/\[(-?\d)\]/g,
|
||||
function(b, c) {
|
||||
return parseInt(a.line) + parseInt(c) || ""
|
||||
}).replace(/\{(\d)\}/g,
|
||||
function(b, c) {
|
||||
return a.extract[parseInt(c)] || ""
|
||||
}).replace(/\{current\}/, a.extract[1].slice(0, a.column) + '<span class="error">' + a.extract[1].slice(a.column) + "</span>")),f.innerHTML = h,q([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #ee4444;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.ctx {","color: #dd4444;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"), {title:"error-message"}),f.style.cssText = ["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),d.env == "development" && (g = setInterval(function() {
|
||||
document.body && (document.getElementById(c) ? document.body.replaceChild(f, document.getElementById(c)) : document.body.insertBefore(f, document.body.firstChild),clearInterval(g))
|
||||
}, 10))
|
||||
}
|
||||
|
||||
function u(a) {
|
||||
d.env == "development" && typeof console != "undefined" && console.log("less: " + a)
|
||||
}
|
||||
|
||||
function t(a) {
|
||||
return a && a.parentNode.removeChild(a)
|
||||
}
|
||||
|
||||
function s() {
|
||||
if (a.XMLHttpRequest)return new XMLHttpRequest;
|
||||
try {
|
||||
return new ActiveXObject("MSXML2.XMLHTTP.3.0")
|
||||
} catch(b) {
|
||||
u("browser doesn't support AJAX.");
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
function r(a, b, c, e) {
|
||||
function i(b, c, d) {
|
||||
b.status >= 200 && b.status < 300 ? c(b.responseText, b.getResponseHeader("Last-Modified")) : typeof d == "function" && d(b.status, a)
|
||||
}
|
||||
|
||||
var f = s(),h = g ? !1 : d.async;
|
||||
typeof f.overrideMimeType == "function" && f.overrideMimeType("text/css"),f.open("GET", a, h),f.setRequestHeader("Accept", b || "text/x-less, text/css; q=0.9, */*; q=0.5"),f.send(null),g ? f.status === 0 ? c(f.responseText) : e(f.status, a) : h ? f.onreadystatechange = function() {
|
||||
f.readyState == 4 && i(f, c, e)
|
||||
} : i(f, c, e)
|
||||
}
|
||||
|
||||
function q(a, b, c) {
|
||||
var d,e = b.href ? b.href.replace(/\?.*$/, "") : "",f = "less:" + (b.title || p(e));
|
||||
(d = document.getElementById(f)) === null && (d = document.createElement("style"),d.type = "text/css",d.media = b.media || "screen",d.id = f,document.getElementsByTagName("head")[0].appendChild(d));
|
||||
if (d.styleSheet)try {
|
||||
d.styleSheet.cssText = a
|
||||
} catch(g) {
|
||||
throw new Error("Couldn't reassign styleSheet.cssText.")
|
||||
} else(function(a) {
|
||||
d.childNodes.length > 0 ? d.firstChild.nodeValue !== a.nodeValue && d.replaceChild(a, d.firstChild) : d.appendChild(a)
|
||||
})(document.createTextNode(a));
|
||||
c && h && (u("saving " + e + " to cache."),h.setItem(e, a),h.setItem(e + ":timestamp", c))
|
||||
}
|
||||
|
||||
function p(a) {
|
||||
return a.replace(/^[a-z]+:\/\/?[^\/]+/, "").replace(/^\//, "").replace(/\?.*$/, "").replace(/\.[^\.\/]+$/, "").replace(/[^\.\w-]+/g, "-").replace(/\./g, ":")
|
||||
}
|
||||
|
||||
function o(b, c, e, f) {
|
||||
var g = a.location.href.replace(/[#?].*$/, ""),i = b.href.replace(/\?.*$/, ""),j = h && h.getItem(i),k = h && h.getItem(i + ":timestamp"),l = {css:j,timestamp:k};
|
||||
/^(https?|file):/.test(i) || (i.charAt(0) == "/" ? i = a.location.protocol + "//" + a.location.host + i : i = g.slice(0, g.lastIndexOf("/") + 1) + i),r(b.href, b.type, function(a, g) {
|
||||
if (!e && l && g && (new Date(g)).valueOf() === (new Date(l.timestamp)).valueOf())q(l.css, b),c(null, b, {local:!0,remaining:f}); else try {
|
||||
(new d.Parser({optimization:d.optimization,paths:[i.replace(/[\w\.-]+$/, "")],mime:b.type})).parse(a, function(a, d) {
|
||||
if (a)return v(a, i);
|
||||
try {
|
||||
c(d, b, {local:!1,lastModified:g,remaining:f}),t(document.getElementById("less-error-message:" + p(i)))
|
||||
} catch(a) {
|
||||
v(a, i)
|
||||
}
|
||||
})
|
||||
} catch(h) {
|
||||
v(h, i)
|
||||
}
|
||||
}, function(a, b) {
|
||||
throw new Error("Couldn't load " + b + " (" + a + ")")
|
||||
})
|
||||
}
|
||||
|
||||
function n(a, b) {
|
||||
for (var c = 0; c < d.sheets.length; c++)o(d.sheets[c], a, b, d.sheets.length - (c + 1))
|
||||
}
|
||||
|
||||
function m() {
|
||||
var a = document.getElementsByTagName("style");
|
||||
for (var b = 0; b < a.length; b++)a[b].type.match(k) && (new d.Parser).parse(a[b].innerHTML || "", function(c, d) {
|
||||
a[b].type = "text/css",a[b].innerHTML = d.toCSS()
|
||||
})
|
||||
}
|
||||
|
||||
function c(b) {
|
||||
return a.less[b.split("/")[1]]
|
||||
}
|
||||
|
||||
Array.isArray || (Array.isArray = function(a) {
|
||||
return Object.prototype.toString.call(a) === "[object Array]" || a instanceof Array
|
||||
}),Array.prototype.forEach || (Array.prototype.forEach = function(a, b) {
|
||||
var c = this.length >>> 0;
|
||||
for (var d = 0; d < c; d++)d in this && a.call(b, this[d], d, this)
|
||||
}),Array.prototype.map || (Array.prototype.map = function(a) {
|
||||
var b = this.length >>> 0,c = Array(b),d = arguments[1];
|
||||
for (var e = 0; e < b; e++)e in this && (c[e] = a.call(d, this[e], e, this));
|
||||
return c
|
||||
}),Array.prototype.filter || (Array.prototype.filter = function(a) {
|
||||
var b = [],c = arguments[1];
|
||||
for (var d = 0; d < this.length; d++)a.call(c, this[d]) && b.push(this[d]);
|
||||
return b
|
||||
}),Array.prototype.reduce || (Array.prototype.reduce = function(a) {
|
||||
var b = this.length >>> 0,c = 0;
|
||||
if (b === 0 && arguments.length === 1)throw new TypeError;
|
||||
if (arguments.length >= 2)var d = arguments[1]; else for (; ;) {
|
||||
if (c in this) {
|
||||
d = this[c++];
|
||||
break
|
||||
}
|
||||
if (++c >= b)throw new TypeError
|
||||
}
|
||||
for (; c < b; c++)c in this && (d = a.call(null, d, this[c], c, this));
|
||||
return d
|
||||
}),Array.prototype.indexOf || (Array.prototype.indexOf = function(a) {
|
||||
var b = this.length,c = arguments[1] || 0;
|
||||
if (!b)return-1;
|
||||
if (c >= b)return-1;
|
||||
c < 0 && (c += b);
|
||||
for (; c < b; c++) {
|
||||
if (!Object.prototype.hasOwnProperty.call(this, c))continue;
|
||||
if (a === this[c])return c
|
||||
}
|
||||
return-1
|
||||
}),Object.keys || (Object.keys = function(a) {
|
||||
var b = [];
|
||||
for (var c in a)Object.prototype.hasOwnProperty.call(a, c) && b.push(c);
|
||||
return b
|
||||
}),String.prototype.trim || (String.prototype.trim = function() {
|
||||
return String(this).replace(/^\s\s*/, "").replace(/\s\s*$/, "")
|
||||
});
|
||||
var d,e;
|
||||
typeof a == "undefined" ? (d = exports,e = c("less/tree")) : (typeof a.less == "undefined" && (a.less = {}),d = a.less,e = a.less.tree = {}),d.Parser = function(a) {
|
||||
function t(a) {
|
||||
return typeof a == "string" ? b.charAt(c) === a : a.test(j[f]) ? !0 : !1
|
||||
}
|
||||
|
||||
function s(a) {
|
||||
var d,e,g,h,i,m,n,o;
|
||||
if (a instanceof Function)return a.call(l.parsers);
|
||||
if (typeof a == "string")d = b.charAt(c) === a ? a : null,g = 1,r(); else {
|
||||
r();
|
||||
if (d = a.exec(j[f]))g = d[0].length; else return null
|
||||
}
|
||||
if (d) {
|
||||
o = c += g,m = c + j[f].length - g;
|
||||
while (c < m) {
|
||||
h = b.charCodeAt(c);
|
||||
if (h !== 32 && h !== 10 && h !== 9)break;
|
||||
c++
|
||||
}
|
||||
j[f] = j[f].slice(g + (c - o)),k = c,j[f].length === 0 && f < j.length - 1 && f++;
|
||||
return typeof d == "string" ? d : d.length === 1 ? d[0] : d
|
||||
}
|
||||
}
|
||||
|
||||
function r() {
|
||||
c > k && (j[f] = j[f].slice(c - k),k = c)
|
||||
}
|
||||
|
||||
function q() {
|
||||
j[f] = g,c = h,k = c
|
||||
}
|
||||
|
||||
function p() {
|
||||
g = j[f],h = c,k = c
|
||||
}
|
||||
|
||||
var b,c,f,g,h,i,j,k,l,m = this,n = function() {
|
||||
},o = this.imports = {paths:a && a.paths || [],queue:[],files:{},mime:a && a.mime,push:function(b, c) {
|
||||
var e = this;
|
||||
this.queue.push(b),d.Parser.importer(b, this.paths, function(a) {
|
||||
e.queue.splice(e.queue.indexOf(b), 1),e.files[b] = a,c(a),e.queue.length === 0 && n()
|
||||
}, a)
|
||||
}};
|
||||
this.env = a = a || {},this.optimization = "optimization"in this.env ? this.env.optimization : 1,this.env.filename = this.env.filename || null;
|
||||
return l = {imports:o,parse:function(d, g) {
|
||||
var h,l,m,o,p,q,r = [],t,u = null;
|
||||
c = f = k = i = 0,j = [],b = d.replace(/\r\n/g, "\n"),j = function(c) {
|
||||
var d = 0,e = /[^"'`\{\}\/\(\)]+/g,f = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,g = 0,h,i = c[0],j,k;
|
||||
for (var l = 0,m,n; l < b.length; l++) {
|
||||
e.lastIndex = l,(h = e.exec(b)) && h.index === l && (l += h[0].length,i.push(h[0])),m = b.charAt(l),f.lastIndex = l,!k && !j && m === "/" && (n = b.charAt(l + 1),(n === "/" || n === "*") && (h = f.exec(b)) && h.index === l && (l += h[0].length,i.push(h[0]),m = b.charAt(l)));
|
||||
if (m === "{" && !k && !j)g++,i.push(m); else if (m === "}" && !k && !j)g--,i.push(m),c[++d] = i = []; else if (m === "(" && !k && !j)i.push(m),j = !0; else if (m === ")" && !k && j)i.push(m),j = !1; else {
|
||||
if (m === '"' || m === "'" || m === "`")k ? k = k === m ? !1 : k : k = m;
|
||||
i.push(m)
|
||||
}
|
||||
}
|
||||
if (g > 0)throw{type:"Syntax",message:"Missing closing `}`",filename:a.filename};
|
||||
return c.map(function(a) {
|
||||
return a.join("")
|
||||
})
|
||||
}([
|
||||
[]
|
||||
]),h = new e.Ruleset([], s(this.parsers.primary)),h.root = !0,h.toCSS = function(c) {
|
||||
var d,f,g;
|
||||
return function(g, h) {
|
||||
function n(a) {
|
||||
return a ? (b.slice(0, a).match(/\n/g) || "").length : null
|
||||
}
|
||||
|
||||
var i = [];
|
||||
g = g || {},typeof h == "object" && !Array.isArray(h) && (h = Object.keys(h).map(function(a) {
|
||||
var b = h[a];
|
||||
b instanceof e.Value || (b instanceof e.Expression || (b = new e.Expression([b])),b = new e.Value([b]));
|
||||
return new e.Rule("@" + a, b, !1, 0)
|
||||
}),i = [new e.Ruleset(null, h)]);
|
||||
try {
|
||||
var j = c.call(this, {frames:i}).toCSS([], {compress:g.compress || !1})
|
||||
} catch(k) {
|
||||
f = b.split("\n"),d = n(k.index);
|
||||
for (var l = k.index,m = -1; l >= 0 && b.charAt(l) !== "\n"; l--)m++;
|
||||
throw{type:k.type,message:k.message,filename:a.filename,index:k.index,line:typeof d == "number" ? d + 1 : null,callLine:k.call && n(k.call) + 1,callExtract:f[n(k.call)],stack:k.stack,column:m,extract:[f[d - 1],f[d],f[d + 1]]}
|
||||
}
|
||||
return g.compress ? j.replace(/(\s)+/g, "$1") : j
|
||||
}
|
||||
}(h.eval);
|
||||
if (c < b.length - 1) {
|
||||
c = i,q = b.split("\n"),p = (b.slice(0, c).match(/\n/g) || "").length + 1;
|
||||
for (var v = c,w = -1; v >= 0 && b.charAt(v) !== "\n"; v--)w++;
|
||||
u = {name:"ParseError",message:"Syntax Error on line " + p,index:c,filename:a.filename,line:p,column:w,extract:[q[p - 2],q[p - 1],q[p]]}
|
||||
}
|
||||
this.imports.queue.length > 0 ? n = function() {
|
||||
g(u, h)
|
||||
} : g(u, h)
|
||||
},parsers:{primary:function() {
|
||||
var a,b = [];
|
||||
while ((a = s(this.mixin.definition) || s(this.rule) || s(this.ruleset) || s(this.mixin.call) || s(this.comment) || s(this.directive)) || s(/^[\s\n]+/))a && b.push(a);
|
||||
return b
|
||||
},comment:function() {
|
||||
var a;
|
||||
if (b.charAt(c) === "/") {
|
||||
if (b.charAt(c + 1) === "/")return new e.Comment(s(/^\/\/.*/), !0);
|
||||
if (a = s(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new e.Comment(a)
|
||||
}
|
||||
},entities:{quoted:function() {
|
||||
var a,d = c,f;
|
||||
b.charAt(d) === "~" && (d++,f = !0);
|
||||
if (b.charAt(d) === '"' || b.charAt(d) === "'") {
|
||||
f && s("~");
|
||||
if (a = s(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new e.Quoted(a[0], a[1] || a[2], f)
|
||||
}
|
||||
},keyword:function() {
|
||||
var a;
|
||||
if (a = s(/^[A-Za-z-]+/))return new e.Keyword(a)
|
||||
},call:function() {
|
||||
var a,b,d = c;
|
||||
if (!!(a = /^([\w-]+|%)\(/.exec(j[f]))) {
|
||||
a = a[1].toLowerCase();
|
||||
if (a === "url")return null;
|
||||
c += a.length;
|
||||
if (a === "alpha")return s(this.alpha);
|
||||
s("("),b = s(this.entities.arguments);
|
||||
if (!s(")"))return;
|
||||
if (a)return new e.Call(a, b, d)
|
||||
}
|
||||
},arguments:function() {
|
||||
var a = [],b;
|
||||
while (b = s(this.expression)) {
|
||||
a.push(b);
|
||||
if (!s(","))break
|
||||
}
|
||||
return a
|
||||
},literal:function() {
|
||||
return s(this.entities.dimension) || s(this.entities.color) || s(this.entities.quoted)
|
||||
},url:function() {
|
||||
var a;
|
||||
if (b.charAt(c) === "u" && !!s(/^url\(/)) {
|
||||
a = s(this.entities.quoted) || s(this.entities.variable) || s(this.entities.dataURI) || s(/^[-\w%@$\/.&=:;#+?~]+/) || "";
|
||||
if (!s(")"))throw new Error("missing closing ) for url()");
|
||||
return new e.URL(a.value || a.data || a instanceof e.Variable ? a : new e.Anonymous(a), o.paths)
|
||||
}
|
||||
},dataURI:function() {
|
||||
var a;
|
||||
if (s(/^data:/)) {
|
||||
a = {},a.mime = s(/^[^\/]+\/[^,;)]+/) || "",a.charset = s(/^;\s*charset=[^,;)]+/) || "",a.base64 = s(/^;\s*base64/) || "",a.data = s(/^,\s*[^)]+/);
|
||||
if (a.data)return a
|
||||
}
|
||||
},variable:function() {
|
||||
var a,d = c;
|
||||
if (b.charAt(c) === "@" && (a = s(/^@@?[\w-]+/)))return new e.Variable(a, d)
|
||||
},color:function() {
|
||||
var a;
|
||||
if (b.charAt(c) === "#" && (a = s(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new e.Color(a[1])
|
||||
},dimension:function() {
|
||||
var a,d = b.charCodeAt(c);
|
||||
if (!(d > 57 || d < 45 || d === 47))if (a = s(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new e.Dimension(a[1], a[2])
|
||||
},javascript:function() {
|
||||
var a,d = c,f;
|
||||
b.charAt(d) === "~" && (d++,f = !0);
|
||||
if (b.charAt(d) === "`") {
|
||||
f && s("~");
|
||||
if (a = s(/^`([^`]*)`/))return new e.JavaScript(a[1], c, f)
|
||||
}
|
||||
}},variable:function() {
|
||||
var a;
|
||||
if (b.charAt(c) === "@" && (a = s(/^(@[\w-]+)\s*:/)))return a[1]
|
||||
},shorthand:function() {
|
||||
var a,b;
|
||||
if (!!t(/^[@\w.%-]+\/[@\w.-]+/) && (a = s(this.entity)) && s("/") && (b = s(this.entity)))return new e.Shorthand(a, b)
|
||||
},mixin:{call:function() {
|
||||
var a = [],d,f,g,h = c,i = b.charAt(c);
|
||||
if (i === "." || i === "#") {
|
||||
while (d = s(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/))a.push(new e.Element(f, d)),f = s(">");
|
||||
s("(") && (g = s(this.entities.arguments)) && s(")");
|
||||
if (a.length > 0 && (s(";") || t("}")))return new e.mixin.Call(a, g, h)
|
||||
}
|
||||
},definition:function() {
|
||||
var a,d = [],f,g,h,i;
|
||||
if (!(b.charAt(c) !== "." && b.charAt(c) !== "#" || t(/^[^{]*(;|})/)))if (f = s(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)) {
|
||||
a = f[1];
|
||||
while (h = s(this.entities.variable) || s(this.entities.literal) || s(this.entities.keyword)) {
|
||||
if (h instanceof e.Variable)if (s(":"))if (i = s(this.expression))d.push({name:h.name,value:i}); else throw new Error("Expected value"); else d.push({name:h.name}); else d.push({value:h});
|
||||
if (!s(","))break
|
||||
}
|
||||
if (!s(")"))throw new Error("Expected )");
|
||||
g = s(this.block);
|
||||
if (g)return new e.mixin.Definition(a, d, g)
|
||||
}
|
||||
}},entity:function() {
|
||||
return s(this.entities.literal) || s(this.entities.variable) || s(this.entities.url) || s(this.entities.call) || s(this.entities.keyword) || s(this.entities.javascript) || s(this.comment)
|
||||
},end:function() {
|
||||
return s(";") || t("}")
|
||||
},alpha:function() {
|
||||
var a;
|
||||
if (!!s(/^\(opacity=/i))if (a = s(/^\d+/) || s(this.entities.variable)) {
|
||||
if (!s(")"))throw new Error("missing closing ) for alpha()");
|
||||
return new e.Alpha(a)
|
||||
}
|
||||
},element:function() {
|
||||
var a,b,c;
|
||||
c = s(this.combinator),a = s(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || s("*") || s(this.attribute) || s(/^\([^)@]+\)/);
|
||||
if (a)return new e.Element(c, a)
|
||||
},combinator:function() {
|
||||
var a,d = b.charAt(c);
|
||||
if (d === ">" || d === "&" || d === "+" || d === "~") {
|
||||
c++;
|
||||
while (b.charAt(c) === " ")c++;
|
||||
return new e.Combinator(d)
|
||||
}
|
||||
if (d === ":" && b.charAt(c + 1) === ":") {
|
||||
c += 2;
|
||||
while (b.charAt(c) === " ")c++;
|
||||
return new e.Combinator("::")
|
||||
}
|
||||
return b.charAt(c - 1) === " " ? new e.Combinator(" ") : new e.Combinator(null)
|
||||
},selector:function() {
|
||||
var a,d,f = [],g,h;
|
||||
while (d = s(this.element)) {
|
||||
g = b.charAt(c),f.push(d);
|
||||
if (g === "{" || g === "}" || g === ";" || g === ",")break
|
||||
}
|
||||
if (f.length > 0)return new e.Selector(f)
|
||||
},tag:function() {
|
||||
return s(/^[a-zA-Z][a-zA-Z-]*[0-9]?/) || s("*")
|
||||
},attribute:function() {
|
||||
var a = "",b,c,d;
|
||||
if (!!s("[")) {
|
||||
if (b = s(/^[a-zA-Z-]+/) || s(this.entities.quoted))(d = s(/^[|~*$^]?=/)) && (c = s(this.entities.quoted) || s(/^[\w-]+/)) ? a = [b,d,c.toCSS ? c.toCSS() : c].join("") : a = b;
|
||||
if (!s("]"))return;
|
||||
if (a)return"[" + a + "]"
|
||||
}
|
||||
},block:function() {
|
||||
var a;
|
||||
if (s("{") && (a = s(this.primary)) && s("}"))return a
|
||||
},ruleset:function() {
|
||||
var a = [],b,d,g;
|
||||
p();
|
||||
if (g = /^([.#: \w-]+)[\s\n]*\{/.exec(j[f]))c += g[0].length - 1,a = [new e.Selector([new e.Element(null, g[1])])]; else while (b = s(this.selector)) {
|
||||
a.push(b),s(this.comment);
|
||||
if (!s(","))break;
|
||||
s(this.comment)
|
||||
}
|
||||
if (a.length > 0 && (d = s(this.block)))return new e.Ruleset(a, d);
|
||||
i = c,q()
|
||||
},rule:function() {
|
||||
var a,d,g = b.charAt(c),k,l;
|
||||
p();
|
||||
if (g !== "." && g !== "#" && g !== "&")if (a = s(this.variable) || s(this.property)) {
|
||||
a.charAt(0) != "@" && (l = /^([^@+\/'"*`(;{}-]*);/.exec(j[f])) ? (c += l[0].length - 1,d = new e.Anonymous(l[1])) : a === "font" ? d = s(this.font) : d = s(this.value),k = s(this.important);
|
||||
if (d && s(this.end))return new e.Rule(a, d, k, h);
|
||||
i = c,q()
|
||||
}
|
||||
},"import":function() {
|
||||
var a;
|
||||
if (s(/^@import\s+/) && (a = s(this.entities.quoted) || s(this.entities.url)) && s(";"))return new e.Import(a, o)
|
||||
},directive:function() {
|
||||
var a,d,f,g;
|
||||
if (b.charAt(c) === "@") {
|
||||
if (d = s(this["import"]))return d;
|
||||
if (a = s(/^@media|@page|@-[-a-z]+/)) {
|
||||
g = (s(/^[^{]+/) || "").trim();
|
||||
if (f = s(this.block))return new e.Directive(a + " " + g, f)
|
||||
} else if (a = s(/^@[-a-z]+/))if (a === "@font-face") {
|
||||
if (f = s(this.block))return new e.Directive(a, f)
|
||||
} else if ((d = s(this.entity)) && s(";"))return new e.Directive(a, d)
|
||||
}
|
||||
},font:function() {
|
||||
var a = [],b = [],c,d,f,g;
|
||||
while (g = s(this.shorthand) || s(this.entity))b.push(g);
|
||||
a.push(new e.Expression(b));
|
||||
if (s(","))while (g = s(this.expression)) {
|
||||
a.push(g);
|
||||
if (!s(","))break
|
||||
}
|
||||
return new e.Value(a)
|
||||
},value:function() {
|
||||
var a,b = [],c;
|
||||
while (a = s(this.expression)) {
|
||||
b.push(a);
|
||||
if (!s(","))break
|
||||
}
|
||||
if (b.length > 0)return new e.Value(b)
|
||||
},important:function() {
|
||||
if (b.charAt(c) === "!")return s(/^! *important/)
|
||||
},sub:function() {
|
||||
var a;
|
||||
if (s("(") && (a = s(this.expression)) && s(")"))return a
|
||||
},multiplication:function() {
|
||||
var a,b,c,d;
|
||||
if (a = s(this.operand)) {
|
||||
while ((c = s("/") || s("*")) && (b = s(this.operand)))d = new e.Operation(c, [d || a,b]);
|
||||
return d || a
|
||||
}
|
||||
},addition:function() {
|
||||
var a,d,f,g;
|
||||
if (a = s(this.multiplication)) {
|
||||
while ((f = s(/^[-+]\s+/) || b.charAt(c - 1) != " " && (s("+") || s("-"))) && (d = s(this.multiplication)))g = new e.Operation(f, [g || a,d]);
|
||||
return g || a
|
||||
}
|
||||
},operand:function() {
|
||||
var a,d = b.charAt(c + 1);
|
||||
b.charAt(c) === "-" && (d === "@" || d === "(") && (a = s("-"));
|
||||
var f = s(this.sub) || s(this.entities.dimension) || s(this.entities.color) || s(this.entities.variable) || s(this.entities.call);
|
||||
return a ? new e.Operation("*", [new e.Dimension(-1),f]) : f
|
||||
},expression:function() {
|
||||
var a,b,c = [],d;
|
||||
while (a = s(this.addition) || s(this.entity))c.push(a);
|
||||
if (c.length > 0)return new e.Expression(c)
|
||||
},property:function() {
|
||||
var a;
|
||||
if (a = s(/^(\*?-?[-a-z_0-9]+)\s*:/))return a[1]
|
||||
}}}
|
||||
},typeof a != "undefined" && (d.Parser.importer = function(a, b, c, d) {
|
||||
a.charAt(0) !== "/" && b.length > 0 && (a = b[0] + a),o({href:a,title:a,type:d.mime}, c, !0)
|
||||
}),function(a) {
|
||||
function d(a) {
|
||||
return Math.min(1, Math.max(0, a))
|
||||
}
|
||||
|
||||
function c(b) {
|
||||
if (b instanceof a.Dimension)return parseFloat(b.unit == "%" ? b.value / 100 : b.value);
|
||||
if (typeof b == "number")return b;
|
||||
throw{error:"RuntimeError",message:"color functions take numbers as parameters"}
|
||||
}
|
||||
|
||||
function b(b) {
|
||||
return a.functions.hsla(b.h, b.s, b.l, b.a)
|
||||
}
|
||||
|
||||
a.functions = {rgb:function(a, b, c) {
|
||||
return this.rgba(a, b, c, 1)
|
||||
},rgba:function(b, d, e, f) {
|
||||
var g = [b,d,e].map(function(a) {
|
||||
return c(a)
|
||||
}),f = c(f);
|
||||
return new a.Color(g, f)
|
||||
},hsl:function(a, b, c) {
|
||||
return this.hsla(a, b, c, 1)
|
||||
},hsla:function(a, b, d, e) {
|
||||
function h(a) {
|
||||
a = a < 0 ? a + 1 : a > 1 ? a - 1 : a;
|
||||
return a * 6 < 1 ? g + (f - g) * a * 6 : a * 2 < 1 ? f : a * 3 < 2 ? g + (f - g) * (2 / 3 - a) * 6 : g
|
||||
}
|
||||
|
||||
a = c(a) % 360 / 360,b = c(b),d = c(d),e = c(e);
|
||||
var f = d <= .5 ? d * (b + 1) : d + b - d * b,g = d * 2 - f;
|
||||
return this.rgba(h(a + 1 / 3) * 255, h(a) * 255, h(a - 1 / 3) * 255, e)
|
||||
},hue:function(b) {
|
||||
return new a.Dimension(Math.round(b.toHSL().h))
|
||||
},saturation:function(b) {
|
||||
return new a.Dimension(Math.round(b.toHSL().s * 100), "%")
|
||||
},lightness:function(b) {
|
||||
return new a.Dimension(Math.round(b.toHSL().l * 100), "%")
|
||||
},alpha:function(b) {
|
||||
return new a.Dimension(b.toHSL().a)
|
||||
},saturate:function(a, c) {
|
||||
var e = a.toHSL();
|
||||
e.s += c.value / 100,e.s = d(e.s);
|
||||
return b(e)
|
||||
},desaturate:function(a, c) {
|
||||
var e = a.toHSL();
|
||||
e.s -= c.value / 100,e.s = d(e.s);
|
||||
return b(e)
|
||||
},lighten:function(a, c) {
|
||||
var e = a.toHSL();
|
||||
e.l += c.value / 100,e.l = d(e.l);
|
||||
return b(e)
|
||||
},darken:function(a, c) {
|
||||
var e = a.toHSL();
|
||||
e.l -= c.value / 100,e.l = d(e.l);
|
||||
return b(e)
|
||||
},fadein:function(a, c) {
|
||||
var e = a.toHSL();
|
||||
e.a += c.value / 100,e.a = d(e.a);
|
||||
return b(e)
|
||||
},fadeout:function(a, c) {
|
||||
var e = a.toHSL();
|
||||
e.a -= c.value / 100,e.a = d(e.a);
|
||||
return b(e)
|
||||
},spin:function(a, c) {
|
||||
var d = a.toHSL(),e = (d.h + c.value) % 360;
|
||||
d.h = e < 0 ? 360 + e : e;
|
||||
return b(d)
|
||||
},mix:function(b, c, d) {
|
||||
var e = d.value / 100,f = e * 2 - 1,g = b.toHSL().a - c.toHSL().a,h = ((f * g == -1 ? f : (f + g) / (1 + f * g)) + 1) / 2,i = 1 - h,j = [b.rgb[0] * h + c.rgb[0] * i,b.rgb[1] * h + c.rgb[1] * i,b.rgb[2] * h + c.rgb[2] * i],k = b.alpha * e + c.alpha * (1 - e);
|
||||
return new a.Color(j, k)
|
||||
},greyscale:function(b) {
|
||||
return this.desaturate(b, new a.Dimension(100))
|
||||
},e:function(b) {
|
||||
return new a.Anonymous(b instanceof a.JavaScript ? b.evaluated : b)
|
||||
},escape:function(b) {
|
||||
return new a.Anonymous(encodeURI(b.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29"))
|
||||
},"%":function(b) {
|
||||
var c = Array.prototype.slice.call(arguments, 1),d = b.value;
|
||||
for (var e = 0; e < c.length; e++)d = d.replace(/%[sda]/i, function(a) {
|
||||
var b = a.match(/s/i) ? c[e].value : c[e].toCSS();
|
||||
return a.match(/[A-Z]$/) ? encodeURIComponent(b) : b
|
||||
});
|
||||
d = d.replace(/%%/g, "%");
|
||||
return new a.Quoted('"' + d + '"', d)
|
||||
},round:function(b) {
|
||||
if (b instanceof a.Dimension)return new a.Dimension(Math.round(c(b)), b.unit);
|
||||
if (typeof b == "number")return Math.round(b);
|
||||
throw{error:"RuntimeError",message:"math functions take numbers as parameters"}
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Alpha = function(a) {
|
||||
this.value = a
|
||||
},a.Alpha.prototype = {toCSS:function() {
|
||||
return"alpha(opacity=" + (this.value.toCSS ? this.value.toCSS() : this.value) + ")"
|
||||
},eval:function(a) {
|
||||
this.value.eval && (this.value = this.value.eval(a));
|
||||
return this
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Anonymous = function(a) {
|
||||
this.value = a.value || a
|
||||
},a.Anonymous.prototype = {toCSS:function() {
|
||||
return this.value
|
||||
},eval:function() {
|
||||
return this
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Call = function(a, b, c) {
|
||||
this.name = a,this.args = b,this.index = c
|
||||
},a.Call.prototype = {eval:function(b) {
|
||||
var c = this.args.map(function(a) {
|
||||
return a.eval(b)
|
||||
});
|
||||
if (!(this.name in a.functions))return new a.Anonymous(this.name + "(" + c.map(
|
||||
function(a) {
|
||||
return a.toCSS()
|
||||
}).join(", ") + ")");
|
||||
try {
|
||||
return a.functions[this.name].apply(a.functions, c)
|
||||
} catch(d) {
|
||||
throw{message:"error evaluating function `" + this.name + "`",index:this.index}
|
||||
}
|
||||
},toCSS:function(a) {
|
||||
return this.eval(a).toCSS()
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Color = function(a, b) {
|
||||
Array.isArray(a) ? this.rgb = a : a.length == 6 ? this.rgb = a.match(/.{2}/g).map(function(a) {
|
||||
return parseInt(a, 16)
|
||||
}) : a.length == 8 ? (this.alpha = parseInt(a.substring(0, 2), 16) / 255,this.rgb = a.substr(2).match(/.{2}/g).map(function(a) {
|
||||
return parseInt(a, 16)
|
||||
})) : this.rgb = a.split("").map(function(a) {
|
||||
return parseInt(a + a, 16)
|
||||
}),this.alpha = typeof b == "number" ? b : 1
|
||||
},a.Color.prototype = {eval:function() {
|
||||
return this
|
||||
},toCSS:function() {
|
||||
return this.alpha < 1 ? "rgba(" + this.rgb.map(
|
||||
function(a) {
|
||||
return Math.round(a)
|
||||
}).concat(this.alpha).join(", ") + ")" : "#" + this.rgb.map(
|
||||
function(a) {
|
||||
a = Math.round(a),a = (a > 255 ? 255 : a < 0 ? 0 : a).toString(16);
|
||||
return a.length === 1 ? "0" + a : a
|
||||
}).join("")
|
||||
},operate:function(b, c) {
|
||||
var d = [];
|
||||
c instanceof a.Color || (c = c.toColor());
|
||||
for (var e = 0; e < 3; e++)d[e] = a.operate(b, this.rgb[e], c.rgb[e]);
|
||||
return new a.Color(d, this.alpha + c.alpha)
|
||||
},toHSL:function() {
|
||||
var a = this.rgb[0] / 255,b = this.rgb[1] / 255,c = this.rgb[2] / 255,d = this.alpha,e = Math.max(a, b, c),f = Math.min(a, b, c),g,h,i = (e + f) / 2,j = e - f;
|
||||
if (e === f)g = h = 0; else {
|
||||
h = i > .5 ? j / (2 - e - f) : j / (e + f);
|
||||
switch (e) {
|
||||
case a:
|
||||
g = (b - c) / j + (b < c ? 6 : 0);
|
||||
break;
|
||||
case b:
|
||||
g = (c - a) / j + 2;
|
||||
break;
|
||||
case c:
|
||||
g = (a - b) / j + 4
|
||||
}
|
||||
g /= 6
|
||||
}
|
||||
return{h:g * 360,s:h,l:i,a:d}
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Comment = function(a, b) {
|
||||
this.value = a,this.silent = !!b
|
||||
},a.Comment.prototype = {toCSS:function(a) {
|
||||
return a.compress ? "" : this.value
|
||||
},eval:function() {
|
||||
return this
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Dimension = function(a, b) {
|
||||
this.value = parseFloat(a),this.unit = b || null
|
||||
},a.Dimension.prototype = {eval:function() {
|
||||
return this
|
||||
},toColor:function() {
|
||||
return new a.Color([this.value,this.value,this.value])
|
||||
},toCSS:function() {
|
||||
var a = this.value + this.unit;
|
||||
return a
|
||||
},operate:function(b, c) {
|
||||
return new a.Dimension(a.operate(b, this.value, c.value), this.unit || c.unit)
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Directive = function(b, c) {
|
||||
this.name = b,Array.isArray(c) ? this.ruleset = new a.Ruleset([], c) : this.value = c
|
||||
},a.Directive.prototype = {toCSS:function(a, b) {
|
||||
if (this.ruleset) {
|
||||
this.ruleset.root = !0;
|
||||
return this.name + (b.compress ? "{" : " {\n ") + this.ruleset.toCSS(a, b).trim().replace(/\n/g, "\n ") + (b.compress ? "}" : "\n}\n")
|
||||
}
|
||||
return this.name + " " + this.value.toCSS() + ";\n"
|
||||
},eval:function(a) {
|
||||
a.frames.unshift(this),this.ruleset = this.ruleset && this.ruleset.eval(a),a.frames.shift();
|
||||
return this
|
||||
},variable:function(b) {
|
||||
return a.Ruleset.prototype.variable.call(this.ruleset, b)
|
||||
},find:function() {
|
||||
return a.Ruleset.prototype.find.apply(this.ruleset, arguments)
|
||||
},rulesets:function() {
|
||||
return a.Ruleset.prototype.rulesets.apply(this.ruleset)
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Element = function(b, c) {
|
||||
this.combinator = b instanceof a.Combinator ? b : new a.Combinator(b),this.value = c.trim()
|
||||
},a.Element.prototype.toCSS = function(a) {
|
||||
return this.combinator.toCSS(a || {}) + this.value
|
||||
},a.Combinator = function(a) {
|
||||
a === " " ? this.value = " " : this.value = a ? a.trim() : ""
|
||||
},a.Combinator.prototype.toCSS = function(a) {
|
||||
return{"":""," ":" ","&":"",":":" :","::":"::","+":a.compress ? "+" : " + ","~":a.compress ? "~" : " ~ ",">":a.compress ? ">" : " > "}[this.value]
|
||||
}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Expression = function(a) {
|
||||
this.value = a
|
||||
},a.Expression.prototype = {eval:function(b) {
|
||||
return this.value.length > 1 ? new a.Expression(this.value.map(function(a) {
|
||||
return a.eval(b)
|
||||
})) : this.value.length === 1 ? this.value[0].eval(b) : this
|
||||
},toCSS:function(a) {
|
||||
return this.value.map(
|
||||
function(b) {
|
||||
return b.toCSS(a)
|
||||
}).join(" ")
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Import = function(b, c) {
|
||||
var d = this;
|
||||
this._path = b,b instanceof a.Quoted ? this.path = /\.(le?|c)ss$/.test(b.value) ? b.value : b.value + ".less" : this.path = b.value.value || b.value,this.css = /css$/.test(this.path),this.css || c.push(this.path, function(a) {
|
||||
if (!a)throw new Error("Error parsing " + d.path);
|
||||
d.root = a
|
||||
})
|
||||
},a.Import.prototype = {toCSS:function() {
|
||||
return this.css ? "@import " + this._path.toCSS() + ";\n" : ""
|
||||
},eval:function(b) {
|
||||
var c;
|
||||
if (this.css)return this;
|
||||
c = new a.Ruleset(null, this.root.rules.slice(0));
|
||||
for (var d = 0; d < c.rules.length; d++)c.rules[d]instanceof a.Import && Array.prototype.splice.apply(c.rules, [d,1].concat(c.rules[d].eval(b)));
|
||||
return c.rules
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.JavaScript = function(a, b, c) {
|
||||
this.escaped = c,this.expression = a,this.index = b
|
||||
},a.JavaScript.prototype = {eval:function(b) {
|
||||
var c,d = this,e = {},f = this.expression.replace(/@\{([\w-]+)\}/g, function(c, e) {
|
||||
return a.jsify((new a.Variable("@" + e, d.index)).eval(b))
|
||||
});
|
||||
try {
|
||||
f = new Function("return (" + f + ")")
|
||||
} catch(g) {
|
||||
throw{message:"JavaScript evaluation error: `" + f + "`",index:this.index}
|
||||
}
|
||||
for (var h in b.frames[0].variables())e[h.slice(1)] = {value:b.frames[0].variables()[h].value,toJS:function() {
|
||||
return this.value.eval(b).toCSS()
|
||||
}};
|
||||
try {
|
||||
c = f.call(e)
|
||||
} catch(g) {
|
||||
throw{message:"JavaScript evaluation error: '" + g.name + ": " + g.message + "'",index:this.index}
|
||||
}
|
||||
return typeof c == "string" ? new a.Quoted('"' + c + '"', c, this.escaped, this.index) : Array.isArray(c) ? new a.Anonymous(c.join(", ")) : new a.Anonymous(c)
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Keyword = function(a) {
|
||||
this.value = a
|
||||
},a.Keyword.prototype = {eval:function() {
|
||||
return this
|
||||
},toCSS:function() {
|
||||
return this.value
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.mixin = {},a.mixin.Call = function(b, c, d) {
|
||||
this.selector = new a.Selector(b),this.arguments = c,this.index = d
|
||||
},a.mixin.Call.prototype = {eval:function(a) {
|
||||
var b,c,d = [],e = !1;
|
||||
for (var f = 0; f < a.frames.length; f++)if ((b = a.frames[f].find(this.selector)).length > 0) {
|
||||
c = this.arguments && this.arguments.map(function(b) {
|
||||
return b.eval(a)
|
||||
});
|
||||
for (var g = 0; g < b.length; g++)if (b[g].match(c, a))try {
|
||||
Array.prototype.push.apply(d, b[g].eval(a, this.arguments).rules),e = !0
|
||||
} catch(h) {
|
||||
throw{message:h.message,index:h.index,stack:h.stack,call:this.index}
|
||||
}
|
||||
if (e)return d;
|
||||
throw{message:"No matching definition was found for `" + this.selector.toCSS().trim() + "(" + this.arguments.map(
|
||||
function(a) {
|
||||
return a.toCSS()
|
||||
}).join(", ") + ")`",index:this.index}
|
||||
}
|
||||
throw{message:this.selector.toCSS().trim() + " is undefined",index:this.index}
|
||||
}},a.mixin.Definition = function(b, c, d) {
|
||||
this.name = b,this.selectors = [new a.Selector([new a.Element(null, b)])],this.params = c,this.arity = c.length,this.rules = d,this._lookups = {},this.required = c.reduce(function(a, b) {
|
||||
return!b.name || b.name && !b.value ? a + 1 : a
|
||||
}, 0),this.parent = a.Ruleset.prototype,this.frames = []
|
||||
},a.mixin.Definition.prototype = {toCSS:function() {
|
||||
return""
|
||||
},variable:function(a) {
|
||||
return this.parent.variable.call(this, a)
|
||||
},variables:function() {
|
||||
return this.parent.variables.call(this)
|
||||
},find:function() {
|
||||
return this.parent.find.apply(this, arguments)
|
||||
},rulesets:function() {
|
||||
return this.parent.rulesets.apply(this)
|
||||
},eval:function(b, c) {
|
||||
var d = new a.Ruleset(null, []),e,f = [];
|
||||
for (var g = 0,h; g < this.params.length; g++)if (this.params[g].name)if (h = c && c[g] || this.params[g].value)d.rules.unshift(new a.Rule(this.params[g].name, h.eval(b))); else throw{message:"wrong number of arguments for " + this.name + " (" + c.length + " for " + this.arity + ")"};
|
||||
for (var g = 0; g < Math.max(this.params.length, c && c.length); g++)f.push(c[g] || this.params[g].value);
|
||||
d.rules.unshift(new a.Rule("@arguments", (new a.Expression(f)).eval(b)));
|
||||
return(new a.Ruleset(null, this.rules.slice(0))).eval({frames:[this,d].concat(this.frames, b.frames)})
|
||||
},match:function(a, b) {
|
||||
var c = a && a.length || 0,d;
|
||||
if (c < this.required)return!1;
|
||||
if (this.required > 0 && c > this.params.length)return!1;
|
||||
d = Math.min(c, this.arity);
|
||||
for (var e = 0; e < d; e++)if (!this.params[e].name && a[e].eval(b).toCSS() != this.params[e].value.eval(b).toCSS())return!1;
|
||||
return!0
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Operation = function(a, b) {
|
||||
this.op = a.trim(),this.operands = b
|
||||
},a.Operation.prototype.eval = function(b) {
|
||||
var c = this.operands[0].eval(b),d = this.operands[1].eval(b),e;
|
||||
if (c instanceof a.Dimension && d instanceof a.Color)if (this.op === "*" || this.op === "+")e = d,d = c,c = e; else throw{name:"OperationError",message:"Can't substract or divide a color from a number"};
|
||||
return c.operate(this.op, d)
|
||||
},a.operate = function(a, b, c) {
|
||||
switch (a) {
|
||||
case"+":
|
||||
return b + c;
|
||||
case"-":
|
||||
return b - c;
|
||||
case"*":
|
||||
return b * c;
|
||||
case"/":
|
||||
return b / c
|
||||
}
|
||||
}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Quoted = function(a, b, c, d) {
|
||||
this.escaped = c,this.value = b || "",this.quote = a.charAt(0),this.index = d
|
||||
},a.Quoted.prototype = {toCSS:function() {
|
||||
return this.escaped ? this.value : this.quote + this.value + this.quote
|
||||
},eval:function(b) {
|
||||
var c = this,d = this.value.replace(/`([^`]+)`/g,
|
||||
function(d, e) {
|
||||
return(new a.JavaScript(e, c.index, !0)).eval(b).value
|
||||
}).replace(/@\{([\w-]+)\}/g, function(d, e) {
|
||||
var f = (new a.Variable("@" + e, c.index)).eval(b);
|
||||
return f.value || f.toCSS()
|
||||
});
|
||||
return new a.Quoted(this.quote + d + this.quote, d, this.escaped, this.index)
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Rule = function(b, c, d, e) {
|
||||
this.name = b,this.value = c instanceof a.Value ? c : new a.Value([c]),this.important = d ? " " + d.trim() : "",this.index = e,b.charAt(0) === "@" ? this.variable = !0 : this.variable = !1
|
||||
},a.Rule.prototype.toCSS = function(a) {
|
||||
return this.variable ? "" : this.name + (a.compress ? ":" : ": ") + this.value.toCSS(a) + this.important + ";"
|
||||
},a.Rule.prototype.eval = function(b) {
|
||||
return new a.Rule(this.name, this.value.eval(b), this.important, this.index)
|
||||
},a.Shorthand = function(a, b) {
|
||||
this.a = a,this.b = b
|
||||
},a.Shorthand.prototype = {toCSS:function(a) {
|
||||
return this.a.toCSS(a) + "/" + this.b.toCSS(a)
|
||||
},eval:function() {
|
||||
return this
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Ruleset = function(a, b) {
|
||||
this.selectors = a,this.rules = b,this._lookups = {}
|
||||
},a.Ruleset.prototype = {eval:function(b) {
|
||||
var c = new a.Ruleset(this.selectors, this.rules.slice(0));
|
||||
c.root = this.root,b.frames.unshift(c);
|
||||
if (c.root)for (var d = 0; d < c.rules.length; d++)c.rules[d]instanceof a.Import && Array.prototype.splice.apply(c.rules, [d,1].concat(c.rules[d].eval(b)));
|
||||
for (var d = 0; d < c.rules.length; d++)c.rules[d]instanceof a.mixin.Definition && (c.rules[d].frames = b.frames.slice(0));
|
||||
for (var d = 0; d < c.rules.length; d++)c.rules[d]instanceof a.mixin.Call && Array.prototype.splice.apply(c.rules, [d,1].concat(c.rules[d].eval(b)));
|
||||
for (var d = 0,e; d < c.rules.length; d++)e = c.rules[d],e instanceof a.mixin.Definition || (c.rules[d] = e.eval ? e.eval(b) : e);
|
||||
b.frames.shift();
|
||||
return c
|
||||
},match:function(a) {
|
||||
return!a || a.length === 0
|
||||
},variables:function() {
|
||||
return this._variables ? this._variables : this._variables = this.rules.reduce(function(b, c) {
|
||||
c instanceof a.Rule && c.variable === !0 && (b[c.name] = c);
|
||||
return b
|
||||
}, {})
|
||||
},variable:function(a) {
|
||||
return this.variables()[a]
|
||||
},rulesets:function() {
|
||||
return this._rulesets ? this._rulesets : this._rulesets = this.rules.filter(function(b) {
|
||||
return b instanceof a.Ruleset || b instanceof a.mixin.Definition
|
||||
})
|
||||
},find:function(b, c) {
|
||||
c = c || this;
|
||||
var d = [],e,f,g = b.toCSS();
|
||||
if (g in this._lookups)return this._lookups[g];
|
||||
this.rulesets().forEach(function(e) {
|
||||
if (e !== c)for (var g = 0; g < e.selectors.length; g++)if (f = b.match(e.selectors[g])) {
|
||||
b.elements.length > 1 ? Array.prototype.push.apply(d, e.find(new a.Selector(b.elements.slice(1)), c)) : d.push(e);
|
||||
break
|
||||
}
|
||||
});
|
||||
return this._lookups[g] = d
|
||||
},toCSS:function(b, c) {
|
||||
var d = [],e = [],f = [],g = [],h,i;
|
||||
if (!this.root)if (b.length === 0)g = this.selectors.map(function(a) {
|
||||
return[a]
|
||||
}); else for (var j = 0; j < this.selectors.length; j++)for (var k = 0; k < b.length; k++)g.push(b[k].concat([this.selectors[j]]));
|
||||
for (var l = 0; l < this.rules.length; l++)i = this.rules[l],i.rules || i instanceof a.Directive ? f.push(i.toCSS(g, c)) : i instanceof a.Comment ? i.silent || (this.root ? f.push(i.toCSS(c)) : e.push(i.toCSS(c))) : i.toCSS && !i.variable ? e.push(i.toCSS(c)) : i.value && !i.variable && e.push(i.value.toString());
|
||||
f = f.join(""),this.root ? d.push(e.join(c.compress ? "" : "\n")) : e.length > 0 && (h = g.map(
|
||||
function(a) {
|
||||
return a.map(
|
||||
function(a) {
|
||||
return a.toCSS(c)
|
||||
}).join("").trim()
|
||||
}).join(c.compress ? "," : g.length > 3 ? ",\n" : ", "),d.push(h, (c.compress ? "{" : " {\n ") + e.join(c.compress ? "" : "\n ") + (c.compress ? "}" : "\n}\n"))),d.push(f);
|
||||
return d.join("") + (c.compress ? "\n" : "")
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Selector = function(a) {
|
||||
this.elements = a,this.elements[0].combinator.value === "" && (this.elements[0].combinator.value = " ")
|
||||
},a.Selector.prototype.match = function(a) {
|
||||
return this.elements[0].value === a.elements[0].value ? !0 : !1
|
||||
},a.Selector.prototype.toCSS = function(a) {
|
||||
if (this._css)return this._css;
|
||||
return this._css = this.elements.map(
|
||||
function(b) {
|
||||
return typeof b == "string" ? " " + b.trim() : b.toCSS(a)
|
||||
}).join("")
|
||||
}
|
||||
}(c("less/tree")),function(b) {
|
||||
b.URL = function(b, c) {
|
||||
b.data ? this.attrs = b : (!/^(?:https?:\/|file:\/|data:\/)?\//.test(b.value) && c.length > 0 && typeof a != "undefined" && (b.value = c[0] + (b.value.charAt(0) === "/" ? b.value.slice(1) : b.value)),this.value = b,this.paths = c)
|
||||
},b.URL.prototype = {toCSS:function() {
|
||||
return"url(" + (this.attrs ? "data:" + this.attrs.mime + this.attrs.charset + this.attrs.base64 + this.attrs.data : this.value.toCSS()) + ")"
|
||||
},eval:function(a) {
|
||||
return this.attrs ? this : new b.URL(this.value.eval(a), this.paths)
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Value = function(a) {
|
||||
this.value = a,this.is = "value"
|
||||
},a.Value.prototype = {eval:function(b) {
|
||||
return this.value.length === 1 ? this.value[0].eval(b) : new a.Value(this.value.map(function(a) {
|
||||
return a.eval(b)
|
||||
}))
|
||||
},toCSS:function(a) {
|
||||
return this.value.map(
|
||||
function(b) {
|
||||
return b.toCSS(a)
|
||||
}).join(a.compress ? "," : ", ")
|
||||
}}
|
||||
}(c("less/tree")),function(a) {
|
||||
a.Variable = function(a, b) {
|
||||
this.name = a,this
|
||||
.index = b
|
||||
},a.Variable.prototype = {eval:function(b) {
|
||||
var c,d,e = this.name;
|
||||
e.indexOf("@@") == 0 && (e = "@" + (new a.Variable(e.slice(1))).eval(b).value);
|
||||
if (c = a.find(b.frames, function(a) {
|
||||
if (d = a.variable(e))return d.value.eval(b)
|
||||
}))return c;
|
||||
throw{message:"variable " + e + " is undefined",index:this.index}
|
||||
}}
|
||||
}(c("less/tree")),c("less/tree").find = function(a, b) {
|
||||
for (var c = 0,d; c < a.length; c++)if (d = b.call(a, a[c]))return d;
|
||||
return null
|
||||
},c("less/tree").jsify = function(a) {
|
||||
return Array.isArray(a.value) && a.value.length > 1 ? "[" + a.value.map(
|
||||
function(a) {
|
||||
return a.toCSS(!1)
|
||||
}).join(", ") + "]" : a.toCSS(!1)
|
||||
};
|
||||
var g = location.protocol === "file:" || location.protocol === "chrome:" || location.protocol === "chrome-extension:" || location.protocol === "resource:";
|
||||
d.env = d.env || (location.hostname == "127.0.0.1" || location.hostname == "0.0.0.0" || location.hostname == "localhost" || location.port.length > 0 || g ? "development" : "production"),d.async = !1,d.poll = d.poll || (g ? 1e3 : 1500),d.watch = function() {
|
||||
return this.watchMode = !0
|
||||
},d.unwatch = function() {
|
||||
return this.watchMode = !1
|
||||
},d.env === "development" ? (d.optimization = 0,/!watch/.test(location.hash) && d.watch(),d.watchTimer = setInterval(function() {
|
||||
d.watchMode && n(function(a, b, c) {
|
||||
a && q(a.toCSS(), b, c.lastModified)
|
||||
})
|
||||
}, d.poll)) : d.optimization = 3;
|
||||
var h;
|
||||
try {
|
||||
h = typeof a.localStorage == "undefined" ? null : a.localStorage
|
||||
} catch(i) {
|
||||
h = null
|
||||
}
|
||||
var j = document.getElementsByTagName("link"),k = /^text\/(x-)?less$/;
|
||||
d.sheets = [];
|
||||
for (var l = 0; l < j.length; l++)(j[l].rel === "stylesheet/less" || j[l].rel.match(/stylesheet/) && j[l].type.match(k)) && d.sheets.push(j[l]);
|
||||
d.refresh = function(a) {
|
||||
var b,c;
|
||||
b = c = new Date,n(function(a, d, e) {
|
||||
e.local ? u("loading " + d.href + " from cache.") : (u("parsed " + d.href + " successfully."),q(a.toCSS(), d, e.lastModified)),u("css for " + d.href + " generated in " + (new Date - c) + "ms"),e.remaining === 0 && u("css generated in " + (new Date - b) + "ms"),c = new Date
|
||||
}, a),m()
|
||||
},d.refreshStyles = m,d.refresh(d.env === "development")
|
||||
})(window)
|
11
mindplot/src/main/javascript/libraries/less/less-1.4.2.min.js
vendored
Executable file
16
mindplot/src/main/javascript/libraries/less/less-1.6.2.min.js
vendored
Normal file
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
---
|
||||
name: MooDialog.Alert
|
||||
description: Creates an Alert dialog
|
||||
authors: Arian Stolwijk
|
||||
license: MIT-style license
|
||||
requires: MooDialog
|
||||
provides: MooDialog.Alert
|
||||
...
|
||||
*/
|
||||
|
||||
|
||||
MooDialog.Alert = new Class({
|
||||
|
||||
Extends: MooDialog,
|
||||
|
||||
options: {
|
||||
okText: 'Ok',
|
||||
focus: true,
|
||||
textPClass: 'MooDialogAlert'
|
||||
},
|
||||
|
||||
initialize: function(msg, options){
|
||||
this.parent(options);
|
||||
|
||||
var okButton = new Element('input[type=button]', {
|
||||
events: {
|
||||
click: this.close.bind(this)
|
||||
},
|
||||
value: this.options.okText
|
||||
});
|
||||
|
||||
this.setContent(
|
||||
new Element('p.' + this.options.textPClass, {text: msg}),
|
||||
new Element('div.buttons').adopt(okButton)
|
||||
);
|
||||
if (this.options.autoOpen) this.open();
|
||||
|
||||
if (this.options.focus) this.addEvent('show', function(){
|
||||
okButton.focus()
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
---
|
||||
name: MooDialog.Confirm
|
||||
description: Creates an Confirm Dialog
|
||||
authors: Arian Stolwijk
|
||||
license: MIT-style license
|
||||
requires: MooDialog
|
||||
provides: [MooDialog.Confirm, Element.confirmLinkClick, Element.confirmFormSubmit]
|
||||
...
|
||||
*/
|
||||
|
||||
|
||||
MooDialog.Confirm = new Class({
|
||||
|
||||
Extends: MooDialog,
|
||||
|
||||
options: {
|
||||
okText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
focus: true,
|
||||
textPClass: 'MooDialogConfirm'
|
||||
},
|
||||
|
||||
initialize: function(msg, fn, fn1, options){
|
||||
this.parent(options);
|
||||
var emptyFn = function(){},
|
||||
self = this;
|
||||
|
||||
var buttons = [
|
||||
{fn: fn || emptyFn, txt: this.options.okText},
|
||||
{fn: fn1 || emptyFn, txt: this.options.cancelText}
|
||||
].map(function(button){
|
||||
return new Element('input[type=button]', {
|
||||
events: {
|
||||
click: function(){
|
||||
button.fn();
|
||||
self.close();
|
||||
}
|
||||
},
|
||||
value: button.txt
|
||||
});
|
||||
});
|
||||
|
||||
this.setContent(
|
||||
new Element('p.' + this.options.textPClass, {text: msg}),
|
||||
new Element('div.buttons').adopt(buttons)
|
||||
);
|
||||
if (this.options.autoOpen) this.open();
|
||||
|
||||
if(this.options.focus) this.addEvent('show', function(){
|
||||
buttons[1].focus();
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Element.implement({
|
||||
|
||||
confirmLinkClick: function(msg, options){
|
||||
this.addEvent('click', function(e){
|
||||
e.stop();
|
||||
new MooDialog.Confirm(msg, function(){
|
||||
location.href = this.get('href');
|
||||
}.bind(this), null, options)
|
||||
});
|
||||
return this;
|
||||
},
|
||||
|
||||
confirmFormSubmit: function(msg, options){
|
||||
this.addEvent('submit', function(e){
|
||||
e.stop();
|
||||
new MooDialog.Confirm(msg, function(){
|
||||
this.submit();
|
||||
}.bind(this), null, options)
|
||||
}.bind(this));
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
---
|
||||
name: MooDialog.Error
|
||||
description: Creates an Error dialog
|
||||
authors: Arian Stolwijk
|
||||
license: MIT-style license
|
||||
requires: MooDialog
|
||||
provides: MooDialog.Error
|
||||
...
|
||||
*/
|
||||
|
||||
|
||||
MooDialog.Error = new Class({
|
||||
|
||||
Extends: MooDialog.Alert,
|
||||
|
||||
options: {
|
||||
textPClass: 'MooDialogError'
|
||||
}
|
||||
|
||||
});
|
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
---
|
||||
name: MooDialog.Fx
|
||||
description: Overwrite the default events so the Dialogs are using Fx on open and close
|
||||
authors: Arian Stolwijk
|
||||
license: MIT-style license
|
||||
requires: [Cores/Fx.Tween, Overlay]
|
||||
provides: MooDialog.Fx
|
||||
...
|
||||
*/
|
||||
|
||||
|
||||
MooDialog.implement('options', {
|
||||
|
||||
duration: 400,
|
||||
closeOnOverlayClick: true,
|
||||
|
||||
onInitialize: function(wrapper){
|
||||
this.fx = new Fx.Tween(wrapper, {
|
||||
property: 'opacity',
|
||||
duration: this.options.duration
|
||||
}).set(0);
|
||||
},
|
||||
|
||||
onBeforeOpen: function(wrapper){
|
||||
this.overlay = new Overlay(this.options.inject, {
|
||||
duration: this.options.duration
|
||||
});
|
||||
if (this.options.closeOnOverlayClick)
|
||||
this.overlay.addEvent('click', this.close.bind(this));
|
||||
this.overlay.open();
|
||||
this.fx.start(1).chain(function(){
|
||||
this.fireEvent('show');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
onBeforeClose: function(wrapper){
|
||||
this.overlay.destroy();
|
||||
this.fx.start(0).chain(function(){
|
||||
this.fireEvent('hide');
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
});
|
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
---
|
||||
name: MooDialog.IFrame
|
||||
description: Opens an IFrame in a MooDialog
|
||||
authors: Arian Stolwijk
|
||||
license: MIT-style license
|
||||
requires: MooDialog
|
||||
provides: MooDialog.IFrame
|
||||
...
|
||||
*/
|
||||
|
||||
|
||||
MooDialog.Iframe = new Class({
|
||||
|
||||
Extends: MooDialog,
|
||||
|
||||
options: {
|
||||
useScrollBar: true
|
||||
},
|
||||
|
||||
initialize: function(url, options){
|
||||
this.parent(options);
|
||||
|
||||
this.setContent(
|
||||
new Element('iframe', {
|
||||
src: url,
|
||||
frameborder: 0,
|
||||
scrolling: this.options.useScrollBar ? 'auto' : 'no'
|
||||
})
|
||||
);
|
||||
if (this.options.autoOpen) this.open();
|
||||
}
|
||||
});
|
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
---
|
||||
name: MooDialog.Prompt
|
||||
description: Creates a Prompt dialog
|
||||
authors: Arian Stolwijk
|
||||
license: MIT-style license
|
||||
requires: MooDialog
|
||||
provides: MooDialog.Prompt
|
||||
...
|
||||
*/
|
||||
|
||||
|
||||
MooDialog.Prompt = new Class({
|
||||
|
||||
Extends: MooDialog,
|
||||
|
||||
options: {
|
||||
okText: 'Ok',
|
||||
focus: true,
|
||||
textPClass: 'MooDialogPrompt'
|
||||
},
|
||||
|
||||
initialize: function(msg, fn, options){
|
||||
this.parent(options);
|
||||
if (!fn) fn = function(){};
|
||||
|
||||
var textInput = new Element('input.textInput', {type: 'text'}),
|
||||
submitButton = new Element('input[type=submit]', {value: this.options.okText}),
|
||||
formEvents = {
|
||||
submit: function(e){
|
||||
e.stop();
|
||||
fn(textInput.get('value'));
|
||||
this.close();
|
||||
}.bind(this)
|
||||
};
|
||||
|
||||
this.setContent(
|
||||
new Element('p.' + this.options.textPClass, {text: msg}),
|
||||
new Element('form.buttons', {events: formEvents}).adopt(textInput, submitButton)
|
||||
);
|
||||
if (this.options.autoOpen) this.open();
|
||||
|
||||
if (this.options.focus) this.addEvent('show', function(){
|
||||
textInput.focus();
|
||||
});
|
||||
}
|
||||
});
|
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
---
|
||||
name: MooDialog.Request
|
||||
description: Loads Data into a Dialog with Request
|
||||
authors: Arian Stolwijk
|
||||
license: MIT-style license
|
||||
requires: [MooDialog, Core/Request.HTML]
|
||||
provides: MooDialog.Request
|
||||
...
|
||||
*/
|
||||
|
||||
MooDialog.Request = new Class({
|
||||
|
||||
Extends: MooDialog,
|
||||
|
||||
initialize: function(url, requestOptions, options) {
|
||||
this.parent(options);
|
||||
this.requestOptions = requestOptions || {};
|
||||
this.requestOptions.update = this.content;
|
||||
this.requestOptions.evalScripts = true;
|
||||
this.requestOptions.noCache = true;
|
||||
|
||||
this.requestOptions.onFailure = function(xhr) {
|
||||
// Intercept form requests ...
|
||||
console.log("Failure:");
|
||||
console.log(xhr);
|
||||
}.bind(this);
|
||||
|
||||
this.requestOptions.onSuccess = function() {
|
||||
// Intercept form requests ...
|
||||
var forms = this.content.getElements('form');
|
||||
forms.forEach(function(form) {
|
||||
form.addEvent('submit', function(event) {
|
||||
// Intercept form ...
|
||||
this.requestOptions.url = form.action;
|
||||
this.requestOptions.method = form.method ? form.method : 'post';
|
||||
var request = new Request.HTML(this.requestOptions);
|
||||
request.post(form);
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
}.bind(this))
|
||||
}.bind(this));
|
||||
}.bind(this);
|
||||
|
||||
this.addEvent('open', function() {
|
||||
this.requestOptions.url = url;
|
||||
this.requestOptions.method = 'get';
|
||||
var request = new Request.HTML(this.requestOptions);
|
||||
request.send();
|
||||
|
||||
MooDialog.Request.active = this;
|
||||
}.bind(this));
|
||||
|
||||
this.addEvent('close', function() {
|
||||
MooDialog.Request.active = null;
|
||||
}.bind(this));
|
||||
|
||||
if (this.options.autoOpen) this.open();
|
||||
},
|
||||
|
||||
setRequestOptions: function(options) {
|
||||
this.requestOptions = Object.merge(this.requestOptions, options);
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
@@ -1,133 +0,0 @@
|
||||
/*
|
||||
---
|
||||
name: MooDialog
|
||||
description: The base class of MooDialog
|
||||
authors: Arian Stolwijk
|
||||
license: MIT-style license
|
||||
requires: [Core/Class, Core/Element, Core/Element.Styles, Core/Element.Event]
|
||||
provides: [MooDialog, Element.MooDialog]
|
||||
...
|
||||
*/
|
||||
|
||||
|
||||
var MooDialog = new Class({
|
||||
|
||||
Implements: [Options, Events],
|
||||
|
||||
options: {
|
||||
'class': 'MooDialog',
|
||||
title: null,
|
||||
scroll: true, // IE
|
||||
forceScroll: false,
|
||||
useEscKey: true,
|
||||
destroyOnHide: true,
|
||||
autoOpen: true,
|
||||
closeButton: true,
|
||||
onInitialize: function(){
|
||||
this.wrapper.setStyle('display', 'none');
|
||||
},
|
||||
onBeforeOpen: function(){
|
||||
this.wrapper.setStyle('display', 'block');
|
||||
this.fireEvent('show');
|
||||
},
|
||||
onBeforeClose: function(){
|
||||
this.wrapper.setStyle('display', 'none');
|
||||
this.fireEvent('hide');
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function(options){
|
||||
this.setOptions(options);
|
||||
this.options.inject = this.options.inject || document.body;
|
||||
options = this.options;
|
||||
|
||||
var wrapper = this.wrapper = new Element('div.' + options['class'].replace(' ', '.')).inject(options.inject);
|
||||
|
||||
if (options.title){
|
||||
this.title = new Element('div.title').set('text', options.title).inject(wrapper);
|
||||
// this.title.addClass('MooDialogTitle');
|
||||
}
|
||||
|
||||
if (options.closeButton){
|
||||
this.closeButton = new Element('a.close', {
|
||||
events: {click: this.close.bind(this)}
|
||||
}).inject(wrapper);
|
||||
}
|
||||
this.content = new Element('div.content').inject(wrapper);
|
||||
|
||||
|
||||
/*<ie6>*/// IE 6 scroll
|
||||
if ((options.scroll && Browser.ie6) || options.forceScroll){
|
||||
wrapper.setStyle('position', 'absolute');
|
||||
var position = wrapper.getPosition(options.inject);
|
||||
window.addEvent('scroll', function(){
|
||||
var scroll = document.getScroll();
|
||||
wrapper.setPosition({
|
||||
x: position.x + scroll.x,
|
||||
y: position.y + scroll.y
|
||||
});
|
||||
});
|
||||
}
|
||||
/*</ie6>*/
|
||||
|
||||
if (options.useEscKey){
|
||||
// Add event for the esc key
|
||||
document.addEvent('keydown', function(e){
|
||||
if (e.key == 'esc') this.close();
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
this.addEvent('hide', function(){
|
||||
if (options.destroyOnHide)
|
||||
this.destroy();
|
||||
}.bind(this));
|
||||
|
||||
this.fireEvent('initialize', wrapper);
|
||||
},
|
||||
|
||||
setContent: function(){
|
||||
var content = Array.from(arguments);
|
||||
if (content.length == 1) content = content[0];
|
||||
|
||||
this.content.empty();
|
||||
|
||||
var type = typeOf(content);
|
||||
if (['string', 'number'].contains(type)) this.content.set('text', content);
|
||||
else this.content.adopt(content);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
open: function(){
|
||||
this.fireEvent('beforeOpen', this.wrapper).fireEvent('open');
|
||||
this.opened = true;
|
||||
return this;
|
||||
},
|
||||
|
||||
close: function(){
|
||||
this.fireEvent('beforeClose', this.wrapper).fireEvent('close');
|
||||
this.opened = false;
|
||||
return this;
|
||||
},
|
||||
|
||||
destroy: function(){
|
||||
this.wrapper.destroy();
|
||||
},
|
||||
|
||||
toElement: function(){
|
||||
return this.wrapper;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Element.implement({
|
||||
|
||||
MooDialog: function(options){
|
||||
this.store('MooDialog',
|
||||
new MooDialog(options).setContent(this).open()
|
||||
);
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
---
|
||||
|
||||
name: Overlay
|
||||
|
||||
authors:
|
||||
- David Walsh (http://davidwalsh.name)
|
||||
|
||||
license:
|
||||
- MIT-style license
|
||||
|
||||
requires: [Core/Class, Core/Element.Style, Core/Element.Event, Core/Element.Dimensions, Core/Fx.Tween]
|
||||
|
||||
provides:
|
||||
- Overlay
|
||||
...
|
||||
*/
|
||||
|
||||
var Overlay = new Class({
|
||||
|
||||
Implements: [Options, Events],
|
||||
|
||||
options: {
|
||||
id: 'overlay',
|
||||
color: '#000000',
|
||||
duration: 500,
|
||||
opacity: 0.8,
|
||||
zIndex: 5000/*,
|
||||
onClick: $empty,
|
||||
onClose: $empty,
|
||||
onHide: $empty,
|
||||
onOpen: $empty,
|
||||
onShow: $empty
|
||||
*/
|
||||
},
|
||||
|
||||
initialize: function(container, options) {
|
||||
this.setOptions(options);
|
||||
this.container = document.id(container);
|
||||
|
||||
this.bound = {
|
||||
'window': {
|
||||
resize: this.resize.bind(this),
|
||||
scroll: this.scroll.bind(this)
|
||||
},
|
||||
overlayClick: this.overlayClick.bind(this),
|
||||
tweenStart: this.tweenStart.bind(this),
|
||||
tweenComplete: this.tweenComplete.bind(this)
|
||||
};
|
||||
|
||||
this.build().attach();
|
||||
},
|
||||
|
||||
build: function() {
|
||||
this.overlay = new Element('div', {
|
||||
id: this.options.id,
|
||||
opacity: 0,
|
||||
styles: {
|
||||
position: (Browser.ie6) ? 'absolute' : 'fixed',
|
||||
background: this.options.color,
|
||||
left: 0,
|
||||
top: 0,
|
||||
'z-index': this.options.zIndex
|
||||
}
|
||||
}).inject(this.container);
|
||||
|
||||
this.tween = new Fx.Tween(this.overlay, {
|
||||
duration: this.options.duration,
|
||||
link: 'cancel',
|
||||
property: 'opacity'
|
||||
});
|
||||
return this;
|
||||
}.protect(),
|
||||
|
||||
attach: function() {
|
||||
window.addEvents(this.bound.window);
|
||||
this.overlay.addEvent('click', this.bound.overlayClick);
|
||||
this.tween.addEvents({
|
||||
onStart: this.bound.tweenStart,
|
||||
onComplete: this.bound.tweenComplete
|
||||
});
|
||||
return this;
|
||||
},
|
||||
|
||||
detach: function() {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
args.each(function(item) {
|
||||
if (item == 'window') window.removeEvents(this.bound.window);
|
||||
if (item == 'overlay') this.overlay.removeEvent('click', this.bound.overlayClick);
|
||||
}, this);
|
||||
return this;
|
||||
},
|
||||
|
||||
overlayClick: function() {
|
||||
this.fireEvent('click');
|
||||
return this;
|
||||
},
|
||||
|
||||
tweenStart: function() {
|
||||
this.overlay.setStyles({
|
||||
width: '100%',
|
||||
height: this.container.getScrollSize().y
|
||||
});
|
||||
return this;
|
||||
},
|
||||
|
||||
tweenComplete: function() {
|
||||
this.fireEvent(this.overlay.get('opacity') == this.options.opacity ? 'show' : 'hide');
|
||||
return this;
|
||||
},
|
||||
|
||||
open: function() {
|
||||
this.fireEvent('open');
|
||||
this.overlay.setStyle('display', 'block');
|
||||
this.tween.start(this.options.opacity);
|
||||
return this;
|
||||
},
|
||||
|
||||
close: function() {
|
||||
this.fireEvent('close');
|
||||
this.overlay.setStyle('display', 'none');
|
||||
this.tween.start(0);
|
||||
return this;
|
||||
},
|
||||
|
||||
destroy: function(){
|
||||
this.close();
|
||||
this.overlay.dispose();
|
||||
},
|
||||
|
||||
resize: function() {
|
||||
this.fireEvent('resize');
|
||||
this.overlay.setStyle('height', this.container.getScrollSize().y);
|
||||
return this;
|
||||
},
|
||||
|
||||
scroll: function() {
|
||||
this.fireEvent('scroll');
|
||||
if (Browser.ie6) this.overlay.setStyle('left', window.getScroll().x);
|
||||
return this;
|
||||
}
|
||||
|
||||
});
|
@@ -1,95 +0,0 @@
|
||||
/* Created by Arian Stolwijk <http://www.aryweb.nl> */
|
||||
|
||||
.MooDialog {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
z-index: 11000;
|
||||
width: 400px;
|
||||
margin: -250px 0 0 -250px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #999;
|
||||
border: 1px solid rgba(0, 0, 0, 0.3);
|
||||
*border: 1px solid #999;
|
||||
/* IE6-7 */
|
||||
|
||||
-webkit-border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
|
||||
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding-box;
|
||||
background-clip: padding-box;
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.MooDialogTitle {
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
.MooDialog .content {
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.MooDialog .title {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-bottom: 1px solid #a1aec5;
|
||||
font-weight: bold;
|
||||
text-shadow: 1px 1px 0 #fff;
|
||||
/*color: black;*/
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 5px 30px;
|
||||
font-size: 18px
|
||||
}
|
||||
|
||||
.MooDialog .close {
|
||||
background: url(dialog-close.png) no-repeat;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
top: 8px;
|
||||
left: 420px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.MooDialog .buttons {
|
||||
text-align: right;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.MooDialog .iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.MooDialog .textInput {
|
||||
width: 200px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.MooDialog .MooDialogAlert,
|
||||
.MooDialog .MooDialogConfirm,
|
||||
.MooDialog .MooDialogPrompt,
|
||||
.MooDialog .MooDialogError {
|
||||
background: url(dialog-warning.png) no-repeat;
|
||||
padding-left: 40px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.MooDialog .MooDialogConfirm,
|
||||
.MooDialog .MooDialogPromt {
|
||||
background: url(dialog-question.png) no-repeat;
|
||||
}
|
||||
|
||||
.MooDialog .MooDialogError {
|
||||
background: url(dialog-error.png) no-repeat;
|
||||
}
|
Before Width: | Height: | Size: 689 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.6 KiB |