Compare commits
606 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2b3fdf1196 | ||
|
08d2403133 | ||
|
802c9d3375 | ||
|
81b138cf62 | ||
|
25ee14b7aa | ||
|
014d9334b3 | ||
|
7ee42468bd | ||
|
c83f4bd213 | ||
|
b0a6e7fac5 | ||
|
7d973c7a87 | ||
|
d8e255cac8 | ||
|
b45f874ce4 | ||
|
8b6764af17 | ||
|
a6a79e9f94 | ||
|
94e76fad9c | ||
|
3c9573c93e | ||
|
663310b388 | ||
|
4641c3cc5a | ||
|
1ff3cf2127 | ||
|
7b512ea2f6 | ||
|
8318e897fe | ||
|
99c909c69b | ||
|
704fb02d1a | ||
|
8686eb0ad4 | ||
|
5de02c8d51 | ||
|
fff27e1bb7 | ||
|
c0abb0a71c | ||
|
e273c52f59 | ||
|
d23bff3f09 | ||
|
d609f6f3d7 | ||
|
1d6adf177f | ||
|
06004f73a8 | ||
|
8542ef8b13 | ||
|
72034aad1e | ||
|
9efa963ec8 | ||
|
55ab0f280f | ||
|
a42811630d | ||
|
5dd2440a73 | ||
|
d7ca087182 | ||
|
d2a99998b5 | ||
|
d6a60636ed | ||
|
9ca2f6bb1e | ||
|
b886a5888a | ||
|
cec140b1fd | ||
|
84cffac713 | ||
|
754d4b3dcf | ||
|
7ee577c400 | ||
|
c854c1b377 | ||
|
bfe24b7dfb | ||
|
85c7e3ce5c | ||
|
27304ea385 | ||
|
8a994ee6f5 | ||
|
5ec3b6cce1 | ||
|
8cd05ec37e | ||
|
5a00229390 | ||
|
4b01f7c8ee | ||
|
edb91b92bd | ||
|
c6ae7be255 | ||
|
86ba19c120 | ||
|
183ab33729 | ||
|
9e992a8f61 | ||
|
5d18283285 | ||
|
d66666010d | ||
|
bddf867b63 | ||
|
d0d161e8ab | ||
|
64c7198d50 | ||
|
2fae012fd9 | ||
|
e8ee76c5f8 | ||
|
3d6df8a143 | ||
|
dec0fb7aef | ||
|
980a984499 | ||
|
1f8e251009 | ||
|
4729022d6a | ||
|
eb9a28603c | ||
|
d191aa9075 | ||
|
e585686bd2 | ||
|
44b3707005 | ||
|
251f0eca46 | ||
|
1bdf75e295 | ||
|
ccdab5257b | ||
|
797a4adfd4 | ||
|
3b64577d15 | ||
|
06fc95c454 | ||
|
0c15789c4b | ||
|
ae31613fdd | ||
|
6432fefa67 | ||
|
29037e60d8 | ||
|
29894a276e | ||
|
db0595ac7e | ||
|
bf8345908b | ||
|
d111c54f15 | ||
|
6a5eb910b5 | ||
|
8462e54293 | ||
|
7b45b4b633 | ||
|
b7051d56c0 | ||
|
8be0f19792 | ||
|
44dbce0801 | ||
|
878fe464ea | ||
|
68fd71d300 | ||
|
73e955afac | ||
|
ea4684d9c8 | ||
|
0b021c7602 | ||
|
1de1a9f55f | ||
|
60d75b6f2d | ||
|
ae71b1331f | ||
|
c56698d085 | ||
|
7299c7d506 | ||
|
9e8f73df99 | ||
|
572eb44e7a | ||
|
1d6e3ec4bf | ||
|
83e51a6501 | ||
|
5733dbf45e | ||
|
b110d338af | ||
|
08a066271b | ||
|
8996df4cbb | ||
|
c5932dc0f8 | ||
|
832fb6ce52 | ||
|
bbc380366f | ||
|
95d9414ae3 | ||
|
1a31e5ee99 | ||
|
d48abe6121 | ||
|
f564b4b34a | ||
|
147a4ec06a | ||
|
c81439cae8 | ||
|
06d3f0cd25 | ||
|
2a37167b01 | ||
|
2b89fdccca | ||
|
6624abb9ed | ||
|
726ffcd817 | ||
|
356ab4b1c1 | ||
|
a9c1d42925 | ||
|
08a9289893 | ||
|
3df00e9e0e | ||
|
b3e2e37929 | ||
|
7f6d575c16 | ||
|
10b9a4ceb2 | ||
|
d23595a75c | ||
|
a3c6ce10c2 | ||
|
1444be36ce | ||
|
ba90addad2 | ||
|
cfa669fe2e | ||
|
efb7e0cc3b | ||
|
668506ceb8 | ||
|
105c0544e1 | ||
|
29acc46d34 | ||
|
6fe9dcf578 | ||
|
d555309c22 | ||
|
d089b471fc | ||
|
7525ba4820 | ||
|
58390dfb92 | ||
|
b765a21369 | ||
|
560ceffaaf | ||
|
f3cc90d9d0 | ||
|
434fb4c8f5 | ||
|
57e5fcac3a | ||
|
b99cb2f8a3 | ||
|
ea95ba0ec7 | ||
|
3cf726f928 | ||
|
460d8270c6 | ||
|
079606c4e7 | ||
|
d67a16f550 | ||
|
8db7f5015f | ||
|
734463d233 | ||
|
fdf041e8b1 | ||
|
23611c8d54 | ||
|
729d2e98f7 | ||
|
baa8adacda | ||
|
7a535b1dca | ||
|
632a9a6e00 | ||
|
a4aa1c5436 | ||
|
9a19e2a5eb | ||
|
6d1a00291e | ||
|
d6656dffc0 | ||
|
3b23fead8e | ||
|
94b043ecf5 | ||
|
c8286c26aa | ||
|
f567513468 | ||
|
472bb38342 | ||
|
10fb98cdaa | ||
|
f65149c948 | ||
|
b4857ed99e | ||
|
131a501508 | ||
|
37e9676687 | ||
|
6ed7bc9154 | ||
|
d535fcc381 | ||
|
d28b439e62 | ||
|
0738804d88 | ||
|
f248a8c099 | ||
|
0891beeecd | ||
|
4646ae15c4 | ||
|
54fb696090 | ||
|
e5d9380699 | ||
|
5fe892abfd | ||
|
12ec295fe0 | ||
|
8936ef5008 | ||
|
0eaa8c8638 | ||
|
28010a85aa | ||
|
f1e4b1c8c0 | ||
|
1a2ba04b76 | ||
|
1ead555e09 | ||
|
cf246f00c8 | ||
|
4200d85cc0 | ||
|
a4ae253ae3 | ||
|
640b8d7ed0 | ||
|
5429178a1c | ||
|
163bc960b3 | ||
|
b79930394d | ||
|
c8e0b92ef5 | ||
|
7d0e4dc35a | ||
|
5f9b98324d | ||
|
95fcbb5888 | ||
|
2f4efde017 | ||
|
a62a053533 | ||
|
2d6a0c3e24 | ||
|
9897e69ee2 | ||
|
01fa9def4a | ||
|
71bba1c5ab | ||
|
708b8eb355 | ||
|
3e7ed53a2d | ||
|
136dc1154b | ||
|
301048ecad | ||
|
26138188ea | ||
|
558aa31516 | ||
|
f0e056c298 | ||
|
ccd5eb8e15 | ||
|
43d5779d5f | ||
|
148b56aecb | ||
|
684c412e95 | ||
|
7d9ccaec91 | ||
|
b4c69133f5 | ||
|
9edea47dbd | ||
|
ed55fd824f | ||
|
eff063ca37 | ||
|
a74f4158c6 | ||
|
d601a2818f | ||
|
81e9b5f59d | ||
|
f048d0adb7 | ||
|
2ec941e1a0 | ||
|
72a46367d6 | ||
|
b19ac2c4c3 | ||
|
acb3782561 | ||
|
c7b193f43f | ||
|
154db9d9e8 | ||
|
deb6c4be4d | ||
|
8b6ef7536e | ||
|
d0e07269c4 | ||
|
81e3cb590c | ||
|
a70dd1e52e | ||
|
194a7f200e | ||
|
306a2a2ada | ||
|
0c43bb4ad3 | ||
|
829815f9e9 | ||
|
93a8647c6a | ||
|
6ac7948312 | ||
|
0dc426487d | ||
|
b9e64e20e3 | ||
|
561fb00ac2 | ||
|
b774052e1d | ||
|
367bcf084d | ||
|
fe2b7225ef | ||
|
49d9820a44 | ||
|
3f2c687643 | ||
|
c68b4c90da | ||
|
1b480b566a | ||
|
504e3e18e6 | ||
|
f2be251c8b | ||
|
cedd12314b | ||
|
02cb53d082 | ||
|
0acd0c097f | ||
|
9a9dabc0ab | ||
|
99be712a5f | ||
|
ed4d50724a | ||
|
94812cd96a | ||
|
f39e82b016 | ||
|
2f994be98d | ||
|
40907bc479 | ||
|
d4f9fb1756 | ||
|
14d688b9bf | ||
|
a745167c75 | ||
|
2cb7ec9afb | ||
|
540b575e54 | ||
|
7e5b3c51a8 | ||
|
5d4da27842 | ||
|
20a786460c | ||
|
07b18d9527 | ||
|
adfc6c08f2 | ||
|
9a1c0fe46d | ||
|
a8f7d28c11 | ||
|
5b1fb27ca2 | ||
|
cf0b3cf80d | ||
|
0493d66daa | ||
|
f66c476187 | ||
|
9b3f1c79a6 | ||
|
5e62eb3279 | ||
|
2ccb4bfb83 | ||
|
686e011f9b | ||
|
f610bfdfb3 | ||
|
f0c6d944a8 | ||
|
ebf4603889 | ||
|
706031a641 | ||
|
25e6e4de4f | ||
|
ae604b1c70 | ||
|
0d11dee06c | ||
|
00773ae3b9 | ||
|
88fed0af0a | ||
|
31aab0bd48 | ||
|
4f40431d55 | ||
|
d1004f2919 | ||
|
7151aa4e2c | ||
|
c3d2739293 | ||
|
091955255b | ||
|
2aa68c3d4b | ||
|
f4fb008f1b | ||
|
da2594292b | ||
|
f30106ab39 | ||
|
8a684519f0 | ||
|
24417d4fd0 | ||
|
9c4dfb7f25 | ||
|
7d6c26539d | ||
|
8bdc5f6b05 | ||
|
91b5a08b11 | ||
|
c0b8eb7176 | ||
|
871d89a304 | ||
|
0933786525 | ||
|
0968549e55 | ||
|
bec5a087aa | ||
|
2528ceb8df | ||
|
f5c7d63528 | ||
|
af0a62aee9 | ||
|
8e402431b8 | ||
|
e34f5ce45a | ||
|
b401a53a21 | ||
|
0c103fc3a2 | ||
|
2e7aa144b2 | ||
|
4eec745296 | ||
|
947fd30fa2 | ||
|
52cac830ae | ||
|
808660cfbb | ||
|
9d2cf7e1ff | ||
|
5d231249c7 | ||
|
242827f7e6 | ||
|
3736f48efa | ||
|
9639b9e113 | ||
|
531be52c5b | ||
|
2e24032d1c | ||
|
cc9fa543cb | ||
|
541d07c46c | ||
|
52d3838094 | ||
|
3828a1afdb | ||
|
d288787fdc | ||
|
c6aed4bf6e | ||
|
2c26c3cdc0 | ||
|
7eda354f8f | ||
|
9b133468e4 | ||
|
f20b3a7a46 | ||
|
953e473ef0 | ||
|
abede3c010 | ||
|
f2a5221cbd | ||
|
f339ed777e | ||
|
e165bbbff6 | ||
|
3d948a1419 | ||
|
cd02cdb1ce | ||
|
1e90a74ac7 | ||
|
ae587a037a | ||
|
22c102917e | ||
|
703414266e | ||
|
0001dff347 | ||
|
970e5bd2ed | ||
|
a50a96492f | ||
|
c525acbad4 | ||
|
63c063933d | ||
|
83d80cadb5 | ||
|
59a57e0b34 | ||
|
b2adb4f6a6 | ||
|
80dfab3ef4 | ||
|
94915bc8e4 | ||
|
fd73564be2 | ||
|
3679db819a | ||
|
a2db34ae61 | ||
|
50adfa0053 | ||
|
9a77ff3bb8 | ||
|
5f29024559 | ||
|
94ac039390 | ||
|
805f5eed7f | ||
|
914e3b508c | ||
|
e4d5425a7d | ||
|
5e4c1e4357 | ||
|
86324c6873 | ||
|
c87424ae80 | ||
|
896e299f8f | ||
|
fc6b573f86 | ||
|
751157815e | ||
|
175b2f8921 | ||
|
9f6ba0b19c | ||
|
f8b25f949a | ||
|
711b673e31 | ||
|
55ab430cfe | ||
|
fd6d23c513 | ||
|
4d3d8daa37 | ||
|
1dce163782 | ||
|
efd285eb10 | ||
|
128052102d | ||
|
8f2f9da3da | ||
|
84c96287f3 | ||
|
f75124233b | ||
|
26bd9f8840 | ||
|
da8f474c64 | ||
|
5e8c1960e7 | ||
|
35d76ea56f | ||
|
a230dd104c | ||
|
31fb342ef1 | ||
|
65283a0edc | ||
|
9686431874 | ||
|
96cb014a6e | ||
|
8915e7eddf | ||
|
fd021de86d | ||
|
f5b4cc9ea7 | ||
|
8e66c97aa3 | ||
|
bd80d95d22 | ||
|
4d46864388 | ||
|
3696e126e3 | ||
|
65ee33a09f | ||
|
dce29eda19 | ||
|
81d3d591fa | ||
|
2a2dc7c57f | ||
|
2c355205d0 | ||
|
ed508d646c | ||
|
fcb99490d8 | ||
|
fd00a5e0fc | ||
|
f9d1e869b0 | ||
|
06210ab95b | ||
|
3137f78cce | ||
|
dcd59efc12 | ||
|
2b8972a35a | ||
|
f961ae578c | ||
|
0188e15a92 | ||
|
c12b73c1ff | ||
|
a60f001f2c | ||
|
04d58533cf | ||
|
ed6d89fb7e | ||
|
3b47ed2e52 | ||
|
abfc06c7d5 | ||
|
712cc2c60b | ||
|
057d5bc01f | ||
|
e36b0b8b52 | ||
|
4dd7a82e32 | ||
|
580d977aa9 | ||
|
45c67d6b57 | ||
|
0b6c8a5977 | ||
|
811cc8a668 | ||
|
f136240591 | ||
|
e0a6d15ad0 | ||
|
617abd9d90 | ||
|
c2e74cb2d4 | ||
|
db70db49a5 | ||
|
4cc6382043 | ||
|
c8d3d99224 | ||
|
645402e691 | ||
|
8ed1a18280 | ||
|
0d81db52f1 | ||
|
67398fe07e | ||
|
9b21c77485 | ||
|
94356a5773 | ||
|
2f8df725c9 | ||
|
b9e508424c | ||
|
48e211cc2d | ||
|
3578d6e624 | ||
|
8356906791 | ||
|
9e7f289a9e | ||
|
9e67329703 | ||
|
8489eaea6d | ||
|
9fb0ebd8f6 | ||
|
e03f5f632b | ||
|
b6ee7e61b8 | ||
|
202c3f28a3 | ||
|
a1a28efe49 | ||
|
0e5592a0d3 | ||
|
52efdf729b | ||
|
ef3e8ae772 | ||
|
1c1fc2ca96 | ||
|
bf3bd5c1c7 | ||
|
9cabfb14a5 | ||
|
def2034fa0 | ||
|
b5a7a11920 | ||
|
6155a70c04 | ||
|
846ad24bf3 | ||
|
9ab0637690 | ||
|
fe331a5170 | ||
|
f4969e11b9 | ||
|
312f5447b8 | ||
|
879fa4c926 | ||
|
5e0c879654 | ||
|
9049ca25aa | ||
|
76ccc5e6b2 | ||
|
8aa733158c | ||
|
0eef3b3251 | ||
|
965ba4edaa | ||
|
7960c0a419 | ||
|
99a3fa64ec | ||
|
a7316d516c | ||
|
efe562f057 | ||
|
d2b7b640d9 | ||
|
79f5e51513 | ||
|
0f605d89f0 | ||
|
cb6828c08e | ||
|
3ff67910c9 | ||
|
51f531f6b4 | ||
|
fc22dd32a2 | ||
|
deca7e51b2 | ||
|
28ffead0a0 | ||
|
d1dfb48be5 | ||
|
9360a27f15 | ||
|
cc8ff94b10 | ||
|
f245116e48 | ||
|
7bd87c50ac | ||
|
86d5c98ed7 | ||
|
5d05f21803 | ||
|
6e2880c8cc | ||
|
87ce3fc0a9 | ||
|
92849b02eb | ||
|
829655f253 | ||
|
b4bdad796e | ||
|
d52e2c04a6 | ||
|
edc3351fd8 | ||
|
73a664ab97 | ||
|
cabca992d1 | ||
|
e734ea350c | ||
|
ac7af5b8f1 | ||
|
43e9f8fcad | ||
|
7a401b648e | ||
|
82ff47220d | ||
|
f3d88e91c4 | ||
|
37419cba66 | ||
|
8b0465bda6 | ||
|
765b1fc80e | ||
|
0d8b6b210e | ||
|
d2c287684f | ||
|
bad11bea88 | ||
|
6c1188314b | ||
|
f4f97d3112 | ||
|
a958fcbd6e | ||
|
02b31e463b | ||
|
6fe53446ce | ||
|
5d62bf520a | ||
|
12448fc6cb | ||
|
ebd6f886d5 | ||
|
66e4b0fb19 | ||
|
f34ec25610 | ||
|
46264991b9 | ||
|
b9748ca23a | ||
|
fe99c9a238 | ||
|
9f495f1e76 | ||
|
dd1698b5d9 | ||
|
c5bf91a9fe | ||
|
ac8309819c | ||
|
e1e9c9ebeb | ||
|
4062b6771c | ||
|
0cdabba5eb | ||
|
064b8f1071 | ||
|
c3dcd8f3a9 | ||
|
b717a5f910 | ||
|
1602421544 | ||
|
fe44da9b43 | ||
|
2a8ae4c397 | ||
|
7f7a67872e | ||
|
322b0ba13e | ||
|
0aa2d67698 | ||
|
3c0055b767 | ||
|
2549305621 | ||
|
42564b2759 | ||
|
032df5fdf4 | ||
|
dbbe8901b7 | ||
|
91f27c4e10 | ||
|
91aeddee70 | ||
|
fab3c96097 | ||
|
b89b08b7b3 | ||
|
ed37b20dfc | ||
|
f44e616a4b | ||
|
e70f2726a3 | ||
|
964505abd4 | ||
|
ce932e57e0 | ||
|
2ec9e70245 | ||
|
fc6d91f59e | ||
|
f8a6607de9 | ||
|
ca0b5bfcbe | ||
|
be545d7103 | ||
|
3832844ee6 | ||
|
b3234675cc | ||
|
146c6d8a17 | ||
|
37e11a5b05 | ||
|
ea5f1afa40 | ||
|
2e0339492d | ||
|
f8d6cdebc4 | ||
|
58ed80d763 | ||
|
61569bc571 | ||
|
7ba21f85bf | ||
|
2c5f7139d5 | ||
|
0c433352c5 | ||
|
07c8a1d8c7 | ||
|
6560973237 | ||
|
596aeeebc4 | ||
|
16e59a0879 | ||
|
2861a7b5f9 | ||
|
b1172f16cc | ||
|
71762ff629 | ||
|
00fd168489 |
@@ -1,34 +0,0 @@
|
||||
# Compiling and Running
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The following products must be installed:
|
||||
|
||||
* Java Development Kit 6 or higher (http://java.sun.com/javase/downloads/index.jsp)
|
||||
* Maven 3.x or higher (http://maven.apache.org/)
|
||||
|
||||
## Compiling
|
||||
|
||||
WiseMapping uses Maven as packaging and project management. The project is composed of 4 maven sub-modules:
|
||||
|
||||
* core-js: Utilities JavaScript libraries
|
||||
* web2d: JavaScript 2D VML/SVG abstraction library used by the mind map editor
|
||||
* mindplot: JavaScript mind map designer core
|
||||
* wise-editor: Mindmap Editor standalone distribution
|
||||
* wise-webapp: J2EE web application
|
||||
|
||||
Full compilation of the project can be done executing within <project-dir>:
|
||||
|
||||
`mvn package`
|
||||
|
||||
Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping*.war will be generated.
|
||||
|
||||
## Testing
|
||||
The previously generated war can be deployed locally executing within the directory <project-dir>/wise-webapp the following command:
|
||||
|
||||
`mvn jetty:run-war`
|
||||
|
||||
This will start the application on the URL: http://localhost:8080/wise-webapp/. Additionally, a file based database is automatically populated with a test user.
|
||||
|
||||
User: test@wisemapping.org
|
||||
Password: test
|
22
Home.textile
@@ -1,22 +0,0 @@
|
||||
h1. What is WiseMapping Open Source?
|
||||
|
||||
WiseMapping is a free web based mindmapping application. The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com.
|
||||
|
||||
|
||||
h1. Why Open Source ?
|
||||
|
||||
In the last years, we have received hundred of mails from different persons asking for:
|
||||
Integrating wisemapping.com with their sites
|
||||
Deploying a private instance of wisemapping.com
|
||||
Participating in the development of the site
|
||||
All this make us wonder "Why if we share our product to all this people and invite them to participate with us in this journey ?" .
|
||||
|
||||
h1. Who are we ?
|
||||
|
||||
We’re a couple of friends working on an idea: “Create the best on-line collaborative mind mapping tool ever created”. This has been our idea since the first day we started.
|
||||
|
||||
h1. [[Documentation]]
|
||||
|
||||
h1. [[Compiling and Running]]
|
||||
|
||||
h1. [[FAQ]]
|
108
README.md
@@ -1,6 +1,4 @@
|
||||
# WiseMapping: a Web based mindmapping application
|
||||
|
||||
## Project Information
|
||||
# Project Information
|
||||
|
||||
The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com. More info: www.wisemapping.org
|
||||
|
||||
@@ -9,116 +7,66 @@ The goal of this project is to provide a high quality product that can be deploy
|
||||
### Prerequisites
|
||||
|
||||
The following products must be installed:
|
||||
* Java Development Kit 6 or higher (http://java.sun.com/javase/downloads/index.jsp)
|
||||
* Maven 2.2.1 or higher (http://maven.apache.org/)
|
||||
|
||||
* Java Development Kit 7 or higher ([http://www.oracle.com/technetwork/java/javase/downloads/index.html])
|
||||
* Maven 3.x or higher ([http://maven.apache.org/])
|
||||
|
||||
### Compiling
|
||||
|
||||
WiseMapping uses Maven as packaging and project management. The project is composed of 4 maven sub-modules:
|
||||
* core-js: Utilities JavaScript libraries
|
||||
WiseMapping uses Maven as packaging and project management. It's composed of 5 maven sub-modules:
|
||||
|
||||
* core-js: Utilities JavaScript classes
|
||||
* web2d: JavaScript 2D SVG abstraction library used by the mind map editor
|
||||
* mindplot: JavaScript mind map designer core
|
||||
* mindplot: JavaScript mindmap designer core
|
||||
* wise-editor: Mindmap Editor standalone distribution
|
||||
* wise-webapp: J2EE web application
|
||||
|
||||
Full compilation of the project can be done executing within <project-dir>:
|
||||
The full compilation of the project can be performed executing within <project-dir>:
|
||||
|
||||
`mvn install`
|
||||
`mvn package`
|
||||
|
||||
Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping.war will be generated.
|
||||
Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping*.war will be generated.
|
||||
|
||||
### Testing
|
||||
|
||||
The previously generated war can be deployed locally executing within the directory <project-dir>/wise-webapp the following command:
|
||||
|
||||
`mvn jetty:run-war`
|
||||
`cd wise-webapp;mvn jetty:run-war`
|
||||
|
||||
This will start the application on the URL: http://localhost:8080/wise-webapp/. Additionally, a file based database is automatically populated with a test user.
|
||||
This will start the application on the URL: [http://localhost:8080/wise-webapp/]. Additionally, a file based database is automatically populated with a test user.
|
||||
|
||||
User: test@wisemapping.org
|
||||
|
||||
Password: test
|
||||
|
||||
## Running the JS only version
|
||||
|
||||
Start by creating the .zip file:
|
||||
Start by creating the .zip file:
|
||||
|
||||
`mvn assembly:assembly -Dmaven.test.skip=true`
|
||||
|
||||
To test the javascript frontend you then do:
|
||||
|
||||
unzip target/wisemapping-3.0-SNAPSHOT-editor.zip
|
||||
cd target/wisemapping-3.0-SNAPSHOT-editor
|
||||
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start'
|
||||
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start'
|
||||
|
||||
Now open a browser using the URL http://localhost:8000/
|
||||
Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/
|
||||
|
||||
### Attaching drag and drop events.
|
||||
## Members
|
||||
|
||||
1) Support for dragging TextNodes:
|
||||
### Founders
|
||||
|
||||
The following code is an example of how to add attach to the div dragImageNode the support for node dragging.
|
||||
|
||||
$("dragTextNode").addEvent('mousedown', function(event) {
|
||||
event.preventDefault();
|
||||
* Pablo Luna <pveiga@wisemapping.com>
|
||||
* Paulo Veiga <pablo@wisemapping.com>
|
||||
|
||||
// Create a image node ...
|
||||
var mindmap = designer.getMindmap();
|
||||
var node = mindmap.createNode();
|
||||
node.setText("Node Text !!!!");
|
||||
node.setMetadata("{'media':'test'}");
|
||||
node.setShapeType(mindplot.model.TopicShape.RECTANGLE);
|
||||
### Individual Controbutors
|
||||
|
||||
// Add link ...
|
||||
var link = node.createFeature(mindplot.TopicFeature.Link.id, {url:"http://www.wisemapping.com"});
|
||||
node.addFeature(link);
|
||||
* Ezequiel Bergamaschi <ezequielbergamaschi@gmail.com>
|
||||
* Claudio Barril <claudiobarril@gmail.com>
|
||||
|
||||
// Add Note ...
|
||||
var note = node.createFeature(mindplot.TopicFeature.Note.id, {text:"This is a note"});
|
||||
node.addFeature(note);
|
||||
### Past Individual Contributors
|
||||
|
||||
designer.addDraggedNode(event, node);
|
||||
});
|
||||
|
||||
In the example, a new node is created with text "Node Text !!!!" and a note and a link associated to it when the user drop the node. Something to pay attention is the node.setMetadata("{}"), this attributes will be persisted during the serialization. Here you can store all the data you need.
|
||||
|
||||
2) Support for dragging Images: Similar to the point 1,drag support is registered to the div dragImageNode.
|
||||
|
||||
$("dragImageNode").addEvent('mousedown', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
// Create a image node ...
|
||||
var mindmap = designer.getMindmap();
|
||||
var node = mindmap.createNode();
|
||||
node.setImageSize(80, 43);
|
||||
node.setMetadata("{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}");
|
||||
node.setImageUrl("images/logo-small.png");
|
||||
node.setShapeType(mindplot.model.TopicShape.IMAGE);
|
||||
|
||||
designer.addDraggedNode(event, node);
|
||||
});
|
||||
|
||||
The node.setShapeType(mindplot.model.TopicShape.IMAGE) defines a image node. This makes mandatory the set of setImageUrl and setImageSize properties in the node.
|
||||
|
||||
3) An event registration mechanism for Image nodes edit events: The next snipped show how to register a custom edition handler.
|
||||
|
||||
designer.addEvent("editnode", function(event) {
|
||||
var node = event.model;
|
||||
|
||||
alert("Node Id:" + node.getId());
|
||||
alert("Node Metadata:" + node.getMetadata());
|
||||
alert("Is Read Only:" + event.readOnly);
|
||||
} });
|
||||
|
||||
|
||||
|
||||
## Author
|
||||
|
||||
* Pablo Luna
|
||||
* Paulo Veiga
|
||||
* Ignacio Manzano
|
||||
* Nicolas Damonte
|
||||
|
||||
|
||||
## License
|
||||
|
||||
The source code is Licensed under the WiseMapping Open License, Version 1.0 (the “License”);
|
||||
|
||||
You may obtain a copy of the License at: http://www.wisemapping.org/license
|
||||
You may obtain a copy of the License at: [https://wisemapping.atlassian.net/wiki/display/WS/License]
|
||||
|
10
config/database/hsql/apopulate-schemas.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURDATE(), 1,'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURDATE());
|
||||
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');
|
||||
|
||||
COMMIT;
|
||||
SHUTDOWN;
|
96
config/database/hsql/create-schemas.sql
Normal file
@@ -0,0 +1,96 @@
|
||||
CREATE TABLE COLLABORATOR (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
email VARCHAR(255) NOT NULL,
|
||||
creation_date DATE
|
||||
);
|
||||
|
||||
CREATE TABLE USER (
|
||||
colaborator_id INTEGER NOT NULL IDENTITY,
|
||||
authentication_type CHAR(1) NOT NULL,
|
||||
authenticator_uri VARCHAR(255) NULL,
|
||||
firstname VARCHAR(255) NOT NULL,
|
||||
lastname VARCHAR(255) NOT NULL,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
activation_code BIGINT NOT NULL,
|
||||
activation_date DATE,
|
||||
allow_send_email CHAR(1) NOT NULL,
|
||||
locale VARCHAR(5),
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id)
|
||||
);
|
||||
|
||||
CREATE TABLE MINDMAP (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
description VARCHAR(255) NOT NULL,
|
||||
xml LONGVARBINARY NOT NULL,
|
||||
public BOOLEAN NOT NULL,
|
||||
creation_date DATETIME,
|
||||
edition_date DATETIME,
|
||||
creator_id INTEGER NOT NULL,
|
||||
tags VARCHAR(1014),
|
||||
last_editor_id INTEGER NOT NULL
|
||||
--FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id)
|
||||
);
|
||||
|
||||
CREATE TABLE LABEL (
|
||||
id INTEGER NOT NULL PRIMARY KEY IDENTITY,
|
||||
title VARCHAR(30),
|
||||
creator_id INTEGER NOT NULL,
|
||||
parent_label_id INTEGER,
|
||||
color VARCHAR(7) NOT NULL,
|
||||
iconName VARCHAR(50) NOT NULL
|
||||
--FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id)
|
||||
);
|
||||
|
||||
CREATE TABLE R_LABEL_MINDMAP (
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
label_id INTEGER NOT NULL,
|
||||
PRIMARY KEY (mindmap_id, label_id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (label_id) REFERENCES LABEL (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
CREATE TABLE MINDMAP_HISTORY (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
xml LONGVARBINARY NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
creation_date DATETIME,
|
||||
editor_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id)
|
||||
);
|
||||
|
||||
CREATE TABLE COLLABORATION_PROPERTIES (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
starred BOOLEAN NOT NULL,
|
||||
mindmap_properties VARCHAR(512)
|
||||
);
|
||||
|
||||
CREATE TABLE COLLABORATION (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
colaborator_id INTEGER NOT NULL,
|
||||
properties_id INTEGER NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
role_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE TAG (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
user_id INTEGER NOT NULL,
|
||||
--FOREIGN KEY(user_id) REFERENCES USER(colaborator_id)
|
||||
);
|
||||
|
||||
CREATE TABLE ACCESS_AUDITORY (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
user_id INTEGER NOT NULL,
|
||||
login_date DATE,
|
||||
FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
COMMIT;
|
11
config/database/hsql/drop-schemas.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
DROP TABLE IF EXISTS ACCESS_AUDITORY;
|
||||
DROP TABLE IF EXISTS TAG;
|
||||
DROP TABLE IF EXISTS COLLABORATION;
|
||||
DROP TABLE IF EXISTS COLLABORATION_PROPERTIES;
|
||||
DROP TABLE IF EXISTS MINDMAP_HISTORY;
|
||||
DROP TABLE IF EXISTS R_LABEL_MINDMAP;
|
||||
DROP TABLE IF EXISTS LABEL;
|
||||
DROP TABLE IF EXISTS MINDMAP;
|
||||
DROP TABLE IF EXISTS USER;
|
||||
DROP TABLE IF EXISTS COLLABORATOR;
|
||||
COMMIT;
|
13
config/database/mysql/apopulate-schemas.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# Command: mysql -u root -p < apopulate_schemas.sql
|
||||
#
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURRENT_DATE());
|
||||
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');
|
||||
|
||||
COMMIT;
|
10
config/database/mysql/create-database.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Command: mysql -u root -p < create_database.sql
|
||||
#
|
||||
DROP DATABASE IF EXISTS wisemapping;
|
||||
|
||||
CREATE DATABASE IF NOT EXISTS wisemapping
|
||||
CHARACTER SET = 'utf8'
|
||||
COLLATE = 'utf8_unicode_ci';
|
||||
GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost';
|
||||
SET PASSWORD FOR 'wisemapping'@'localhost' = PASSWORD('password');
|
137
config/database/mysql/create-schemas.sql
Normal file
@@ -0,0 +1,137 @@
|
||||
#
|
||||
# Command: mysql -u root -p < create_schemas.sql
|
||||
#
|
||||
|
||||
USE wisemapping;
|
||||
|
||||
CREATE TABLE COLLABORATOR (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
email VARCHAR(255)
|
||||
CHARACTER SET utf8 NOT NULL UNIQUE,
|
||||
creation_date DATE
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE USER (
|
||||
colaborator_id INTEGER NOT NULL PRIMARY KEY,
|
||||
authentication_type CHAR(1)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
authenticator_uri VARCHAR(255)
|
||||
CHARACTER SET utf8,
|
||||
firstname VARCHAR(255) CHARACTER SET utf8 NOT NULL,
|
||||
lastname VARCHAR(255) CHARACTER SET utf8 NOT NULL,
|
||||
password VARCHAR(255) CHARACTER SET utf8 NOT NULL,
|
||||
activation_code BIGINT(20) NOT NULL,
|
||||
activation_date DATE,
|
||||
allow_send_email CHAR(1) CHARACTER SET utf8 NOT NULL DEFAULT 0,
|
||||
locale VARCHAR(5),
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE MINDMAP (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
title VARCHAR(255)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
description VARCHAR(255)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
xml MEDIUMBLOB NOT NULL,
|
||||
public BOOL NOT NULL DEFAULT 0,
|
||||
creation_date DATETIME,
|
||||
edition_date DATETIME,
|
||||
creator_id INTEGER NOT NULL,
|
||||
tags VARCHAR(1014)
|
||||
CHARACTER SET utf8,
|
||||
last_editor_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE LABEL (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
title VARCHAR(30)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
creator_id INTEGER NOT NULL,
|
||||
parent_label_id INTEGER,
|
||||
color VARCHAR(7) NOT NULL,
|
||||
iconName VARCHAR(50) NOT NULL,
|
||||
FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id),
|
||||
FOREIGN KEY (parent_label_id) REFERENCES LABEL (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE R_LABEL_MINDMAP (
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
label_id INTEGER NOT NULL,
|
||||
PRIMARY KEY (mindmap_id, label_id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (label_id) REFERENCES LABEL (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE MINDMAP_HISTORY
|
||||
(id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
xml MEDIUMBLOB NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
creation_date DATETIME,
|
||||
editor_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE COLLABORATION_PROPERTIES (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
starred BOOL NOT NULL DEFAULT 0,
|
||||
mindmap_properties VARCHAR(512)
|
||||
CHARACTER SET utf8
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE COLLABORATION (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
colaborator_id INTEGER NOT NULL,
|
||||
properties_id INTEGER NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
role_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION,
|
||||
FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE TAG (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
name VARCHAR(255)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
user_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE ACCESS_AUDITORY (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
login_date DATE,
|
||||
user_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
COMMIT;
|
11
config/database/mysql/drop-schemas.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
DROP TABLE IF EXISTS TAG;
|
||||
DROP TABLE IF EXISTS ACCESS_AUDITORY;
|
||||
DROP TABLE IF EXISTS COLLABORATION;
|
||||
DROP TABLE IF EXISTS COLLABORATION_PROPERTIES;
|
||||
DROP TABLE IF EXISTS MINDMAP_HISTORY;
|
||||
DROP TABLE IF EXISTS LABEL;
|
||||
DROP TABLE IF EXISTS MINDMAP;
|
||||
DROP TABLE IF EXISTS R_LABEL_MINDMAP
|
||||
DROP TABLE IF EXISTS USER;
|
||||
DROP TABLE IF EXISTS COLLABORATOR;
|
||||
COMMIT;
|
57
config/database/mysql/v2.0-to-v3.0.sql
Normal file
@@ -0,0 +1,57 @@
|
||||
CREATE TABLE COLLABORATION_PROPERTIES (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
starred BOOL NOT NULL DEFAULT 0,
|
||||
mindmap_properties VARCHAR(512)
|
||||
CHARACTER SET utf8
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
DROP TABLE `MINDMAP_NATIVE`;
|
||||
ALTER TABLE `MINDMAP_COLABORATOR` RENAME TO `COLLABORATION`;
|
||||
ALTER TABLE `COLABORATOR` RENAME TO `COLLABORATOR`;
|
||||
|
||||
ALTER TABLE `MINDMAP` DROP COLUMN `editor_properties`, DROP COLUMN `mindMapNative_id`;
|
||||
|
||||
ALTER TABLE `MINDMAP` CHANGE COLUMN `owner_id` `creator_id` INT(11) NOT NULL
|
||||
, DROP INDEX `owner_id`
|
||||
, ADD INDEX `owner_id` (`creator_id` ASC);
|
||||
|
||||
ALTER TABLE `COLLABORATION` ADD COLUMN `properties_id` INT(11) NULL DEFAULT NULL
|
||||
AFTER `role_id`;
|
||||
DROP TABLE USER_LOGIN;
|
||||
|
||||
CREATE TABLE ACCESS_AUDITORY (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
user_id INTEGER NOT NULL,
|
||||
login_date DATE
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
#ALTER TABLE ACCESS_AUDITORY
|
||||
# ADD CONSTRAINT `user_id`
|
||||
# FOREIGN KEY ()
|
||||
# REFERENCES `USER` ()
|
||||
# ON DELETE CASCADE
|
||||
# ON UPDATE NO ACTION
|
||||
#, ADD INDEX `user_id` () ;
|
||||
|
||||
ALTER TABLE `MINDMAP_HISTORY` DROP COLUMN `creator_user`, ADD COLUMN `editor_id` INT(11) NULL DEFAULT NULL AFTER `creation_date`;
|
||||
|
||||
ALTER TABLE `USER` ADD COLUMN `locale` VARCHAR(5) NULL
|
||||
AFTER `allowSendEmail`;
|
||||
|
||||
ALTER TABLE `MINDMAP` DROP COLUMN `last_editor`, ADD COLUMN `last_editor_id` INT(11) NULL DEFAULT 2
|
||||
AFTER `tags`;
|
||||
|
||||
ALTER TABLE `USER` DROP COLUMN `username`, CHANGE COLUMN `activationCode` `activation_code` BIGINT(20) NOT NULL, CHANGE COLUMN `allowSendEmail` `allow_send_email` CHAR(1) NOT NULL DEFAULT '0';
|
||||
|
||||
INSERT INTO `MINDMAP` (`last_editor_id`) VALUES (1);
|
||||
|
||||
INSERT INTO `COLLABORATOR` (`id`, `email`, `creation_date`) VALUES (8081, 'migfake@wis.com', '2007-10-09');
|
||||
DELETE FROM `USER`
|
||||
WHERE activation_date IS null;
|
||||
DROP TABLE FEEDBACK;
|
||||
|
||||
|
||||
ALTER TABLE `MINDMAP` CHANGE COLUMN `XML` `XML` MEDIUMBLOB NULL DEFAULT NULL;
|
||||
ALTER TABLE `MINDMAP_HISTORY` CHANGE COLUMN `XML` `XML` MEDIUMBLOB NULL DEFAULT NULL;
|
5
config/database/mysql/v3.0-to-v3.0.1.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE `USER` ADD COLUMN `authentication_type` CHAR(1) CHARACTER SET utf8 NOT NULL DEFAULT 'D'
|
||||
AFTER `colaborator_id`;
|
||||
|
||||
ALTER TABLE `USER` ADD COLUMN `authenticator_uri` VARCHAR(255) CHARACTER SET utf8
|
||||
AFTER `authentication_type`;
|
37
config/database/mysql/v3.0.2-to-v3.0.3.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
ALTER TABLE `USER` DROP COLUMN `id`;
|
||||
|
||||
ALTER TABLE `ACCESS_AUDITORY`
|
||||
ADD CONSTRAINT
|
||||
FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION;
|
||||
|
||||
CREATE TABLE LABEL (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
title VARCHAR(30)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
creator_id INTEGER NOT NULL,
|
||||
parent_label_id INTEGER,
|
||||
color VARCHAR(7) NOT NULL,
|
||||
FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id),
|
||||
FOREIGN KEY (parent_label_id) REFERENCES LABEL (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE R_LABEL_MINDMAP (
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
label_id INTEGER NOT NULL,
|
||||
PRIMARY KEY (mindmap_id, label_id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (label_id) REFERENCES LABEL (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
ALTER TABLE `LABEL`
|
||||
ADD COLUMN iconName VARCHAR(50) NOT NULL;
|
||||
|
||||
UPDATE LABEL SET iconName = 'glyphicon glyphicon-tag';
|
3
config/database/postgres/create-database.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
CREATE DATABASE wisemapping;
|
||||
CREATE USER wisemapping WITH PASSWORD 'password';
|
||||
GRANT ALL PRIVILEGES ON DATABASE wisemapping TO wisemapping;
|
96
config/database/postgres/create-schemas.sql
Normal file
@@ -0,0 +1,96 @@
|
||||
CREATE TABLE COLLABORATOR (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
email VARCHAR(255) NOT NULL UNIQUE,
|
||||
creation_date DATE
|
||||
);
|
||||
|
||||
CREATE TABLE "user" (
|
||||
authentication_type TEXT NOT NULL,
|
||||
authenticator_uri VARCHAR(255),
|
||||
colaborator_id INTEGER NOT NULL PRIMARY KEY,
|
||||
firstname VARCHAR(255) NOT NULL,
|
||||
lastname VARCHAR(255) NOT NULL,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
activation_code BIGINT NOT NULL,
|
||||
activation_date DATE,
|
||||
allow_send_email TEXT NOT NULL DEFAULT 0,
|
||||
locale VARCHAR(5),
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
CREATE TABLE LABEL (
|
||||
id INTEGER NOT NULL PRIMARY KEY,
|
||||
title VARCHAR(255),
|
||||
creator_id INTEGER NOT NULL,
|
||||
parent_label_id INTEGER,
|
||||
color VARCHAR(7) NOT NULL
|
||||
--FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id)
|
||||
);
|
||||
|
||||
CREATE TABLE R_LABEL_MINDMAP (
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
label_id INTEGER NOT NULL,
|
||||
PRIMARY KEY (mindmap_id, label_id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (label_id) REFERENCES LABEL (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
CREATE TABLE MINDMAP (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
description VARCHAR(255) NOT NULL,
|
||||
xml BYTEA NOT NULL,
|
||||
public BOOL NOT NULL DEFAULT FALSE,
|
||||
creation_date TIMESTAMP,
|
||||
edition_date TIMESTAMP,
|
||||
creator_id INTEGER NOT NULL,
|
||||
tags VARCHAR(1014),
|
||||
last_editor_id INTEGER NOT NULL --,
|
||||
--FOREIGN KEY(creator_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE MINDMAP_HISTORY
|
||||
(id SERIAL NOT NULL PRIMARY KEY,
|
||||
xml BYTEA NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
creation_date TIMESTAMP,
|
||||
editor_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE COLLABORATION_PROPERTIES (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
starred BOOL NOT NULL DEFAULT FALSE,
|
||||
mindmap_properties VARCHAR(512)
|
||||
);
|
||||
|
||||
CREATE TABLE COLLABORATION (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
colaborator_id INTEGER NOT NULL,
|
||||
properties_id INTEGER NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
role_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) ON DELETE CASCADE ON UPDATE NO ACTION,
|
||||
FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
CREATE TABLE TAG (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
user_id INTEGER NOT NULL --,
|
||||
--FOREIGN KEY(user_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE ACCESS_AUDITORY (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
login_date DATE,
|
||||
user_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (user_id) REFERENCES "user" (colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
|
||||
COMMIT;
|
@@ -1,9 +1,11 @@
|
||||
DROP TABLE TAG;
|
||||
DROP TABLE ACCESS_AUDITORY;
|
||||
DROP TABLE COLLABORATION;
|
||||
DROP TABLE COLLABORATION_PROPERTIES;
|
||||
DROP TABLE MINDMAP_HISTORY;
|
||||
DROP TABLE MINDMAP;
|
||||
DROP TABLE USER;
|
||||
DROP TABLE COLLABORATOR;
|
||||
DROP TABLE TAG;
|
||||
DROP TABLE ACCESS_AUDITORY;
|
||||
DROP TABLE COLLABORATION;
|
||||
DROP TABLE COLLABORATION_PROPERTIES;
|
||||
DROP TABLE MINDMAP_HISTORY;
|
||||
DROP TABLE R_LABEL_MINDMAP;
|
||||
DROP TABLE LABEL;
|
||||
DROP TABLE MINDMAP;
|
||||
DROP TABLE "user";
|
||||
DROP TABLE COLLABORATOR;
|
||||
COMMIT;
|
@@ -9,7 +9,7 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.0.4</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<files>
|
||||
<file>
|
||||
<file>
|
||||
<source>core-js/target/classes/core.js</source>
|
||||
<outputDirectory>/js</outputDirectory>
|
||||
</file>
|
||||
@@ -14,10 +14,6 @@
|
||||
<source>mindplot/target/classes/mindplot-min.js</source>
|
||||
<outputDirectory>/js</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>mindplot/target/classes/mindplot.js</source>
|
||||
<outputDirectory>/js</outputDirectory>
|
||||
</file>
|
||||
</files>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
|
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
WISE_VERSION=$1
|
||||
SERVER_DOWNLOAD_DIR=/var/www/wisemapping.org/stable
|
||||
|
||||
WISE_BIN_FILE_NAME=wisemapping-${WISE_VERSION}.zip
|
||||
WISE_BIN_FILE_PATH=./target/${WISE_BIN_FILE_NAME}
|
||||
|
||||
#WISE_SRC_FILE_NAME=wisemapping-${WISE_VERSION}-src.tar.gz
|
||||
#WISE_SRC_FILE_PATH=./target/${WISE_SRC_FILE_NAME}
|
||||
|
||||
#scp ${WISE_SRC_FILE_PATH} thecrow@wisemapping.com:${SERVER_DOWNLOAD_DIR}/
|
||||
scp ${WISE_BIN_FILE_PATH} thecrow@wisemapping.com:${SERVER_DOWNLOAD_DIR}
|
||||
|
||||
# It's there ?
|
||||
cd target
|
||||
wget -S http://downloads.wisemapping.org/stable/${WISE_BIN_FILE_NAME}
|
||||
#wget -S http://downloads.wisemapping.org/stable/${WISE_SRC_FILE_NAME}
|
@@ -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.5.v20120716
|
||||
JETTY_VERSION=8.1.14.v20131031
|
||||
JETTY_DIST_DIR=jetty-distribution-${JETTY_VERSION}
|
||||
JETTY_ZIP=${JETTY_DIST_DIR}.zip
|
||||
|
||||
@@ -51,8 +51,9 @@ cp $BASE_DIR/wisemapping.xml $JETTY_DIR/contexts/
|
||||
|
||||
|
||||
# Distribute scripts
|
||||
cp -r $BASE_DIR/../wise-webapp/src/test/sql $TARGET_DIR/wisemapping-$WISE_VERSION/config
|
||||
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
|
||||
|
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
WISE_VERSION=$1
|
||||
TMP_DIR=/tmp/wise-src/wisemapping-src
|
||||
TAR_FILE_NAME=wisemapping-${WISE_VERSION}-src.tar.gz
|
||||
OUTPUT_DIR=`pwd`"/target"
|
||||
OUTPUT_FILE=${OUTPUT_DIR}/${TAR_FILE_NAME}
|
||||
|
||||
|
||||
# Clean all.
|
||||
cd ..
|
||||
rm -rf ${TMP_DIR}/../
|
||||
mvn clean
|
||||
|
||||
# Prepare copy
|
||||
mkdir -p ${TMP_DIR}
|
||||
rsync -aCv --exclude ".git" --exclude "wisemapping.i*" --exclude "**/*/Brix*" --exclude "**/brix" --exclude "*/*.iml" --exclude "*/wisemapping.log*" --exclude "**/.DS_Store" --exclude "*.textile" --exclude "**/.gitignore" --exclude "installer" --exclude "*/target" . ${TMP_DIR}
|
||||
|
||||
# Zip file
|
||||
[ ! -e ${OUTPUT_DIR} ] && mkdir ${OUTPUT_DIR}
|
||||
rm -f ${OUTPUT_FILE}
|
||||
|
||||
cd ${TMP_DIR}/..
|
||||
tar -cvzf ${OUTPUT_FILE} .
|
||||
|
||||
echo
|
||||
echo "#################################################################"
|
||||
echo "Zip file generated on:"${OUTPUT_FILE}
|
||||
echo "#################################################################"
|
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
|
@@ -1,4 +1,4 @@
|
||||
Copyright [2012] [wisemapping]
|
||||
Copyright [2014] [wisemapping]
|
||||
|
||||
Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.0.4</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -193,9 +193,6 @@
|
||||
<include>commands/AddFeatureToTopicCommand.js</include>
|
||||
<include>commands/AddRelationshipCommand.js</include>
|
||||
<include>commands/MoveControlPointCommand.js</include>
|
||||
<include>collaboration/CollaborationManager.js</include>
|
||||
<include>collaboration/framework/AbstractCollaborativeFramework.js</include>
|
||||
<include>collaboration/framework/AbstractCollaborativeModelFactory.js</include>
|
||||
<include>widget/ModalDialogNotifier.js</include>
|
||||
<include>widget/ToolbarNotifier.js</include>
|
||||
<include>widget/ToolbarItem.js</include>
|
||||
@@ -228,10 +225,12 @@
|
||||
<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>
|
||||
</includes>
|
||||
</aggregation>
|
||||
|
@@ -1,153 +0,0 @@
|
||||
/*
|
||||
* 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.BrixActionDispatcher = new Class({
|
||||
Extends: mindplot.ActionDispatcher,
|
||||
initialize: function(commandContext, fireOnChange) {
|
||||
this.parent(commandContext, fireOnChange);
|
||||
this._commandContext = commandContext;
|
||||
},
|
||||
|
||||
dragTopic: function(topicId, position, order, parentTopic) {
|
||||
var framework = this._getFramework();
|
||||
var node = framework.getTopic(topicId);
|
||||
|
||||
// Set node order ...
|
||||
if (order != null) {
|
||||
node.setOrder(order);
|
||||
} else if (position != null) {
|
||||
// Set position ...
|
||||
node.setPosition(position);
|
||||
} else {
|
||||
$assert("Illegal commnand state exception.");
|
||||
}
|
||||
// Finally, connect node ...
|
||||
if ($defined(this._parentId)) {
|
||||
var parentNode = topic.findTopics([this._parentId])[0];
|
||||
node.disconnect();
|
||||
node.connect(parentNode);
|
||||
}
|
||||
},
|
||||
|
||||
changeTextToTopic : function(topicsIds, text) {
|
||||
var framework = this._getFramework();
|
||||
var topicId;
|
||||
if (!(topicsIds instanceof Array)) {
|
||||
topicId = topicsIds;
|
||||
} else {
|
||||
topicId = topicsIds[0];
|
||||
}
|
||||
var node = framework.getTopic(topicId);
|
||||
node.setText(text);
|
||||
|
||||
},
|
||||
|
||||
_getFramework:function () {
|
||||
return mindplot.collaboration.CollaborationManager.getInstance().getCollaborativeFramework();
|
||||
},
|
||||
|
||||
addTopics : function(nodeModel, parentTopicId) {
|
||||
var framework = this._getFramework();
|
||||
var cmindmap = framework.getModel();
|
||||
|
||||
var cparent = $defined(parentTopicId) ? framework.getTopic(parentTopicId) : cmindmap.getCentralTopic();
|
||||
var cnode = cmindmap.createNode(nodeModel.getType(), nodeModel.getId());
|
||||
nodeModel.copyTo(cnode);
|
||||
|
||||
cnode.connectTo(cparent);
|
||||
},
|
||||
|
||||
changeFontSizeToTopic : function(topicsIds, size) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setFontSize(size, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeFontColorToTopic : function(topicsIds, color) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setFontColor(color, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeFontFamilyToTopic : function(topicsIds, family) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setFontFamily(family, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeFontStyleToTopic : function(topicsIds) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
var style = ( topic.getFontStyle() == "italic") ? "normal" : "italic";
|
||||
topic.setFontStyle(style, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeShapeTypeToTopic : function(topicsIds, shapeType) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setShapeType(shapeType);
|
||||
}.bind(this))
|
||||
},
|
||||
|
||||
changeFontWeightToTopic : function(topicsIds) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
var weight = (topic.getFontWeight() == "bold") ? "normal" : "bold";
|
||||
topic.setFontWeight(weight, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeBackgroundColorToTopic : function(topicsIds, color) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setBackgroundColor(color, true);
|
||||
}.bind(this));
|
||||
|
||||
},
|
||||
|
||||
changeBorderColorToTopic : function(topicsIds, color) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setBorderColor(color);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
deleteEntities : function(topicsIds, relIds) {
|
||||
$assert(topicsIds, "topicsIds can not be null");
|
||||
var framework = this._getFramework();
|
||||
var mindmap = framework.getModel();
|
||||
|
||||
topicsIds.each(function(topicId) {
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.deleteNode();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@@ -29,16 +29,12 @@ mindplot.ConnectionLine = new Class({
|
||||
var ctrlPoints = this._getCtrlPoints(sourceNode, targetNode);
|
||||
if (targetNode.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
line = this._createLine(lineType, mindplot.ConnectionLine.CURVED);
|
||||
if (line.getType() == "CurvedLine") {
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
}
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
} else {
|
||||
line = this._createLine(lineType, mindplot.ConnectionLine.SIMPLE_CURVED);
|
||||
if (line.getType() == "CurvedLine") {
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
}
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
}
|
||||
// Set line styles ...
|
||||
var strokeColor = mindplot.ConnectionLine.getStrokeColor();
|
||||
|
@@ -33,11 +33,7 @@ mindplot.Designer = new Class({
|
||||
|
||||
// Dispatcher manager ...
|
||||
var commandContext = new mindplot.CommandContext(this);
|
||||
if (!$defined(options.collab) || options.collab == 'standalone') {
|
||||
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
|
||||
} else {
|
||||
this._actionDispatcher = new mindplot.BrixActionDispatcher(commandContext);
|
||||
}
|
||||
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
|
||||
|
||||
this._actionDispatcher.addEvent("modelUpdate", function (event) {
|
||||
this.fireEvent("modelUpdate", event);
|
||||
@@ -440,8 +436,9 @@ mindplot.Designer = new Class({
|
||||
}
|
||||
// Execute event ...
|
||||
var topic = nodes[0];
|
||||
this._actionDispatcher.shrinkBranch([topic.getId()], !topic.areChildrenShrunken());
|
||||
|
||||
if (topic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
this._actionDispatcher.shrinkBranch([topic.getId()], !topic.areChildrenShrunken());
|
||||
}
|
||||
},
|
||||
|
||||
createChildForSelectedNode:function () {
|
||||
@@ -469,10 +466,57 @@ mindplot.Designer = new Class({
|
||||
|
||||
},
|
||||
|
||||
_copyNodeProps: function(sourceModel,targetModel){
|
||||
|
||||
// I don't copy the font size if the target is the source is the central topic.
|
||||
if(sourceModel.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE)
|
||||
{
|
||||
var fontSize = sourceModel.getFontSize();
|
||||
if(fontSize){
|
||||
targetModel.setFontSize(fontSize)
|
||||
}
|
||||
}
|
||||
|
||||
var fontFamily = sourceModel.getFontFamily();
|
||||
if(fontFamily){
|
||||
targetModel.setFontFamily(fontFamily)
|
||||
}
|
||||
|
||||
var fontColor = sourceModel.getFontColor();
|
||||
if(fontColor){
|
||||
targetModel.setFontColor(fontColor)
|
||||
}
|
||||
|
||||
var fontWeight = sourceModel.getFontWeight();
|
||||
if(fontWeight){
|
||||
targetModel.setFontWeight(fontWeight)
|
||||
}
|
||||
|
||||
var fontStyle = sourceModel.getFontStyle();
|
||||
if(fontStyle){
|
||||
targetModel.setFontStyle(fontStyle)
|
||||
}
|
||||
|
||||
var shape = sourceModel.getShapeType();
|
||||
if(shape){
|
||||
targetModel.setShapeType(shape)
|
||||
}
|
||||
|
||||
var borderColor = sourceModel.getBorderColor();
|
||||
if(borderColor){
|
||||
targetModel.setBorderColor(borderColor)
|
||||
}
|
||||
|
||||
var backgroundColor = sourceModel.getBackgroundColor();
|
||||
if(backgroundColor){
|
||||
targetModel.setBackgroundColor(backgroundColor)
|
||||
}
|
||||
},
|
||||
|
||||
_createChildModel:function (topic, mousePos) {
|
||||
// Create a new node ...
|
||||
var model = topic.getModel();
|
||||
var mindmap = model.getMindmap();
|
||||
var parentModel = topic.getModel();
|
||||
var mindmap = parentModel.getMindmap();
|
||||
var childModel = mindmap.createNode();
|
||||
|
||||
// Create a new node ...
|
||||
@@ -483,6 +527,8 @@ mindplot.Designer = new Class({
|
||||
var position = result.position;
|
||||
childModel.setPosition(position.x, position.y);
|
||||
|
||||
this._copyNodeProps(parentModel,childModel);
|
||||
|
||||
return childModel;
|
||||
},
|
||||
|
||||
@@ -547,8 +593,11 @@ mindplot.Designer = new Class({
|
||||
// Create a new node ...
|
||||
var order = topic.getOrder() + 1;
|
||||
result.setOrder(order);
|
||||
result.setPosition(10, 10); // Set a dummy pisition ...
|
||||
result.setPosition(10, 10); // Set a dummy position ...
|
||||
}
|
||||
|
||||
this._copyNodeProps(model,result);
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
@@ -697,6 +746,9 @@ mindplot.Designer = new Class({
|
||||
|
||||
var targetTopicId = model.getToNode();
|
||||
var targetTopic = dmodel.findTopicById(targetTopicId);
|
||||
$assert(targetTopic, "targetTopic could not be found:" + targetTopicId + dmodel.getTopics().map(function (e) {
|
||||
return e.getId()
|
||||
}));
|
||||
|
||||
// Build relationship line ....
|
||||
var result = new mindplot.Relationship(sourceTopic, targetTopic, model);
|
||||
@@ -749,7 +801,16 @@ mindplot.Designer = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
_resetEdition:function () {
|
||||
var screenManager = this._workspace.getScreenManager();
|
||||
screenManager.fireEvent("update");
|
||||
screenManager.fireEvent("mouseup");
|
||||
this._relPivot.dispose();
|
||||
},
|
||||
|
||||
deleteSelectedEntities:function () {
|
||||
// Is there some action in progress ?.
|
||||
this._resetEdition();
|
||||
|
||||
var topics = this.getModel().filterSelectedTopics();
|
||||
var relation = this.getModel().filterSelectedRelationships();
|
||||
|
@@ -252,7 +252,7 @@ mindplot.DesignerKeyboard = new Class({
|
||||
designer.zoomOut();
|
||||
},
|
||||
|
||||
'ctrl++':function (event) {
|
||||
'ctrl+=':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
|
@@ -115,14 +115,16 @@ mindplot.DragTopic = new Class({
|
||||
},
|
||||
|
||||
removeFromWorkspace:function (workspace) {
|
||||
// Remove drag shadow.
|
||||
workspace.removeChild(this._elem2d);
|
||||
this._isInWorkspace = false;
|
||||
if (this._isInWorkspace) {
|
||||
// Remove drag shadow.
|
||||
workspace.removeChild(this._elem2d);
|
||||
|
||||
// Remove pivot shape. To improve performace it will not be removed. Only the visibility will be changed.
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.setVisibility(false);
|
||||
// Remove pivot shape. To improve performance it will not be removed. Only the visibility will be changed.
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.setVisibility(false);
|
||||
|
||||
this._isInWorkspace = false;
|
||||
}
|
||||
},
|
||||
|
||||
isInWorkspace:function () {
|
||||
@@ -130,10 +132,12 @@ mindplot.DragTopic = new Class({
|
||||
},
|
||||
|
||||
addToWorkspace:function (workspace) {
|
||||
workspace.appendChild(this._elem2d);
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.addToWorkspace(workspace);
|
||||
this._isInWorkspace = true;
|
||||
if (!this._isInWorkspace) {
|
||||
workspace.appendChild(this._elem2d);
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.addToWorkspace(workspace);
|
||||
this._isInWorkspace = true;
|
||||
}
|
||||
},
|
||||
|
||||
_getDragPivot:function () {
|
||||
|
@@ -102,7 +102,6 @@ mindplot.ImageIcon = new Class({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mindplot.ImageIcon.prototype.ICON_FAMILIES = [
|
||||
{"id":"face", "icons":["face_plain", "face_sad", "face_crying", "face_smile", "face_surprise", "face_wink"]},
|
||||
{"id":"funy", "icons":["funy_angel", "funy_devilish", "funy_glasses", "funy_grin", "funy_kiss", "funy_monkey"]},
|
||||
@@ -114,6 +113,7 @@ mindplot.ImageIcon.prototype.ICON_FAMILIES = [
|
||||
{"id":"onoff", "icons":["onoff_clock", "onoff_clock_red", "onoff_add", "onoff_delete", "onoff_status_offline", "onoff_status_online"]},
|
||||
{"id":"money", "icons":["money_money", "money_dollar", "money_euro", "money_pound", "money_yen", "money_coins", "money_ruby"]},
|
||||
{"id":"time", "icons":["time_calendar", "time_clock", "time_hourglass"]},
|
||||
{"id":"number", "icons":["number_1", "number_2", "number_3", "number_4", "number_5", "number_6", "number_7", "number_8", "number_9"]},
|
||||
{"id":"chart", "icons":["chart_bar", "chart_line", "chart_curve", "chart_pie", "chart_organisation"]},
|
||||
{"id":"sign", "icons":["sign_warning", "sign_info", "sign_stop", "sign_help", "sign_cancel"]},
|
||||
{"id":"hard", "icons":["hard_cd", "hard_computer", "hard_controller", "hard_driver_disk", "hard_ipod", "hard_keyboard", "hard_mouse", "hard_printer"]},
|
||||
@@ -126,7 +126,7 @@ mindplot.ImageIcon.prototype.ICON_FAMILIES = [
|
||||
{"id":"bullet", "icons":["bullet_black", "bullet_blue", "bullet_green", "bullet_orange", "bullet_red", "bullet_pink", "bullet_purple"]},
|
||||
{"id":"tag", "icons":["tag_blue", "tag_green", "tag_orange", "tag_red", "tag_pink", "tag_yellow"]},
|
||||
{"id":"object", "icons":["object_bell", "object_clanbomber", "object_key", "object_pencil", "object_phone", "object_magnifier", "object_clip", "object_music", "object_star", "object_wizard", "object_house", "object_cake", "object_camera", "object_palette", "object_rainbow"]},
|
||||
{"id":"weather", "icons":["weather_clear-night", "weather_clear", "weather_few-clouds-night", "weather_few-clouds", "weather_overcast", "weather_severe-alert", "weather_showers-scattered", "weather_showers", "weather_snow", "weather_storm"]}
|
||||
{"id":"weather", "icons":["weather_clear-night", "weather_clear", "weather_few-clouds-night", "weather_few-clouds", "weather_overcast", "weather_severe-alert", "weather_showers-scattered", "weather_showers", "weather_snow", "weather_storm"]},
|
||||
{"id":"task", "icons":["task_0", "task_25", "task_50", "task_75", "task_100"]}
|
||||
];
|
||||
|
||||
|
||||
|
@@ -18,8 +18,10 @@
|
||||
|
||||
mindplot.LocalStorageManager = new Class({
|
||||
Extends:mindplot.PersistenceManager,
|
||||
initialize:function () {
|
||||
initialize:function (documentUrl,forceLoad) {
|
||||
this.parent();
|
||||
this.documentUrl = documentUrl;
|
||||
this.forceLoad = forceLoad;
|
||||
},
|
||||
|
||||
saveMapXml:function (mapId, mapXml, pref, saveHistory, events) {
|
||||
@@ -32,10 +34,10 @@ mindplot.LocalStorageManager = new Class({
|
||||
|
||||
loadMapDom:function (mapId) {
|
||||
var xml = localStorage.getItem(mapId + "-xml");
|
||||
if (xml == null) {
|
||||
// Let's try to open one from the local directory ...
|
||||
if (xml == null || this.forceLoad) {
|
||||
var xmlRequest = new Request({
|
||||
url:'samples/' + mapId + '.xml',
|
||||
url:this.documentUrl.replace("{id}", mapId),
|
||||
headers:{"Content-Type":"text/plain","Accept":"application/xml"},
|
||||
method:'get',
|
||||
async:false,
|
||||
onSuccess:function (responseText) {
|
||||
|
@@ -98,28 +98,7 @@ mindplot.MainTopic = new Class({
|
||||
},
|
||||
|
||||
workoutIncomingConnectionPoint:function (sourcePosition) {
|
||||
$assert(sourcePosition, 'sourcePoint can not be null');
|
||||
var pos = this.getPosition();
|
||||
var size = this.getSize();
|
||||
|
||||
var isAtRight = mindplot.util.Shape.isAtRight(sourcePosition, pos);
|
||||
var result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight);
|
||||
if (this.getShapeType() == mindplot.model.TopicShape.LINE) {
|
||||
result.y = result.y + (this.getSize().height / 2);
|
||||
}
|
||||
|
||||
// Move a little the position...
|
||||
var offset = mindplot.Topic.CONNECTOR_WIDTH / 2;
|
||||
if (this.getPosition().x > 0) {
|
||||
result.x = result.x + offset;
|
||||
} else {
|
||||
result.x = result.x - offset;
|
||||
}
|
||||
|
||||
result.x = Math.ceil(result.x);
|
||||
result.y = Math.ceil(result.y);
|
||||
return result;
|
||||
|
||||
return mindplot.util.Shape.workoutIncomingConnectionPoint(this, sourcePosition);
|
||||
},
|
||||
|
||||
workoutOutgoingConnectionPoint:function (targetPosition) {
|
||||
|
@@ -191,7 +191,7 @@ mindplot.MultilineTextEditor = new Class({
|
||||
// Set editor's initial size
|
||||
var displayFunc = function () {
|
||||
// Position the editor and set the size...
|
||||
var textShape = this._topic.getTextShape();
|
||||
var textShape = topic.getTextShape();
|
||||
textShape.positionRelativeTo(this._containerElem, {
|
||||
position:{x:'left', y:'top'},
|
||||
edge:{x:'left', y:'top'}
|
||||
|
@@ -83,14 +83,19 @@ mindplot.Relationship = new Class({
|
||||
|
||||
var targetTopic = this._targetTopic;
|
||||
var targetPosition = targetTopic.getPosition();
|
||||
if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
targetPosition = mindplot.util.Shape.workoutIncomingConnectionPoint(targetTopic, sourcePosition);
|
||||
}
|
||||
|
||||
var sPos, tPos;
|
||||
this._line2d.setStroke(2);
|
||||
var ctrlPoints = this._line2d.getControlPoints();
|
||||
if (!this._line2d.isDestControlPointCustom() && !this._line2d.isSrcControlPointCustom()) {
|
||||
|
||||
var defaultPoints = mindplot.util.Shape.calculateDefaultControlPoints(sourcePosition, targetPosition);
|
||||
ctrlPoints[0].x = defaultPoints[0].x;
|
||||
ctrlPoints[0].y = defaultPoints[0].y;
|
||||
|
||||
ctrlPoints[1].x = defaultPoints[1].x;
|
||||
ctrlPoints[1].y = defaultPoints[1].y;
|
||||
}
|
||||
@@ -101,6 +106,7 @@ mindplot.Relationship = new Class({
|
||||
var tpoint = new core.Point();
|
||||
tpoint.x = parseInt(ctrlPoints[1].x) + parseInt(targetPosition.x);
|
||||
tpoint.y = parseInt(ctrlPoints[1].y) + parseInt(targetPosition.y);
|
||||
|
||||
sPos = mindplot.util.Shape.calculateRelationShipPointCoordinates(sourceTopic, spoint);
|
||||
tPos = mindplot.util.Shape.calculateRelationShipPointCoordinates(targetTopic, tpoint);
|
||||
|
||||
|
@@ -43,7 +43,9 @@ mindplot.RelationshipPivot = new Class({
|
||||
|
||||
this._pivot = new web2d.CurvedLine();
|
||||
this._pivot.setStyle(web2d.CurvedLine.SIMPLE_LINE);
|
||||
this._pivot.setFrom(sourcePos.x, sourcePos.y);
|
||||
|
||||
var fromPos = this._calculateFromPosition(sourcePos);
|
||||
this._pivot.setFrom(fromPos.x, fromPos.y);
|
||||
|
||||
this._pivot.setTo(targetPos.x, targetPos.y);
|
||||
this._pivot.setStroke(2, 'solid', strokeColor);
|
||||
@@ -54,7 +56,6 @@ 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);
|
||||
|
||||
@@ -99,8 +100,13 @@ mindplot.RelationshipPivot = new Class({
|
||||
var pos = screen.getWorkspaceMousePosition(event);
|
||||
|
||||
// Leave the arrow a couple of pixels away from the cursor.
|
||||
var gapDistance = Math.sign(pos.x - this._sourceTopic.getPosition().x) * 5;
|
||||
var sourcePosition = this._sourceTopic.getPosition();
|
||||
var gapDistance = Math.sign(pos.x - sourcePosition.x) * 5;
|
||||
|
||||
var sPos = this._calculateFromPosition(pos);
|
||||
this._pivot.setFrom(sPos.x, sPos.y);
|
||||
|
||||
// Update target position ...
|
||||
this._pivot.setTo(pos.x - gapDistance, pos.y);
|
||||
|
||||
var controlPoints = this._pivot.getControlPoints();
|
||||
@@ -118,6 +124,21 @@ mindplot.RelationshipPivot = new Class({
|
||||
event.stopPropagation();
|
||||
},
|
||||
|
||||
_calculateFromPosition:function (toPosition) {
|
||||
|
||||
// Calculate origin position ...
|
||||
var sourcePosition = this._sourceTopic.getPosition();
|
||||
if (this._sourceTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
sourcePosition = mindplot.util.Shape.workoutIncomingConnectionPoint(this._sourceTopic, toPosition);
|
||||
}
|
||||
var controlPoint = mindplot.util.Shape.calculateDefaultControlPoints(sourcePosition, toPosition);
|
||||
|
||||
var spoint = new core.Point();
|
||||
spoint.x = parseInt(controlPoint[0].x) + parseInt(sourcePosition.x);
|
||||
spoint.y = parseInt(controlPoint[0].y) + parseInt(sourcePosition.y);
|
||||
return mindplot.util.Shape.calculateRelationShipPointCoordinates(this._sourceTopic, spoint);
|
||||
},
|
||||
|
||||
_connectOnFocus:function (targetTopic) {
|
||||
var sourceTopic = this._sourceTopic;
|
||||
var mindmap = this._designer.getMindmap();
|
||||
|
@@ -20,13 +20,13 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
Extends:mindplot.PersistenceManager,
|
||||
initialize:function (options) {
|
||||
this.parent();
|
||||
$assert(options.saveUrl, "saveUrl can not be null");
|
||||
$assert(options.documentUrl, "documentUrl can not be null");
|
||||
$assert(options.revertUrl, "revertUrl can not be null");
|
||||
$assert(options.lockUrl, "lockUrl can not be null");
|
||||
$assert(options.session, "session can not be null");
|
||||
$assert(options.timestamp, "timestamp can not be null");
|
||||
|
||||
this.saveUrl = options.saveUrl;
|
||||
this.documentUrl = options.documentUrl;
|
||||
this.revertUrl = options.revertUrl;
|
||||
this.lockUrl = options.lockUrl;
|
||||
this.timestamp = options.timestamp;
|
||||
@@ -43,8 +43,8 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
|
||||
var persistence = this;
|
||||
var query = "minor=" + !saveHistory;
|
||||
query = query + (this.timestamp ? "×tamp=" + this.timestamp : "");
|
||||
query = query + (this.session ? "&session=" + this.session : "");
|
||||
query = query + "×tamp=" + this.timestamp;
|
||||
query = query + "&session=" + this.session;
|
||||
|
||||
if (!persistence.onSave) {
|
||||
|
||||
@@ -56,7 +56,7 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
}, 10000);
|
||||
|
||||
var request = new Request({
|
||||
url:this.saveUrl.replace("{id}", mapId) + "?" + query,
|
||||
url:this.documentUrl.replace("{id}", mapId) + "?" + query,
|
||||
method:'put',
|
||||
async:!sync,
|
||||
|
||||
@@ -99,13 +99,10 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
}
|
||||
}
|
||||
events.onError(userMsg);
|
||||
|
||||
// @Todo: Only for debug. Remove.
|
||||
persistence.onSave = false;
|
||||
throw new Error("responseText:" + responseText + ",status:" + this.status);
|
||||
},
|
||||
|
||||
headers:{"Content-Type":"application/json", "Accept":"application/json"},
|
||||
headers:{"Content-Type":"application/json; charset=utf-8", "Accept":"application/json"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
});
|
||||
@@ -124,7 +121,7 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
},
|
||||
onFailure:function () {
|
||||
},
|
||||
headers:{"Content-Type":"application/json", "Accept":"application/json"},
|
||||
headers:{"Content-Type":"application/json; charset=utf-8", "Accept":"application/json"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
});
|
||||
@@ -163,6 +160,29 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
severity = "INFO";
|
||||
}
|
||||
return {severity:severity, message:message};
|
||||
},
|
||||
|
||||
loadMapDom:function (mapId) {
|
||||
// Let's try to open one from the local directory ...
|
||||
var xml;
|
||||
var xmlRequest = new Request({
|
||||
url:this.documentUrl.replace("{id}", mapId) + "/xml",
|
||||
method:'get',
|
||||
async:false,
|
||||
headers:{"Content-Type":"text/plain","Accept":"application/xml"},
|
||||
onSuccess: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");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@@ -270,6 +270,11 @@ mindplot.CommandContext = new Class({
|
||||
return mindmap.createNode(mindplot.NodeModel.MAIN_TOPIC_TYPE);
|
||||
},
|
||||
|
||||
addTopic:function (topic) {
|
||||
var mindmap = this._designer.getMindmap();
|
||||
return mindmap.addBranch(topic.getModel());
|
||||
},
|
||||
|
||||
connect:function (childTopic, parentTopic) {
|
||||
childTopic.connectTo(parentTopic, this._designer._workspace);
|
||||
},
|
||||
|
@@ -598,7 +598,7 @@ mindplot.Topic = new Class({
|
||||
|
||||
areChildrenShrunken:function () {
|
||||
var model = this.getModel();
|
||||
return model.areChildrenShrunken();
|
||||
return model.areChildrenShrunken() && !this.isCentralTopic();
|
||||
},
|
||||
|
||||
isCollapsed:function () {
|
||||
@@ -888,7 +888,12 @@ mindplot.Topic = new Class({
|
||||
|
||||
_setRelationshipLinesVisibility:function (value) {
|
||||
this._relationships.each(function (relationship) {
|
||||
relationship.setVisibility(value);
|
||||
var sourceTopic = relationship.getSourceTopic();
|
||||
var targetTopic = relationship.getTargetTopic();
|
||||
|
||||
var targetParent = targetTopic.getModel().getParent();
|
||||
var sourceParent = sourceTopic.getModel().getParent();
|
||||
relationship.setVisibility(value && (targetParent == null || !targetParent.areChildrenShrunken()) && (sourceParent == null || !sourceParent.areChildrenShrunken()));
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1203,7 +1208,7 @@ mindplot.Topic = new Class({
|
||||
var relationships = child.getRelationships();
|
||||
result = result.concat(relationships);
|
||||
|
||||
if(!child.areChildrenShrunken()){
|
||||
if (!child.areChildrenShrunken()) {
|
||||
var innerChilds = this._flatten2DElements(child);
|
||||
result = result.concat(innerChilds);
|
||||
}
|
||||
|
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* 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.collaboration.CollaborationManager = new Class({
|
||||
initialize:function() {
|
||||
this.collaborativeModelReady = false;
|
||||
this.collaborativeModelReady = null;
|
||||
},
|
||||
|
||||
setCollaborativeFramework : function(framework) {
|
||||
this._collaborativeFramework = framework;
|
||||
},
|
||||
|
||||
buildMindmap: function() {
|
||||
return this._collaborativeFramework.buildMindmap();
|
||||
},
|
||||
|
||||
getCollaborativeFramework:function() {
|
||||
return this._collaborativeFramework;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
mindplot.collaboration.CollaborationManager.getInstance = function() {
|
||||
if (!$defined(mindplot.collaboration.CollaborationManager.__collaborationManager)) {
|
||||
mindplot.collaboration.CollaborationManager.__collaborationManager = new mindplot.collaboration.CollaborationManager();
|
||||
}
|
||||
return mindplot.collaboration.CollaborationManager.__collaborationManager;
|
||||
};
|
||||
mindplot.collaboration.CollaborationManager.getInstance();
|
@@ -1,54 +0,0 @@
|
||||
mindplot.collaboration.framework.AbstractCollaborativeFramework = new Class({
|
||||
initialize: function(model) {
|
||||
$assert(model, "model can not be null");
|
||||
this._model = model;
|
||||
this._actionDispatcher = null;
|
||||
},
|
||||
|
||||
getModel : function() {
|
||||
return this._model;
|
||||
},
|
||||
|
||||
buildMindmap : function() {
|
||||
|
||||
var cmind = this.getModel();
|
||||
var mmind = new mindplot.model.Mindmap();
|
||||
cmind.copyTo(mmind);
|
||||
return mmind;
|
||||
},
|
||||
|
||||
_findTopic : function(nodes, id) {
|
||||
var result;
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var node = nodes[i];
|
||||
if (node.getId() == id) {
|
||||
result = node;
|
||||
} else {
|
||||
var children = node.getChildren();
|
||||
result = this._findTopic(children, id)
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
getTopic:function(id) {
|
||||
$assert($defined(id), "id can not be null");
|
||||
var branches = this.getModel().getBranches();
|
||||
var result = this._findTopic(branches, id);
|
||||
$assert(result, "Could not find topic:" + id);
|
||||
return result;
|
||||
},
|
||||
|
||||
getActionDispatcher:function() {
|
||||
if (this._actionDispatcher == null) {
|
||||
var context = mindplot.ActionDispatcher.getInstance()._commandContext;
|
||||
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(context);
|
||||
}
|
||||
return this._actionDispatcher;
|
||||
}
|
||||
|
||||
});
|
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* 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.collaboration.framework.AbstractCollaborativeModelFactory = new Class({
|
||||
createNewMindmap:function() {
|
||||
throw "Unsupported operation";
|
||||
},
|
||||
buildMindmap:function(model) {
|
||||
throw "Unsupported operation";
|
||||
}
|
||||
});
|
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* 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.collaboration.framework.brix.BrixCollaborativeModelFactory = new Class({
|
||||
Extends:mindplot.collaboration.framework.AbstractCollaborativeModelFactory,
|
||||
initialize:function(brixFramework) {
|
||||
$assert(brixFramework, 'brixFramework can not be null');
|
||||
this._brixFramework = brixFramework;
|
||||
},
|
||||
|
||||
createNewMindmap : function() {
|
||||
var mindmap = new mindplot.collaboration.framework.brix.model.Mindmap(this._brixFramework);
|
||||
var node = mindmap.createNode(mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE, 0);
|
||||
mindmap.setVersion('pela-brix');
|
||||
mindmap.addBranch(node);
|
||||
return mindmap;
|
||||
},
|
||||
|
||||
buildMindmap : function(model) {
|
||||
return new mindplot.collaboration.framework.brix.model.Mindmap(this._brixFramework, model);
|
||||
}
|
||||
});
|
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* 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.collaboration.framework.brix.BrixFramework = new Class({
|
||||
Extends: mindplot.collaboration.framework.AbstractCollaborativeFramework,
|
||||
initialize: function(model, app) {
|
||||
this._app = app;
|
||||
var factory = new mindplot.collaboration.framework.brix.BrixCollaborativeModelFactory(this);
|
||||
var root = this.getBrixModel().getRoot();
|
||||
var cmodel = null;
|
||||
var brixMap = root.get("mindmap");
|
||||
if (brixMap != null) {
|
||||
cmodel = factory.buildMindmap(brixMap);
|
||||
} else {
|
||||
cmodel = factory.createNewMindmap();
|
||||
root.put("mindmap", cmodel.getBrixModel());
|
||||
}
|
||||
this.parent(cmodel);
|
||||
console.log("cmodel:" + cmodel.inspect());
|
||||
},
|
||||
|
||||
getBrixModel:function() {
|
||||
return this._app.getModel();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
instanciated = false;
|
||||
mindplot.collaboration.framework.brix.BrixFramework.init = function(onload) {
|
||||
$assert(onload, "load function can not be null");
|
||||
|
||||
if (!instanciated) {
|
||||
var app = new goog.collab.CollaborativeApp();
|
||||
mindplot.collaboration.framework.brix.BrixFramework.buildMenu(app);
|
||||
app.start();
|
||||
|
||||
app.addListener('modelLoad', function(model) {
|
||||
var framework = new mindplot.collaboration.framework.brix.BrixFramework(model, app);
|
||||
mindplot.collaboration.CollaborationManager.getInstance().setCollaborativeFramework(framework);
|
||||
onload();
|
||||
}.bind(this));
|
||||
instanciated = true;
|
||||
}
|
||||
};
|
||||
|
||||
mindplot.collaboration.framework.brix.BrixFramework.buildMenu = function(app) {
|
||||
var menuBar = new goog.collab.ui.MenuBar();
|
||||
|
||||
// Configure toolbar menu ...
|
||||
var fileMenu = menuBar.addSubMenu("File");
|
||||
fileMenu.addItem("Save", function() {
|
||||
});
|
||||
fileMenu.addItem("Export", function() {
|
||||
});
|
||||
|
||||
var editMenu = menuBar.addSubMenu("Edit");
|
||||
editMenu.addItem("Undo", function() {
|
||||
});
|
||||
editMenu.addItem("Redo", function() {
|
||||
});
|
||||
|
||||
var formatMenu = menuBar.addSubMenu("Format");
|
||||
formatMenu.addItem("Bold", function() {
|
||||
});
|
||||
|
||||
var helpMenu = menuBar.addSubMenu("Help");
|
||||
helpMenu.addItem("Shortcuts", function() {
|
||||
});
|
||||
|
||||
app.setMenuBar(menuBar);
|
||||
};
|
||||
|
||||
|
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
* 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.collaboration.framework.brix.model.Mindmap = new Class({
|
||||
Extends:mindplot.model.IMindmap,
|
||||
initialize:function(brixFramework, brixModel) {
|
||||
$assert(brixFramework, 'brixFramework can not be null');
|
||||
|
||||
this._brixFramework = brixFramework;
|
||||
if (!$defined(brixModel)) {
|
||||
this._brixModel = this._createBrixModel();
|
||||
} else {
|
||||
this._brixModel = brixModel;
|
||||
}
|
||||
},
|
||||
|
||||
getVersion: function() {
|
||||
return this._brixModel.get('version');
|
||||
},
|
||||
|
||||
setVersion: function(value) {
|
||||
this._brixModel.put('version', value);
|
||||
},
|
||||
|
||||
getDescription: function() {
|
||||
return this._brixModel.get('description');
|
||||
},
|
||||
|
||||
setDescription: function(value) {
|
||||
this._brixModel.put('description', value);
|
||||
},
|
||||
|
||||
_createBrixModel:function() {
|
||||
var model = this._brixFramework.getBrixModel().create("Map");
|
||||
var branches = this._brixFramework.getBrixModel().create("List");
|
||||
model.put("branches", branches);
|
||||
return model;
|
||||
},
|
||||
|
||||
getBrixModel:function() {
|
||||
return this._brixModel;
|
||||
},
|
||||
|
||||
getBranches : function() {
|
||||
var result = [];
|
||||
var branches = this._brixModel.get("branches");
|
||||
for (var i = 0; i < branches.size(); i++) {
|
||||
var node = branches.get(i);
|
||||
if (node != null) {
|
||||
var nodeModel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, node, this);
|
||||
result.push(nodeModel);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
addBranch : function(nodeModel) {
|
||||
$assert(nodeModel, "nodeModel can not be null");
|
||||
var branches = this._brixModel.get("branches");
|
||||
|
||||
// @Todo: Hack ?
|
||||
var newModel = mindplot.collaboration.framework.brix.model.NodeModel.create(this._brixFramework, this, nodeModel.getType(), nodeModel.getId());
|
||||
nodeModel.copyTo(newModel);
|
||||
|
||||
branches.add(newModel);
|
||||
},
|
||||
|
||||
removeBranch : function(nodeModel) {
|
||||
$assert(nodeModel, "nodeModel can not be null");
|
||||
$assert(nodeModel.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE, "central topic can not be removed");
|
||||
|
||||
var branches = this._brixModel.get("branches");
|
||||
for (var i = 0; i < branches.size(); i++) {
|
||||
|
||||
// @Todo: remove should remove null elements ...
|
||||
var branch = branches.get(i);
|
||||
if (branch != null) {
|
||||
if (branch == nodeModel.getBrixModel()) {
|
||||
branches.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
createNode : function(type, id) {
|
||||
return mindplot.collaboration.framework.brix.model.NodeModel.create(this._brixFramework, this, type, id);
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
@@ -1,168 +0,0 @@
|
||||
/*
|
||||
* 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.collaboration.framework.brix.model.NodeModel = new Class({
|
||||
Extends: mindplot.model.INodeModel,
|
||||
initialize : function(brixFramework, brixModel, mindmap) {
|
||||
$assert(brixFramework, "brixFramework can not null");
|
||||
$assert(brixModel, "brixModel can not null");
|
||||
$assert(mindmap && mindmap.getBranches, "mindmap can not null");
|
||||
|
||||
this.parent(mindmap);
|
||||
this._brixModel = brixModel;
|
||||
this._brixFramework = brixFramework;
|
||||
this._addBrixListeners();
|
||||
},
|
||||
|
||||
_addBrixListeners : function() {
|
||||
|
||||
// Nodes creation should be cached ...
|
||||
if (!this._brixModel.__registered) {
|
||||
// Register listener for properties changes ....
|
||||
var actionDispatcher = this._brixFramework.getActionDispatcher();
|
||||
this._brixModel.addListener("valueChanged", function(event) {
|
||||
var key = event.getProperty();
|
||||
var value = event.getNewValue();
|
||||
|
||||
var funName = 'change' + key.capitalize() + 'ToTopic';
|
||||
if (!$defined(actionDispatcher[funName])) {
|
||||
throw "No implementation for:" + funName;
|
||||
}
|
||||
console.log("This action dispatcher:" + funName);
|
||||
|
||||
actionDispatcher[funName]([this.getId()], value);
|
||||
}.bind(this));
|
||||
|
||||
var children = this._brixModel.get("children");
|
||||
children.addListener("valuesAdded", function(event) {
|
||||
try {
|
||||
|
||||
var brixChildren = event.getValues();
|
||||
for (var i = 0; i < brixChildren.size(); i++) {
|
||||
var brixNodeModel = brixChildren.get(0);
|
||||
|
||||
var cmodel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, brixNodeModel, this.getMindmap());
|
||||
|
||||
// @Todo: This is not ok. Is using designer global variable.
|
||||
var model = new mindplot.model.NodeModel(cmodel.getType(), designer.getMindmap(), this.getId());
|
||||
cmodel.copyTo(model);
|
||||
|
||||
actionDispatcher.addTopics([model], [this.getId()]);
|
||||
}
|
||||
} catch(e) {
|
||||
console.trace();
|
||||
}
|
||||
|
||||
}.bind(this));
|
||||
|
||||
children.addListener("valuesRemoved", function(event) {
|
||||
try {
|
||||
var brixChildren = event.getValues();
|
||||
for (var i = 0; i < brixChildren.size(); i++) {
|
||||
var brixNodeModel = brixChildren.get(i);
|
||||
var cmodel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, brixNodeModel, this.getMindmap());
|
||||
actionDispatcher.deleteEntities([cmodel.getId()]);
|
||||
}
|
||||
} catch(e) {
|
||||
console.trace();
|
||||
}
|
||||
|
||||
}.bind(this));
|
||||
this._brixModel.__registered = true;
|
||||
}
|
||||
},
|
||||
|
||||
getChildren : function() {
|
||||
var result = [];
|
||||
var children = this._brixModel.get("children");
|
||||
for (var i = 0; i < children.size(); i++) {
|
||||
var node = children.get(i);
|
||||
var nodeModel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, node, this.getMindmap());
|
||||
nodeModel.setParent(this);
|
||||
result.push(nodeModel);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
|
||||
getBrixModel:function() {
|
||||
return this._brixModel;
|
||||
},
|
||||
|
||||
putProperty : function(key, value) {
|
||||
$defined(key, 'key can not be null');
|
||||
this._brixModel.put(key, value);
|
||||
},
|
||||
|
||||
getProperty : function(key) {
|
||||
$defined(key, 'key can not be null');
|
||||
return this._brixModel.get(key);
|
||||
},
|
||||
|
||||
getPropertiesKeys : function() {
|
||||
var keys = this._brixModel.getKeys();
|
||||
keys.erase('children');
|
||||
keys.erase('icons');
|
||||
keys.erase('links');
|
||||
keys.erase('notes');
|
||||
return keys;
|
||||
},
|
||||
|
||||
getParent : function() {
|
||||
return this._brixModel._parent;
|
||||
},
|
||||
|
||||
setParent : function(parent) {
|
||||
this._brixModel._parent = parent;
|
||||
},
|
||||
|
||||
appendChild : function(node) {
|
||||
$assert(node && node.isNodeModel(), 'Only NodeModel can be appended to Mindmap object');
|
||||
var children = this._brixModel.get("children");
|
||||
children.add(node.getBrixModel());
|
||||
this.setParent(this);
|
||||
},
|
||||
|
||||
removeChild : function(child) {
|
||||
$assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object.');
|
||||
var children = this._brixModel.get("children");
|
||||
for (var i = 0; i < children.size(); i++) {
|
||||
if (children.get(i) == child.getBrixModel()) {
|
||||
children.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.setParent(null);
|
||||
}
|
||||
});
|
||||
|
||||
mindplot.collaboration.framework.brix.model.NodeModel.create = function(brixFramework, mindmap, type, id) {
|
||||
$assert(brixFramework, 'brixFramework can not be null');
|
||||
$assert(mindmap, 'mindmap can not be null');
|
||||
$assert(type, 'type can not be null');
|
||||
$assert($defined(id), 'id can not be null');
|
||||
|
||||
var brixModel = brixFramework.getBrixModel().create("Map");
|
||||
brixModel.put("type", type);
|
||||
brixModel.put("id", id);
|
||||
|
||||
var children = brixFramework.getBrixModel().create("List");
|
||||
brixModel.put("children", children);
|
||||
|
||||
return new mindplot.collaboration.framework.brix.model.NodeModel(brixFramework, brixModel, mindmap);
|
||||
};
|
@@ -41,6 +41,8 @@ mindplot.commands.AddTopicCommand = new Class({
|
||||
var parentTopic = commandContext.findTopics(parentId)[0];
|
||||
commandContext.connect(topic, parentTopic);
|
||||
}
|
||||
}else {
|
||||
commandContext.addTopic(topic);
|
||||
}
|
||||
|
||||
// Select just created node ...
|
||||
@@ -55,12 +57,20 @@ mindplot.commands.AddTopicCommand = new Class({
|
||||
},
|
||||
|
||||
undoExecute:function (commandContext) {
|
||||
// Finally, delete the topic from the workspace ...
|
||||
// Delete disconnected the nodes. Create a copy of the topics ...
|
||||
var clonedModel = [];
|
||||
this._models.each(function (model) {
|
||||
clonedModel.push(model.clone());
|
||||
});
|
||||
|
||||
// Finally, remove the nodes ...
|
||||
this._models.each(function (model) {
|
||||
|
||||
var topicId = model.getId();
|
||||
var topic = commandContext.findTopics(topicId)[0];
|
||||
commandContext.deleteTopic(topic);
|
||||
}.bind(this));
|
||||
|
||||
this._models = clonedModel;
|
||||
}
|
||||
});
|
@@ -149,6 +149,20 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
return this._collectInDepthRelationships(topic);
|
||||
}, this);
|
||||
result.append(rels.flatten());
|
||||
|
||||
if (result.length > 0) {
|
||||
// Filter for unique ...
|
||||
result = result.sort(function (a, b) {
|
||||
return a.getModel().getId() - b.getModel().getId();
|
||||
});
|
||||
var ret = [result[0]];
|
||||
for (var i = 1; i < result.length; i++) { // start loop at 1 as element 0 can never be a duplicate
|
||||
if (result[i - 1] !== result[i]) {
|
||||
ret.push(result[i]);
|
||||
}
|
||||
}
|
||||
result = ret;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -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)
|
16
mindplot/src/main/javascript/libraries/less/less-1.6.2.min.js
vendored
Normal file
@@ -93,7 +93,7 @@ mindplot.model.RelationshipModel = new Class({
|
||||
this._startArrow = startArrow;
|
||||
},
|
||||
|
||||
clone:function (model) {
|
||||
clone:function () {
|
||||
var result = new mindplot.model.RelationshipModel(this._sourceTargetId, this._targetTopicId);
|
||||
result._id = this._id;
|
||||
result._lineType = this._lineType;
|
||||
|
@@ -167,7 +167,7 @@ mindplot.persistence.XMLSerializer_Beta = new Class({
|
||||
$assert(documentElement.nodeName != "parsererror", "Error while parsing: '" + documentElement.childNodes[0].nodeValue);
|
||||
|
||||
// Is a wisemap?.
|
||||
$assert(documentElement.tagName == mindplot.persistence.XMLSerializer_Beta.MAP_ROOT_NODE, "This seem not to be a map document. Root Tag: '" + documentElement.tagName);
|
||||
$assert(documentElement.tagName == mindplot.persistence.XMLSerializer_Beta.MAP_ROOT_NODE, "This seem not to be a map document. Root Tag: '" + documentElement.tagName + ",',HTML:" +dom.innerHTML + ",XML:"+ core.Utils.innerXML(dom));
|
||||
|
||||
// Start the loading process ...
|
||||
var version = documentElement.getAttribute("version");
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
|
||||
toXML:function (mindmap) {
|
||||
toXML: function (mindmap) {
|
||||
$assert(mindmap, "Can not save a null mindmap");
|
||||
|
||||
var document = core.Utils.createDocument();
|
||||
@@ -27,7 +27,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
var mapElem = document.createElement("map");
|
||||
var name = mindmap.getId();
|
||||
if ($defined(name)) {
|
||||
mapElem.setAttribute('name', name);
|
||||
mapElem.setAttribute('name', this.rmXmlInv(name));
|
||||
}
|
||||
var version = mindmap.getVersion();
|
||||
if ($defined(version)) {
|
||||
@@ -61,7 +61,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
return document;
|
||||
},
|
||||
|
||||
_topicToXML:function (document, topic) {
|
||||
_topicToXML: function (document, topic) {
|
||||
var parentTopic = document.createElement("topic");
|
||||
|
||||
// Set topic attributes...
|
||||
@@ -92,7 +92,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
|
||||
}
|
||||
|
||||
if (topic.areChildrenShrunken()) {
|
||||
if (topic.areChildrenShrunken() && topic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
parentTopic.setAttribute('shrink', 'true');
|
||||
}
|
||||
|
||||
@@ -149,10 +149,10 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
for (var key in attributes) {
|
||||
var value = attributes[key];
|
||||
if (key == 'text') {
|
||||
var cdata = document.createCDATASection(value);
|
||||
var cdata = document.createCDATASection(this.rmXmlInv(value));
|
||||
featureDom.appendChild(cdata);
|
||||
} else {
|
||||
featureDom.setAttribute(key, value);
|
||||
featureDom.setAttribute(key, this.rmXmlInv(value));
|
||||
}
|
||||
}
|
||||
parentTopic.appendChild(featureDom);
|
||||
@@ -169,18 +169,18 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
return parentTopic;
|
||||
},
|
||||
|
||||
_noteTextToXML:function (document, elem, text) {
|
||||
_noteTextToXML: function (document, elem, text) {
|
||||
if (text.indexOf('\n') == -1) {
|
||||
elem.setAttribute('text', text);
|
||||
elem.setAttribute('text', this.rmXmlInv(text));
|
||||
} else {
|
||||
var textDom = document.createElement("text");
|
||||
var cdata = document.createCDATASection(text);
|
||||
var cdata = document.createCDATASection(this.rmXmlInv(text));
|
||||
textDom.appendChild(cdata);
|
||||
elem.appendChild(textDom);
|
||||
}
|
||||
},
|
||||
|
||||
_relationshipToXML:function (document, relationship) {
|
||||
_relationshipToXML: function (document, relationship) {
|
||||
var result = document.createElement("relationship");
|
||||
result.setAttribute("srcTopicId", relationship.getFromNode());
|
||||
result.setAttribute("destTopicId", relationship.getToNode());
|
||||
@@ -203,7 +203,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
return result;
|
||||
},
|
||||
|
||||
loadFromDom:function (dom, mapId) {
|
||||
loadFromDom: function (dom, mapId) {
|
||||
$assert(dom, "dom can not be null");
|
||||
$assert(mapId, "mapId can not be null");
|
||||
|
||||
@@ -239,7 +239,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
return mindmap;
|
||||
},
|
||||
|
||||
_deserializeNode:function (domElem, mindmap) {
|
||||
_deserializeNode: function (domElem, mindmap) {
|
||||
var type = (domElem.getAttribute('central') != null) ? mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE : mindplot.model.INodeModel.MAIN_TOPIC_TYPE;
|
||||
|
||||
// Load attributes...
|
||||
@@ -319,7 +319,8 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
}
|
||||
|
||||
var isShrink = domElem.getAttribute('shrink');
|
||||
if ($defined(isShrink)) {
|
||||
// Hack: Some production maps has been stored with the central topic collapsed. This is a bug.
|
||||
if ($defined(isShrink) && type != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
topic.setChildrenShrunken(isShrink);
|
||||
}
|
||||
|
||||
@@ -372,7 +373,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
return topic;
|
||||
},
|
||||
|
||||
_deserializeTextAttr:function (domElem) {
|
||||
_deserializeTextAttr: function (domElem) {
|
||||
var value = domElem.getAttribute("text");
|
||||
if (!$defined(value)) {
|
||||
var children = domElem.childNodes;
|
||||
@@ -395,7 +396,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
return value;
|
||||
},
|
||||
|
||||
_deserializeNodeText:function (domElem) {
|
||||
_deserializeNodeText: function (domElem) {
|
||||
var children = domElem.childNodes;
|
||||
var value = null;
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
@@ -407,7 +408,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
return value;
|
||||
},
|
||||
|
||||
_deserializeRelationship:function (domElement, mindmap) {
|
||||
_deserializeRelationship: function (domElement, mindmap) {
|
||||
var srcId = domElement.getAttribute("srcTopicId");
|
||||
var destId = domElement.getAttribute("destTopicId");
|
||||
var lineType = domElement.getAttribute("lineType");
|
||||
@@ -436,6 +437,36 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
||||
model.setStartArrow('true');
|
||||
return model;
|
||||
}
|
||||
/*
|
||||
* This method ensures that the output String has only
|
||||
* valid XML unicode characters as specified by the
|
||||
* XML 1.0 standard. For reference, please see
|
||||
* <a href="http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char">the
|
||||
* standard</a>. This method will return an empty
|
||||
* String if the input is null or empty.
|
||||
*
|
||||
* @param in The String whose non-valid characters we want to remove.
|
||||
* @return The in String, stripped of non-valid characters.
|
||||
*/,
|
||||
rmXmlInv: function (str) {
|
||||
|
||||
if (str == null || str == undefined)
|
||||
return null;
|
||||
|
||||
var result = "";
|
||||
for (var i=0;i<str.length;i++){
|
||||
var c = str.charCodeAt(i);
|
||||
if ((c == 0x9) || (c == 0xA) || (c == 0xD)
|
||||
|| ((c >= 0x20) && (c <= 0xD7FF))
|
||||
|| ((c >= 0xE000) && (c <= 0xFFFD))
|
||||
|| ((c >= 0x10000) && (c <= 0x10FFFF))) {
|
||||
result = result + str.charAt(i);
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mindplot.persistence.XMLSerializer_Pela.MAP_ROOT_NODE = 'map';
|
@@ -46,15 +46,16 @@ mindplot.util.Shape =
|
||||
calculateRelationShipPointCoordinates:function (topic, controlPoint) {
|
||||
var size = topic.getSize();
|
||||
var position = topic.getPosition();
|
||||
var div = (position.x - controlPoint.x);
|
||||
div = (Math.abs(div) > 0.1 ? div : 0.1); // Prevent division by 0.
|
||||
var m;
|
||||
var yGap = position.y - controlPoint.y;
|
||||
var xGap = position.x - controlPoint.x;
|
||||
var disable = Math.abs(yGap) < 5 || Math.abs(xGap) < 5 || Math.abs(yGap - xGap) < 5;
|
||||
|
||||
var m = (position.y - controlPoint.y) / div;
|
||||
var y, x;
|
||||
var gap = 5;
|
||||
if (controlPoint.y > position.y + (size.height / 2)) {
|
||||
y = position.y + (size.height / 2) + gap;
|
||||
x = position.x - ((position.y - y) / m);
|
||||
x = !disable ? position.x - ((position.y - y) / (yGap / xGap)) : position.x;
|
||||
if (x > position.x + (size.width / 2)) {
|
||||
x = position.x + (size.width / 2);
|
||||
} else if (x < position.x - (size.width / 2)) {
|
||||
@@ -62,7 +63,7 @@ mindplot.util.Shape =
|
||||
}
|
||||
} else if (controlPoint.y < position.y - (size.height / 2)) {
|
||||
y = position.y - (size.height / 2) - gap;
|
||||
x = position.x - ((position.y - y) / m);
|
||||
x = !disable ? position.x - ((position.y - y) / (yGap / xGap)) : position.x;
|
||||
if (x > position.x + (size.width / 2)) {
|
||||
x = position.x + (size.width / 2);
|
||||
} else if (x < position.x - (size.width / 2)) {
|
||||
@@ -70,10 +71,10 @@ mindplot.util.Shape =
|
||||
}
|
||||
} else if (controlPoint.x < (position.x - size.width / 2)) {
|
||||
x = position.x - (size.width / 2) - gap;
|
||||
y = position.y - (m * (position.x - x));
|
||||
y = !disable ? position.y - ((yGap / xGap) * (position.x - x)) : position.y;
|
||||
} else {
|
||||
x = position.x + (size.width / 2) + gap;
|
||||
y = position.y - (m * (position.x - x));
|
||||
y = !disable ? position.y - ((yGap / xGap) * (position.x - x)) : position.y;
|
||||
}
|
||||
|
||||
return new core.Point(x, y);
|
||||
@@ -97,6 +98,31 @@ mindplot.util.Shape =
|
||||
var y2 = m * (x2 - tarPos.x) + tarPos.y;
|
||||
|
||||
return [new core.Point(-srcPos.x + x1, -srcPos.y + y1), new core.Point(-tarPos.x + x2, -tarPos.y + y2)];
|
||||
},
|
||||
|
||||
workoutIncomingConnectionPoint:function (targetNode, sourcePosition) {
|
||||
$assert(sourcePosition, 'sourcePoint can not be null');
|
||||
var pos = targetNode.getPosition();
|
||||
var size = targetNode.getSize();
|
||||
|
||||
var isAtRight = mindplot.util.Shape.isAtRight(sourcePosition, pos);
|
||||
var result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight);
|
||||
if (targetNode.getShapeType() == mindplot.model.TopicShape.LINE) {
|
||||
result.y = result.y + (targetNode.getSize().height / 2);
|
||||
}
|
||||
|
||||
// Move a little the position...
|
||||
var offset = mindplot.Topic.CONNECTOR_WIDTH / 2;
|
||||
if (!isAtRight) {
|
||||
result.x = result.x + offset;
|
||||
} else {
|
||||
result.x = result.x - offset;
|
||||
}
|
||||
|
||||
result.x = Math.ceil(result.x);
|
||||
result.y = Math.ceil(result.y);
|
||||
return result;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -66,7 +66,7 @@ mindplot.widget.FloatingTip = new Class({
|
||||
},
|
||||
|
||||
show:function (element) {
|
||||
var old = element.retrieve('floatingtip');
|
||||
var old = $(element).retrieve('floatingtip');
|
||||
if (old){
|
||||
if (old.getStyle('opacity') == 1) {
|
||||
clearTimeout(old.retrieve('timeout'));
|
||||
|
@@ -29,7 +29,7 @@ mindplot.widget.IconPanel = new Class({
|
||||
|
||||
buildPanel:function () {
|
||||
var content = new Element('div', {'class':'toolbarPanel', 'id':'IconsPanel'});
|
||||
content.setStyles({width:253, height:210, padding:5});
|
||||
content.setStyles({width:253, height:230, padding:5});
|
||||
content.addEvent("click", function (event) {
|
||||
event.stopPropagation()
|
||||
});
|
||||
|
@@ -99,7 +99,7 @@ mindplot.widget.LinkEditor = new Class({
|
||||
});
|
||||
openButton.inject(form);
|
||||
openButton.addEvent('click',function(){
|
||||
window.open(input.value,"_blank", "status=1,width=700,height=450,resize=1");
|
||||
window.open(input.value,"_blank", "status=1,width=700,height=450,resizable=1");
|
||||
});
|
||||
|
||||
|
||||
|
@@ -67,7 +67,7 @@ mindplot.widget.LinkIconTooltip = new Class({
|
||||
});
|
||||
|
||||
var img = new Element('img', {
|
||||
src:'http://open.thumbshots.org/image.pxf?url=' + linkIcon.getModel().getUrl(),
|
||||
src:'http://immediatenet.com/t/m?Size=1024x768&URL=' + linkIcon.getModel().getUrl(),
|
||||
img:linkIcon.getModel().getUrl(),
|
||||
alt:linkIcon.getModel().getUrl()
|
||||
}
|
||||
|
@@ -223,9 +223,10 @@ mindplot.widget.Menu = new Class({
|
||||
this._registerTooltip('export', $msg('EXPORT'));
|
||||
|
||||
this._addButton('print', false, false, function () {
|
||||
this.save(saveElem, designer, false);
|
||||
var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("c/maps/"));
|
||||
window.open(baseUrl + 'c/maps/' + mapId + '/print');
|
||||
});
|
||||
}.bind(this));
|
||||
|
||||
this._registerTooltip('print', $msg('PRINT'));
|
||||
|
||||
@@ -274,7 +275,7 @@ mindplot.widget.Menu = new Class({
|
||||
}
|
||||
|
||||
this._addButton('addTopic', true, false, function () {
|
||||
designer.createChildForSelectedNode();
|
||||
designer.createSiblingForSelectedNode();
|
||||
});
|
||||
this._registerTooltip('addTopic', $msg('ADD_TOPIC'), "Enter");
|
||||
|
||||
@@ -432,6 +433,20 @@ mindplot.widget.Menu = new Class({
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var videoElem = $("tutorialVideo");
|
||||
if (videoElem) {
|
||||
var width = 900;
|
||||
var height = 500;
|
||||
var left = (screen.width / 2) - (width / 2);
|
||||
var top = (screen.height / 2) - (height / 2);
|
||||
|
||||
videoElem.addEvent('click', function (event) {
|
||||
window.open("https://www.youtube.com/tv?vq=medium#/watch?v=rKxZwNKs9cE", "_blank", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
_registerEvents:function (designer) {
|
||||
|
60
mindplot/src/main/resources/messages_ca.properties
Normal file
@@ -0,0 +1,60 @@
|
||||
DISCARD_CHANGES=Descartar els canvis
|
||||
SAVE=Desar
|
||||
INSERT=Inserir
|
||||
ZOOM_IN=Apropar
|
||||
ZOOM_OUT=Allunyar
|
||||
|
||||
TOPIC_BORDER_COLOR=Color del bord
|
||||
TOPIC_SHAPE=Forma del Tòpic
|
||||
TOPIC_ADD=Afegir Tòpic
|
||||
TOPIC_DELETE=Esborrar Tòpic
|
||||
TOPIC_ICON=Afegir Icona
|
||||
TOPIC_LINK=Afegir Enllaç
|
||||
TOPIC_NOTE=Afegir Nota
|
||||
TOPIC_COLOR=Color del Tòpic
|
||||
TOPIC_RELATIONSHIP=Relació
|
||||
FONT_FAMILY=Tipus de font
|
||||
|
||||
FONT_SIZE=Mida del text
|
||||
FONT_BOLD=Negreta
|
||||
FONT_ITALIC=Itàlica
|
||||
FONT_COLOR=Color del Text
|
||||
|
||||
UNDO=Refer
|
||||
NOTE=Nota
|
||||
LOADING=Carregant ...
|
||||
PRINT=Imprimir
|
||||
PUBLISH=Publicar
|
||||
REDO=Desfer
|
||||
ADD_TOPIC=Afegir Tòpic
|
||||
COLLABORATE=Compartir
|
||||
EXPORT=Exportar
|
||||
HISTORY=Història
|
||||
SAVE_COMPLETE=Desat completat
|
||||
SAVING=Gravant ...
|
||||
ONE_TOPIC_MUST_BE_SELECTED=No ha estat possible crear un nou tòpic. Com a mínim ha de seleccionar un tòpic.
|
||||
ONLY_ONE_TOPIC_MUST_BE_SELECTED=No ha estar possible crear un nou tòpic. Només un tòpic ha d'estar seleccionat.
|
||||
SAVE_COULD_NOT_BE_COMPLETED=No s'ha pogut desar. Provi més tard.
|
||||
UNEXPECTED_ERROR_LOADING=Ho sentim, un error ha esdevingut inesperadament. Provi recarregant l'editor, si el problema continua contacti a support@wisemapping.com.
|
||||
ZOOM_ERROR=No es pot fer més zoom.
|
||||
ZOOM_IN_ERROR=El zoom és massa creixent.
|
||||
MAIN_TOPIC=Tòpic principal
|
||||
SUB_TOPIC=Tòpic secundari
|
||||
ISOLATED_TOPIC=Tòpic aïllat
|
||||
CENTRAL_TOPIC=Tòpic central
|
||||
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=Els tòpics fills no es poden col·lapsar. Només un tòpic ha d'estar seleccionat.
|
||||
SHORTCUTS=Accessos directes
|
||||
ENTITIES_COULD_NOT_BE_DELETED=El tòpic o la relució no poden ser esborrats. Com a mínim ha de seleccionar un.
|
||||
AT_LEAST_ONE_TOPIC_MUST_BE_SELECTED=Com a mínim ha de seleccionar un tòpic.
|
||||
CLIPBOARD_IS_EMPTY=Res a copiar.
|
||||
CENTRAL_TOPIC_CAN_NOT_BE_DELETED=El tòpic central no pot esborrar-se.
|
||||
RELATIONSHIP_COULD_NOT_BE_CREATED=La relució no s'ha pout drear. Primer has de seleccionar una relució pare.
|
||||
SELECTION_COPIED_TO_CLIPBOARD=Tòpics copiats
|
||||
|
||||
WRITE_YOUR_TEXT_HERE=Escriu aquí la teva nota ...
|
||||
REMOVE=Esborrar
|
||||
ACCEPT=Acceptar
|
||||
CANCEL=Cancel·lar
|
||||
LINK=Enllaç
|
||||
OPEN_LINK=Obrir Enllaç
|
||||
SESSION_EXPIRED=La seva sessió ha finalitzat. Si us plau, torni a connectar-se.
|
59
mindplot/src/main/resources/messages_de.properties
Normal file
@@ -0,0 +1,59 @@
|
||||
ZOOM_IN=Ansicht vergrößern
|
||||
ZOOM_OUT=Ansicht verkleinern
|
||||
TOPIC_SHAPE=Themen Gestaltung
|
||||
TOPIC_ADD=Thema hinzufügen
|
||||
TOPIC_DELETE=Thema löschen
|
||||
TOPIC_ICON=Symbol hinzufügen
|
||||
TOPIC_LINK=Verbindung hinzufügen
|
||||
TOPIC_RELATIONSHIP=Beziehung
|
||||
TOPIC_COLOR=Themenfarbe
|
||||
TOPIC_BORDER_COLOR=Thema Randfarbe
|
||||
TOPIC_NOTE=Notiz hinzufügen
|
||||
FONT_FAMILY=Schrifttyp
|
||||
FONT_SIZE=Schriftgröße
|
||||
FONT_BOLD=Fette Schrift
|
||||
FONT_ITALIC=Kursive Schrift
|
||||
UNDO=Rückgängig machen
|
||||
REDO=Wiederholen
|
||||
INSERT=Einfügen
|
||||
SAVE=Sichern
|
||||
NOTE=Notiz
|
||||
|
||||
ADD_TOPIC=Thema hinzufügen
|
||||
LOADING=Laden ...
|
||||
EXPORT=Exportieren
|
||||
PRINT=Drucken
|
||||
PUBLISH=Publizieren
|
||||
COLLABORATE=Mitbenutzen
|
||||
HISTORY=Historie
|
||||
DISCARD_CHANGES=Änderungen verwerfen
|
||||
FONT_COLOR=Textfarbe
|
||||
SAVING=Sichern ...
|
||||
SAVE_COMPLETE=Sichern abgeschlossen
|
||||
|
||||
ZOOM_IN_ERROR=Zoom zu hoch.
|
||||
ZOOM_ERROR=Es kann nicht weiter vergrößert bzw. verkelinert werden.
|
||||
ONLY_ONE_TOPIC_MUST_BE_SELECTED=Thema konnte nicht angelegt werden. Bitte wählen Sie nur ein Thema aus.
|
||||
ONE_TOPIC_MUST_BE_SELECTED=Thema konnte nicht angelegt werden. Es muss ein Thema ausgewählt werden.
|
||||
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=Kinderknoten können nicht eingefaltet werden. Es muss ein Thema ausgewäht werden.
|
||||
SAVE_COULD_NOT_BE_COMPLETED=Sichern wurde nicht abgeschlossen. Versuchen Sie es später nocheinmal.
|
||||
UNEXPECTED_ERROR_LOADING=E tut uns Leid, ein unerwarteter Fehler ist aufgetreten.\nVersuchen Sie, den Editor neu zu laden. Falls das Problem erneut auftritt, bitte kontaktieren Sie uns unter support@wisemapping.com.
|
||||
MAIN_TOPIC=Hauptthema
|
||||
SUB_TOPIC=Unterthema
|
||||
ISOLATED_TOPIC=Isoliertes Thema
|
||||
CENTRAL_TOPIC=Zentrales Thema
|
||||
SHORTCUTS=Tastaturkürzel
|
||||
|
||||
ENTITIES_COULD_NOT_BE_DELETED=Konnte das Thema oder die Beziehung nicht löschen. Es muss mindest ein Eintrag ausgewählt sein.
|
||||
AT_LEAST_ONE_TOPIC_MUST_BE_SELECTED=Es muss mindestens ein Thema ausgewählt sein.
|
||||
CLIPBOARD_IS_EMPTY=Es gibt nichts zu kopieren. Die Zwischenablage ist leer.
|
||||
CENTRAL_TOPIC_CAN_NOT_BE_DELETED=Das zentrale Thema kann nicht gelöscht werden.
|
||||
RELATIONSHIP_COULD_NOT_BE_CREATED=Die Beziehung konnte nicht angelegt werden. Es muss erst ein Vater-Thema ausgewählt werden, um die Beziehung herzustellen.
|
||||
SELECTION_COPIED_TO_CLIPBOARD=Themen in der Zwischenablage
|
||||
WRITE_YOUR_TEXT_HERE=Schreiben Sie ihre Notiz hier ...
|
||||
REMOVE=Entfernen
|
||||
ACCEPT=Akzeptieren
|
||||
CANCEL=Abbrechen
|
||||
LINK=Verbindung
|
||||
OPEN_LINK=Öffne URL
|
||||
|
18
pom.xml
@@ -4,14 +4,15 @@
|
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<properties>
|
||||
<com.wisemapping.version>3.0-SNAPSHOT</com.wisemapping.version>
|
||||
<com.wisemapping.version>3.0.4</com.wisemapping.version>
|
||||
<superpom.dir>${project.basedir}/wise-webapps</superpom.dir>
|
||||
</properties>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<name>WiseMapping Project</name>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.0.4</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<licenses>
|
||||
@@ -47,17 +48,17 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.12</version>
|
||||
<version>2.16</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<version>2.6</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.0</version>
|
||||
<version>3.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -101,12 +102,11 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<inherited>true</inherited>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
3
setup.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
export MAVEN_OPTS="-XX:MaxPermSize=128M"
|
@@ -9,7 +9,7 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.0.4</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -153,11 +153,21 @@ web2d.peer.svg.TextPeer = new Class({
|
||||
},
|
||||
|
||||
getWidth : function () {
|
||||
var computedWidth;
|
||||
// Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround
|
||||
try {
|
||||
var computedWidth = this._native.getBBox().width;
|
||||
|
||||
computedWidth = this._native.getBBox().width;
|
||||
// Chrome bug is producing this error, oly during page loading. Remove the hack if it works. The issue seems to be
|
||||
// caused when the element is hidden. I don't know why, but it works ...
|
||||
if(computedWidth==0){
|
||||
var bbox = this._native.getBBox();
|
||||
computedWidth = bbox.width;
|
||||
}
|
||||
|
||||
} catch(e) {
|
||||
computedWidth = 10;
|
||||
|
||||
}
|
||||
|
||||
var width = parseInt(computedWidth);
|
||||
|
@@ -89,7 +89,7 @@ function testElementFill()
|
||||
assertEquals(opacity, fill.opacity);
|
||||
}
|
||||
|
||||
// Set attributes
|
||||
// Set delegated
|
||||
elem.setAttribute('fillColor', color);
|
||||
elem.setAttribute('fillOpacity', opacity);
|
||||
|
||||
|
@@ -30,6 +30,7 @@ function createStorageManager(mindplot) {
|
||||
},
|
||||
|
||||
loadMapDom : function(mapId) {
|
||||
var xml;
|
||||
var xmlRequest = new Request({
|
||||
url: this.backendUrl + mapId,
|
||||
method: 'get',
|
||||
|
71
wise-editor/doc/Integration.md
Normal file
@@ -0,0 +1,71 @@
|
||||
JS Editor Integration
|
||||
---------------------
|
||||
|
||||
## Running the JS only version
|
||||
|
||||
Start by creating the .zip file:
|
||||
|
||||
`mvn assembly:assembly -Dmaven.test.skip=true`
|
||||
|
||||
To test the javascript frontend you then do:
|
||||
|
||||
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start'
|
||||
|
||||
Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/
|
||||
|
||||
### Attaching drag and drop events.
|
||||
|
||||
1) Support for dragging TextNodes:
|
||||
|
||||
The following code is an example of how to add attach to the div dragImageNode the support for node dragging.
|
||||
|
||||
$("dragTextNode").addEvent('mousedown', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
// Create a image node ...
|
||||
var mindmap = designer.getMindmap();
|
||||
var node = mindmap.createNode();
|
||||
node.setText("Node Text !!!!");
|
||||
node.setMetadata("{'media':'test'}");
|
||||
node.setShapeType(mindplot.model.TopicShape.RECTANGLE);
|
||||
|
||||
// Add link ...
|
||||
var link = node.createFeature(mindplot.TopicFeature.Link.id, {url:"http://www.wisemapping.com"});
|
||||
node.addFeature(link);
|
||||
|
||||
// Add Note ...
|
||||
var note = node.createFeature(mindplot.TopicFeature.Note.id, {text:"This is a note"});
|
||||
node.addFeature(note);
|
||||
|
||||
designer.addDraggedNode(event, node);
|
||||
});
|
||||
|
||||
In the example, a new node is created with text "Node Text !!!!" and a note and a link associated to it when the user drop the node. Something to pay attention is the node.setMetadata("{}"), this delegated will be persisted during the serialization. Here you can store all the data you need.
|
||||
|
||||
2) Support for dragging Images: Similar to the point 1,drag support is registered to the div dragImageNode.
|
||||
|
||||
$("dragImageNode").addEvent('mousedown', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
// Create a image node ...
|
||||
var mindmap = designer.getMindmap();
|
||||
var node = mindmap.createNode();
|
||||
node.setImageSize(80, 43);
|
||||
node.setMetadata("{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}");
|
||||
node.setImageUrl("images/logo-small.png");
|
||||
node.setShapeType(mindplot.model.TopicShape.IMAGE);
|
||||
|
||||
designer.addDraggedNode(event, node);
|
||||
});
|
||||
|
||||
The node.setShapeType(mindplot.model.TopicShape.IMAGE) defines a image node. This makes mandatory the set of setImageUrl and setImageSize properties in the node.
|
||||
|
||||
3) An event registration mechanism for Image nodes edit events: The next snipped show how to register a custom edition handler.
|
||||
|
||||
designer.addEvent("editnode", function(event) {
|
||||
var node = event.model;
|
||||
|
||||
alert("Node Id:" + node.getId());
|
||||
alert("Node Metadata:" + node.getMetadata());
|
||||
alert("Is Read Only:" + event.readOnly);
|
||||
} });
|
@@ -9,7 +9,7 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.0.4</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -31,8 +31,8 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.1.26</version>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.14.v20131031</version>
|
||||
<configuration>
|
||||
<connectors>
|
||||
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
|
||||
|
@@ -1,48 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" src="http://docs.google.com/brix/static/api/js/jsapi.nocache.js"></script>
|
||||
<script type="text/javascript">
|
||||
var collabOnLoad = function() {
|
||||
app = new goog.collab.CollaborativeApp();
|
||||
app.start();
|
||||
|
||||
app.addListener('modelLoad', function(model) {
|
||||
var root = app.getModel().getRoot();
|
||||
var myList = root.get("myList");
|
||||
if (!myList) {
|
||||
myList = app.getModel().create("List");
|
||||
root.put("myList", myList);
|
||||
}
|
||||
|
||||
myList.addListener('valuesAdded', function(event) {
|
||||
console.log("value added:" + myList.size());
|
||||
});
|
||||
|
||||
myList.addListener('valuesRemoved', function(event) {
|
||||
console.log("value removed:" + myList.size());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
removedAction = function() {
|
||||
var root = app.getModel().getRoot();
|
||||
var myList = root.get("myList");
|
||||
myList.remove(myList.size() - 1);
|
||||
};
|
||||
|
||||
addAction = function() {
|
||||
var root = app.getModel().getRoot();
|
||||
var myList = root.get("myList");
|
||||
myList.add("Some elem " + myList.size());
|
||||
console.log("Click on adding...");
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
Funca?
|
||||
|
||||
<input style="font-size:20px;width:50px;height:50px;" type="button" value="Add" id="a2" onclick="addAction(this)"/>
|
||||
<input style="font-size:20px;width:50px;height:50px;" type="button" value="Remove" id="a2"
|
||||
onclick="removedAction(this)"/>
|
||||
</body>
|
||||
</html>
|
@@ -1,6 +1,5 @@
|
||||
@import "compatibility.less";
|
||||
@import "css/libraries/moodialog/css/MooDialog.css";
|
||||
|
||||
@import "libraries/moodialog/css/MooDialog.css";
|
||||
/********************************************************************************/
|
||||
/* Header & Toolbar Styles */
|
||||
/********************************************************************************/
|
||||
@@ -13,7 +12,8 @@ body {
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
overflow:hidden;
|
||||
overflow: hidden;
|
||||
position: fixed
|
||||
}
|
||||
|
||||
div#mindplot {
|
||||
@@ -21,7 +21,7 @@ div#mindplot {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height:100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -36,8 +36,8 @@ div#small_error_icon {
|
||||
background-color: #dfcf3c;
|
||||
padding: 5px 15px;
|
||||
color: #666666;
|
||||
/*font-weight: bold;*/
|
||||
/*width: 100px;*/
|
||||
/*font-weight: bold;*/
|
||||
/*width: 100px;*/
|
||||
font-size: 13px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
@@ -49,8 +49,8 @@ div#small_error_icon {
|
||||
background-color: #dfcf3c;
|
||||
padding: 5px 15px;
|
||||
color: #666666;
|
||||
/*font-weight: bold;*/
|
||||
/*width: 100px;*/
|
||||
/*font-weight: bold;*/
|
||||
/*width: 100px;*/
|
||||
font-size: 13px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
@@ -150,18 +150,18 @@ div#small_error_icon {
|
||||
/* Modal dialogs definitions */
|
||||
|
||||
div.modalDialog {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
z-index: 11000;
|
||||
width: 500px;
|
||||
margin: -250px 0 0 -250px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #999;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
z-index: 11000;
|
||||
width: 500px;
|
||||
margin: -250px 0 0 -250px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #999;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
|
||||
/* IE6-7 */
|
||||
/* IE6-7 */
|
||||
-webkit-border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
@@ -178,31 +178,40 @@ div.modalDialog .content {
|
||||
padding: 5px 5px;
|
||||
}
|
||||
|
||||
div.modalDialog .title
|
||||
{
|
||||
div.modalDialog .title {
|
||||
font-weight: bold;
|
||||
text-shadow: 1px 1px 0 #fff;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 5px 15px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
/*--- End Modal Dialog Form ---*/
|
||||
|
||||
.publishModalDialog .content{
|
||||
height:420px;
|
||||
.publishModalDialog .content {
|
||||
height: 420px;
|
||||
}
|
||||
|
||||
.exportModalDialog .content{
|
||||
height:400px;
|
||||
.exportModalDialog .content {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.shareModalDialog .content {
|
||||
height:440px;
|
||||
height: 440px;
|
||||
}
|
||||
|
||||
div.shareModalDialog {
|
||||
width: 550px;
|
||||
}
|
||||
|
||||
#tutorialVideo{
|
||||
background: url(../images/help.png) no-repeat left center;
|
||||
padding-left: 19px;
|
||||
}
|
||||
|
||||
#keyboardShortcuts{
|
||||
background: url(../images/help.png) no-repeat left center;
|
||||
padding-left: 19px;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,6 +1,9 @@
|
||||
@import "editor.less";
|
||||
|
||||
/* Overwrite some styles */
|
||||
body{
|
||||
position: inherit;
|
||||
}
|
||||
|
||||
div#headerInfo {
|
||||
height: 0;
|
||||
|
BIN
wise-editor/src/main/webapp/icons/number_1.png
Executable file
After Width: | Height: | Size: 3.4 KiB |
BIN
wise-editor/src/main/webapp/icons/number_2.png
Executable file
After Width: | Height: | Size: 3.5 KiB |
BIN
wise-editor/src/main/webapp/icons/number_3.png
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
wise-editor/src/main/webapp/icons/number_4.png
Executable file
After Width: | Height: | Size: 3.5 KiB |
BIN
wise-editor/src/main/webapp/icons/number_5.png
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
wise-editor/src/main/webapp/icons/number_6.png
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
wise-editor/src/main/webapp/icons/number_7.png
Executable file
After Width: | Height: | Size: 3.4 KiB |
BIN
wise-editor/src/main/webapp/icons/number_8.png
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
wise-editor/src/main/webapp/icons/number_9.png
Executable file
After Width: | Height: | Size: 3.6 KiB |
BIN
wise-editor/src/main/webapp/icons/task_0.png
Executable file
After Width: | Height: | Size: 3.1 KiB |
BIN
wise-editor/src/main/webapp/icons/task_100.png
Executable file
After Width: | Height: | Size: 3.1 KiB |
BIN
wise-editor/src/main/webapp/icons/task_25.png
Executable file
After Width: | Height: | Size: 3.2 KiB |
BIN
wise-editor/src/main/webapp/icons/task_50.png
Executable file
After Width: | Height: | Size: 3.2 KiB |
BIN
wise-editor/src/main/webapp/icons/task_75.png
Executable file
After Width: | Height: | Size: 3.2 KiB |
BIN
wise-editor/src/main/webapp/images/logo-135x135.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
wise-editor/src/main/webapp/images/logo-head-only.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
@@ -87,7 +87,7 @@ function buildDesigner(options) {
|
||||
}
|
||||
|
||||
} else {
|
||||
persistence = new mindplot.LocalStorageManager();
|
||||
persistence = new mindplot.LocalStorageManager("samples/{id}.xml");
|
||||
}
|
||||
mindplot.PersistenceManager.init(persistence);
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
../../../../../mindplot/src/main/javascript/libraries/less/less-1.1.3.min.js
|
||||
../../../../../mindplot/src/main/javascript/libraries/less/less-1.6.2.min.js
|
1
wise-webapp/config
Symbolic link
@@ -0,0 +1 @@
|
||||
../config/
|
@@ -5,14 +5,22 @@ Introduction
|
||||
-------------
|
||||
|
||||
All WiseMapping services are exposed as REST services. Those services are the same used by the WiseMapping when you are using it.
|
||||
In the following section, all supported services are listed. The following variables should be replaced:
|
||||
In the following section, all supported services are listed.
|
||||
|
||||
REST Console
|
||||
-------------
|
||||
|
||||
You can learn how what are WiseMapping REST API's from using our interactive console. You can access it from here: http://localhost:8080/doc/rest/index.html.
|
||||
Important: Don't forget to configure your server host url in /WEB-INF/app.properties. By default it's configure to http://localhost:8080/wisemapping/</p>
|
||||
|
||||
CURL Usage Examples
|
||||
-------------
|
||||
|
||||
The following variables should be replaced:
|
||||
|
||||
- host.name: Host name where WiseMapping is deployed. Default Value: localhost
|
||||
- host.post: Post number where WiseMapping is deployed. Default Value: 8080
|
||||
- context.path: Context Path name where the application is deployed. Default Value: wisemapping
|
||||
|
||||
Supported Operations
|
||||
----------------------
|
||||
- context.path: Context Path name where the application is deployed. Default Value: wisemapping
|
||||
|
||||
Obtaining user information by email:
|
||||
* Template Path: /service/admin/users/email/{user.email}.json
|
||||
@@ -22,4 +30,13 @@ Deleting a based on the user id:
|
||||
* Template Path: /service/admin/users/{userId}
|
||||
* curl "http://{host.name}:{host.port}/{context.path}/service/admin/users/{userId}" --request delete --basic -u "admin@wisemapping.org:admin"
|
||||
|
||||
Changing Password:
|
||||
Template Path: /service/admin/users/{userId}/password
|
||||
* curl "http://{host.name}:{host.port}/{context.path}/service/admin/users/{userId}/password" --request put --basic -u "admin@wisemapping.org:admin" -H "Content-Type:text/plain" --data "<new_password>"
|
||||
|
||||
Creating a new user:
|
||||
* Template Path: /service/admin/users/
|
||||
* Method: Post
|
||||
* curl "http://{host.name}:{host.port}/{context.path}/service/admin/users" --request post --basic -u "admin@wisemapping.org:admin" -H "Content-Type:application/json" --data '{"email": "te2@mydomain.de", "lastname": "lastname", "firstname":"myfirstname","password":"password"}'
|
||||
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.0.4</version>
|
||||
</parent>
|
||||
|
||||
<repositories>
|
||||
@@ -28,7 +28,7 @@
|
||||
</repositories>
|
||||
|
||||
<properties>
|
||||
<org.springframework.version>3.1.0.RELEASE</org.springframework.version>
|
||||
<org.springframework.version>3.1.3.RELEASE</org.springframework.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -77,6 +77,18 @@
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-ldap</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-openid</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
@@ -107,16 +119,6 @@
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jsr173_api</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.xmlgraphics</groupId>
|
||||
<artifactId>fop</artifactId>
|
||||
@@ -176,12 +178,6 @@
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.transaction</groupId>
|
||||
<artifactId>jta</artifactId>
|
||||
<version>1.0.1B</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
@@ -224,21 +220,15 @@
|
||||
<version>1.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.4</version>
|
||||
<groupId>javax</groupId>
|
||||
<artifactId>javaee-api</artifactId>
|
||||
<version>6.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.mail</groupId>
|
||||
<artifactId>mail</artifactId>
|
||||
<version>1.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
@@ -276,7 +266,6 @@
|
||||
<artifactId>jackson-core-asl</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-mapper-asl</artifactId>
|
||||
@@ -307,86 +296,156 @@
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.7.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mangofactory</groupId>
|
||||
<artifactId>swagger-springmvc</artifactId>
|
||||
<version>0.6.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.wordnik</groupId>
|
||||
<artifactId>swagger-annotations_2.9.1</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>coverage</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.6.4.201312101107</version>
|
||||
<executions>
|
||||
<!--
|
||||
Prepares the property pointing to the JaCoCo runtime agent which
|
||||
is passed as VM argument when Maven the Surefire plugin is executed.
|
||||
-->
|
||||
<execution>
|
||||
<id>pre-unit-test</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<!--
|
||||
Ensures that the code coverage report for unit tests is created after
|
||||
unit tests have been run.
|
||||
-->
|
||||
<execution>
|
||||
<id>post-unit-test</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>hsqldb</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>sql-maven-plugin</artifactId>
|
||||
<version>1.5</version>
|
||||
|
||||
<configuration>
|
||||
<driver>org.hsqldb.jdbc.JDBCDriver</driver>
|
||||
<url>jdbc:hsqldb:file:${project.build.directory}/db/wisemapping</url>
|
||||
<username>sa</username>
|
||||
</configuration>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>2.2.8</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>drop-schemas</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<onError>continue</onError>
|
||||
<orderFile>descending</orderFile>
|
||||
<fileset>
|
||||
<basedir>${project.basedir}</basedir>
|
||||
<includes>
|
||||
<include>config/database/hsql/drop-schemas.sql</include>
|
||||
<include>config/database/hsql/create-schemas.sql</include>
|
||||
<include>config/database/hsql/apopulate-schemas.sql</include>
|
||||
</includes>
|
||||
</fileset>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>mysqldb</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>sql-maven-plugin</artifactId>
|
||||
<version>1.5</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>init-schema</id>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<phase>prepare-package</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<driver>com.mysql.jdbc.Driver</driver>
|
||||
<username>root</username>
|
||||
<password></password>
|
||||
<url>jdbc:mysql://127.0.0.1:3306/?useUnicode=true&characterEncoding=UTF-8</url>
|
||||
<autocommit>false</autocommit>
|
||||
<srcFiles>
|
||||
<srcFile>config/database/mysql/create-database.sql</srcFile>
|
||||
<srcFile>config/database/mysql/create-schemas.sql</srcFile>
|
||||
<srcFile>config/database/mysql/apopulate-schemas.sql</srcFile>
|
||||
</srcFiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>sql-maven-plugin</artifactId>
|
||||
<version>1.5</version>
|
||||
|
||||
<configuration>
|
||||
<driver>org.hsqldb.jdbc.JDBCDriver</driver>
|
||||
<url>jdbc:hsqldb:file:${project.build.directory}/db/wisemapping</url>
|
||||
<username>sa</username>
|
||||
</configuration>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>2.2.8</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>drop-schemas</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<onError>continue</onError>
|
||||
<orderFile>ascending</orderFile>
|
||||
<fileset>
|
||||
<basedir>${project.basedir}</basedir>
|
||||
<includes>
|
||||
<include>src/test/sql/hsql/drop-schemas.sql</include>
|
||||
</includes>
|
||||
</fileset>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>create-schema</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<orderFile>ascending</orderFile>
|
||||
<fileset>
|
||||
<basedir>${project.basedir}</basedir>
|
||||
<includes>
|
||||
<include>src/test/sql/hsql/create-schemas.sql</include>
|
||||
</includes>
|
||||
</fileset>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>create-data</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<orderFile>ascending</orderFile>
|
||||
<fileset>
|
||||
<basedir>${project.basedir}</basedir>
|
||||
<includes>
|
||||
<include>src/test/sql/hsql/test-data.sql</include>
|
||||
</includes>
|
||||
</fileset>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>native2ascii-maven-plugin</artifactId>
|
||||
@@ -404,8 +463,6 @@
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.1.1</version>
|
||||
@@ -469,16 +526,30 @@
|
||||
</webResources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.tomcat.maven</groupId>
|
||||
<artifactId>tomcat7-maven-plugin</artifactId>
|
||||
<version>2.0</version>
|
||||
<configuration>
|
||||
<path>/wisemapping</path>
|
||||
<warFile>${project.build.directory}/wisemapping.war</warFile>
|
||||
<mode>war</mode>
|
||||
<update>true</update>
|
||||
<systemProperties>
|
||||
<database.base.url>${project.build.directory}</database.base.url>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.4.v20120524</version>
|
||||
<version>8.1.14.v20131031</version>
|
||||
<configuration>
|
||||
<stopKey>foo</stopKey>
|
||||
<stopPort>9999</stopPort>
|
||||
@@ -501,7 +572,6 @@
|
||||
<value>${project.build.directory}</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<!--<scanIntervalSeconds>10</scanIntervalSeconds>-->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
@@ -524,7 +594,6 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
|
@@ -0,0 +1,26 @@
|
||||
package com.wisemapping.dao;
|
||||
|
||||
import com.wisemapping.model.Label;
|
||||
import com.wisemapping.model.User;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LabelManager {
|
||||
|
||||
void addLabel(@NotNull final Label label);
|
||||
|
||||
void saveLabel(@NotNull final Label label);
|
||||
|
||||
@NotNull
|
||||
List<Label> getAllLabels(@NotNull final User user);
|
||||
|
||||
@Nullable
|
||||
Label getLabelById(int id, @NotNull final User user);
|
||||
|
||||
@Nullable
|
||||
Label getLabelByTitle(@NotNull final String title, @NotNull final User user);
|
||||
|
||||
void removeLabel(@NotNull final Label label);
|
||||
}
|
@@ -0,0 +1,57 @@
|
||||
package com.wisemapping.dao;
|
||||
|
||||
import com.wisemapping.model.Label;
|
||||
import com.wisemapping.model.User;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LabelManagerImpl extends HibernateDaoSupport
|
||||
implements LabelManager {
|
||||
|
||||
@Override
|
||||
public void addLabel(@NotNull final Label label) {
|
||||
saveLabel(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveLabel(@NotNull final Label label) {
|
||||
getSession().save(label);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<Label> getAllLabels(@NotNull final User user) {
|
||||
return getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where creator_id=?", user.getId());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Label getLabelById(int id, @NotNull final User user) {
|
||||
List<Label> labels = getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where id=? and creator=?", new Object[]{id, user});
|
||||
return getFirst(labels);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Label getLabelByTitle(@NotNull String title, @NotNull final User user) {
|
||||
final List<Label> labels = getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where title=? and creator=?", new Object[]{title, user});
|
||||
return getFirst(labels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLabel(@NotNull Label label) {
|
||||
getHibernateTemplate().delete(label);
|
||||
}
|
||||
|
||||
@Nullable private Label getFirst(List<Label> labels) {
|
||||
Label result = null;
|
||||
if (labels != null && !labels.isEmpty()) {
|
||||
result = labels.get(0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@@ -22,6 +22,7 @@ import com.wisemapping.model.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public interface MindmapManager {
|
||||
@@ -38,7 +39,7 @@ public interface MindmapManager {
|
||||
|
||||
List<Mindmap> getAllMindmaps();
|
||||
|
||||
@NotNull
|
||||
@Nullable
|
||||
Mindmap getMindmapById(int mindmapId);
|
||||
|
||||
Mindmap getMindmapByTitle(final String name, final User user);
|
||||
@@ -66,4 +67,6 @@ public interface MindmapManager {
|
||||
public MindMapHistory getHistory(int historyId);
|
||||
|
||||
void updateCollaboration(@NotNull Collaboration collaboration);
|
||||
|
||||
void purgeHistory(int mapId) throws IOException;
|
||||
}
|
||||
|
@@ -19,7 +19,9 @@
|
||||
package com.wisemapping.dao;
|
||||
|
||||
import com.wisemapping.model.*;
|
||||
import com.wisemapping.util.ZipUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.criterion.SimpleExpression;
|
||||
@@ -27,6 +29,7 @@ import org.hibernate.criterion.Junction;
|
||||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.Criteria;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Calendar;
|
||||
|
||||
@@ -57,11 +60,10 @@ public class MindmapManagerImpl
|
||||
final Criteria hibernateCriteria = getSession().createCriteria(MindMapHistory.class);
|
||||
hibernateCriteria.add(Restrictions.eq("mindmapId", mindmapId));
|
||||
hibernateCriteria.addOrder(Order.desc("creationTime"));
|
||||
// Mientras no haya paginacion solo los 10 primeros
|
||||
|
||||
// This line throws errors in some environments, so getting all history and taking firsts 10 records
|
||||
// hibernateCriteria.setMaxResults(10);
|
||||
List list = hibernateCriteria.list();
|
||||
return list.subList(0, (10 < list.size() ? 10 : list.size()));
|
||||
hibernateCriteria.setMaxResults(30);
|
||||
return hibernateCriteria.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,6 +76,38 @@ public class MindmapManagerImpl
|
||||
getHibernateTemplate().save(collaboration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void purgeHistory(int mapId) throws IOException {
|
||||
final Criteria hibernateCriteria = getSession().createCriteria(MindMapHistory.class);
|
||||
hibernateCriteria.add(Restrictions.eq("mindmapId", mapId));
|
||||
hibernateCriteria.addOrder(Order.desc("creationTime"));
|
||||
|
||||
final List<MindMapHistory> historyList = hibernateCriteria.list();
|
||||
|
||||
final Mindmap mindmap = this.getMindmapById(mapId);
|
||||
if (mindmap != null) {
|
||||
final Calendar yearAgo = Calendar.getInstance();
|
||||
yearAgo.add(Calendar.MONTH, -12);
|
||||
|
||||
// If the map has not been modified in the last months, it means that I don't need to keep all the history ...
|
||||
int max = mindmap.getLastModificationTime().before(yearAgo) ? 10 : 25;
|
||||
|
||||
for (MindMapHistory history : historyList) {
|
||||
byte[] zippedXml = history.getZippedXml();
|
||||
if (new String(zippedXml).startsWith("<map")) {
|
||||
history.setZippedXml(ZipUtils.bytesToZip(zippedXml));
|
||||
getHibernateTemplate().update(history);
|
||||
}
|
||||
}
|
||||
|
||||
if (historyList.size() > max) {
|
||||
for (int i = max; i < historyList.size(); i++) {
|
||||
getHibernateTemplate().delete(historyList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Mindmap> search(MindMapCriteria criteria, int maxResult) {
|
||||
final Criteria hibernateCriteria = getSession().createCriteria(Mindmap.class);
|
||||
@@ -164,7 +198,7 @@ public class MindmapManagerImpl
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@Nullable
|
||||
public Mindmap getMindmapById(int id) {
|
||||
return getHibernateTemplate().get(Mindmap.class, id);
|
||||
}
|
||||
@@ -203,13 +237,20 @@ public class MindmapManagerImpl
|
||||
|
||||
@Override
|
||||
public void removeMindmap(@NotNull final Mindmap mindMap) {
|
||||
// Delete history first ...
|
||||
final Criteria hibernateCriteria = getSession().createCriteria(MindMapHistory.class);
|
||||
hibernateCriteria.add(Restrictions.eq("mindmapId", mindMap.getId()));
|
||||
List list = hibernateCriteria.list();
|
||||
getHibernateTemplate().deleteAll(list);
|
||||
|
||||
// Delete mindmap ....
|
||||
getHibernateTemplate().delete(mindMap);
|
||||
}
|
||||
|
||||
private void saveHistory(@NotNull final Mindmap mindMap) {
|
||||
final MindMapHistory history = new MindMapHistory();
|
||||
|
||||
history.setXml(mindMap.getXml());
|
||||
history.setZippedXml(mindMap.getZippedXml());
|
||||
history.setCreationTime(Calendar.getInstance());
|
||||
history.setEditor(mindMap.getLastEditor());
|
||||
history.setMindmapId(mindMap.getId());
|
||||
|
@@ -45,6 +45,6 @@ public interface UserManager {
|
||||
|
||||
public User createUser(User user, Collaborator col);
|
||||
|
||||
public void deleteUser(User user);
|
||||
public void removeUser(@NotNull User user);
|
||||
|
||||
}
|
||||
|
@@ -22,7 +22,9 @@ import com.wisemapping.model.Collaboration;
|
||||
import com.wisemapping.model.Collaborator;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.model.AccessAuditory;
|
||||
import org.hibernate.ObjectNotFoundException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
import org.springframework.security.authentication.encoding.PasswordEncoder;
|
||||
//import org.acegisecurity.providers.encoding.PasswordEncoder;
|
||||
@@ -69,8 +71,15 @@ public class UserManagerImpl
|
||||
return cola;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public User getUserBy(long id) {
|
||||
return getHibernateTemplate().get(User.class, id);
|
||||
User user = null;
|
||||
try{
|
||||
user = getHibernateTemplate().get(User.class, id);
|
||||
} catch (ObjectNotFoundException e){
|
||||
// Ignore ...
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -101,11 +110,8 @@ public class UserManagerImpl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUser(@NotNull User user) {
|
||||
final Collaborator collaborator = this.getCollaboratorBy(user.getEmail());
|
||||
getHibernateTemplate().delete(collaborator);
|
||||
public void removeUser(@NotNull final User user) {
|
||||
getHibernateTemplate().delete(user);
|
||||
getHibernateTemplate().flush();
|
||||
}
|
||||
|
||||
public void auditLogin(@NotNull AccessAuditory accessAuditory) {
|
||||
|
@@ -18,7 +18,11 @@ abstract public class ClientException extends WiseMappingException {
|
||||
String getMsgBundleKey();
|
||||
|
||||
public String getMessage(@NotNull final MessageSource messageSource, final @NotNull Locale locale) {
|
||||
return messageSource.getMessage(this.getMsgBundleKey(), this.getMsgBundleArgs(), locale);
|
||||
String message = messageSource.getMessage(this.getMsgBundleKey(), this.getMsgBundleArgs(), locale);
|
||||
if(message==null){
|
||||
message = this.getMessage();
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
protected Object[] getMsgBundleArgs(){
|
||||
@@ -28,4 +32,8 @@ abstract public class ClientException extends WiseMappingException {
|
||||
public Severity getSeverity() {
|
||||
return this.severity;
|
||||
}
|
||||
|
||||
public String getTechInfo() {
|
||||
return getMessage();
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class EditionSessionExpiredException
|
||||
extends ClientException
|
||||
{
|
||||
public static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED";
|
||||
private static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED";
|
||||
|
||||
public EditionSessionExpiredException(@NotNull String msg)
|
||||
{
|
||||
|