401 Commits

Author SHA1 Message Date
Paulo Gustavo Veiga
8a65c0cfb3 Revert "Implement REST Console support."
This reverts commit f4017e6362.

Conflicts:
	wise-webapp/pom.xml
2014-01-26 22:39:35 -03:00
Paulo Gustavo Veiga
a02e8435bf Enable Java 1.7 compilation. 2014-01-26 22:22:36 -03:00
Paulo Gustavo Veiga
054521e072 Bug WISE-205 fixed.
Fix IE 11 browser detection.
2014-01-26 22:15:01 -03:00
Paulo Gustavo Veiga
9e3806f73a Add Jira Issue Integration.
Conflicts:
	wise-webapp/pom.xml
2014-01-26 22:14:37 -03:00
Paulo Gustavo Veiga
5ca8c4718f Merge branch 'release/v3.0.2' of bitbucket.org:wisemapping/wisemapping-open-source into release/v3.0.2 2014-01-24 20:26:54 -03:00
Paulo Gustavo Veiga
f4017e6362 Implement REST Console support. 2014-01-24 09:11:24 -03:00
Paulo Gustavo Veiga
023e4b8f9f Bug WISE-122 fixed.
Display proper message for change password for account based on OpenId.
2014-01-16 01:21:59 -03:00
Paulo Gustavo Veiga
22c102917e Fix failing uning tests ... 2014-01-12 22:53:42 -03:00
Paulo Veiga
0001dff347 Merge branch 'release/v3.0.2' of bitbucket.org:wisemapping/wisemapping-open-source into release/v3.0.2 2014-01-12 05:55:42 +00:00
Paulo Veiga
a50a96492f Fix jetty download. 2014-01-12 05:54:43 +00:00
Paulo Gustavo Veiga
63c063933d Q!
Bug WISE-22 fixed. Resolve resize node issue.
2014-01-12 05:50:50 +00:00
Paulo Gustavo Veiga
80dfab3ef4 Bug WISE-22 fixed. Resolve resize node issue. 2014-01-12 02:17:42 -03:00
Paulo Gustavo Veiga
a2db34ae61 Revert "Bug WISE-16 fixed. Backed completed."
This reverts commit 9a77ff3bb8.
2014-01-10 00:21:21 -03:00
Paulo Gustavo Veiga
9a77ff3bb8 Bug WISE-16 fixed. Backed completed. 2014-01-10 00:19:56 -03:00
Paulo Gustavo Veiga
5e4c1e4357 Add compile information 2014-01-08 23:33:00 +00:00
Paulo Gustavo Veiga
c87424ae80 Add compilation details temporally. 2014-01-08 23:28:21 +00:00
Paulo Gustavo Veiga
fc6b573f86 README.md edited online with Bitbucket 2014-01-08 23:21:30 +00:00
Paulo Gustavo Veiga
175b2f8921 Home.textile edited online with Bitbucket 2014-01-08 23:18:24 +00:00
Paulo Gustavo Veiga
f8b25f949a Compiling-and-running.md edited online with Bitbucket 2014-01-08 23:16:06 +00:00
Paulo Gustavo Veiga
55ab430cfe Fix compile documentation ... 2014-01-08 23:12:53 +00:00
Ezequiel Bergamaschi
4d3d8daa37 fix wrong version of jetty-maven-plugin 2014-01-07 16:58:05 -03:00
Paulo Gustavo Veiga
efd285eb10 README.md edited online with Bitbucket 2014-01-07 01:52:14 +00:00
Paulo Gustavo Veiga
128052102d README.md edited online with Bitbucket 2014-01-07 01:49:07 +00:00
Paulo Veiga
8f2f9da3da Fix 2014-01-05 22:03:41 +00:00
Paulo Gustavo Veiga
84c96287f3 Hack Chrome text element issue. 2014-01-05 18:57:47 -03:00
Paulo Gustavo Veiga
f75124233b Update part of Maven Pluggins versions. 2014-01-05 18:10:42 -03:00
Paulo Gustavo Veiga
26bd9f8840 Resources moved to https. 2014-01-02 18:34:14 -03:00
Paulo Gustavo Veiga
da8f474c64 Add extra documentation for LDAP configuration 2013-09-25 11:00:54 -03:00
Paulo Gustavo Veiga
5e8c1960e7 Fix postgress schema. 2013-05-19 11:42:06 -03:00
Paulo Gustavo Veiga
35d76ea56f Fix message. 2013-04-20 00:43:19 -03:00
Paulo Gustavo Veiga
a230dd104c Fix unlock issues. 2013-04-07 12:27:45 -03:00
Paulo Gustavo Veiga
31fb342ef1 Fix missing message. 2013-04-05 20:49:17 -03:00
Paulo Gustavo Veiga
65283a0edc Improve text export. 2013-04-04 22:11:59 -03:00
Paulo Gustavo Veiga
9686431874 Fix node export format. 2013-04-04 21:46:54 -03:00
Paulo Gustavo Veiga
96cb014a6e Add firefox 20 support. 2013-04-04 20:39:11 -03:00
Paulo Gustavo Veiga
8915e7eddf Fix rename issues. 2013-03-31 15:33:00 -03:00
Paulo Gustavo Veiga
fd021de86d Mindmap loading is lazy. 2013-03-30 01:09:28 -03:00
Paulo Gustavo Veiga
f5b4cc9ea7 Add debung info for exceptions.... 2013-03-29 22:44:13 -03:00
Paulo Gustavo Veiga
8e66c97aa3 Handle deleted maps propertly. 2013-03-29 21:09:28 -03:00
Paulo Gustavo Veiga
bd80d95d22 Fix NPE on loading maps. 2013-03-29 20:32:52 -03:00
Paulo Gustavo Veiga
4d46864388 Add compress fix. 2013-03-29 15:44:49 -03:00
Paulo Gustavo Veiga
3696e126e3 Fix descriptor. 2013-03-29 15:09:55 -03:00
Paulo Gustavo Veiga
65ee33a09f Fix compile 2013-03-29 14:57:21 -03:00
Paulo Gustavo Veiga
dce29eda19 Fix history bug. 2013-03-29 14:51:21 -03:00
Paulo Gustavo Veiga
81d3d591fa Keep working on mindmanager support. 2013-03-29 14:29:58 -03:00
Paulo Gustavo Veiga
2a2dc7c57f Change mindjet extension. 2013-03-29 12:08:40 -03:00
Paulo Gustavo Veiga
2c355205d0 Complete mindjet integration. 2013-03-29 11:49:59 -03:00
Paulo Gustavo Veiga
ed508d646c Add mindjet support. 2013-03-29 11:28:26 -03:00
Paulo Gustavo Veiga
fcb99490d8 Fix image icon render. 2013-03-28 17:33:26 -03:00
Paulo Gustavo Veiga
fd00a5e0fc Minor text fix. 2013-03-28 17:20:01 -03:00
Paulo Gustavo Veiga
f9d1e869b0 Move to WiseMapping 3.1 2013-03-28 17:06:34 -03:00
Paulo Gustavo Veiga
06210ab95b Add text/plan, open office and xls transformation support. 2013-03-28 17:01:42 -03:00
Paulo Gustavo Veiga
3137f78cce Improve purge. 2013-03-28 12:28:53 -03:00
Paulo Gustavo Veiga
dcd59efc12 Add history purge. 2013-03-26 22:58:45 -03:00
Paulo Gustavo Veiga
2b8972a35a Add delete permission to admin. 2013-03-24 22:57:32 -03:00
Paulo Gustavo Veiga
f961ae578c Add purge to history... 2013-03-24 22:49:55 -03:00
Paulo Gustavo Veiga
0188e15a92 Add more catchs .. 2013-03-24 19:28:20 -03:00
Paulo Gustavo Veiga
c12b73c1ff Add catch ... 2013-03-24 19:24:24 -03:00
Paulo Gustavo Veiga
a60f001f2c Check for more period. 2013-03-24 19:15:37 -03:00
Paulo Gustavo Veiga
04d58533cf Catch all exceptions during purge. 2013-03-24 17:20:41 -03:00
Paulo Gustavo Veiga
ed6d89fb7e Admin can delete maps. 2013-03-24 16:58:18 -03:00
Paulo Gustavo Veiga
3b47ed2e52 Fix string case. 2013-03-24 16:48:14 -03:00
Paulo Gustavo Veiga
abfc06c7d5 Fix classcast. 2013-03-24 16:41:57 -03:00
Paulo Gustavo Veiga
712cc2c60b Fix classcast. 2013-03-24 16:33:58 -03:00
Paulo Gustavo Veiga
057d5bc01f Add admin as permissions for finding. 2013-03-24 16:30:38 -03:00
Paulo Gustavo Veiga
e36b0b8b52 Handle exceptions. 2013-03-24 16:20:56 -03:00
Paulo Gustavo Veiga
4dd7a82e32 Add debug info. 2013-03-24 16:10:30 -03:00
Paulo Gustavo Veiga
580d977aa9 Add purge flag. 2013-03-24 15:57:59 -03:00
Paulo Gustavo Veiga
45c67d6b57 Add purge flag. 2013-03-24 15:42:25 -03:00
Paulo Gustavo Veiga
0b6c8a5977 Add purge action. 2013-03-24 15:11:06 -03:00
Paulo Gustavo Veiga
811cc8a668 Add purge action. 2013-03-24 15:03:19 -03:00
Paulo Gustavo Veiga
f136240591 Minor fix on property. 2013-03-19 23:25:36 -03:00
Paulo Gustavo Veiga
e0a6d15ad0 Initialize OPSS values. 2013-03-19 23:18:19 -03:00
Paulo Gustavo Veiga
617abd9d90 Change exception ... 2013-03-19 22:41:43 -03:00
Paulo Gustavo Veiga
c2e74cb2d4 Fix HTML tests positioning. 2013-03-19 22:21:51 -03:00
Paulo Gustavo Veiga
db70db49a5 Add missing resource. 2013-03-19 21:44:51 -03:00
Paulo Gustavo Veiga
4cc6382043 Fix resources. 2013-03-19 21:39:17 -03:00
Paulo Gustavo Veiga
c8d3d99224 Do not send duplicated emails on bugs. 2013-03-19 21:18:15 -03:00
Paulo Gustavo Veiga
645402e691 Fix property name. 2013-03-18 23:27:05 -03:00
Paulo Gustavo Veiga
8ed1a18280 Minor fixes. 2013-03-18 23:25:49 -03:00
Paulo Gustavo Veiga
0d81db52f1 Add alter table scripts. 2013-03-17 23:40:39 -03:00
Paulo Gustavo Veiga
67398fe07e Add OpenId required colums. 2013-03-17 23:19:29 -03:00
Paulo Gustavo Veiga
9b21c77485 Finish OpenId implementation. 2013-03-17 23:17:55 -03:00
Paulo Gustavo Veiga
94356a5773 Outh working!. Pending:
- Test all databases
- Migration Scripts
- Manage error due to changing of authentication schemas.
- Link from the login page.
- What happend with the logout ?.
2013-03-17 18:51:33 -03:00
Paulo Gustavo Veiga
2f8df725c9 Login page completed. 2013-03-17 16:39:50 -03:00
Paulo Gustavo Veiga
b9e508424c Minor fix. 2013-03-17 13:32:41 -03:00
Paulo Gustavo Veiga
48e211cc2d Escape invalid XML chars during serialization. 2013-03-17 11:22:53 -03:00
Paulo Gustavo Veiga
3578d6e624 Temporal hack for broken maps in Firefox. \r issue. 2013-03-14 21:38:38 -03:00
Paulo Gustavo Veiga
8356906791 Another try to capture serialization issue. 2013-03-14 21:25:02 -03:00
Pablo Luna
9e7f289a9e removing Google Brix... no further comments 2013-03-14 23:57:38 +00:00
Pablo Luna
9e67329703 fixing build 2013-03-14 21:51:17 +00:00
Paulo Gustavo Veiga
8489eaea6d More tests fixed. 2013-03-10 21:25:21 -03:00
Paulo Gustavo Veiga
9fb0ebd8f6 Fix tests. 2013-03-10 21:20:19 -03:00
Paulo Gustavo Veiga
e03f5f632b Fix export unit tests. 2013-03-10 19:57:24 -03:00
Paulo Gustavo Veiga
b6ee7e61b8 Fix SVG export tests... 2013-03-10 19:45:21 -03:00
Paulo Gustavo Veiga
202c3f28a3 Fix open id. 2013-03-10 19:07:52 -03:00
Paulo Gustavo Veiga
a1a28efe49 Minor fix, use db database result. 2013-03-10 19:06:55 -03:00
Paulo Gustavo Veiga
0e5592a0d3 Move database configuration scripts. 2013-03-10 19:05:33 -03:00
Paulo Gustavo Veiga
52efdf729b Try to fix encoding issue on post. 2013-03-07 23:46:07 -03:00
Paulo Gustavo Veiga
ef3e8ae772 Add inheritance of properties con creation. 2013-03-03 02:04:00 -03:00
Paulo Gustavo Veiga
1c1fc2ca96 Fix copy and paste issue. 2013-03-03 00:51:14 -03:00
Paulo Gustavo Veiga
bf3bd5c1c7 Fix save on Opera. 2013-03-02 21:29:26 -03:00
Paulo Gustavo Veiga
9cabfb14a5 Add more debug info. 2013-03-02 18:13:59 -03:00
Paulo Gustavo Veiga
def2034fa0 More debug. 2013-03-02 18:12:32 -03:00
Paulo Gustavo Veiga
b5a7a11920 Check map before save. 2013-02-27 23:08:37 -03:00
Paulo Gustavo Veiga
6155a70c04 Fix Message: 'Uncaught TypeError: Object [object Object] has no method 'retrieve'', line:'4988', url: :http://app.wisemapping.com/js/mindplot-min.js 2013-02-24 18:37:13 -03:00
Paulo Gustavo Veiga
846ad24bf3 Minor fix to enable LDAP customization of first and last name. 2013-02-24 17:46:05 -03:00
Paulo Gustavo Veiga
9ab0637690 Fix scape name with spaces. 2013-02-24 17:34:25 -03:00
Paulo Gustavo Veiga
fe331a5170 Merge branch 'master' of repo.wisemapping.org:wisemapping/wiseorg 2013-02-23 23:14:00 -03:00
Paulo Gustavo Veiga
f4969e11b9 Add mode debug info. 2013-02-23 23:07:21 -03:00
Paulo Gustavo Veiga
312f5447b8 Fix NPE. 2013-02-23 15:39:10 -03:00
Paulo Gustavo Veiga
879fa4c926 Add postgres scripts. 2013-02-23 15:33:09 -03:00
Paulo Gustavo Veiga
5e0c879654 Minor fix on export. 2013-02-23 14:54:51 -03:00
Paulo Gustavo Veiga
9049ca25aa More export issues fixed. 2013-02-23 13:53:56 -03:00
Paulo Gustavo Veiga
76ccc5e6b2 Fix mindmap export. 2013-02-23 13:48:43 -03:00
Paulo Gustavo Veiga
8aa733158c Minor translation fix. 2013-02-23 12:58:34 -03:00
Paulo Gustavo Veiga
0eef3b3251 Add Catalan support for time ... 2013-02-23 12:53:06 -03:00
Paulo Gustavo Veiga
965ba4edaa Space " in customization dialogs. 2013-02-23 12:44:45 -03:00
Paulo Gustavo Veiga
7960c0a419 Finsh CA Integrationb. 2013-02-22 20:49:20 -03:00
Paulo Gustavo Veiga
99a3fa64ec Add Catalan support. 2013-02-22 20:39:51 -03:00
Paulo Gustavo Veiga
a7316d516c Add rest service doc. 2013-02-22 20:08:48 -03:00
Paulo Gustavo Veiga
efe562f057 Minor fix. 2013-02-20 14:20:11 -03:00
Paulo Gustavo Veiga
d2b7b640d9 Fix print issue loading cached maps. 2013-02-20 14:16:00 -03:00
Paulo Gustavo Veiga
79f5e51513 Finish LDAP support. 2013-02-20 13:15:31 -03:00
Paulo Gustavo Veiga
0f605d89f0 Enable security configuration from properties. 2013-02-17 23:10:04 -03:00
Paulo Gustavo Veiga
cb6828c08e Minor fixes
Update Spring 3.1.3 fixed.
2013-02-17 21:26:42 -03:00
Paulo Gustavo Veiga
3ff67910c9 Add LDAP support. 2013-02-17 21:00:08 -03:00
Paulo Gustavo Veiga
51f531f6b4 Fix revert on zip format. 2013-02-13 23:13:27 -03:00
Paulo Gustavo Veiga
fc22dd32a2 Compiles. 2013-02-13 23:08:55 -03:00
Paulo Gustavo Veiga
deca7e51b2 Fix npe. 2013-02-13 23:06:18 -03:00
Paulo Gustavo Veiga
28ffead0a0 Fix npe. 2013-02-13 22:51:55 -03:00
Paulo Gustavo Veiga
d1dfb48be5 Add new files. 2013-02-13 22:46:45 -03:00
Paulo Gustavo Veiga
9360a27f15 Show more rows on history. 2013-02-13 21:41:47 -03:00
Paulo Gustavo Veiga
cc8ff94b10 Fix encoding issue on import. 2013-02-11 13:25:07 -03:00
Paulo Gustavo Veiga
f245116e48 Fix deleted object would be re-saved by cascade (remove deleted object from associations): [com.wisemapping.model.Collaboration#114902]; nested exception is org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [com.wisemapping.model.Collaboration#114902] 2013-02-10 16:14:32 -03:00
Paulo Gustavo Veiga
7bd87c50ac - Disable cache ... 2013-02-10 15:24:37 -03:00
Paulo Gustavo Veiga
86d5c98ed7 - Fix security issues when the map is loaded from the rest service. Two URL has been defined for each type of access. 2013-02-07 21:56:36 -03:00
Paulo Gustavo Veiga
5d05f21803 - Fix security issues when the map is loaded from the rest service. Two URL has been defined for each type of access. 2013-02-07 21:44:20 -03:00
Paulo Gustavo Veiga
6e2880c8cc - Review security for print. This is required for enable public sharing of maps. The issue is when the map is not public in the editor. 2013-02-03 17:47:48 -03:00
Paulo Gustavo Veiga
87ce3fc0a9 - Print is not public
- Public maps now are shared using REST
2013-02-03 17:33:19 -03:00
Paulo Gustavo Veiga
92849b02eb Finish moving mindmap loading to rest. 2013-02-03 13:47:31 -03:00
Paulo Gustavo Veiga
829655f253 Add dummy parameter when the service is readOnly. 2013-02-03 13:19:24 -03:00
Paulo Gustavo Veiga
b4bdad796e Use the same PersitenceManager for public maps. 2013-02-03 12:54:46 -03:00
Paulo Gustavo Veiga
d52e2c04a6 Fix encoding on returning maps. 2013-02-03 12:51:12 -03:00
Paulo Gustavo Veiga
edc3351fd8 Fix httpBase servlet request property. 2013-02-03 12:38:04 -03:00
Paulo Gustavo Veiga
73a664ab97 Minor fix. 2013-01-31 22:57:49 -03:00
Paulo Gustavo Veiga
cabca992d1 Map are loaded using Rest service. 2013-01-31 22:50:21 -03:00
Paulo Gustavo Veiga
e734ea350c Add /f secuence scape. 2013-01-31 20:27:17 -03:00
Paulo Gustavo Veiga
ac7af5b8f1 Minor fix. 2013-01-31 20:10:50 -03:00
Paulo Gustavo Veiga
43e9f8fcad Fix firefox issue with \b caracters. 2013-01-31 20:01:15 -03:00
Paulo Gustavo Veiga
7a401b648e Copy and Paste of nodes was not working. Fixed. 2013-01-31 15:44:43 -03:00
Paulo Gustavo Veiga
82ff47220d Disable browser cache. 2013-01-31 14:49:04 -03:00
Paulo Gustavo Veiga
f3d88e91c4 Fix typo 2013-01-26 01:07:29 -03:00
Paulo Gustavo Veiga
37419cba66 Fix delete issue removing in hsql. History is now removed in advance. 2013-01-26 00:52:05 -03:00
Paulo Gustavo Veiga
8b0465bda6 Fix null object reference on editor. 2012-12-02 21:59:21 -03:00
Paulo Gustavo Veiga
765b1fc80e Exported images are now centered. 2012-12-02 16:37:09 -03:00
Paulo Gustavo Veiga
0d8b6b210e - Add metadata descriptor to template page
- Add png export tests.
2012-12-01 19:09:31 -03:00
Paulo Gustavo Veiga
d2c287684f Improve img quality export. 2012-12-01 17:58:01 -03:00
Paulo Gustavo Veiga
bad11bea88 Fix freemind import/export notes. 2012-12-01 17:22:54 -03:00
Paulo Gustavo Veiga
6c1188314b Control attributes order for freemind serialization. 2012-12-01 16:25:37 -03:00
Paulo Gustavo Veiga
f4f97d3112 Add disclamer for tutotial video reproduction. 2012-11-30 22:25:45 -03:00
Paulo Gustavo Veiga
a958fcbd6e Minor typo. 2012-11-30 22:11:30 -03:00
Paulo Gustavo Veiga
02b31e463b Add help icon to the toolbar. 2012-11-30 22:08:51 -03:00
Paulo Gustavo Veiga
6fe53446ce Add link to tutorial video. 2012-11-30 22:03:11 -03:00
Paulo Gustavo Veiga
5d62bf520a Fix collapsed nodes. 2012-11-28 22:14:52 -03:00
Paulo Gustavo Veiga
12448fc6cb Central node never can be collapsed. 2012-11-28 22:09:29 -03:00
Paulo Gustavo Veiga
ebd6f886d5 Try to fix issues with encoding. 2012-11-28 21:45:13 -03:00
Paulo Gustavo Veiga
66e4b0fb19 Update to Spring 3.1.2 2012-11-26 10:43:50 -03:00
Paulo Gustavo Veiga
f34ec25610 Add new icon. 2012-11-24 14:36:18 -03:00
Paulo Gustavo Veiga
46264991b9 Pogress SQL fix. 2012-11-24 14:16:49 -03:00
Paulo Gustavo Veiga
b9748ca23a Add some documentation for password reset. 2012-11-24 12:56:12 -03:00
Paulo Gustavo Veiga
fe99c9a238 Fix zoom issue. 2012-11-22 00:46:24 -03:00
Paulo Gustavo Veiga
9f495f1e76 Fix event error on firefox 1.6. 2012-11-22 00:30:49 -03:00
Paulo Gustavo Veiga
dd1698b5d9 Fix sharing. 2012-11-22 00:22:39 -03:00
Paulo Gustavo Veiga
c5bf91a9fe Disable debug info. 2012-11-22 00:12:12 -03:00
Paulo Gustavo Veiga
ac8309819c Fix Firefox issue with null values. 2012-11-22 00:05:46 -03:00
Paulo Gustavo Veiga
e1e9c9ebeb Minot fix. 2012-11-20 00:17:33 -03:00
Paulo Gustavo Veiga
4062b6771c Fix some issues. 2012-11-20 00:11:06 -03:00
Paulo Gustavo Veiga
0cdabba5eb Fix issue in embedded and public view toolbar. 2012-11-20 00:02:42 -03:00
Paulo Gustavo Veiga
064b8f1071 Change add nodes toolbar action. 2012-11-19 23:31:10 -03:00
Paulo Gustavo Veiga
c3dcd8f3a9 Fix i18n encodding issue. 2012-11-19 22:47:20 -03:00
Paulo Gustavo Veiga
b717a5f910 Remove add from editor. 2012-11-19 21:59:40 -03:00
Paulo Gustavo Veiga
1602421544 Another try. 2012-11-19 21:56:39 -03:00
Paulo Gustavo Veiga
fe44da9b43 Move add to right. 2012-11-19 21:49:56 -03:00
Paulo Gustavo Veiga
2a8ae4c397 Change add location. 2012-11-19 21:19:30 -03:00
Paulo Gustavo Veiga
7f7a67872e Reset all edition actions before delete. 2012-11-18 20:58:23 -03:00
Paulo Gustavo Veiga
322b0ba13e Fix wrong debug transformation. 2012-11-18 20:17:16 -03:00
Paulo Gustavo Veiga
0aa2d67698 Add a small add to test. 2012-11-18 19:29:10 -03:00
Paulo Gustavo Veiga
3c0055b767 Disable ads. 2012-11-18 18:54:56 -03:00
Paulo Gustavo Veiga
2549305621 Add more adds . 2012-11-18 13:38:17 -03:00
Paulo Gustavo Veiga
42564b2759 Fix stared issue. 2012-11-18 13:25:57 -03:00
Paulo Gustavo Veiga
032df5fdf4 Do not update map tiemstamp on map metadata modification. 2012-11-17 21:28:23 -03:00
Paulo Gustavo Veiga
dbbe8901b7 Move add to fixed. 2012-11-17 18:00:55 -03:00
Paulo Gustavo Veiga
91f27c4e10 Fix ads on editor. 2012-11-17 17:47:11 -03:00
Paulo Gustavo Veiga
91aeddee70 Avoid scrolling on drag. 2012-11-17 17:18:40 -03:00
Paulo Gustavo Veiga
fab3c96097 Minor fix for add. 2012-11-17 15:57:02 -03:00
Paulo Gustavo Veiga
b89b08b7b3 Add add to login page and editor page. 2012-11-17 15:43:06 -03:00
Paulo Gustavo Veiga
ed37b20dfc Add debug info. 2012-11-17 14:38:34 -03:00
Paulo Gustavo Veiga
f44e616a4b Minor fix. 2012-11-17 13:57:06 -03:00
Paulo Gustavo Veiga
e70f2726a3 Delete command topic. 2012-11-17 13:54:46 -03:00
Paulo Gustavo Veiga
964505abd4 Filter some useless error for debug. 2012-11-17 13:46:02 -03:00
Paulo Gustavo Veiga
ce932e57e0 Fix issue deleting multiple relationships. 2012-11-17 13:42:46 -03:00
Paulo Gustavo Veiga
2ec9e70245 Relationship source position during drag is not positioned in the center anymore. 2012-11-17 12:23:24 -03:00
Paulo Gustavo Veiga
fc6d91f59e Fix relationship central node positioning problem ... 2012-11-17 12:02:59 -03:00
Paulo Gustavo Veiga
f8a6607de9 Fix equals bug. 2012-11-17 09:59:53 -03:00
Paulo Gustavo Veiga
ca0b5bfcbe Undo of a deleted topic keep into account if the nodes are visible or not. 2012-11-17 00:24:17 -03:00
Paulo Gustavo Veiga
be545d7103 Add german message bundle. 2012-11-16 23:44:23 -03:00
Paulo Gustavo Veiga
3832844ee6 Fix german resource. 2012-11-16 23:36:46 -03:00
Paulo Gustavo Veiga
b3234675cc Fix lazy initialization bug. 2012-11-16 23:29:01 -03:00
Paulo Gustavo Veiga
146c6d8a17 Add more debug ... 2012-11-16 23:17:46 -03:00
Paulo Gustavo Veiga
37e11a5b05 Add more debug... 2012-11-16 23:11:45 -03:00
Paulo Gustavo Veiga
ea5f1afa40 Change file encoding to UTF-8. 2012-11-16 23:02:37 -03:00
Paulo Gustavo Veiga
2e0339492d Add german support. 2012-11-16 22:47:18 -03:00
Paulo Gustavo Veiga
f8d6cdebc4 Merge branch 'master' into db-purge 2012-11-16 22:39:19 -03:00
Paulo Gustavo Veiga
58ed80d763 Avoid additional checks ... 2012-11-16 22:37:29 -03:00
Ralf Mueller
61569bc571 Added german language message files. 2012-11-15 16:15:26 +01:00
Paulo Gustavo Veiga
7ba21f85bf Fix 'element could not be removed:[object Object] fixed. 2012-11-14 23:46:28 -03:00
Paulo Gustavo Veiga
2c5f7139d5 Add new priority icons. 2012-11-14 21:19:56 -03:00
Paulo Gustavo Veiga
0c433352c5 Minor fix. 2012-11-14 20:53:59 -03:00
Paulo Gustavo Veiga
07c8a1d8c7 Update session for the same user. 2012-11-14 20:44:59 -03:00
Paulo Gustavo Veiga
6560973237 Replace all User.equals for Collaborator.identityEquality 2012-11-14 20:35:09 -03:00
Paulo Gustavo Veiga
596aeeebc4 Keep fixing user issues. 2012-11-14 20:33:42 -03:00
Paulo Gustavo Veiga
16e59a0879 Fix collaboration equal issue. 2012-11-14 20:17:55 -03:00
Paulo Gustavo Veiga
2861a7b5f9 Fix user comparator. 2012-11-14 20:00:46 -03:00
Paulo Gustavo Veiga
b1172f16cc Fix more lock issues. 2012-11-13 21:01:04 -03:00
Paulo Gustavo Veiga
71762ff629 Add more debug. 2012-11-13 13:44:33 -03:00
Paulo Gustavo Veiga
00fd168489 Keep fixing session issues. 2012-11-13 13:34:35 -03:00
Paulo Gustavo Veiga
c1318e496c Capture meta+- keys. 2012-11-12 22:27:42 -03:00
Paulo Gustavo Veiga
8de31d9edc Avoid overlapping saves ... 2012-11-12 21:45:08 -03:00
Paulo Gustavo Veiga
90b584569b Fix children shrunken issue. 2012-11-11 21:06:20 -03:00
Paulo Gustavo Veiga
df98282620 Improve error reporting. 2012-11-11 20:23:21 -03:00
Paulo Gustavo Veiga
751692837c Improve error handling ... 2012-11-11 20:07:56 -03:00
Paulo Gustavo Veiga
3f2f23d3c1 Change event registration for unload. 2012-11-11 17:23:15 -03:00
Paulo Gustavo Veiga
4ac8a41a46 Fix logger url. 2012-11-11 02:18:25 -03:00
Paulo Gustavo Veiga
cba00adc41 Fix embedded url 2012-11-10 20:34:04 -03:00
Paulo Gustavo Veiga
0f66d6fb6d Push not read only. 2012-11-10 20:22:26 -03:00
Paulo Gustavo Veiga
b36df012f8 Merge branch 'db-purge' of repo.wisemapping.org:wisemapping/wiseorg into db-purge 2012-11-10 20:03:08 -03:00
Paulo Gustavo Veiga
e302171ac9 Merge branch 'master' into db-purge 2012-11-10 20:02:44 -03:00
Paulo Gustavo Veiga
abdb56c35d Merge branch 'master' into db-purge 2012-11-10 19:53:10 -03:00
Paulo Gustavo Veiga
a228ea6ed5 Split rest authentication into two. For web apps integration url is /c/restful/ 2012-11-10 19:53:04 -03:00
Paulo Gustavo Veiga
6c2d277f02 This is to avoid enter on edition mode in the node when alt+tab is pressed. 2012-11-07 21:07:28 -03:00
Paulo Gustavo Veiga
10f8b5748e Fix site.location resolution. Evironment seems not be be resolved . 2012-11-07 20:47:15 -03:00
Paulo Gustavo Veiga
6a9d1c684e Add dialog message support. 2012-11-07 20:14:07 -03:00
Paulo Gustavo Veiga
2f8cd121e3 add $notifyModal function. 2012-11-05 21:55:19 -03:00
Paulo Gustavo Veiga
fe8516bb94 Merge branch 'master' into db-purge
Conflicts:
	wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties
2012-11-05 20:40:54 -03:00
Paulo Gustavo Veiga
29e397ab3f Fix call to undefined value 2012-11-05 00:58:00 -03:00
Paulo Gustavo Veiga
c1d041e3f8 Remove logger info. 2012-11-05 00:55:51 -03:00
Paulo Gustavo Veiga
98729c2582 Configure loggers for proper login. 2012-11-05 00:51:06 -03:00
Paulo Gustavo Veiga
53768b5400 Workaround for change text event. 2012-11-05 00:11:14 -03:00
Paulo Gustavo Veiga
7feb29b151 Add additional log information 2012-11-04 23:33:30 -03:00
Paulo Gustavo Veiga
031bbe50e1 Add addional debug info. 2012-11-04 23:20:21 -03:00
Paulo Gustavo Veiga
17ea409542 Add start.sh script to the distribution. 2012-11-04 18:25:49 -03:00
Paulo Gustavo Veiga
37b4298579 Fix Apache Proxy configuration property. 2012-11-04 18:17:32 -03:00
Paulo Gustavo Veiga
5cb2289cbc Disable images support. 2012-11-04 15:56:26 -03:00
Paulo Gustavo Veiga
c86bd15382 Fix unit tests. 2012-11-04 01:51:23 -03:00
Paulo Gustavo Veiga
aed1c0afcb Fix wrong merge. 2012-11-04 01:40:40 -03:00
Paulo Gustavo Veiga
a74efa4647 Merge branch 'master' into db-purge
Conflicts:
	mindplot/src/main/javascript/MainTopic.js
	wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java
	wise-webapp/src/main/java/com/wisemapping/rest/BaseController.java
2012-11-04 01:38:52 -03:00
Paulo Gustavo Veiga
cf0f0a8c00 Do not print exception message. 2012-11-04 01:15:46 -03:00
Paulo Gustavo Veiga
52ce817e3a Fix integration tests execution. 2012-11-04 01:06:02 -03:00
Paulo Gustavo Veiga
45a190bbac Merge branch 'images'
Conflicts:
	mindplot/src/main/javascript/StandaloneActionDispatcher.js
2012-11-02 02:08:28 -03:00
Paulo Gustavo Veiga
d7c74e289e Try to detect delete node error on close. 2012-11-02 02:04:22 -03:00
Paulo Gustavo Veiga
27a82d9e41 Fix NPE with empty node text. 2012-11-02 00:47:55 -03:00
Paulo Gustavo Veiga
806bb96ce1 Fix error when the connections in the pool has been closed. 2012-11-02 00:38:13 -03:00
Paulo Gustavo Veiga
9067a6cff2 Fix error when the connections in the pool has been closed. 2012-11-01 23:29:18 -03:00
Paulo Gustavo Veiga
ef88ee06de Merge branch 'db-purge' of repo.wisemapping.org:wisemapping/wiseorg into db-purge
Conflicts:
	wise-webapp/src/test/resources/data/freemind/richtextnode.mmr
2012-11-01 21:43:27 -03:00
Paulo Gustavo Veiga
b4005c8159 Add new doc. 2012-11-01 21:36:41 -03:00
Paulo Gustavo Veiga
2d58e9a0f5 Temporal commit. 2012-11-01 21:35:01 -03:00
Paulo Gustavo Veiga
af8d833356 Update copyright year. 2012-11-01 21:35:01 -03:00
Paulo Gustavo Veiga
6303ba93c7 Edition lock is working. Working on user interation. 2012-11-01 21:35:00 -03:00
Paulo Gustavo Veiga
04d43e62c7 - Change MYSQL blob to mediumblob. 2012-11-01 21:35:00 -03:00
Paulo Gustavo Veiga
a179875fee - Finish exclusive locking support. 2012-11-01 21:35:00 -03:00
Paulo Gustavo Veiga
e5e2e86fce Fix parser error on export. 2012-11-01 00:14:21 -03:00
Paulo Gustavo Veiga
dafe8eeb03 Fix i18n during import. 2012-10-31 23:14:13 -03:00
Paulo Gustavo Veiga
a492521a10 Remove xml prolog from generation. 2012-10-07 15:04:48 -03:00
Paulo Gustavo Veiga
ddaa89acee - Fix export NPE. 2012-10-06 22:07:44 -03:00
Paulo Gustavo Veiga
a155477eff Fix import NPE. 2012-10-05 20:42:32 -03:00
Paulo Gustavo Veiga
24b4f4b190 Temporal commit. 2012-10-05 20:05:33 -03:00
Paulo Gustavo Veiga
cc57fae5cf Update copyright year. 2012-10-05 08:35:31 -03:00
Paulo Gustavo Veiga
d17b8397f7 Edition lock is working. Working on user interation. 2012-10-04 20:28:59 -03:00
Paulo Gustavo Veiga
ad9d00843f Add Opera 12 support to the list. 2012-10-03 00:27:19 -03:00
Paulo Gustavo Veiga
742fa9d03e - Add Opera 11 support. 2012-10-03 00:26:11 -03:00
Paulo Gustavo Veiga
7fa766c2d0 Add debug information. REMOVE COMMIT 2012-10-01 23:26:28 -03:00
Paulo Gustavo Veiga
3fdbcb31d3 - Change MYSQL blob to mediumblob. 2012-10-01 23:14:25 -03:00
Paulo Gustavo Veiga
3672d2a8e2 - Finish exclusive locking support. 2012-10-01 00:22:17 -03:00
Paulo Gustavo Veiga
4f1bb45fc2 Minor improvement to change freemind change if the background color was defined. 2012-09-29 17:38:51 -03:00
Paulo Gustavo Veiga
c37b632ac9 Fix FeeMind size conversion. Now it's mapped to the proper wise size. 2012-09-29 16:53:43 -03:00
Paulo Gustavo Veiga
c7f7b20260 Fix wrong exception mapping. 2012-09-29 15:42:41 -03:00
Paulo Gustavo Veiga
9985384a7f Improve freemind imported to support html text nodes. 2012-09-29 15:27:16 -03:00
Paulo Gustavo Veiga
295fbba387 - Add freemind import exception data on failure. 2012-09-29 12:39:20 -03:00
Paulo Gustavo Veiga
dfe07e2da0 - Features are not created inside topic. This helps on revert action. 2012-09-28 23:14:37 -03:00
Paulo Gustavo Veiga
dbf8b0e28c - Add restriction to the input name for the map
- Translate some pending resources.
2012-09-28 20:35:31 -03:00
Paulo Gustavo Veiga
1811749964 - Fix error when the node is being deleted and the text is being edited. 2012-09-28 00:49:45 -03:00
Paulo Gustavo Veiga
e72ae37ac7 - Remove fade event on node creation.
- Node are always hidden on creation.
2012-09-28 00:07:34 -03:00
Paulo Gustavo Veiga
6b76c53663 - Try to fix feature remove issues. 2012-09-27 23:44:52 -03:00
Paulo Gustavo Veiga
3bd2242080 - Try to fix feature remove issues. 2012-09-27 23:41:17 -03:00
Paulo Gustavo Veiga
e5ab234d01 - Fix feature issue on redo. 2012-09-27 23:28:24 -03:00
Paulo Gustavo Veiga
22d9f7a199 - Do not propagate some keyboard events. 2012-09-27 20:53:32 -03:00
Paulo Gustavo Veiga
1e5e11a309 - Fix wrong state issue when the topic is restored. 2012-09-27 20:18:12 -03:00
Paulo Gustavo Veiga
f6e5018272 - Remove visibility flag on createTopic. 2012-09-27 09:17:34 -03:00
Paulo Gustavo Veiga
4a0d70e3b3 - Minor fixes 2012-09-27 08:12:03 -03:00
Paulo Gustavo Veiga
3d1dc9bfc6 - Fix Cannot call method 'getTextShape' of null' 2012-09-26 20:00:38 -03:00
Paulo Gustavo Veiga
14e9bf0e06 - TypeError: $("#userSettingsBtn") is null, line:4 2012-09-26 19:42:24 -03:00
Paulo Gustavo Veiga
f8fb56e49f - Add tab as option to creating a child node. 2012-09-26 19:31:41 -03:00
Paulo Gustavo Veiga
65f4238c3e Disable scrolling with arrows in Firefox. 2012-09-26 19:24:31 -03:00
Paulo Gustavo Veiga
66fcc68677 Fix npe removing relationships. 2012-09-25 08:58:37 -03:00
Paulo Gustavo Veiga
63d4de6da1 - Add open button to the link editor. 2012-09-24 21:36:20 -03:00
Paulo Gustavo Veiga
8320ae0abf - Fix orphan relationships. 2012-09-24 20:40:01 -03:00
Paulo Gustavo Veiga
be4d7d1c91 Fix toolbar issue. Now alawys is on the top. 2012-09-24 19:39:42 -03:00
Paulo Gustavo Veiga
f6b1499322 - Ups. Complete footer rename. 2012-09-24 19:34:57 -03:00
Paulo Gustavo Veiga
25ac0bbadd - Add additional debug info. RootTree seems to be out of sync. 2012-09-24 16:43:31 -03:00
Paulo Gustavo Veiga
b847782079 - Add additional debug info. RootTree seems to be out of sync. 2012-09-24 15:55:45 -03:00
Paulo Gustavo Veiga
cfaa8f786d - Fix setting position on beta maps. 2012-09-24 15:20:43 -03:00
Paulo Gustavo Veiga
0dafb4b31b - Fix undo of multiple nodes. 2012-09-24 14:54:19 -03:00
Paulo Gustavo Veiga
acd149bfc9 - Add more info to detect errors. 2012-09-24 13:15:24 -03:00
Paulo Gustavo Veiga
155ec74dea - Add more info to detect errors. 2012-09-24 13:11:11 -03:00
Paulo Gustavo Veiga
56ac4aaed3 Add button refers to http://www.wisemapping.com 2012-09-23 11:40:45 -03:00
Paulo Gustavo Veiga
7db5bb3591 - Add more error details on parsing error. 2012-09-23 10:59:05 -03:00
Paulo Gustavo Veiga
9c632faf77 - Improve error login message. 2012-09-23 10:39:56 -03:00
Paulo Gustavo Veiga
85d41300bf - Do not log "Script Error." 2012-09-23 10:30:42 -03:00
Paulo Gustavo Veiga
a42c54678a Minor analytics refector. 2012-09-23 10:26:26 -03:00
Paulo Gustavo Veiga
88f5f1a5bd - Try to catch more exception details. 2012-09-22 21:34:43 -03:00
Paulo Gustavo Veiga
f5d3b51f6e Fix typo. 2012-09-22 21:12:20 -03:00
Paulo Gustavo Veiga
ff63b4f89c - Update IE parser to Msxml2.DOMDocument.6.0 2012-09-22 21:08:06 -03:00
Paulo Gustavo Veiga
d2f9749d61 - Refactor node properties to topics. 2012-09-21 09:34:33 -03:00
Paulo Gustavo Veiga
7bbcd82488 - Remove CENTRAL_NODE flag. 2012-09-20 19:00:31 -03:00
Paulo Gustavo Veiga
a0ee153ca0 - Remove getTopicType flag. 2012-09-20 09:23:48 -03:00
Paulo Gustavo Veiga
8a8922f2a6 - Minot fix on password recovery. 2012-09-19 23:33:52 -03:00
Paulo Gustavo Veiga
7c4f500361 - Fix error on IE9 on sharing ... 2012-09-19 23:12:47 -03:00
Paulo Gustavo Veiga
9cbb6eadc2 - I18 link and note dialog. 2012-09-19 21:28:31 -03:00
Paulo Gustavo Veiga
310a6b9e03 - I18 link and note dialog. 2012-09-19 20:21:20 -03:00
Paulo Gustavo Veiga
cd776073dc - Throw Error objects instead of Strings. 2012-09-19 20:01:22 -03:00
Paulo Gustavo Veiga
6555203a94 - Fix java.lang.NullPointerException
at com.wisemapping.util.Browser.isInUserAgentString(Browser.java:267)
      	at com.wisemapping.util.Browser.checkUserAgent(Browser.java:2 issue.
2012-09-19 19:24:30 -03:00
Paulo Gustavo Veiga
f8cb849597 Add more logs. 2012-09-19 09:02:21 -03:00
Paulo Gustavo Veiga
5e93c0a98c - Fix I18n resource
- Fix "$(this._divContainer).addEvent is not a function" error.
2012-09-19 08:52:05 -03:00
Paulo Gustavo Veiga
4ec8e75bdb i18n forgot password. 2012-09-18 21:17:57 -03:00
Paulo Gustavo Veiga
a19003077c Fix NPE when browser version can not be detected. 2012-09-18 21:02:44 -03:00
Paulo Gustavo Veiga
8a9c219b9d Minor fix. 2012-09-18 20:56:51 -03:00
Paulo Gustavo Veiga
662fc82919 Wheel enabled on read only maps
Fix NPE on mobile firefox on UserAgent
MindmapList display list fix on read only maps.
2012-09-18 20:46:04 -03:00
Paulo Gustavo Veiga
029bfa809a Fix NPE on Firefox mobile. 2012-09-18 10:47:14 -03:00
Paulo Gustavo Veiga
7246260220 - Fix the problem tha public links where not properly displayed. 2012-09-17 22:20:22 -03:00
Paulo Gustavo Veiga
000b6a693d - Fix save errors when the resturned value is a HTML and not a JSON object. 2012-09-17 21:28:27 -03:00
Paulo Gustavo Veiga
e1d4f0afc8 - Fix login button bug when the form produces an error. 2012-09-17 00:35:39 -03:00
Paulo Gustavo Veiga
849cb4a9ce - Fix wrong redirection path. 2012-09-17 00:25:06 -03:00
Paulo Gustavo Veiga
de64764306 - Fix wrong redirection path. 2012-09-16 23:53:57 -03:00
Paulo Gustavo Veiga
c44d88eb09 - Add some automatic tests to detect user agent. 2012-09-16 21:45:58 -03:00
Paulo Gustavo Veiga
66e214ca88 Another minor stupid fix. 2012-09-16 21:25:59 -03:00
Paulo Gustavo Veiga
bb26d73462 Add IE8 to the list. 2012-09-16 21:22:22 -03:00
Paulo Gustavo Veiga
6badd972b0 - Catch save exception is the object is not JSON 2012-09-16 21:08:35 -03:00
Paulo Gustavo Veiga
7b1574150a - Add Safari 6 to the supported matrix. 2012-09-16 20:47:13 -03:00
Paulo Gustavo Veiga
46f3ec96c5 - Add images support 2012-09-16 20:33:51 -03:00
Paulo Gustavo Veiga
69ed3d8126 Fix br time language issue. 2012-09-16 20:23:25 -03:00
Paulo Gustavo Veiga
1400130ebf Fix @NotNull import. 2012-09-16 20:05:12 -03:00
Paulo Gustavo Veiga
a0ea9a6980 - Add support for serialized sessions... 2012-09-16 20:02:08 -03:00
Paulo Gustavo Veiga
36a35b44d7 - Replace Browser user agent detection 2012-09-16 18:36:23 -03:00
Paulo Gustavo Veiga
f90dd4f22a - Footer lt staayout 2012-09-16 16:05:10 -03:00
Paulo Gustavo Veiga
f1c9c95ed5 - Fix layout 2012-09-15 12:59:56 -03:00
Paulo Gustavo Veiga
15e03c690f - Filter collaborators from export. 2012-09-15 11:35:53 -03:00
Paulo Gustavo Veiga
e0a67fe1d7 - Fix User.parameter Conflict on JSON 2012-09-14 22:43:47 -03:00
Paulo Gustavo Veiga
b4f036745f Minor fix. 2012-09-14 11:02:28 -03:00
Paulo Gustavo Veiga
5719e54091 Hack for wron encoding on UTF chars. 2012-09-14 10:55:59 -03:00
Paulo Gustavo Veiga
3895365d93 - Remove DOMParser wrapper. 2012-09-14 09:03:50 -03:00
Paulo Gustavo Veiga
7d073920df - Add more info for detecting Firefox 15 error on dom serialization 2012-09-13 09:26:43 -03:00
Paulo Gustavo Veiga
5c9a10b878 - Catch IO exceptions during JSON deserialization 2012-09-13 09:21:30 -03:00
Paulo Gustavo Veiga
bef8711138 Enter is supported in any part of the text node. Not only at the end. 2012-09-13 01:22:20 -03:00
Paulo Gustavo Veiga
011acba666 Minor fix. 2012-09-13 00:35:46 -03:00
Paulo Gustavo Veiga
a1199687d4 Fix problem opening public maps. 2012-09-13 00:17:49 -03:00
Paulo Gustavo Veiga
4c988d4ae2 - Footer is more positioned in the bottom 2012-09-12 23:29:57 -03:00
Paulo Gustavo Veiga
022e3d982a - Add stacktrace support for IE. 2012-09-12 20:18:19 -03:00
Paulo Gustavo Veiga
69912ecef4 Fix service.xml fie. 2012-09-11 21:24:23 -03:00
Paulo Gustavo Veiga
a263a05520 Minor permissions modification. 2012-09-11 21:09:37 -03:00
Paulo Gustavo Veiga
2e2e978c43 - Fix IE 9 issue that true value is serialized as number instead of boolean string. 2012-09-11 20:46:53 -03:00
Paulo Gustavo Veiga
1e53ba827f - Fix java.lang.NullPointerException,at java.util.regex.Matcher.getTextLength(Matcher.java:1140) exception. 2012-09-11 20:30:00 -03:00
Paulo Gustavo Veiga
d811c8f011 Handle validations exceptions. 2012-09-11 14:02:06 -03:00
Paulo Gustavo Veiga
0cbe108910 Add added to the top. 2012-09-11 02:01:52 -03:00
Paulo Gustavo Veiga
3fb746f79b - Change to start using bootstrap grid 2012-09-11 01:47:23 -03:00
Paulo Gustavo Veiga
6efc068a6c Fix editor.js url location. 2012-09-10 14:45:44 -03:00
Paulo Gustavo Veiga
db49d96b97 - Fix image URL on sharing. 2012-09-10 13:16:52 -03:00
Paulo Gustavo Veiga
3fda0c9dab Fix better default for email notifications. 2012-09-10 09:50:56 -03:00
Paulo Gustavo Veiga
e83fa28ae8 Relax and add support for Firefox 10 and Chrome 18. 2012-09-09 19:13:53 -03:00
Paulo Gustavo Veiga
84fcad2688 Fix compilation. 2012-09-09 19:04:34 -03:00
Paulo Gustavo Veiga
3f2b343a06 Detect Google Mediapartners browser. 2012-09-09 19:02:41 -03:00
Paulo Gustavo Veiga
e76a2372d0 Fix minor french translation typos. 2012-09-09 13:34:33 -03:00
Paulo Gustavo Veiga
861d265891 - Fix MooDialog.Request.active is null 2012-09-08 14:32:43 -03:00
Paulo Gustavo Veiga
0b0cb960f7 Enable annotations driven. 2012-09-08 12:49:49 -03:00
Paulo Gustavo Veiga
c15c1824b3 Fix stack overflow 2012-09-08 12:27:50 -03:00
Paulo Gustavo Veiga
8321363333 Add freemind converted. 2012-09-08 12:01:26 -03:00
Paulo Gustavo Veiga
c950e68a27 - Bug Cannot call method 'trim' of undefined, line:2255 fixed. 2012-09-07 20:15:42 -03:00
Paulo Gustavo Veiga
8d9fb53741 Minor fix. 2012-09-07 19:49:36 -03:00
Paulo Gustavo Veiga
4cce432bb8 Add debug information on broken input streams. 2012-09-07 19:40:08 -03:00
Paulo Gustavo Veiga
337a67a8f6 Fix ReCaptha NPE
Improve error handling when permission are removed.
2012-09-06 23:52:53 -03:00
Paulo Gustavo Veiga
743164ade4 - Fix Uncaught Cilcular connection, line:8 error 2012-09-04 23:41:34 -03:00
Paulo Gustavo Veiga
9a94326469 - Minor improvement on relationship. Show arrow. 2012-09-04 23:29:24 -03:00
Paulo Gustavo Veiga
a86a38d157 - Fix character encodding issue on mysql 2012-09-04 22:12:52 -03:00
Paulo Gustavo Veiga
9ab4c4975c - Fix undo issues over features. 2012-09-04 01:06:50 -03:00
Paulo Gustavo Veiga
1efa24f2aa - Fix Uncaught Icon can no be found., line:3940 2012-09-04 00:50:12 -03:00
Paulo Gustavo Veiga
3f173ec2f1 - Fix Cannot call method 'set' of null. This occurs on zoomIn and zoomOut of print. 2012-09-03 22:16:36 -03:00
Paulo Gustavo Veiga
6008376ad5 - Add Mediapartners-Google add sense crawler 2012-09-03 21:39:40 -03:00
Paulo Gustavo Veiga
c4c3f30303 Bug TypeError: c is undefined, line:4491 fixed. 2012-09-03 21:13:35 -03:00
Paulo Gustavo Veiga
bcc5676b49 - Bug Cannot call method 'getChildren' of null, line:1955 fixed. 2012-09-03 20:54:18 -03:00
Paulo Gustavo Veiga
ca37d3f384 -Fix Uncaught RangeError: Maximum call stack size exceeded, line:114 2012-09-02 19:52:37 -03:00
Paulo Gustavo Veiga
04a221799a Add filter for avoiding multiple emails on error reporting. 2012-09-02 18:24:15 -03:00
710 changed files with 82978 additions and 7744 deletions

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@ wisemapping.log*
*/.DS_Store
.DS_Store
target
.idea

View File

@@ -4,20 +4,20 @@
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/)
* 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:
WiseMapping uses Maven as packaging and project management. It's composed of 5 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
* core-js: Utilities JavaScript classes
* web2d: JavaScript 2D SVG abstraction library used by the mind map editor
* 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 package`
@@ -26,9 +26,11 @@ Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapp
## 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
Password: test
Enjoy :)

View File

@@ -18,5 +18,3 @@ Were a couple of friends working on an idea: “Create the best on-line colla
h1. [[Documentation]]
h1. [[Compiling and Running]]
h1. [[FAQ]]

118
README.md
View File

@@ -1,124 +1,50 @@
# WiseMapping: a Web based mindmapping application
## 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
## Compiling and Running
# Compiling and Running
### Prerequisites
## 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/)
### Compiling
* 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/])
WiseMapping uses Maven as packaging and project management. The project is composed of 4 maven sub-modules:
* core-js: Utilities JavaScript libraries
## Compiling
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.
### Testing
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:
`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'
Now open a browser using the URL http://localhost:8000/
### 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 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
## Authors
* Pablo Luna
* Paulo Veiga
* Ignacio Manzano
* Nicolas Damonte
Past Collaborators: 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]

View File

@@ -0,0 +1,11 @@
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;

View File

@@ -0,0 +1,74 @@
CREATE TABLE COLLABORATOR (
id INTEGER NOT NULL IDENTITY,
email VARCHAR(255) NOT NULL,
creation_date DATE);
CREATE TABLE USER (
id INTEGER NOT NULL IDENTITY,
colaborator_id INTEGER NOT NULL,
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 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
);
COMMIT;

View File

@@ -7,4 +7,3 @@ DROP TABLE MINDMAP;
DROP TABLE USER;
DROP TABLE COLLABORATOR;
COMMIT;
SHUTDOWN;

View File

@@ -0,0 +1,6 @@
CREATE DATABASE wisemapping
CHARACTER SET = 'utf8'
COLLATE = 'utf8_unicode_ci';
CREATE USER 'wisemapping'@'localhost'
IDENTIFIED BY 'password';
GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost';

View File

@@ -0,0 +1,104 @@
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 (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
colaborator_id INTEGER NOT NULL,
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 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
)
CHARACTER SET utf8;
COMMIT;

View File

@@ -0,0 +1,10 @@
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,'D')
VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1);
COMMIT;

View 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;

View 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`;

View File

@@ -0,0 +1,3 @@
CREATE DATABASE wisemapping;
CREATE USER wisemapping WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE wisemapping TO wisemapping;

View File

@@ -0,0 +1,80 @@
CREATE TABLE COLLABORATOR (
id SERIAL NOT NULL PRIMARY KEY,
email VARCHAR(255) NOT NULL UNIQUE,
creation_date DATE
);
CREATE TABLE "user" (
id SERIAL NOT NULL PRIMARY KEY,
authentication_type TEXT NOT NULL,
authenticator_uri VARCHAR(255),
colaborator_id INTEGER NOT 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 TEXT NOT NULL DEFAULT 0,
locale VARCHAR(5),
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (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
);
COMMIT;

View File

@@ -0,0 +1,9 @@
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;
COMMIT;

View File

@@ -9,7 +9,7 @@
<groupId>org.wisemapping</groupId>
<artifactId>wisemapping</artifactId>
<relativePath>../pom.xml</relativePath>
<version>3.0-SNAPSHOT</version>
<version>3.1-SNAPSHOT</version>
</parent>
<build>

View File

@@ -13,15 +13,9 @@ $defined = function (obj) {
$assert = function (assert, message) {
if (!$defined(assert) || !assert) {
var stack;
try {
null.eval();
} catch (e) {
stack = e;
}
console.log(message + "," + stack);
window.errorStack = stackTrace();
throw message;
logStackTrace();
console.log(message);
throw new Error(message);
}
};
@@ -29,77 +23,35 @@ Math.sign = function (value) {
return (value >= 0) ? 1 : -1;
};
function stackTrace() {
var result = "";
var isCallstackPopulated = false;
try {
null.eval();
} catch (e) {
if (e.stack) { //Firefox and Chrome...
result = e.stack;
isCallstackPopulated = true;
}
else if (window.opera && e.message) { //Opera
result = e.message;
isCallstackPopulated = true;
function logStackTrace(exception) {
if (!$defined(exception)) {
try {
throw Error("Unexpected Exception");
} catch (e) {
exception = e;
}
}
var result = "";
if (exception.stack) { //Firefox and Chrome...
result = exception.stack;
}
else if (window.opera && exception.message) { //Opera
result = exception.message;
} else { //IE and Safari
result = exception.sourceURL + ': ' + exception.line + "\n\n";
var currentFunction = arguments.callee.caller;
while (currentFunction) {
var fn = currentFunction.toString();
result = result + "\n" + fn;
currentFunction = currentFunction.caller;
}
}
window.errorStack = result;
return result;
}
/*
* DOMParser HTML extension
* 2012-02-02
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
/*global document, DOMParser*/
(function (DOMParser) {
"use strict";
var DOMParser_proto = DOMParser.prototype , real_parseFromString = DOMParser_proto.parseFromString;
// Firefox/Opera/IE throw errors on unsupported types
try {
// WebKit returns null on unsupported types
if ((new DOMParser).parseFromString("", "text/html")) {
// text/html parsing is natively supported
return;
}
} catch (ex) {
}
DOMParser_proto.parseFromString = function (markup, type) {
if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
var
doc = document.implementation.createHTMLDocument("")
, doc_elt = doc.documentElement
, first_elt
;
doc_elt.innerHTML = markup;
first_elt = doc_elt.firstElementChild;
if (// are we dealing with an entire document or a fragment?
doc_elt.childElementCount === 1
&& first_elt.localName.toLowerCase() === "html"
) {
doc.replaceChild(first_elt, doc_elt);
}
return doc;
} else {
return real_parseFromString.apply(this, arguments);
}
};
}(DOMParser));
// Support for Windows ...
if (!window.console) {
console = {

View File

@@ -1,64 +1,61 @@
/*
* Copyright [2011] [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.
*/
core.Utils = {
};
core.Utils.innerXML = function(/*Node*/node) {
// summary:
// Implementation of MS's innerXML function.
if ($defined(node.innerXML)) {
return node.innerXML;
// string
} else if ($defined(node.xml)) {
return node.xml;
// string
} else if ($defined(XMLSerializer)) {
return (new XMLSerializer()).serializeToString(node);
// string
}
};
core.Utils.createDocument = function() {
// summary:
// cross-browser implementation of creating an XML document object.
var doc = null;
var _document = window.document;
if ($defined(window.ActiveXObject)) {
var prefixes = [ "MSXML2", "Microsoft", "MSXML", "MSXML3" ];
for (var i = 0; i < prefixes.length; i++) {
try {
doc = new ActiveXObject(prefixes[i] + ".XMLDOM");
} catch(e) { /* squelch */
}
if ($defined(doc)) {
break;
}
}
} else if ((_document.implementation) &&
(_document.implementation.createDocument)) {
doc = _document.implementation.createDocument("", "", null);
}
return doc;
// DOMDocument
/*
* 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.
*/
core.Utils = {
};
core.Utils.innerXML = function (node) {
// summary:
// Implementation of MS's innerXML function.
if ($defined(node.innerXML)) {
return node.innerXML;
// string
} else if ($defined(node.xml)) {
return node.xml;
// string
} else if ($defined(XMLSerializer)) {
return (new XMLSerializer()).serializeToString(node);
// string
}
};
/**
* Cross-browser implementation of creating an XML document object.
*/
core.Utils.createDocument = function () {
var doc = null;
if ($defined(window.ActiveXObject)) {
//http://blogs.msdn.com/b/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx
var progIDs = [ 'Msxml2.DOMDocument.6.0', 'Msxml2.DOMDocument.3.0'];
for (var i = 0; i < progIDs.length; i++) {
try {
doc = new ActiveXObject(progIDs[i]);
break;
}
catch (ex) {
}
}
} else if (window.document.implementation && window.document.implementation.createDocument) {
doc = window.document.implementation.createDocument("", "", null);
}
$assert(doc, "Parser could not be instantiated");
return doc;
};

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -16,5 +16,6 @@ WISE_BIN_FILE_PATH=./target/${WISE_BIN_FILE_NAME}
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}

View File

@@ -1,6 +1,5 @@
#!/bin/bash
set -x
set -e
set -u
@@ -9,7 +8,8 @@ BASE_DIR=`pwd`
TARGET_DIR=$BASE_DIR/target
JETTY_DIR=$TARGET_DIR/wisemapping-$WISE_VERSION
WISE_WEBAPP_DIR=$JETTY_DIR/webapps/wisemapping
JETTY_DIST_DIR=jetty-distribution-8.1.4.v20120524
JETTY_VERSION=8.1.14.v20131031
JETTY_DIST_DIR=jetty-distribution-${JETTY_VERSION}
JETTY_ZIP=${JETTY_DIST_DIR}.zip
# Clean ...
@@ -24,7 +24,7 @@ mvn -o -f $BASE_DIR/../pom.xml package -Dmaven.test.skip=true
if [ ! -f ./target/${JETTY_ZIP} ]
then
echo "Download Jetty"
wget http://download.eclipse.org/jetty/8.1.4.v20120524/dist/jetty-distribution-8.1.4.v20120524.zip -P $TARGET_DIR
wget http://download.eclipse.org/jetty/${JETTY_VERSION}/dist/${JETTY_ZIP} -P $TARGET_DIR
fi
echo "Unzip Jetty ...:"
@@ -42,17 +42,17 @@ mkdir $WISE_WEBAPP_DIR
unzip $BASE_DIR/../wise-webapp/target/wisemapping.war -d $WISE_WEBAPP_DIR >/dev/null
# DB Configuration ...
sed 's/target\/db\/wisemapping/webapps\/wisemapping\/WEB-INF\/database\/wisemapping/' $WISE_WEBAPP_DIR/WEB-INF/app.properties > $WISE_WEBAPP_DIR/WEB-INF/app.properties2
sed 's/\${database.base.url}\/db\/wisemapping/webapps\/wisemapping\/WEB-INF\/database\/wisemapping/' $WISE_WEBAPP_DIR/WEB-INF/app.properties > $WISE_WEBAPP_DIR/WEB-INF/app.properties2
mv $WISE_WEBAPP_DIR/WEB-INF/app.properties2 $WISE_WEBAPP_DIR/WEB-INF/app.properties
mkdir $WISE_WEBAPP_DIR/WEB-INF/database
cp -r $BASE_DIR/../wise-webapp/target/db/* $WISE_WEBAPP_DIR/WEB-INF/database/
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}/
# Store version
echo $1 > $WISE_WEBAPP_DIR/version

View File

@@ -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 "#################################################################"

4
distribution/start.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
java -Xmx256m -Dorg.apache.jasper.compiler.disablejsr199=true -jar start.jar

14
java.iml Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -1,4 +1,4 @@
Copyright [2011] [wisemapping]
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

View File

@@ -9,7 +9,7 @@
<groupId>org.wisemapping</groupId>
<artifactId>wisemapping</artifactId>
<relativePath>../pom.xml</relativePath>
<version>3.0-SNAPSHOT</version>
<version>3.1-SNAPSHOT</version>
</parent>
<dependencies>
@@ -140,6 +140,7 @@
<include>Workspace.js</include>
<include>ShrinkConnector.js</include>
<include>DesignerKeyboard.js</include>
<include>TopicStyle.js</include>
<include>NodeGraph.js</include>
<include>Topic.js</include>
<include>CentralTopic.js</include>
@@ -192,9 +193,7 @@
<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>
<include>widget/ToolbarPaneItem.js</include>
@@ -226,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>

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -36,29 +36,11 @@ mindplot.CentralTopic = new Class({
return this.getPosition();
},
_getInnerPadding:function () {
return 11;
},
getTopicType:function () {
return mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE;
},
setCursor:function (type) {
type = (type == 'move') ? 'default' : type;
this.parent(type);
},
isConnectedToCentralTopic:function () {
return false;
},
_defaultShapeType:function () {
return mindplot.model.TopicShape.ROUNDED_RECT;
},
updateTopicShape:function () {
},
@@ -70,28 +52,6 @@ mindplot.CentralTopic = new Class({
this.setPosition(zeroPoint);
},
_defaultText:function () {
return $msg('CENTRAL_TOPIC');
},
_defaultBackgroundColor:function () {
return "rgb(80,157,192)";
},
_defaultBorderColor:function () {
return "rgb(57,113,177)";
},
_defaultFontStyle:function () {
return {
font:"Verdana",
size:10,
style:"normal",
weight:"bold",
color:"#ffffff"
};
},
getShrinkConnector:function () {
return null;
},

View File

@@ -1,153 +0,0 @@
/*
* Copyright [2011] [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();
});
}
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -20,7 +20,7 @@ mindplot.ConnectionLine = new Class({
initialize:function (sourceNode, targetNode, lineType) {
$assert(targetNode, 'parentNode node can not be null');
$assert(sourceNode, 'childNode node can not be null');
$assert(sourceNode != targetNode, 'Cilcular connection');
$assert(sourceNode != targetNode, 'Circular connection');
this._targetTopic = targetNode;
this._sourceTopic = sourceNode;
@@ -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();

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -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);
@@ -55,9 +51,15 @@ mindplot.Designer = new Class({
// Register events
if (!this.isReadOnly()) {
this._registerEvents();
// Register mouse events ...
this._registerMouseEvents();
// Register keyboard events ...
mindplot.DesignerKeyboard.register(this);
this._dragManager = this._buildDragManager(this._workspace);
}
this._registerWheelEvents();
this._relPivot = new mindplot.RelationshipPivot(this._workspace, this);
@@ -76,6 +78,32 @@ mindplot.Designer = new Class({
this.deselectAll();
},
_registerWheelEvents:function () {
var workspace = this._workspace;
var screenManager = workspace.getScreenManager();
// Zoom In and Zoom Out must active event
$(document).addEvent('mousewheel', function (event) {
// Change mousewheel handling so we let the default
//event happen if we are outside the container.
var coords = screenManager.getContainer().getCoordinates();
var isOutsideContainer = event.client.y < coords.top ||
event.client.y > coords.bottom ||
event.client.x < coords.left ||
event.client.x > coords.right;
if (!isOutsideContainer) {
if (event.wheel > 0) {
this.zoomIn(1.05);
}
else {
this.zoomOut(1.05);
}
event.preventDefault();
}
}.bind(this));
},
/**
* Activates the keyboard events so you can enter text into forms
*/
@@ -84,14 +112,6 @@ mindplot.Designer = new Class({
},
_registerEvents:function () {
// Register mouse events ...
this._registerMouseEvents();
// Register keyboard events ...
mindplot.DesignerKeyboard.register(this);
},
addEvent:function (type, listener) {
if (type == mindplot.TopicEvent.EDIT || type == mindplot.TopicEvent.CLICK) {
var editor = mindplot.TopicEventDispatcher.getInstance();
@@ -136,26 +156,48 @@ mindplot.Designer = new Class({
}
}.bind(this));
// Register mouse drag and drop event ...
function noopHandler(evt) {
evt.stopPropagation();
evt.preventDefault();
}
$(document).addEvent('mousewheel', function (event) {
// Change mousewheel handling so we let the default
//event happen if we are outside the container.
var coords = screenManager.getContainer().getCoordinates();
var isOutsideContainer = event.client.y < coords.top ||
event.client.y > coords.bottom ||
event.client.x < coords.left ||
event.client.x > coords.right;
// Enable drag events ...
// @Todo: Images support on progress ...
// Element.NativeEvents.dragenter = 2;
// Element.NativeEvents.dragexit = 2;
// Element.NativeEvents.dragover = 2;
// Element.NativeEvents.drop = 2;
//
// screenManager.addEvent('dragenter', noopHandler);
// screenManager.addEvent('dragexit', noopHandler);
// screenManager.addEvent('dragover', noopHandler);
// screenManager.addEvent('drop', function (evt) {
// evt.stopPropagation();
// evt.preventDefault();
////
// var files = evt.event.dataTransfer.files;
// console.log(event);
//
// var count = files.length;
//
// // Only call the handler if 1 or more files was dropped.
// if (count > 0) {
//
// var model = this.getMindmap().createNode();
// model.setImageSize(80, 43);
// model.setMetadata("{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}");
// model.setImageUrl("images/logo-small.png");
// model.setShapeType(mindplot.model.TopicShape.IMAGE);
//
// var position = screenManager.getWorkspaceMousePosition(evt);
// model.setPosition(position.x, position.y);
// model.setPosition(100, 100);
//
// this._actionDispatcher.addTopics([model]);
// }
// }.bind(this));
if (!isOutsideContainer) {
if (event.wheel > 0) {
this.zoomIn(1.05);
}
else {
this.zoomOut(1.05);
}
event.preventDefault();
}
}.bind(this));
},
@@ -203,12 +245,8 @@ mindplot.Designer = new Class({
_buildNodeGraph:function (model, readOnly) {
var workspace = this._workspace;
// Create node graph ...
var topic = mindplot.NodeGraph.create(model, {readOnly:readOnly});
// Append it to the workspace ...
this.getModel().addTopic(topic);
// Add Topic events ...
@@ -244,7 +282,7 @@ mindplot.Designer = new Class({
}
}
$assert(targetTopic, "Could not find a topic to connect");
topic.connectTo(targetTopic, workspace);
topic.connectTo(targetTopic, this._workspace);
}
topic.addEvent('ontblur', function () {
@@ -358,7 +396,7 @@ mindplot.Designer = new Class({
// Exclude central topic ..
topics = topics.filter(function (topic) {
return topic.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE
return !topic.isCentralTopic();
});
this._clipboard = topics.map(function (topic) {
@@ -398,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 () {
@@ -427,10 +466,52 @@ 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)
}
},
_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 ...
@@ -441,6 +522,8 @@ mindplot.Designer = new Class({
var position = result.position;
childModel.setPosition(position.x, position.y);
this._copyNodeProps(parentModel,childModel);
return childModel;
},
@@ -505,8 +588,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;
},
@@ -552,7 +638,7 @@ mindplot.Designer = new Class({
for (var i = 0; i < branches.length; i++) {
// NodeModel -> NodeGraph ...
var nodeModel = branches[i];
var nodeGraph = this._nodeModelToNodeGraph(nodeModel, false);
var nodeGraph = this._nodeModelToNodeGraph(nodeModel);
// Update shrink render state...
nodeGraph.setBranchVisibility(true);
@@ -590,7 +676,7 @@ mindplot.Designer = new Class({
return this._options.readOnly;
},
_nodeModelToNodeGraph:function (nodeModel, isVisible) {
_nodeModelToNodeGraph:function (nodeModel) {
$assert(nodeModel, "Node model can not be null");
var children = nodeModel.getChildren().slice();
children = children.sort(function (a, b) {
@@ -598,16 +684,13 @@ mindplot.Designer = new Class({
});
var nodeGraph = this._buildNodeGraph(nodeModel, this.isReadOnly());
if (isVisible) {
nodeGraph.setVisibility(isVisible);
}
nodeGraph.setVisibility(false);
this._workspace.appendChild(nodeGraph);
for (var i = 0; i < children.length; i++) {
var child = children[i];
if ($defined(child))
this._nodeModelToNodeGraph(child, false);
this._nodeModelToNodeGraph(child);
}
return nodeGraph;
@@ -658,6 +741,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);
@@ -688,7 +774,7 @@ mindplot.Designer = new Class({
},
_removeTopic:function (node) {
if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if (!node.isCentralTopic()) {
var parent = node._parent;
node.disconnect(this._workspace);
@@ -710,7 +796,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();
@@ -718,14 +813,14 @@ mindplot.Designer = new Class({
// If there are more than one node selected,
$notify($msg('ENTITIES_COULD_NOT_BE_DELETED'));
return;
} else if (topics.length == 1 && topics[0].getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
} else if (topics.length == 1 && topics[0].isCentralTopic()) {
$notify($msg('CENTRAL_TOPIC_CAN_NOT_BE_DELETED'));
return;
}
// If the central topic has been selected, I must filter ir
var topicIds = topics.filter(function (topic) {
return topic.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE
return !topic.isCentralTopic();
}).map(function (topic) {
return topic.getId()
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -60,19 +60,32 @@ mindplot.DesignerKeyboard = new Class({
}
}.bind(this),
'delete':function () {
'delete':function (event) {
designer.deleteSelectedEntities();
event.preventDefault();
event.stopPropagation();
}.bind(this),
'enter':function () {
designer.createSiblingForSelectedNode();
}.bind(this),
'insert':function () {
'insert':function (event) {
designer.createChildForSelectedNode();
event.preventDefault();
event.stopPropagation();
}.bind(this),
'-':function () {
'tab':function (event) {
designer.createChildForSelectedNode();
event.preventDefault();
event.stopPropagation();
}.bind(this),
'-':function () { // "-" is a insert on several Browsers. Don't ask why ...
designer.createChildForSelectedNode();
}.bind(this),
@@ -225,10 +238,39 @@ mindplot.DesignerKeyboard = new Class({
designer.selectAll();
},
'right':function () {
'meta+=':function (event) {
event.preventDefault();
event.stopPropagation();
designer.zoomIn();
},
'meta+-':function (event) {
event.preventDefault();
event.stopPropagation();
designer.zoomOut();
},
'ctrl+=':function (event) {
event.preventDefault();
event.stopPropagation();
designer.zoomIn();
},
'ctrl+-':function (event) {
event.preventDefault();
event.stopPropagation();
designer.zoomOut();
},
'right':function (event) {
var node = model.selectedTopic();
if (node) {
if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if (node.isCentralTopic()) {
this._goToSideChild(designer, node, 'RIGHT');
}
else {
@@ -243,12 +285,14 @@ mindplot.DesignerKeyboard = new Class({
var centralTopic = model.getCentralTopic();
this._goToNode(designer, centralTopic);
}
event.preventDefault();
event.stopPropagation();
}.bind(this),
'left':function () {
'left':function (event) {
var node = model.selectedTopic();
if (node) {
if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if (node.isCentralTopic()) {
this._goToSideChild(designer, node, 'LEFT');
}
else {
@@ -263,37 +307,48 @@ mindplot.DesignerKeyboard = new Class({
var centralTopic = model.getCentralTopic();
this._goToNode(designer, centralTopic);
}
event.preventDefault();
event.stopPropagation();
}.bind(this),
'up':function () {
'up':function (event) {
var node = model.selectedTopic();
if (node) {
if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if (!node.isCentralTopic()) {
this._goToBrother(designer, node, 'UP');
}
} else {
var centralTopic = model.getCentralTopic();
this._goToNode(designer, centralTopic);
}
event.preventDefault();
event.stopPropagation();
}.bind(this),
'down':function () {
'down':function (event) {
var node = model.selectedTopic();
if (node) {
if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if (!node.isCentralTopic()) {
this._goToBrother(designer, node, 'DOWN');
}
} else {
var centralTopic = model.getCentralTopic();
this._goToNode(designer, centralTopic);
}
event.preventDefault();
event.stopPropagation();
}.bind(this)
};
this.addEvents(keyboardEvents);
var regex = /^(?:shift|control|ctrl|alt|meta)$/;
var modifiers = ['shift', 'control', 'alt', 'meta'];
var excludes = ['esc', 'capslock', 'tab', 'f1', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12', 'backspace', 'down', 'up', 'left', 'right', 'control'];
if (!Browser.Platform.mac) {
// This is to avoid enter on edition mode in the node when alt+tab is pressed.
excludes.push("alt");
}
$(document).addEvent('keydown', function (event) {
@@ -335,39 +390,43 @@ mindplot.DesignerKeyboard = new Class({
},
_goToBrother:function (designer, node, direction) {
var brothers = node.getParent().getChildren();
var target = node;
var y = node.getPosition().y;
var x = node.getPosition().x;
var dist = null;
for (var i = 0; i < brothers.length; i++) {
var sameSide = (x * brothers[i].getPosition().x) >= 0;
if (brothers[i] != node && sameSide) {
var brother = brothers[i];
var brotherY = brother.getPosition().y;
if (direction == "DOWN" && brotherY > y) {
var distancia = y - brotherY;
if (distancia < 0) {
distancia = distancia * (-1);
var parent = node.getParent();
if (parent) {
var brothers = parent.getChildren();
var target = node;
var y = node.getPosition().y;
var x = node.getPosition().x;
var dist = null;
for (var i = 0; i < brothers.length; i++) {
var sameSide = (x * brothers[i].getPosition().x) >= 0;
if (brothers[i] != node && sameSide) {
var brother = brothers[i];
var brotherY = brother.getPosition().y;
if (direction == "DOWN" && brotherY > y) {
var distancia = y - brotherY;
if (distancia < 0) {
distancia = distancia * (-1);
}
if (dist == null || dist > distancia) {
dist = distancia;
target = brothers[i];
}
}
if (dist == null || dist > distancia) {
dist = distancia;
target = brothers[i];
}
}
else if (direction == "UP" && brotherY < y) {
var distance = y - brotherY;
if (distance < 0) {
distance = distance * (-1);
}
if (dist == null || dist > distance) {
dist = distance;
target = brothers[i];
else if (direction == "UP" && brotherY < y) {
var distance = y - brotherY;
if (distance < 0) {
distance = distance * (-1);
}
if (dist == null || dist > distance) {
dist = distance;
target = brothers[i];
}
}
}
}
this._goToNode(designer, target);
}
this._goToNode(designer, target);
},

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -83,6 +83,7 @@ mindplot.DesignerModel = new Class({
addTopic:function (topic) {
$assert(topic, "topic can not be null");
$assert(typeof topic.getId() == "number", "id is not a number:" + topic.getId());
this._topics.push(topic);
},

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,107 +1,112 @@
/*
* Copyright [2011] [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.DragConnector = new Class({
initialize:function (designerModel, workspace) {
$assert(designerModel, 'designerModel can not be null');
$assert(workspace, 'workspace can not be null');
// this._layoutManager = layoutManager;
this._designerModel = designerModel;
this._workspace = workspace;
},
checkConnection:function (dragTopic) {
var topics = this._designerModel.getTopics();
// Must be disconnected from their current connection ?.
var candidates = this._searchConnectionCandidates(dragTopic);
var currentConnection = dragTopic.getConnectedToTopic();
if (currentConnection && (candidates.length == 0 || candidates[0] != currentConnection)) {
dragTopic.disconnect(this._workspace);
}
// Finally, connect nodes ...
if (!dragTopic.isConnected() && candidates.length > 0) {
dragTopic.connectTo(candidates[0]);
}
},
_searchConnectionCandidates:function (dragTopic) {
var topics = this._designerModel.getTopics();
var draggedNode = dragTopic.getDraggedTopic();
// Drag node connects to the border ...
var dragTopicWidth = dragTopic.getSize ? dragTopic.getSize().width : 0; // Hack...
var xMouseGap = dragTopic.getPosition().x > 0 ? 0 : dragTopicWidth;
var sPos = {x:dragTopic.getPosition().x - xMouseGap, y:dragTopic.getPosition().y};
// Perform a initial filter to discard topics:
// - Exclude dragged topic
// - Exclude dragTopic pivot
// - Nodes that are collapsed
topics = topics.filter(function (topic) {
return draggedNode != topic && topic != draggedNode && !topic.areChildrenShrunken() && !topic.isCollapsed();
});
// Filter all the nodes that are outside the vertical boundary:
// * The node is to out of the x scope
// * The x distance greater the vertical tolerated distance
topics = topics.filter(function (topic) {
var tpos = topic.getPosition();
// Center topic has different alignment than the rest of the nodes. That's why i need to divide it by two...
var txborder = tpos.x + (topic.getSize().width / 2) * Math.sign(sPos.x);
var distance = (sPos.x - txborder) * Math.sign(sPos.x);
return distance > 0 && (distance < mindplot.DragConnector.MAX_VERTICAL_CONNECTION_TOLERANCE);
});
// Assign a priority based on the distance:
// - Alignment with the targetNode
// - Vertical distance
// - Horizontal proximity
// - It's already connected.
var currentConnection = dragTopic.getConnectedToTopic();
topics = topics.sort(function (a, b) {
var aPos = a.getPosition();
var bPos = b.getPosition();
var av = this._isVerticallyAligned(a.getSize(), aPos, sPos);
var bv = this._isVerticallyAligned(b.getSize(), bPos, sPos);
return this._proximityWeight(av, a, sPos, currentConnection) - this._proximityWeight(bv, b, sPos, currentConnection);
}.bind(this));
return topics;
},
_proximityWeight:function (isAligned, target, sPos, currentConnection) {
var tPos = target.getPosition();
return (isAligned ? 0 : 200 ) + Math.abs(tPos.x - sPos.x) + Math.abs(tPos.y - sPos.y) + (currentConnection == target ? 0 : 100);
},
_isVerticallyAligned:function (targetSize, targetPosition, sourcePosition) {
return Math.abs(sourcePosition.y - targetPosition.y) < targetSize.height / 2;
}
});
mindplot.DragConnector.MAX_VERTICAL_CONNECTION_TOLERANCE = 80;
/*
* 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.DragConnector = new Class({
initialize:function (designerModel, workspace) {
$assert(designerModel, 'designerModel can not be null');
$assert(workspace, 'workspace can not be null');
// this._layoutManager = layoutManager;
this._designerModel = designerModel;
this._workspace = workspace;
},
checkConnection:function (dragTopic) {
var topics = this._designerModel.getTopics();
// Must be disconnected from their current connection ?.
var candidates = this._searchConnectionCandidates(dragTopic);
var currentConnection = dragTopic.getConnectedToTopic();
if (currentConnection && (candidates.length == 0 || candidates[0] != currentConnection)) {
dragTopic.disconnect(this._workspace);
}
// Finally, connect nodes ...
if (!dragTopic.isConnected() && candidates.length > 0) {
dragTopic.connectTo(candidates[0]);
}
},
_searchConnectionCandidates:function (dragTopic) {
var topics = this._designerModel.getTopics();
var draggedNode = dragTopic.getDraggedTopic();
// Drag node connects to the border ...
var dragTopicWidth = dragTopic.getSize ? dragTopic.getSize().width : 0; // Hack...
var xMouseGap = dragTopic.getPosition().x > 0 ? 0 : dragTopicWidth;
var sPos = {x:dragTopic.getPosition().x - xMouseGap, y:dragTopic.getPosition().y};
// Perform a initial filter to discard topics:
// - Exclude dragged topic
// - Exclude dragTopic pivot
// - Nodes that are collapsed
// - It's not part of the branch dragged itself
topics = topics.filter(function (topic) {
var result = draggedNode != topic;
result = result && topic != draggedNode;
result = result && !topic.areChildrenShrunken() && !topic.isCollapsed();
result = result && !draggedNode.isChildTopic(topic);
return result;
});
// Filter all the nodes that are outside the vertical boundary:
// * The node is to out of the x scope
// * The x distance greater the vertical tolerated distance
topics = topics.filter(function (topic) {
var tpos = topic.getPosition();
// Center topic has different alignment than the rest of the nodes. That's why i need to divide it by two...
var txborder = tpos.x + (topic.getSize().width / 2) * Math.sign(sPos.x);
var distance = (sPos.x - txborder) * Math.sign(sPos.x);
return distance > 0 && (distance < mindplot.DragConnector.MAX_VERTICAL_CONNECTION_TOLERANCE);
});
// Assign a priority based on the distance:
// - Alignment with the targetNode
// - Vertical distance
// - Horizontal proximity
// - It's already connected.
var currentConnection = dragTopic.getConnectedToTopic();
topics = topics.sort(function (a, b) {
var aPos = a.getPosition();
var bPos = b.getPosition();
var av = this._isVerticallyAligned(a.getSize(), aPos, sPos);
var bv = this._isVerticallyAligned(b.getSize(), bPos, sPos);
return this._proximityWeight(av, a, sPos, currentConnection) - this._proximityWeight(bv, b, sPos, currentConnection);
}.bind(this));
return topics;
},
_proximityWeight:function (isAligned, target, sPos, currentConnection) {
var tPos = target.getPosition();
return (isAligned ? 0 : 200 ) + Math.abs(tPos.x - sPos.x) + Math.abs(tPos.y - sPos.y) + (currentConnection == target ? 0 : 100);
},
_isVerticallyAligned:function (targetSize, targetPosition, sourcePosition) {
return Math.abs(sourcePosition.y - targetPosition.y) < targetSize.height / 2;
}
});
mindplot.DragConnector.MAX_VERTICAL_CONNECTION_TOLERANCE = 80;

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -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 () {

View File

@@ -1,3 +1,21 @@
/*
* 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.EditorOptions =
{
LayoutManager:"OriginalLayout",

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -80,7 +80,7 @@ mindplot.IconGroup = new Class({
}, this);
if (result == null) {
throw "Icon can no be found.";
throw new Error("Icon can no be found:" + iconModel.getId() + ", Icons:" + this._icons);
}
return result;

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -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"]}
];

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -18,28 +18,29 @@
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) {
saveMapXml:function (mapId, mapXml, pref, saveHistory, events) {
localStorage.setItem(mapId + "-xml", mapXml);
events.onSuccess();
},
discardChanges : function(mapId) {
discardChanges:function (mapId) {
localStorage.removeItem(mapId + "-xml");
},
loadMapDom : function(mapId) {
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',
method: 'get',
async: false,
onSuccess: function(responseText) {
url:this.documentUrl.replace("{id}", mapId),
headers:{"Content-Type":"text/plain","Accept":"application/xml"},
method:'get',
async:false,
onSuccess:function (responseText) {
xml = responseText;
}
});
@@ -47,13 +48,16 @@ mindplot.LocalStorageManager = new Class({
// If I could not load it from a file, hard code one.
if (xml == null) {
throw "Map could not be loaded";
throw new Error("Map could not be loaded");
}
}
var parser = new DOMParser();
return parser.parseFromString(xml, "text/xml");
},
unlockMap:function (mindmap) {
// Ignore, no implementation required ...
}
}
);

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -55,16 +55,11 @@ mindplot.MainTopic = new Class({
return group;
},
_defaultShapeType:function () {
return mindplot.model.TopicShape.LINE;
},
updateTopicShape:function (targetTopic, workspace) {
// Change figure based on the connected topic ...
var model = this.getModel();
var shapeType = model.getShapeType();
if (targetTopic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if (!targetTopic.isCentralTopic()) {
if (!$defined(shapeType)) {
// Get the real shape type ...
shapeType = this.getShapeType();
@@ -88,10 +83,6 @@ mindplot.MainTopic = new Class({
innerShape.setVisibility(true);
},
getTopicType:function () {
return "MainTopic";
},
_updatePositionOnChangeSize:function (oldSize, newSize) {
var xOffset = Math.round((newSize.width - oldSize.width) / 2);
@@ -107,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) {
@@ -167,82 +137,6 @@ mindplot.MainTopic = new Class({
result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight, true);
}
return result;
},
_getInnerPadding:function () {
var result;
var parent = this.getModel().getParent();
if (parent && mindplot.model.INodeModel.MAIN_TOPIC_TYPE == parent.getType()) {
result = 3;
}
else {
result = 4;
}
return result;
},
isConnectedToCentralTopic:function () {
var model = this.getModel();
var parent = model.getParent();
return parent && parent.getType() === mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE;
},
_defaultText:function () {
var targetTopic = this.getOutgoingConnectedTopic();
var result = "";
if ($defined(targetTopic)) {
if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
result = $msg('MAIN_TOPIC');
} else {
result = $msg('SUB_TOPIC');
}
} else {
result = $msg('ISOLATED_TOPIC');
;
}
return result;
},
_defaultFontStyle:function () {
var targetTopic = this.getOutgoingConnectedTopic();
var result;
if ($defined(targetTopic)) {
if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
result = {
font:"Arial",
size:8,
style:"normal",
weight:"normal",
color:"rgb(82,92,97)"
};
} else {
result = {
font:"Arial",
size:6,
style:"normal",
weight:"normal",
color:"rgb(82,92,97)"
};
}
} else {
result = {
font:"Verdana",
size:8,
style:"normal",
weight:"normal",
color:"rgb(82,92,97)"
};
}
return result;
},
_defaultBackgroundColor:function () {
return "rgb(224,229,239)";
},
_defaultBorderColor:function () {
return 'rgb(2,59,185)';
}
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -17,20 +17,21 @@
*/
mindplot.MultilineTextEditor = new Class({
Extends: Events,
initialize:function() {
Extends:Events,
initialize:function () {
this._topic = null;
this._timeoutId = -1;
},
_buildEditor : function() {
_buildEditor:function () {
var result = new Element('div');
result.setStyles({
position:"absolute",
display: "none",
zIndex: "8",
display:"none",
zIndex:"8",
overflow:"hidden",
border: "0 none"
border:"0 none"
}
);
@@ -42,17 +43,17 @@ mindplot.MultilineTextEditor = new Class({
);
textareaElem.setStyles({
border: "1px gray dashed",
border:"1px gray dashed",
background:"rgba(98, 135, 167, .3)",
outline: '0 none',
resize: 'none',
outline:'0 none',
resize:'none',
overflow:"hidden"
});
textareaElem.inject(result);
return result;
},
_registerEvents : function(containerElem) {
_registerEvents:function (containerElem) {
var textareaElem = this._getTextareaElem();
textareaElem.addEvent('keydown', function (event) {
@@ -63,8 +64,30 @@ mindplot.MultilineTextEditor = new Class({
case 'enter':
if (event.meta || event.control) {
// @todo: Enters must be in any place ...
textareaElem.value = textareaElem.value + "\n";
// Add return ...
var text = textareaElem.value;
var cursorPosition = text.length;
if (textareaElem.selectionStart) {
cursorPosition = textareaElem.selectionStart;
}
var head = text.substring(0, cursorPosition);
var tail = "";
if (cursorPosition < text.length) {
tail = text.substring(cursorPosition, text.length);
}
textareaElem.value = head + "\n" + tail;
// Position cursor ...
if (textareaElem.setSelectionRange) {
textareaElem.focus();
textareaElem.setSelectionRange(cursorPosition + 1, cursorPosition + 1);
} else if (textareaElem.createTextRange) {
var range = textareaElem.createTextRange();
range.moveStart('character', cursorPosition + 1);
range.select();
}
}
else {
this.close(true);
@@ -74,36 +97,36 @@ mindplot.MultilineTextEditor = new Class({
event.stopPropagation();
}.bind(this));
textareaElem.addEvent('keypress', function(event) {
textareaElem.addEvent('keypress', function (event) {
event.stopPropagation();
});
textareaElem.addEvent('keyup', function(event) {
textareaElem.addEvent('keyup', function (event) {
var text = this._getTextareaElem().value;
this.fireEvent('input', [event, text]);
this._adjustEditorSize();
}.bind(this));
// If the user clicks on the input, all event must be ignored ...
containerElem.addEvent('click', function(event) {
containerElem.addEvent('click', function (event) {
event.stopPropagation();
});
containerElem.addEvent('dblclick', function(event) {
containerElem.addEvent('dblclick', function (event) {
event.stopPropagation();
});
containerElem.addEvent('mousedown', function(event) {
containerElem.addEvent('mousedown', function (event) {
event.stopPropagation();
});
},
_adjustEditorSize : function() {
_adjustEditorSize:function () {
if (this.isVisible()) {
var textElem = this._getTextareaElem();
var lines = textElem.value.split('\n');
var maxLineLength = 1;
lines.each(function(line) {
lines.each(function (line) {
if (maxLineLength < line.length)
maxLineLength = line.length;
});
@@ -112,17 +135,17 @@ mindplot.MultilineTextEditor = new Class({
textElem.setAttribute('rows', lines.length);
this._containerElem.setStyles({
width: (maxLineLength + 3) + 'em',
height: textElem.getSize().height
width:(maxLineLength + 3) + 'em',
height:textElem.getSize().height
});
}
},
isVisible : function () {
isVisible:function () {
return $defined(this._containerElem) && this._containerElem.getStyle('display') == 'block';
},
_updateModel : function () {
_updateModel:function () {
if (this._topic.getText() != this._getText()) {
var text = this._getText();
@@ -133,7 +156,11 @@ mindplot.MultilineTextEditor = new Class({
}
},
show : function (topic,text) {
show:function (topic, text) {
// Close a previous node editor if it's opened ...
if (this._topic) {
this.close(false);
}
this._topic = topic;
if (!this.isVisible()) {
@@ -147,7 +174,7 @@ mindplot.MultilineTextEditor = new Class({
}
},
_showEditor : function (defaultText) {
_showEditor:function (defaultText) {
var topic = this._topic;
@@ -162,12 +189,12 @@ mindplot.MultilineTextEditor = new Class({
this._setStyle(font);
// Set editor's initial size
var displayFunc = function() {
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'}
position:{x:'left', y:'top'},
edge:{x:'left', y:'top'}
});
this._containerElem.setStyle('display', 'block');
@@ -181,10 +208,10 @@ mindplot.MultilineTextEditor = new Class({
}.bind(this);
displayFunc.delay(10);
this._timeoutId = displayFunc.delay(10);
},
_setStyle : function (fontStyle) {
_setStyle:function (fontStyle) {
var inputField = this._getTextareaElem();
if (!$defined(fontStyle.font)) {
fontStyle.font = "Arial";
@@ -199,31 +226,31 @@ mindplot.MultilineTextEditor = new Class({
fontStyle.size = 12;
}
var style = {
fontSize : fontStyle.size + "px",
fontFamily : fontStyle.font,
fontStyle : fontStyle.style,
fontWeight : fontStyle.weight,
color : fontStyle.color
fontSize:fontStyle.size + "px",
fontFamily:fontStyle.font,
fontStyle:fontStyle.style,
fontWeight:fontStyle.weight,
color:fontStyle.color
};
inputField.setStyles(style);
this._containerElem.setStyles(style);
},
_setText : function(text) {
_setText:function (text) {
var textareaElem = this._getTextareaElem();
textareaElem.value = text;
this._adjustEditorSize();
},
_getText : function() {
_getText:function () {
return this._getTextareaElem().value;
},
_getTextareaElem : function() {
_getTextareaElem:function () {
return this._containerElem.getElement('textarea');
},
_positionCursor : function(textareaElem, selectText) {
_positionCursor:function (textareaElem, selectText) {
textareaElem.focus();
if (selectText) {
// Mark text as selected ...
@@ -248,9 +275,11 @@ mindplot.MultilineTextEditor = new Class({
},
close : function(update) {
if (this.isVisible()) {
close:function (update) {
if (this.isVisible() && this._topic) {
// Update changes ...
clearTimeout(this._timeoutId);
if (!$defined(update) || update) {
this._updateModel();
}
@@ -261,8 +290,9 @@ mindplot.MultilineTextEditor = new Class({
// Remove it form the screen ...
this._containerElem.dispose();
this._containerElem = null;
this._topic = null;
this._timeoutId = -1;
}
this._topic = null;
}
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -38,6 +38,7 @@ mindplot.NodeGraph = new Class({
},
setId : function(id) {
$assert(typeof topic.getId() == "number", "id is not a number:" + id);
this.getModel().setId(id);
},

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -47,7 +47,7 @@ mindplot.NoteIcon = new Class({
var result = new Element('div');
result.setStyles({padding:'5px'});
var title = new Element('div', {text:'Note'});
var title = new Element('div', {text:$msg('NOTE')});
title.setStyles({
'font-weight':'bold',
color:'black',

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -31,7 +31,7 @@ mindplot.PersistenceManager = new Class({
},
save:function (mindmap, editorProperties, saveHistory, events) {
save:function (mindmap, editorProperties, saveHistory, events, sync) {
$assert(mindmap, "mindmap can not be null");
$assert(editorProperties, "editorProperties can not be null");
@@ -44,10 +44,10 @@ mindplot.PersistenceManager = new Class({
var pref = JSON.encode(editorProperties);
try {
this.saveMapXml(mapId, mapXml, pref, saveHistory, events);
this.saveMapXml(mapId, mapXml, pref, saveHistory, events, sync);
} catch (e) {
console.log(e);
events.onError();
events.onError(this._buildError());
}
},
@@ -58,15 +58,19 @@ mindplot.PersistenceManager = new Class({
},
discardChanges:function (mapId) {
throw "Method must be implemented";
throw new Error("Method must be implemented");
},
loadMapDom:function (mapId) {
throw "Method must be implemented";
throw new Error("Method must be implemented");
},
saveMapXml:function (mapId, mapXml, pref, saveHistory, events) {
throw "Method must be implemented";
saveMapXml:function (mapId, mapXml, pref, saveHistory, events, sync) {
throw new Error("Method must be implemented");
},
unlockMap:function (mindmap) {
throw new Error("Method must be implemented");
}
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -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);

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -39,13 +39,25 @@ mindplot.RelationshipPivot = new Class({
this._workspace.enableWorkspaceEvents(false);
var sourcePos = sourceTopic.getPosition();
var strokeColor = mindplot.Relationship.getStrokeColor();
this._pivot = new web2d.CurvedLine();
this._pivot.setStyle(web2d.CurvedLine.SIMPLE_LINE);
this._pivot.setDashed(2, 2);
this._pivot.setFrom(sourcePos.x, sourcePos.y);
this._pivot.setTo(targetPos.x, targetPos.y);
this._workspace.appendChild(this._pivot);
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);
this._pivot.setDashed(4, 2);
this._startArrow = new web2d.Arrow();
this._startArrow.setStrokeColor(strokeColor);
this._startArrow.setStrokeWidth(2);
this._startArrow.setFrom(sourcePos.x, sourcePos.y);
this._workspace.appendChild(this._pivot);
this._workspace.appendChild(this._startArrow);
this._workspace.addEvent('mousemove', this._mouseMoveEvent);
this._workspace.addEvent('click', this._onClickEvent);
@@ -74,10 +86,12 @@ mindplot.RelationshipPivot = new Class({
}.bind(this));
workspace.removeChild(this._pivot);
workspace.removeChild(this._startArrow);
workspace.enableWorkspaceEvents(true);
this._sourceTopic = null;
this._pivot = null;
this._startArrow = null;
}
},
@@ -85,7 +99,20 @@ mindplot.RelationshipPivot = new Class({
var screen = this._workspace.getScreenManager();
var pos = screen.getWorkspaceMousePosition(event);
this._pivot.setTo(pos.x - 1, pos.y - 1);
// Leave the arrow a couple of pixels away from the cursor.
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();
this._startArrow.setFrom(pos.x - gapDistance, pos.y);
this._startArrow.setControlPoint(controlPoints[1]);
event.stopPropagation();
return false;
},
@@ -97,11 +124,30 @@ 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();
var relModel = mindmap.createRelationship(targetTopic.getId(), sourceTopic.getId());
this._designer._actionDispatcher.addRelationship(relModel);
// Avoid circular connections ...
if (targetTopic.getId() != sourceTopic.getId()) {
var relModel = mindmap.createRelationship(targetTopic.getId(), sourceTopic.getId());
this._designer._actionDispatcher.addRelationship(relModel);
}
this.dispose();
},

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -18,15 +18,22 @@
mindplot.RESTPersistenceManager = new Class({
Extends:mindplot.PersistenceManager,
initialize:function (saveUrl, revertUrl) {
initialize:function (options) {
this.parent();
$assert(saveUrl, "saveUrl can not be null");
$assert(revertUrl, "revertUrl can not be null");
this.saveUrl = saveUrl;
this.revertUrl = revertUrl;
$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.documentUrl = options.documentUrl;
this.revertUrl = options.revertUrl;
this.lockUrl = options.lockUrl;
this.timestamp = options.timestamp;
this.session = options.session;
},
saveMapXml:function (mapId, mapXml, pref, saveHistory, events) {
saveMapXml:function (mapId, mapXml, pref, saveHistory, events, sync) {
var data = {
id:mapId,
@@ -34,24 +41,73 @@ mindplot.RESTPersistenceManager = new Class({
properties:pref
};
var request = new Request({
url:this.saveUrl.replace("{id}", mapId) + "?minor=" + !saveHistory,
method:'put',
onSuccess:function (responseText, responseXML) {
events.onSuccess();
var persistence = this;
var query = "minor=" + !saveHistory;
query = query + "&timestamp=" + this.timestamp;
query = query + "&session=" + this.session;
},
onException:function (headerName, value) {
events.onError();
},
onFailure:function (xhr) {
events.onError();
},
headers:{"Content-Type":"application/json", "Accept":"application/json"},
emulation:false,
urlEncoded:false
});
request.put(JSON.encode(data));
if (!persistence.onSave) {
// Mark save in process and fire a event unlocking the save ...
persistence.onSave = true;
persistence.clearTimeout = setTimeout(function () {
persistence.clearTimeout = null;
persistence.onSave = false;
}, 10000);
var request = new Request({
url:this.documentUrl.replace("{id}", mapId) + "?" + query,
method:'put',
async:!sync,
onSuccess:function (responseText, responseXML) {
persistence.timestamp = responseText;
events.onSuccess();
},
onException:function (headerName, value) {
events.onError(persistence._buildError());
},
onComplete:function () {
// Clear event timeout ...
if (persistence.clearTimeout) {
clearTimeout(persistence.clearTimeout);
}
persistence.onSave = false;
},
onFailure:function (xhr) {
var responseText = xhr.responseText;
var userMsg = {severity:"SEVERE", message:$msg('SAVE_COULD_NOT_BE_COMPLETED')};
var contentType = this.getHeader("Content-Type");
if (contentType != null && contentType.indexOf("application/json") != -1) {
var serverMsg = null;
try {
serverMsg = JSON.decode(responseText);
serverMsg = serverMsg.globalSeverity ? serverMsg : null;
} catch (e) {
// Message could not be decoded ...
}
userMsg = persistence._buildError(serverMsg);
} else {
if (this.status == 405) {
userMsg = {severity:"SEVERE", message:$msg('SESSION_EXPIRED')};
}
}
events.onError(userMsg);
persistence.onSave = false;
},
headers:{"Content-Type":"application/json; charset=utf-8", "Accept":"application/json"},
emulation:false,
urlEncoded:false
});
request.put(JSON.encode(data));
}
},
discardChanges:function (mapId) {
@@ -60,19 +116,74 @@ mindplot.RESTPersistenceManager = new Class({
async:false,
method:'post',
onSuccess:function () {
console.log("Revert success ....");
},
onException:function () {
},
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
});
request.post();
}
},
unlockMap:function (mindmap) {
var mapId = mindmap.getId();
var request = new Request({
url:this.lockUrl.replace("{id}", mapId),
async:false,
method:'put',
onSuccess:function () {
},
onException:function () {
},
onFailure:function () {
},
headers:{"Content-Type":"text/plain"},
emulation:false,
urlEncoded:false
});
request.put("false");
},
_buildError:function (jsonSeverResponse) {
var message = jsonSeverResponse ? jsonSeverResponse.globalErrors[0] : null;
var severity = jsonSeverResponse ? jsonSeverResponse.globalSeverity : null;
if (!message) {
message = $msg('SAVE_COULD_NOT_BE_COMPLETED');
}
if (!severity) {
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");
}
}
);

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -43,14 +43,16 @@ mindplot.ScreenManager = new Class({
if (event == 'click')
this._clickEvents.push(listener);
else
$(this._divContainer).addEvent(event, listener);
this._divContainer.addEvent(event, listener);
},
removeEvent : function(event, listener) {
if (event == 'click')
if (event == 'click') {
this._clickEvents.remove(listener);
else
$(this._divContainer).removeEvent(event, listener);
}
else{
this._divContainer.removeEvent(event, listener);
}
},
fireEvent : function(type, event) {
@@ -60,7 +62,7 @@ mindplot.ScreenManager = new Class({
});
}
else {
$(this._divContainer).fireEvent(type, event);
this._divContainer.fireEvent(type, event);
}
},

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -83,6 +83,7 @@ mindplot.StandaloneActionDispatcher = new Class({
topic.setText(value);
return result;
};
commandFunc.commandType = "changeTextToTopic";
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, text);
this.execute(command);
@@ -242,18 +243,26 @@ mindplot.CommandContext = new Class({
}
var designerTopics = this._designer.getModel().getTopics();
return designerTopics.filter(function (topic) {
var result = designerTopics.filter(function (topic) {
return topicsIds.contains(topic.getId());
});
if (result.length != topicsIds.length) {
var ids = designerTopics.map(function (topic) {
return topic.getId();
});
$assert(result.length == topicsIds.length, "Could not find topic. Result:" + result + ", Filter Criteria:" + topicsIds + ", Current Topics: [" + ids + "]");
}
return result;
},
deleteTopic:function (topic) {
this._designer._removeTopic(topic);
},
createTopic:function (model, isVisible) {
createTopic:function (model) {
$assert(model, "model can not be null");
return this._designer._nodeModelToNodeGraph(model, isVisible);
return this._designer._nodeModelToNodeGraph(model);
},
createModel:function () {
@@ -261,8 +270,13 @@ mindplot.CommandContext = new Class({
return mindmap.createNode(mindplot.NodeModel.MAIN_TOPIC_TYPE);
},
connect:function (childTopic, parentTopic, isVisible) {
childTopic.connectTo(parentTopic, this._designer._workspace, isVisible);
addTopic:function (topic) {
var mindmap = this._designer.getMindmap();
return mindmap.addBranch(topic.getModel());
},
connect:function (childTopic, parentTopic) {
childTopic.connectTo(parentTopic, this._designer._workspace);
},
disconnect:function (topic) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -29,7 +29,7 @@ mindplot.Topic = new Class({
// Position a topic ....
var pos = model.getPosition();
if (pos != null && model.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if (pos != null && this.isCentralTopic()) {
this.setPosition(pos);
}
@@ -107,7 +107,7 @@ mindplot.Topic = new Class({
var model = this.getModel();
var result = model.getShapeType();
if (!$defined(result)) {
result = this._defaultShapeType();
result = mindplot.TopicStyle.defaultShapeType(this);
}
return result;
},
@@ -134,7 +134,7 @@ mindplot.Topic = new Class({
this._setBorderColor(brColor, false);
// Define the pointer ...
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && !this.isReadOnly()) {
if (!this.isCentralTopic() && !this.isReadOnly()) {
this._innerShape.setCursor('move');
} else {
this._innerShape.setCursor('default');
@@ -259,7 +259,7 @@ mindplot.Topic = new Class({
_buildIconGroup:function () {
var textHeight = this.getTextShape().getFontHeight();
var result = new mindplot.IconGroup(this.getId(), textHeight);
var padding = this._getInnerPadding();
var padding = mindplot.TopicStyle.getInnerPadding(this);
result.setPosition(padding, padding);
// Load topic features ...
@@ -274,18 +274,16 @@ mindplot.Topic = new Class({
return result;
},
addFeature:function (type, attributes) {
addFeature:function (featureModel) {
var iconGroup = this.getOrBuildIconGroup();
this.closeEditors();
var model = this.getModel();
// Update model ...
var feature = model.createFeature(type, attributes);
model.addFeature(feature);
var model = this.getModel();
model.addFeature(featureModel);
var result = mindplot.TopicFeature.createIcon(this, feature, this.isReadOnly());
iconGroup.addIcon(result, type == mindplot.TopicFeature.Icon.id && !this.isReadOnly());
var result = mindplot.TopicFeature.createIcon(this, featureModel, this.isReadOnly());
iconGroup.addIcon(result, featureModel.getType() == mindplot.TopicFeature.Icon.id && !this.isReadOnly());
this._adjustShapes();
return result;
@@ -336,7 +334,7 @@ mindplot.Topic = new Class({
if (!readOnly) {
// Propagate mouse events ...
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if (!this.isCentralTopic()) {
result.setCursor('move');
} else {
result.setCursor('default');
@@ -346,10 +344,6 @@ mindplot.Topic = new Class({
return result;
},
_getInnerPadding:function () {
throw "this must be implemented";
},
setFontFamily:function (value, updateModel) {
var textShape = this.getTextShape();
textShape.setFontFamily(value);
@@ -397,7 +391,7 @@ mindplot.Topic = new Class({
var model = this.getModel();
var result = model.getFontWeight();
if (!$defined(result)) {
var font = this._defaultFontStyle();
var font = mindplot.TopicStyle.defaultFontStyle(this);
result = font.weight;
}
return result;
@@ -407,7 +401,7 @@ mindplot.Topic = new Class({
var model = this.getModel();
var result = model.getFontFamily();
if (!$defined(result)) {
var font = this._defaultFontStyle();
var font = mindplot.TopicStyle.defaultFontStyle(this);
result = font.font;
}
return result;
@@ -417,7 +411,7 @@ mindplot.Topic = new Class({
var model = this.getModel();
var result = model.getFontColor();
if (!$defined(result)) {
var font = this._defaultFontStyle();
var font = mindplot.TopicStyle.defaultFontStyle(this);
result = font.color;
}
return result;
@@ -427,7 +421,7 @@ mindplot.Topic = new Class({
var model = this.getModel();
var result = model.getFontStyle();
if (!$defined(result)) {
var font = this._defaultFontStyle();
var font = mindplot.TopicStyle.defaultFontStyle(this);
result = font.style;
}
return result;
@@ -437,7 +431,7 @@ mindplot.Topic = new Class({
var model = this.getModel();
var result = model.getFontSize();
if (!$defined(result)) {
var font = this._defaultFontStyle();
var font = mindplot.TopicStyle.defaultFontStyle(this);
result = font.size;
}
return result;
@@ -454,7 +448,7 @@ mindplot.Topic = new Class({
_setText:function (text, updateModel) {
var textShape = this.getTextShape();
textShape.setText(text == null ? this._defaultText() : text);
textShape.setText(text == null ? mindplot.TopicStyle.defaultText(this) : text);
if ($defined(updateModel) && updateModel) {
var model = this.getModel();
@@ -464,7 +458,7 @@ mindplot.Topic = new Class({
setText:function (text) {
// Avoid empty nodes ...
if (text.trim().length == 0) {
if (!text || text.trim().length == 0) {
text = null;
}
@@ -476,7 +470,7 @@ mindplot.Topic = new Class({
var model = this.getModel();
var result = model.getText();
if (!$defined(result)) {
result = this._defaultText();
result = mindplot.TopicStyle.defaultText(this);
}
return result;
},
@@ -504,7 +498,7 @@ mindplot.Topic = new Class({
var model = this.getModel();
var result = model.getBackgroundColor();
if (!$defined(result)) {
result = this._defaultBackgroundColor();
result = mindplot.TopicStyle.defaultBackgroundColor(this);
}
return result;
},
@@ -532,7 +526,7 @@ mindplot.Topic = new Class({
var model = this.getModel();
var result = model.getBorderColor();
if (!$defined(result)) {
result = this._defaultBorderColor();
result = mindplot.TopicStyle.defaultBorderColor(this);
}
return result;
},
@@ -604,7 +598,7 @@ mindplot.Topic = new Class({
areChildrenShrunken:function () {
var model = this.getModel();
return model.areChildrenShrunken();
return model.areChildrenShrunken() && !this.isCentralTopic();
},
isCollapsed:function () {
@@ -633,9 +627,20 @@ mindplot.Topic = new Class({
var elements = this._flatten2DElements(this);
var fade = new mindplot.util.FadeEffect(elements, !value);
fade.addEvent('complete', function () {
// Set focus on the parent node ...
if (value) {
this.setOnFocus(true);
}
});
// Set focus in false for all the children ...
elements.forEach(function (elem) {
if (elem.setOnFocus) {
elem.setOnFocus(false);
}
});
}.bind(this));
fade.start();
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeShrinkEvent, model);
},
@@ -669,7 +674,6 @@ mindplot.Topic = new Class({
showNoteEditor:function () {
var topicId = this.getId();
var model = this.getModel();
var editorModel = {
@@ -826,7 +830,7 @@ mindplot.Topic = new Class({
setBranchVisibility:function (value) {
var current = this;
var parent = this;
while (parent != null && parent.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
while (parent != null && !parent.isCentralTopic()) {
current = parent;
parent = current.getParent();
}
@@ -840,7 +844,14 @@ mindplot.Topic = new Class({
// Hide all children...
this._setChildrenVisibility(value);
// If there there are connection to the node, topic must be hidden.
this._setRelationshipLinesVisibility(value);
// If it's connected, the connection must be rendered.
var outgoingLine = this.getOutgoingLine();
if (outgoingLine) {
outgoingLine.setVisibility(value);
}
},
moveToBack:function () {
@@ -877,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()));
});
},
@@ -1020,9 +1036,9 @@ mindplot.Topic = new Class({
model.setOrder(value);
},
connectTo:function (targetTopic, workspace, isVisible) {
connectTo:function (targetTopic, workspace) {
$assert(!this._outgoingLine, 'Could not connect an already connected node');
$assert(targetTopic != this, 'Cilcular connection are not allowed');
$assert(targetTopic != this, 'Circular connection are not allowed');
$assert(targetTopic, 'Parent Graph can not be null');
$assert(workspace, 'Workspace can not be null');
@@ -1037,9 +1053,8 @@ mindplot.Topic = new Class({
// Create a connection line ...
var outgoingLine = new mindplot.ConnectionLine(this, targetTopic);
if ($defined(isVisible)) {
outgoingLine.setVisibility(isVisible);
}
outgoingLine.setVisibility(false);
this._outgoingLine = outgoingLine;
workspace.appendChild(outgoingLine);
@@ -1071,7 +1086,6 @@ mindplot.Topic = new Class({
if (this.isInWorkspace()) {
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeConnectEvent, {parentNode:targetTopic.getModel(), childNode:this.getModel()});
}
},
appendChild:function (child) {
@@ -1108,7 +1122,7 @@ mindplot.Topic = new Class({
var elem = this.get2DElement();
workspace.appendChild(elem);
if (!this.isInWorkspace()) {
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if (!this.isCentralTopic()) {
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeAdded, this.getModel());
}
@@ -1151,7 +1165,7 @@ mindplot.Topic = new Class({
var textHeight = textShape.getHeight();
textHeight = textHeight != 0 ? textHeight : 20;
var topicPadding = this._getInnerPadding();
var topicPadding = mindplot.TopicStyle.getInnerPadding(this);
// Adjust the icon size to the size of the text ...
var iconGroup = this.getOrBuildIconGroup();
@@ -1194,12 +1208,34 @@ mindplot.Topic = new Class({
var relationships = child.getRelationships();
result = result.concat(relationships);
var innerChilds = this._flatten2DElements(child);
result = result.concat(innerChilds);
if (!child.areChildrenShrunken()) {
var innerChilds = this._flatten2DElements(child);
result = result.concat(innerChilds);
}
}
return result;
},
isChildTopic:function (childTopic) {
var result = (this.getId() == childTopic.getId());
if (!result) {
var children = this.getChildren();
for (var i = 0; i < children.length; i++) {
var parent = children[i];
result = parent.isChildTopic(childTopic);
if (result) {
break;
}
}
}
return result;
},
isCentralTopic:function () {
return this.getModel().getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE;
}
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -41,12 +41,12 @@ mindplot.TopicFeature = {
});
},
createModel:function (id, attributes) {
$assert(id, 'type can not be null');
createModel:function (type, attributes) {
$assert(type, 'type can not be null');
$assert(attributes, 'attributes can not be null');
var model = mindplot.TopicFeature._featuresMetadataById.filter(function (elem) {
return elem.id == id;
return elem.id == type;
})[0].model;
return new model(attributes);
},

View File

@@ -0,0 +1,132 @@
/*
* Copyright [2011] [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.TopicStyle = new Class({
Static:{
_getStyles:function (topic) {
$assert(topic, "topic can not be null");
var result;
if (topic.isCentralTopic()) {
result = mindplot.TopicStyle.STYLES.CENTRAL_TOPIC;
} else {
var targetTopic = topic.getOutgoingConnectedTopic();
if ($defined(targetTopic)) {
if (targetTopic.isCentralTopic()) {
result = mindplot.TopicStyle.STYLES.MAIN_TOPIC;
} else {
result = mindplot.TopicStyle.STYLES.SUB_TOPIC;
}
} else {
result = mindplot.TopicStyle.STYLES.ISOLATED_TOPIC;
}
}
return result;
},
defaultText:function (topic) {
var msgKey = this._getStyles(topic).msgKey;
return $msg(msgKey);
},
defaultFontStyle:function (topic) {
return this._getStyles(topic).fontStyle;
},
defaultBackgroundColor:function (topic) {
return this._getStyles(topic).backgroundColor;
},
defaultBorderColor:function (topic) {
return this._getStyles(topic).borderColor;
},
getInnerPadding:function (topic) {
return this._getStyles(topic).innerPadding;
},
defaultShapeType:function (topic) {
return this._getStyles(topic).shapeType;
}
}
});
mindplot.TopicStyle.STYLES =
{
CENTRAL_TOPIC:{
borderColor:'rgb(57,113,177)',
backgroundColor:'rgb(80,157,192)',
fontStyle:{
font:"Verdana",
size:10,
style:"normal",
weight:"bold",
color:"#ffffff"
},
msgKey:'CENTRAL_TOPIC',
innerPadding:11,
shapeType:mindplot.model.TopicShape.ROUNDED_RECT
},
MAIN_TOPIC:{
borderColor:'rgb(2,59,185)',
backgroundColor:'rgb(224,229,239)',
fontStyle:{
font:"Arial",
size:8,
style:"normal",
weight:"normal",
color:"rgb(82,92,97)"
},
msgKey:'MAIN_TOPIC',
innerPadding:3,
shapeType:mindplot.model.TopicShape.LINE
},
SUB_TOPIC:{
borderColor:'rgb(2,59,185)',
backgroundColor:'rgb(224,229,239)',
fontStyle:{
font:"Arial",
size:6,
style:"normal",
weight:"normal",
color:"rgb(82,92,97)"
},
msgKey:'SUB_TOPIC',
innerPadding:3,
shapeType:mindplot.model.TopicShape.LINE
},
ISOLATED_TOPIC:{
borderColor:'rgb(2,59,185)',
backgroundColor:'rgb(224,229,239)',
fontStyle:{
font:"Verdana",
size:8,
style:"normal",
weight:"normal",
color:"rgb(82,92,97)"
},
msgKey:'ISOLATED_TOPIC',
innerPadding:4,
shapeType:mindplot.model.TopicShape.LINE
}
};

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,45 +0,0 @@
/*
* Copyright [2011] [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();

View File

@@ -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;
}
});

View File

@@ -1,26 +0,0 @@
/*
* Copyright [2011] [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";
}
});

View File

@@ -1,37 +0,0 @@
/*
* Copyright [2011] [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);
}
});

View File

@@ -1,88 +0,0 @@
/*
* Copyright [2011] [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);
};

View File

@@ -1,106 +0,0 @@
/*
* Copyright [2011] [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);
}
}
);

View File

@@ -1,168 +0,0 @@
/*
* Copyright [2011] [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);
};

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -18,7 +18,7 @@
mindplot.commands.AddFeatureToTopicCommand = new Class({
Extends:mindplot.Command,
initialize: function(topicId, featureType, attributes) {
initialize:function (topicId, featureType, attributes) {
$assert($defined(topicId), 'topicId can not be null');
$assert(featureType, 'featureType can not be null');
@@ -28,15 +28,21 @@ mindplot.commands.AddFeatureToTopicCommand = new Class({
this._topicId = topicId;
this._featureType = featureType;
this._attributes = attributes;
this._featureModel = null;
},
execute: function(commandContext) {
execute:function (commandContext) {
var topic = commandContext.findTopics(this._topicId)[0];
var icon = topic.addFeature(this._featureType, this._attributes);
this._featureModel = icon.getModel();
// Feature must be created only one time.
if (!this._featureModel) {
var model = topic.getModel();
this._featureModel = model.createFeature(this._featureType, this._attributes);
}
topic.addFeature(this._featureModel);
},
undoExecute: function(commandContext) {
undoExecute:function (commandContext) {
var topic = commandContext.findTopics(this._topicId)[0];
topic.removeFeature(this._featureModel);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -32,7 +32,7 @@ mindplot.commands.AddTopicCommand = new Class({
this._models.each(function (model, index) {
// Add a new topic ...
var topic = commandContext.createTopic(model, false);
var topic = commandContext.createTopic(model);
// Connect to topic ...
if (this._parentsIds) {
@@ -41,26 +41,36 @@ mindplot.commands.AddTopicCommand = new Class({
var parentTopic = commandContext.findTopics(parentId)[0];
commandContext.connect(topic, parentTopic);
}
}else {
commandContext.addTopic(topic);
}
// Finally, focus ...
// Select just created node ...
var designer = commandContext._designer;
var fade = new mindplot.util.FadeEffect([topic, topic.getOutgoingLine()], true);
fade.addEvent('complete', function () {
designer.onObjectFocusEvent(topic);
topic.setOnFocus(true);
});
fade.start();
designer.onObjectFocusEvent(topic);
topic.setOnFocus(true);
// Render node ...
topic.setVisibility(true);
}.bind(this));
},
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;
}
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -34,9 +34,11 @@ mindplot.commands.DeleteCommand = new Class({
// If a parent has been selected for deletion, the children must be excluded from the delete ...
var topics = this._filterChildren(this._topicIds, commandContext);
if (topics.length > 0) {
topics.each(function (topic) {
// In case that it's editing text node, force close without update ...
topic.closeEditors();
var model = topic.getModel();
// Delete relationships
@@ -76,24 +78,40 @@ mindplot.commands.DeleteCommand = new Class({
undoExecute:function (commandContext) {
var parent = commandContext.findTopics(this._parentTopicIds);
this._deletedTopicModels.each(function (model, index) {
var topic = commandContext.createTopic(model);
// Was the topic connected?
var parentTopic = parent[index];
if (parentTopic != null) {
commandContext.connect(topic, parentTopic);
topic.setOnFocus(true);
}
// Add all the topics ...
this._deletedTopicModels.each(function (model) {
commandContext.createTopic(model);
}, this);
// Do they need to be connected ?
this._deletedTopicModels.each(function (topicModel, index) {
var topics = commandContext.findTopics(topicModel.getId());
var parentId = this._parentTopicIds[index];
if (parentId) {
var parentTopics = commandContext.findTopics(parentId);
commandContext.connect(topics[0], parentTopics[0]);
}
}, this);
// Add rebuild relationships ...
this._deletedRelModel.each(function (model) {
commandContext.addRelationship(model);
}.bind(this));
// Finally display the topics ...
this._deletedTopicModels.each(function (topicModel) {
var topics = commandContext.findTopics(topicModel.getId());
topics[0].setBranchVisibility(true);
}, this);
// Focus on last recovered topic ..
if (this._deletedTopicModels.length > 0) {
var firstTopic = this._deletedTopicModels[0];
var topic = commandContext.findTopics(firstTopic.getId())[0];
topic.setOnFocus(true);
}
this._deletedTopicModels = [];
this._parentTopicIds = [];
this._deletedRelModel = [];
@@ -124,14 +142,26 @@ mindplot.commands.DeleteCommand = new Class({
_collectInDepthRelationships:function (topic) {
var result = [];
result.append(topic.getRelationships());
var children = topic.getChildren();
if (children.length > 0) {
var rels = children.map(function (topic) {
return this._collectInDepthRelationships(topic);
}, this);
result.append(rels.flatten());
} else {
result.append(topic.getRelationships());
var rels = children.map(function (topic) {
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;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -18,22 +18,22 @@
mindplot.commands.DragTopicCommand = new Class({
Extends:mindplot.Command,
initialize:function (topicIds, position, order, parentTopic) {
$assert(topicIds, "topicIds must be defined");
initialize:function (topicId, position, order, parentTopic) {
$assert(topicId, "topicId must be defined");
this._topicsIds = topicIds;
this._topicsId = topicId;
if ($defined(parentTopic))
this._parentId = parentTopic.getId();
this.parent();
this._position = position;
this._order = order;
this._id = mindplot.Command._nextUUID();
},
execute:function (commandContext) {
var topic = commandContext.findTopics([this._topicsIds])[0];
var topic = commandContext.findTopics(this._topicsId)[0];
topic.setVisibility(false);
// Save old position ...
var origParentTopic = topic.getOutgoingConnectedTopic();
@@ -60,7 +60,7 @@ mindplot.commands.DragTopicCommand = new Class({
if (origParentTopic != this._parentId) {
if ($defined(this._parentId)) {
var parentTopic = commandContext.findTopics([this._parentId])[0];
var parentTopic = commandContext.findTopics(this._parentId)[0];
commandContext.connect(topic, parentTopic);
}
@@ -70,6 +70,7 @@ mindplot.commands.DragTopicCommand = new Class({
this._parentId = origParentTopic.getId();
}
}
topic.setVisibility(true);
// Store for undo ...
this._order = origOrder;

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -18,35 +18,51 @@
mindplot.commands.GenericFunctionCommand = new Class({
Extends:mindplot.Command,
initialize: function(commandFunc, topicsIds,value) {
initialize:function (commandFunc, topicsIds, value) {
$assert(commandFunc, "commandFunc must be defined");
$assert($defined(topicsIds), "topicsIds must be defined");
this.parent();
this._value = value;
this._topicsIds = topicsIds;
this._topicsId = topicsIds;
this._commandFunc = commandFunc;
this._oldValues = [];
},
execute: function(commandContext) {
execute:function (commandContext) {
if (!this.applied) {
var topics = commandContext.findTopics(this._topicsIds);
topics.each(function(topic) {
var oldValue = this._commandFunc(topic, this._value);
this._oldValues.push(oldValue);
}.bind(this));
var topics = null;
try {
topics = commandContext.findTopics(this._topicsId);
} catch (e) {
if (this._commandFunc.commandType != "changeTextToTopic") {
// Workaround: For some reason, there is a combination of events that involves
// making some modification and firing out of focus event. This is causing
// that a remove node try to be removed. In some other life, I will come with the solution.
// Almost aways occurs with IE9. I could be related with some change of order in sets o something similar.
throw e;
}
}
if (topics != null) {
topics.each(function (topic) {
var oldValue = this._commandFunc(topic, this._value);
this._oldValues.push(oldValue);
}.bind(this));
}
this.applied = true;
} else {
throw "Command can not be applied two times in a row.";
}
},
undoExecute: function(commandContext) {
undoExecute:function (commandContext) {
if (this.applied) {
var topics = commandContext.findTopics(this._topicsIds);
topics.each(function(topic, index) {
var topics = commandContext.findTopics(this._topicsId);
topics.each(function (topic, index) {
this._commandFunc(topic, this._oldValues[index]);
}.bind(this));

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -18,7 +18,7 @@
mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
Extends:mindplot.Command,
initialize: function(topicId, featureId) {
initialize:function (topicId, featureId) {
$assert($defined(topicId), 'topicId can not be null');
$assert(featureId, 'iconModel can not be null');
@@ -28,19 +28,16 @@ mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
this._oldFeature = null;
},
execute: function(commandContext) {
execute:function (commandContext) {
var topic = commandContext.findTopics(this._topicId)[0];
var feature = topic.findFeatureById(this._featureId);
topic.removeFeature(feature);
this._oldFeature = feature;
},
undoExecute: function(commandContext) {
undoExecute:function (commandContext) {
var topic = commandContext.findTopics(this._topicId)[0];
var feature = this._oldFeature;
topic.addFeature(feature.getType(), feature.getAttributes());
topic.addFeature(this._oldFeature);
this._oldFeature = null;
}
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -84,7 +84,7 @@ mindplot.layout.RootedTreeSet = new Class({
}
}
validate = !$defined(validate) ? true : validate;
$assert(validate ? result : true, 'node could not be found id:' + id);
$assert(validate ? result : true, 'node could not be found id:' + id + "\n,RootedTreeSet" + this.dump());
return result;
},

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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
@@ -17,54 +17,60 @@
*/
mindplot.model.FeatureModel = new Class({
initialize:function(type) {
$assert(type, 'type can not be null');
Static:{
_nextUUID:function () {
if (!$defined(mindplot.model.FeatureModel._uuid)) {
mindplot.model.FeatureModel._uuid = 0;
}
mindplot.model.FeatureModel._uuid = mindplot.model.FeatureModel._uuid + 1;
return mindplot.model.FeatureModel._uuid;
}
},
initialize:function (type) {
$assert(type, 'type can not be null');
this._id = mindplot.model.FeatureModel._nextUUID();
this._type = type;
this._attributes = {};
// Create type method ...
this['is' + type.camelCase() + 'Model'] = function() {
this['is' + type.camelCase() + 'Model'] = function () {
return true;
};
},
getAttributes : function() {
getAttributes:function () {
return Object.clone(this._attributes);
},
setAttributes : function(attributes) {
setAttributes:function (attributes) {
for (key in attributes) {
this["set" + key.capitalize()](attributes[key]);
}
},
setAttribute : function(key, value) {
setAttribute:function (key, value) {
$assert(key, 'key id can not be null');
this._attributes[key] = value;
},
getAttribute : function(key) {
getAttribute:function (key) {
$assert(key, 'key id can not be null');
return this._attributes[key];
},
getId : function() {
getId:function () {
return this._id;
},
getType:function() {
setId:function (id) {
this._id = id;
},
getType:function () {
return this._type;
}
});
mindplot.model.FeatureModel._nextUUID = function() {
if (!$defined(this._uuid)) {
this._uuid = 0;
}
this._uuid = this._uuid + 1;
return this._uuid;
};
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* 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

Some files were not shown because too many files have changed in this diff Show More