├── .gitignore ├── .gitmodules ├── README.md ├── _src └── wise-webapp │ └── src │ └── main │ ├── java │ └── com │ │ └── wisemapping │ │ └── mail │ │ └── NotificationService.java │ └── resources │ ├── mail │ ├── baseLayout.vm │ ├── confirmationMail.vm │ └── newCollaboration.vm │ ├── messages_fr.properties │ └── samples │ └── tutorial.vm ├── contexts └── wisemapping.xml ├── etc └── jetty.xml ├── service └── wisemapping └── webapps └── wisemapping ├── WEB-INF └── lib │ └── wise-webapp-4.0.3.jar ├── css └── pageHeaders.css ├── favicon.ico ├── framindmap.html ├── images ├── favicon.ico ├── framindmap.png └── mindmaps.png ├── js └── mindplot-min.js ├── jsp ├── accountSettings.jsp ├── footer.jsp ├── framindmap.jsp ├── header.jsp ├── labelIconList.jsp ├── login.jsp ├── mindmapEditor.jsp ├── mindmapEmbed.jsp ├── mindmapExport.jsp ├── mindmapHistory.jsp ├── mindmapList.jsp ├── mindmapPrint.jsp ├── mindmapPublish.jsp ├── mindmapShare.jsp ├── template.jsp ├── termsOfUse.jsp ├── userForgotPassword.jsp ├── userForgotPasswordError.jsp ├── userForgotPasswordSuccess.jsp ├── userRegistration.jsp └── userRegistrationSuccess.jsp └── mindmaps ├── README.md ├── about.html ├── cache.appcache ├── css ├── Aristo │ ├── images │ │ ├── bg_fallback.png │ │ ├── icon_sprite.png │ │ ├── progress_bar.gif │ │ ├── slider_handles.png │ │ ├── ui-icons_222222_256x240.png │ │ └── ui-icons_454545_256x240.png │ └── jquery-ui-1.8.7.custom.css ├── about.css ├── app.css ├── common.css ├── common.css_new └── minicolors │ ├── images │ ├── circle.gif │ ├── gradient.png │ ├── line.gif │ ├── rainbow.png │ └── trigger.png │ └── jquery.miniColors.css ├── img ├── closedhand.png ├── creator-nub-sprite.png ├── favicon.png ├── grid.gif ├── octopus_orange_ombre_pt.png ├── openhand.png ├── plus-minus.png └── transparent.png ├── index.html ├── index.jsp ├── js ├── Action.js ├── ApplicationController.js ├── AutoSaveController.js ├── CanvasDrawingTools.js ├── CanvasPresenter.js ├── CanvasView.js ├── ClipboardController.js ├── Command.js ├── CommandRegistry.js ├── Document.js ├── Event.js ├── ExportMap.js ├── FloatPanel.js ├── HelpController.js ├── Inspector.js ├── MainViewController.js ├── MindMap.js ├── MindMapModel.js ├── MindMaps.js ├── Navigator.js ├── NewDocument.js ├── Node.js ├── NodeMap.js ├── Notification.js ├── OpenDocument.js ├── Point.js ├── PrintController.js ├── SaveDocument.js ├── ShortcutController.js ├── StaticCanvas.js ├── StatusBar.js ├── Storage.js ├── ToolBar.js ├── UndoController.js ├── UndoManager.js ├── Util.js ├── ZoomController.js ├── jquery-1.6.1.min.js └── libs │ ├── downloadify.min.js │ ├── dragscrollable.js │ ├── events.js │ ├── jquery-ui-1.8.11.custom.complete.min.js │ ├── jquery-ui-1.8.11.custom.min.js │ ├── jquery.hotkeys.js │ ├── jquery.minicolors.js │ ├── jquery.mousewheel.js │ ├── jquery.tmpl.js │ └── swfobject.js └── media └── downloadify.swf /.gitignore: -------------------------------------------------------------------------------- 1 | */target 2 | */*.iml 3 | wisemapping.ipr 4 | wisemapping.iws 5 | wisemapping.iml 6 | wisemapping.ids 7 | wise-webapp/wisemapping.log* 8 | wisemapping.log* 9 | */.DS_Store 10 | .DS_Store 11 | target 12 | .idea 13 | */*.bak 14 | */*.save 15 | webapps/wisemapping/nav 16 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "webapps/wisemapping/nav"] 2 | path = webapps/wisemapping/nav 3 | url = https://git.framasoft.org/framasoft/framanav.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![](https://framagit.org/assets/favicon-075eba76312e8421991a0c1f89a89ee81678bcde72319dd3e8047e2a47cd3a42.ico)](https://framagit.org) 2 | 3 | ![English:](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/20px-Flag_of_the_United_Kingdom.svg.png) **Framasoft uses GitLab** for the development of its free softwares. Our Github repositories are only mirrors. 4 | If you want to work with us, **fork us on [framagit.org](https://framagit.org)**. (no registration needed, you can sign in with your Github account) 5 | 6 | ![Français :](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_France.svg/20px-Flag_of_France.svg.png) **Framasoft utilise GitLab** pour le développement de ses logiciels libres. Nos dépôts Github ne sont que des miroirs. 7 | Si vous souhaitez travailler avec nous, **forkez-nous sur [framagit.org](https://framagit.org)**. (l'inscription n'est pas nécessaire, vous pouvez vous connecter avec votre compte Github) 8 | * * * 9 | 10 | Framindmap 11 | ========== 12 | 13 | Framindmap permet de créer des cartes mentales (aussi appelées « cartes heuristiques »). 14 | 15 | Il repose sur le logciel libre [Wisemapping](http://www.wisemapping.com/) dont [le code source se trouve sur ce site](https://bitbucket.org/wisemapping/wisemapping-open-source). 16 | Wisemapping est sous [licence WPL](https://wisemapping.atlassian.net/wiki/pages/viewpage.action?pageId=524357) 17 | Pour l'installer, consultez [le tutoriel sur Framacloud.org](http://framacloud.org/cultiver-son-jardin/installation-de-wisemapping/) 18 | 19 | 20 | Ce dépôt contient également le [logiciel Mindmaps](https://github.com/drichard/mindmaps) de David Richard traduit en français et précompilée. 21 | Ce logiciel est sous licence AGPLv3 22 | La traduction s'est faite directement dans le code html du fichier framindmap.html (= index.html de la version drichard). 23 | Ce logiciel était proposé par défaut comme service en ligne par l'association Framasoft de 2012 à novembre 2014 sur le site : 24 | https://framindmap.org/ 25 | 26 | 27 | -------------------------------------------------------------------------------- /_src/wise-webapp/src/main/resources/mail/baseLayout.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 | 6 | 7 | 8 | 14 | 17 | 18 | 19 |
10 | 11 |

Framindmap

12 |
13 |
15 | ${messageTitle} 16 |
20 |
21 |
22 |

Bonjour ${firstName},

23 |

24 | ${messageBody} 25 |

26 | 27 |

Cordialement,
28 | L’équipe Framasoft
29 |

30 |

--
« La route est longue, mais la voie est libre... »
31 | Framasoft ne vit que par vos dons (déductibles des impôts).
32 | Merci d’avance pour votre soutien https://soutenir.framasoft.org.

33 | 34 |
35 |
36 | 37 |

Important : Ne répondez pas à ce mail. Si vous avez besoin d’aide ou pensez avoir reçu ce mail par erreur, contactez-nous. 38 |

39 | 40 | -------------------------------------------------------------------------------- /_src/wise-webapp/src/main/resources/mail/confirmationMail.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Bienvenue sur Framindmap !

4 | 5 |

6 | Pour activer votre compte et vérifier votre adresse e-mail, cliquez sur le lien suivant. 7 |

8 | ${emailcheck} 9 |

10 |

11 | Si vous avez reçu ce mail par erreur, vous n'avez rien à faire pour supprimer votre compte. 12 | Votre compte ne sera tout simplement pas activé et vous ne recevrez pas d’autre email de notre part. 13 |

14 | 15 |

16 | Si vous ne parvenez pas à cliquer sur le lien ci-dessus, 17 | copiez et coller l’URL dans la barre d’adresse de votre navigateur web. 18 |

19 | 20 |

21 | Si vous avez des questions relatives à l’utilisation de votre compte, contactez-nous. 22 |

23 | 24 |

25 | Cordialement,
26 | L’équipe Framasoft. 27 |

28 |

--
« La route est longue, mais la voie est libre... »
29 | Framasoft ne vit que par vos dons (déductibles des impôts).
30 | Merci d’avance pour votre soutien https://soutenir.framasoft.org.

31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /_src/wise-webapp/src/main/resources/mail/newCollaboration.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 | 6 | 7 | 8 | 14 | 18 | 19 | 20 |
10 | 11 |

Framindmap

12 |
13 |
Cette carte mentale 16 | ${mindmap.title} a été partagée avec vous. 17 |
21 |
22 |
23 |

Message de ${senderMail} :

24 | #if($message ) 25 |
${message}
26 | #end 27 |

Cliquez sur le lien suivant pour ouvrir la carte mentale : ${mindmap.title}

28 | 29 |

Si vous n’avez pas de compte sur Framindmap, vous pouvez créer un compte gratuitement et librement.

30 | 31 |

Cordialement,
32 | L’équipe Framasoft
33 |

34 |

--
« La route est longue, mais la voie est libre... »
35 | Framasoft ne vit que par vos dons (déductibles des impôts).
36 | Merci d’avance pour votre soutien https://soutenir.framasoft.org.

37 | 38 |
39 |
40 | 41 |

Important : Ne répondez pas à ce mail. Si vous avez besoin d’aide ou pensez avoir reçu ce mail par erreur, contactez-nous. 42 |

43 | 44 | -------------------------------------------------------------------------------- /_src/wise-webapp/src/main/resources/samples/tutorial.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 34 | 36 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /contexts/wisemapping.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | / 23 | /webapps/wisemapping 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | 43 | 44 | 51 | 52 | 53 | 54 | 55 | Test Realm 56 | /etc/realm.properties 57 | 58 | 59 | 60 | 64 | 65 | 66 | true 67 | 68 | 69 | 70 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /etc/jetty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 10 27 | 200 28 | false 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 300000 42 | 2 43 | false 44 | 8443 45 | 20000 46 | 5000 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | true 73 | true 74 | true 75 | 1000 76 | false 77 | false 78 | 79 | 80 | 81 | org.eclipse.jetty.server.Request.maxFormContentSize 82 | 500000 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /service/wisemapping: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ### BEGIN INIT INFO 3 | # Provides: wisemapping 4 | # Required-Start: $all 5 | # Required-Stop: 6 | # Default-Start: 2 3 4 5 7 | # Default-Stop: 0 1 6 8 | # Short-Description: wisemapping 9 | # Description: www.wisemapping.com 10 | ### END INIT INFO 11 | 12 | set -e 13 | set -u 14 | 15 | #environmental variables 16 | JAVA_HOME="/usr/lib/jvm/java7" 17 | JDK_HOME=$JAVA_HOME 18 | export PATH=$JAVA_HOME/bin:$PATH 19 | WISE_HOME="/opt/wisemapping" 20 | PID_FILE="$WISE_HOME/.pid" 21 | SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) 22 | 23 | preInitChecks() { 24 | MYSQL_STATUS=`pgrep mysql` 25 | if [ -z $MYSQL_STATUS ]; then 26 | service mysql start >/dev/null 2>&1 27 | fi 28 | } 29 | 30 | wiseStatus() { 31 | echo `pgrep -f "$WISE_HOME/start.jar"` 32 | } 33 | 34 | case "${1:-''}" in 35 | 'start') 36 | #preInitChecks 37 | cd $WISE_HOME 38 | echo "Starting Wisemapping..." 39 | java -Xmx256m -Dorg.apache.jasper.compiler.disablejsr199=true -jar $WISE_HOME/start.jar > $WISE_HOME/logs/start.log 2>&1 & 40 | PID=$! 41 | cd - >/dev/null 2>&1 42 | echo "proccess id: $PID" 43 | echo "$PID" > $PID_FILE 44 | ;; 45 | 'stop') 46 | if [ ! -f $PID_FILE ]; then 47 | PID=$(wiseStatus) 48 | else 49 | PID=`cat $PID_FILE` 50 | rm $PID_FILE >/dev/null 2>&1 51 | fi 52 | kill $PID 53 | echo "Wisemapping stopped" 54 | ;; 55 | 'restart') 56 | set +e; $SELF stop; set -e 57 | $SELF start 58 | ;; 59 | 'status') 60 | STATUS=$(wiseStatus) 61 | if [ -n "$STATUS" ]; then 62 | echo "Wisemapping server is running, pid: $STATUS" 63 | else 64 | echo "Wisemapping is stopped" 65 | fi 66 | ;; 67 | 68 | *) 69 | echo "Usage: $SELF start|stop|restart|status" 70 | exit 1 71 | ;; 72 | esac 73 | -------------------------------------------------------------------------------- /webapps/wisemapping/WEB-INF/lib/wise-webapp-4.0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/WEB-INF/lib/wise-webapp-4.0.3.jar -------------------------------------------------------------------------------- /webapps/wisemapping/css/pageHeaders.css: -------------------------------------------------------------------------------- 1 | /* HEADER STYLES */ 2 | 3 | html,body { 4 | margin: 0; 5 | padding: 0; 6 | height: 100%; 7 | } 8 | 9 | body { 10 | background:#eee; 11 | } 12 | 13 | .ombre { 14 | background:#fff; 15 | -webkit-box-shadow: -4px 6px 9px rgba(50, 50, 50, 0.5); 16 | -moz-box-shadow: -4px 6px 9px rgba(50, 50, 50, 0.5); 17 | box-shadow: -4px 6px 9px rgba(50, 50, 50, 0.5); 18 | margin-bottom: 20px; 19 | } 20 | 21 | .trait { 22 | background-color: #EEE; 23 | height: 11px; 24 | margin:15px 0px; 25 | border:none; 26 | } 27 | 28 | #map-table { 29 | margin-left:-10px; 30 | } 31 | 32 | main, header, footer { 33 | padding : 10px 30px; 34 | } 35 | 36 | main { 37 | padding-bottom:25px; 38 | } 39 | 40 | .jumbotron { 41 | background:transparent; 42 | } 43 | 44 | #header { 45 | margin-top: 0; 46 | /* height: 78px; 47 | width: 100%;*/ 48 | background: transparent; 49 | /* border-bottom: 1px solid #bbb4d6; 50 | position: absolute; 51 | top: 0; 52 | left: 0;*/ 53 | } 54 | 55 | #headerToolbar { 56 | height: 35px; 57 | /* width: 100%; 58 | background-color: #171a17; 59 | border-top: 1px solid #999999; 60 | border-bottom: 1px solid #424141;*/ 61 | color: #666; 62 | } 63 | 64 | #headerContent { 65 | /* width: 800px; 66 | height: 78px;*/ 67 | position: relative; 68 | top: 0; 69 | left: 0; 70 | margin: auto; 71 | } 72 | 73 | #headerLogo { 74 | margin-top: 23px; 75 | height: 80px; 76 | width: 160px; 77 | background: url("../images/logo-medium.png") no-repeat; 78 | position: absolute; 79 | top: 0; 80 | left: -50px; 81 | } 82 | 83 | #headerContent h1 { 84 | font-family: "DejaVu Sans","Verdana","Geneva","sans serif"; 85 | font-weight: bold; 86 | font-size:50px; 87 | } 88 | 89 | #headerContent a { 90 | text-decoration:none; 91 | } 92 | 93 | #headerButtons { 94 | position: absolute; 95 | top: 65px; 96 | left: 150px; 97 | } 98 | 99 | #aboutLink, #faqLink, #feedbackLink, #logoutLink { 100 | float: right; 101 | z-index: 300; 102 | } 103 | 104 | div#headerButtons a { 105 | float: left; 106 | color: #666; 107 | padding: 0 10px; 108 | text-decoration: none; 109 | font-weight: bold; 110 | font-size: 120%; 111 | white-space: nowrap; 112 | } 113 | 114 | div#headerTitle { 115 | float: left; 116 | font-weight: bold; 117 | font-size: 15px; 118 | margin-right: 5px; 119 | margin-left: 5px; 120 | } 121 | 122 | span#headerSubTitle { 123 | font-weight: lighter; 124 | font-size: 12px; 125 | } 126 | 127 | div#headerButtons a:hover { 128 | /*text-decoration: underline;*/ 129 | color: #777; 130 | } 131 | 132 | div#headerButtons activelink a, div#headerButtons activelink a:hover { 133 | text-decoration: none; 134 | border-top: 0; 135 | border-bottom: 0; 136 | } 137 | 138 | 139 | #headerLogo { 140 | cursor: pointer; 141 | } 142 | 143 | div#headerActions { 144 | padding: 7px 0; 145 | /* position: absolute; 146 | right: 0; 147 | z-index: 50; 148 | margin-right: 80px;*/ 149 | text-align:right; 150 | color:#767676; 151 | margin-right:-15px; 152 | } 153 | 154 | div#headerActions a { 155 | color:#666; 156 | padding:10px 15px; 157 | text-decoration:none; 158 | font-weight:bold; 159 | } 160 | 161 | div#headerActions a:hover, 162 | div#headerActions a:focus { 163 | color: white; 164 | background-color:#767676; 165 | text-decoration:none; 166 | } 167 | -------------------------------------------------------------------------------- /webapps/wisemapping/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/favicon.ico -------------------------------------------------------------------------------- /webapps/wisemapping/framindmap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /webapps/wisemapping/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/images/favicon.ico -------------------------------------------------------------------------------- /webapps/wisemapping/images/framindmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/images/framindmap.png -------------------------------------------------------------------------------- /webapps/wisemapping/images/mindmaps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/images/mindmaps.png -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/footer.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 2 | <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | 4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/framindmap.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | 3 |
4 |

Framindmap permet de créer et partager des cartes mentales (aussi appelées « cartes heuristiques »).

5 |

Pourquoi créer une carte mentale ?

6 | 13 |

Pourquoi utiliser Framindmap ?

14 | 22 |
23 | 24 | 25 |
26 |
27 |
28 |

Tutoriel vidéo

29 |

30 |

Pour vous aider dans l'utilisation du logiciel, voici un tutoriel vidéo réalisé par Claire Cassaigne pour le site FenetreSur

31 |

Lire la vidéo »

32 | 33 | 34 | 54 | 55 |
56 | 57 |
58 |

Le logiciel

59 |

60 |

Framindmap repose sur le logiciel libre Wisemapping.

61 |

Ce logiciel est compatible avec les navigateurs web suivants :

62 | 69 |

Il est sous licence WPL.

70 |
71 |
72 |

Cultivez votre jardin

73 |

74 |

Pour participer au développement du logiciel, proposer des améliorations 75 | ou simplement le télécharger, rendez-vous sur le site de développement.

76 |
77 |

Si vous souhaitez installer ce logiciel pour votre propre usage et ainsi gagner en autonomie, nous vous aidons sur :

78 |

framacloud.org

79 |
80 |
81 |
82 |
83 |
84 |
85 | 86 |

Mindmaps

87 |

Auparavant, Framindmap reposait sur le logiciel Mindmaps de David Richard.
88 | Ce logiciel dispose d'une interface plus simple et ne nécessite ni de créer un compte ni de faire transiter vos données sur notre serveur. 89 | Si vous le souhaitez vous pouvez toujours l'utiliser ici :

90 |

Créer une carte mentale avec Mindmaps »

91 |
92 |
93 |
94 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/header.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | 3 | <%@ page import="com.wisemapping.model.User" %> 4 | <%@ page import="com.wisemapping.security.Utils" %> 5 | <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> 6 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 7 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 8 | 9 | <% 10 | User user = Utils.getUser(false); 11 | if (user != null) { 12 | request.setAttribute("principal", user); 13 | } 14 | %> 15 | 16 | 31 | 49 |
50 | 51 |
52 | 53 |

Framindmap

54 |
55 | 56 |
57 |
58 |
59 | 60 | 61 | 81 | 82 |
83 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/labelIconList.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | 3 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/login.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@ include file="/jsp/init.jsp" %> 3 | 4 | <%--@elvariable id="isHsql" type="boolean"--%> 5 | 6 | 7 | 29 | 30 |
31 | 32 | 33 | 34 |
35 |
36 | 37 |
38 |
39 |
40 |
41 |
42 | 43 |
44 | 45 |
46 |


47 |
48 | Se connecter » 49 |
50 |
51 | Créer un compte » 52 |
53 |
54 | 55 | 56 | 57 |
58 |
59 |
60 |

Se connecter

61 |
62 |
63 | 64 | 65 |
66 | 74 | 76 |
77 | 78 | 79 |
80 |
81 |
82 |
83 | 84 |
85 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/mindmapEditor.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="com.wisemapping.security.Utils" %> 2 | <%@ page import="com.wisemapping.model.User" %> 3 | <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> 4 | <%@ include file="/jsp/init.jsp" %> 5 | 6 | 7 | 8 | <%--@elvariable id="mindmap" type="com.wisemapping.model.Mindmap"--%> 9 | <%--@elvariable id="editorTryMode" type="java.lang.Boolean"--%> 10 | <%--@elvariable id="editorTryMode" type="java.lang.String"--%> 11 | <%--@elvariable id="lockInfo" type="com.wisemapping.service.LockInfo"--%> 12 | 13 | 14 | 15 | 16 | Framindmap - <c:out value="${mindmap.title}"/> 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 83 | <%@ include file="/jsp/googleAnalytics.jsf" %> 84 | 85 | 86 | 87 |
88 | 89 | 116 | 117 | 124 | 125 |
126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/mindmapEmbed.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 | 4 | 5 | 6 | <%--@elvariable id="mindmap" type="com.wisemapping.model.Mindmap"--%> 7 | <%--@elvariable id="editorTryMode" type="java.lang.Boolean"--%> 8 | <%--@elvariable id="editorTryMode" type="java.lang.String"--%> 9 | 10 | 11 | 12 | 13 | 14 | Framindmap - ${mindmap.title} 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 63 | 64 | 65 |
66 |
67 | 68 |
69 | 70 | Framindmap 71 | 72 | 73 |
74 |
75 | 76 |
77 | : 78 | : 79 |
80 |
81 |
82 | 83 | <%@ include file="/jsp/googleAnalytics.jsf" %> 84 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/mindmapExport.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 | 4 | 5 |
6 | 9 | 12 |
14 | 15 | 16 | 17 | 18 |
19 | 23 | 24 | 29 | 30 | 35 | 36 | 41 | 42 | 58 | 59 | 64 | 65 | 76 |
77 |
78 | 81 | 82 |
83 | 84 | 85 | 100 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/mindmapHistory.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 | 4 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 | 73 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/mindmapPrint.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 | 4 | <%--@elvariable id="mindmap" type="com.wisemapping.model.Mindmap"--%> 5 | <%--@elvariable id="editorTryMode" type="java.lang.Boolean"--%> 6 | <%--@elvariable id="editorTryMode" type="java.lang.String"--%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | Framindmap - ${mindmap.title} 14 | 15 | 18 | 19 | 20 | 21 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 100 | 101 | 102 | 103 |
104 |
105 | 106 | 107 |
108 | 109 | Framindmap 110 | 111 | 112 |
113 |
114 | 115 |
116 | : 117 | : 118 |
119 |
120 |
121 | 122 | <%@ include file="/jsp/googleAnalytics.jsf" %> 123 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/mindmapPublish.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 | 4 | 10 | 11 |
12 | 18 |
19 | 20 |

21 |

22 | 23 |
24 | 25 | 29 |
30 |
31 |
32 | 33 |
34 |
35 |
36 | 37 |
38 | 39 |
40 |
41 |
42 | 43 |
44 | 45 |
46 |
47 |
48 | 49 |
50 | 51 |
52 |
53 |
54 |
55 | 56 | 58 |
59 | 60 |
61 |

Copiez-collez le lien ci-dessous pour le partager

62 | 65 |
66 |
67 |
68 | 69 | 137 | 138 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/template.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 | 4 | 5 | 6 | <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Framindmap - 20 | <c:choose> 21 | <c:when test="${requestScope.viewTitle!=null}"> 22 | ${requestScope.viewTitle} 23 | </c:when> 24 | <c:otherwise> 25 | <spring:message code="${requestScope.title}"/> 26 | </c:otherwise> 27 | </c:choose> 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
40 | 41 | 42 | 43 | 44 |
45 |
46 |
47 | 48 |
49 |
50 |
51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/userForgotPassword.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 |

4 | 5 |

6 | 7 |

Merci de saisir votre adresse email pour nous aider à retrouver votre compte.

8 | 9 | 10 | 11 |
12 | 13 |
14 | " class="btn btn-primary" 15 | data-loading-text=""/> 16 | " class="btn" 17 | onclick="window.location=''"/> 18 |
19 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/userForgotPasswordError.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 | 4 |

5 | 6 |

Si le problème persiste, contactez-nous depuis ce formulaire.

7 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/userForgotPasswordSuccess.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 | 4 |

5 | Un mot de passe temporaire vous a été envoyé 6 |

7 | 8 |

9 | Nous vous avons envoyé un email qui vous permettra de réinitialiser votre mot de passe. Veuillez vérifier vos emails dès à présent. 10 |

11 | 12 |

13 | Si vous rencontrez un problème pour recevoir cet email, contactez-nous depuis ce formulaire. 14 |

15 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/userRegistration.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 |
4 | 5 | 43 | 44 |
45 |


46 |
47 | Se connecter » 48 |
49 |
50 | Créer un compte » 51 |
52 |
53 | 54 | 55 | 56 |
57 |
58 |
59 |

Se connecter

60 |
61 |
62 | 63 | 64 |
65 | 73 | 75 |
76 | 77 | 78 |
79 |
80 |
81 |
82 | 83 |
84 |
85 |
86 |

Créer un compte

87 | 88 | 89 |
90 | 91 |
92 | 93 | 94 |
95 |
96 |
97 | 98 | 99 |
100 | 101 | 102 |
103 |
104 |
105 | 106 | 107 |
108 | 109 | 110 |
111 |
112 |
113 | 114 | 115 |
116 | 117 | 118 |
119 |
120 |
121 | 123 |
124 | 125 | 126 |
127 |
128 | 138 |
139 |

140 | Tous les champs de ce formulaire sont requis pour le bon fonctionnement du logiciel. 141 | Cependant, il n'est pas nécessaire que vous nous donniez votre véritable identité. 142 |

143 |

Merci de vérifier les informations que vous avez saisies et de relire les Conditions Générales d'Utilisation.

144 |

En cliquant sur le bouton « Créer le compte » ci-dessous, vous vous engagez à les respecter.

145 |

146 | 149 |

150 |
151 | 152 |
153 |
154 |
155 | 156 |
157 | -------------------------------------------------------------------------------- /webapps/wisemapping/jsp/userRegistrationSuccess.jsp: -------------------------------------------------------------------------------- 1 | <%@page pageEncoding="UTF-8" %> 2 | <%@include file="/jsp/init.jsp" %> 3 | 4 |
5 |

Merci de vous être inscrit !

6 | 7 |

8 | 9 |

10 |
11 | 12 |

13 | Thanks so much for your interest in WiseMapping. 14 |

15 |
16 | 17 |

18 | If you have any questions or have any feedback, please don't hesitate to use the on line form. 19 | We'd love to hear from you. 20 |

21 |
22 | 23 |

24 | Votre compte a été créé, vous pouvez vous connecter dès à presént et commencer à apprécier Framindmap. 25 |

26 | 27 |
28 |
29 |

Se connecter

30 |
31 |
32 | 33 | 34 |
35 | 43 | 45 |
46 | 47 | 48 |
49 |
50 |
51 |
52 | 53 | 54 |
55 | 56 |
57 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/README.md: -------------------------------------------------------------------------------- 1 | Framindmap 2 | ========== 3 | 4 | Framindmap permet de créer des cartes mentales (aussi appelées « cartes heuristiques »). 5 | 6 | C'est la version traduite en français et précompilée du logiciel mindmaps de David Richard : 7 | https://github.com/drichard/mindmaps 8 | Le logiciel est sous licence AGPLv3 9 | 10 | Cette version est nettoyée des éléments spécifiques à Framasoft (page d'accueil, barre de navigation et script de tracking). 11 | La traduction s'est faite directement dans le code html du fichier framindmap.html (= index.html de la version drichard). 12 | 13 | L'installation se fait par simple copier/coller des fichiers sur un serveur web (c'est juste du html/css/javascript). 14 | 15 | Ce logiciel est proposé comme service en ligne par l'association Framasoft depuis 2012 sur le site : 16 | http://framindmap.org/ 17 | 18 | 19 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mindmaps 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 27 |
28 |
29 |
30 |

À propos

31 |
32 |
33 |

34 | Framindmap est une application de "mind mapping" qu'on peut traduire en français par "carte heuristique" ou "carte mentale". 35 |

36 |

37 | Il s'agit de la version française, traduite par l'association Framasoft, de l'application "mindmaps" créée par David Richard. 39 |

40 |
41 |
42 |
43 |
44 |

Licence

45 |
46 |
47 |

Framindmap est placé sous licence libre AGPL

48 |
49 |
50 |
51 |
52 |

Configuration minimale

53 |
54 |
55 |

Vous avez besoin d'un navigateur récent supportant les fonctionnalités du HTML5. 56 | Chrome 10+, Firefox 3.6+, Safari 5+, Opera 10.6+, IE9+ devraient fonctionner correctement.

57 |
58 |
59 |
60 | 64 | 65 |
66 |
67 |
68 | 69 | 70 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/cache.appcache: -------------------------------------------------------------------------------- 1 | CACHE MANIFEST 2 | # timestamp {{timestamp}} 3 | 4 | CACHE: 5 | index.html 6 | about.html 7 | css/Aristo/images/bg_fallback.png 8 | css/Aristo/images/icon_sprite.png 9 | css/Aristo/images/progress_bar.gif 10 | css/Aristo/images/slider_handles.png 11 | css/Aristo/images/ui-icons_222222_256x240.png 12 | css/Aristo/images/ui-icons_454545_256x240.png 13 | css/Aristo/jquery-ui-1.8.7.custom.css 14 | css/minicolors/images/circle.gif 15 | css/minicolors/images/gradient.png 16 | css/minicolors/images/line.gif 17 | css/minicolors/images/rainbow.png 18 | css/minicolors/images/trigger.png 19 | css/minicolors/jquery.miniColors.css 20 | css/common.css 21 | css/app.css 22 | css/about.css 23 | img/favicon.png 24 | img/creator-nub-sprite.png 25 | img/grid.gif 26 | img/plus-minus.png 27 | img/transparent.png 28 | js/script.js 29 | media/downloadify.swf 30 | http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js 31 | 32 | NETWORK: 33 | * -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/bg_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/Aristo/images/bg_fallback.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/icon_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/Aristo/images/icon_sprite.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/progress_bar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/Aristo/images/progress_bar.gif -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/slider_handles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/Aristo/images/slider_handles.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/Aristo/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/Aristo/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/about.css: -------------------------------------------------------------------------------- 1 | /* 2 | * USER STYLES 3 | */ 4 | html,body { 5 | height: 100% 6 | } 7 | 8 | a { 9 | color: inherit; 10 | } 11 | 12 | em { 13 | font-style: italic; 14 | } 15 | 16 | strong { 17 | font-weight: bold; 18 | } 19 | 20 | 21 | #wrap { 22 | background: #75a8c4; /* Old browsers */ 23 | background: -moz-linear-gradient(top, #75a8c4 7%, #ffffff 100%); 24 | /* FF3.6+ */ 25 | background: -webkit-gradient(linear, left top, left bottom, color-stop(7%, #75a8c4), 26 | color-stop(100%, #ffffff) ); /* Chrome,Safari4+ */ 27 | background: -webkit-linear-gradient(top, #75a8c4 7%, #ffffff 100%); 28 | /* Chrome10+,Safari5.1+ */ 29 | background: -o-linear-gradient(top, #75a8c4 7%, #ffffff 100%); 30 | /* Opera11.10+ */ 31 | background: -ms-linear-gradient(top, #75a8c4 7%, #ffffff 100%); 32 | /* IE10+ */ 33 | filter: progid : DXImageTransform.Microsoft.gradient ( 34 | 35 | startColorstr = 36 | '#75a8c4', endColorstr = '#ffffff', GradientType 37 | = 38 | 39 | 0 ); 40 | /* IE6-9 */ 41 | background: linear-gradient(top, #75a8c4 7%, #ffffff 100%); /* W3C */ 42 | height: auto !important; 43 | min-height: 100%; 44 | } 45 | 46 | #container { 47 | background-color: white; 48 | padding: 25px 25px; 49 | padding-bottom: 0px; 50 | width: 650px; 51 | margin-left: auto; 52 | margin-right: auto; 53 | box-shadow: #CCC 4px 0 10px, #CCC -4px 0 10px, #AAA 0 38px 36px -24px; 54 | border-bottom-right-radius: 2px; 55 | border-bottom-left-radius: 2px; 56 | width: 650px; 57 | } 58 | 59 | .section { 60 | padding-bottom: 15px; 61 | border-bottom: 1px dashed #CCC; 62 | margin-bottom: 15px; 63 | } 64 | 65 | .section:last-child { 66 | border-bottom: none; 67 | margin-bottom: 0; 68 | } 69 | 70 | #head { 71 | margin-bottom: 25px; 72 | } 73 | 74 | #head a { 75 | text-decoration: none; 76 | } 77 | 78 | h1 { 79 | font-size: 52px; 80 | font-weight: bold; 81 | font-family: sans-serif; 82 | border-bottom: 4px solid #DDDDDD; 83 | color: #6f6faa; 84 | text-shadow: 2px 1px 1px #a4a4a4; 85 | } 86 | 87 | h2 { 88 | font-size: 24px; 89 | font-family: sans-serif; 90 | padding-bottom: 10px; 91 | font-weight: bold; 92 | color: #6f6faa; 93 | text-shadow: 2px 1px 1px #a4a4a4; 94 | } 95 | 96 | .text { 97 | font-size: 16px; 98 | font-family: Georgia, serif; 99 | line-height: 1.2em; 100 | } 101 | 102 | .text p { 103 | margin: 5px auto; 104 | } 105 | 106 | .text .feature { 107 | text-align: center; 108 | margin: 15px auto; 109 | background-color: #F2F2F2; 110 | padding: 5px; 111 | box-shadow: 1px 1px 6px #AAA; 112 | border-radius: 2px; 113 | } 114 | 115 | .text .feature:hover { 116 | box-shadow: 1px 1px 6px #75A8C4; 117 | } 118 | 119 | #footer { 120 | position: relative; 121 | padding: 10px 0px; 122 | background: #EEE; 123 | margin-top: 35px; 124 | height: 66px; 125 | border-top: 1px solid #CCC; 126 | margin: auto -25px; 127 | } 128 | 129 | #social { 130 | position: absolute; 131 | left: 10px; 132 | } 133 | 134 | #social .button { 135 | float: left; 136 | margin-right: 5px; 137 | } 138 | 139 | #copyright { 140 | position: absolute; 141 | bottom: 10px; 142 | left: 10px; 143 | font-size: 11px; 144 | color: #888; 145 | font-family: sans-serif; 146 | left: 10px; 147 | } 148 | 149 | #html5-badge { 150 | float: right; 151 | } 152 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/common.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video 6 | { 7 | margin: 0; 8 | padding: 0; 9 | border: 0; 10 | font-size: 100%; 11 | font: inherit; 12 | vertical-align: baseline; 13 | } 14 | /* HTML5 display-role reset for older browsers */ 15 | article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section 16 | { 17 | display: block; 18 | } 19 | 20 | body { 21 | line-height: 1; 22 | } 23 | 24 | ol,ul { 25 | list-style: none; 26 | } 27 | 28 | blockquote,q { 29 | quotes: none; 30 | } 31 | 32 | blockquote:before,blockquote:after,q:before,q:after { 33 | content: ''; 34 | content: none; 35 | } 36 | 37 | table { 38 | border-collapse: collapse; 39 | border-spacing: 0; 40 | } 41 | 42 | /* 43 | USER STYLES 44 | */ 45 | button { 46 | margin: 0; 47 | } 48 | 49 | /* 50 | UTIL 51 | */ 52 | .no-select { 53 | -webkit-user-select: none; 54 | -khtml-user-select: none; 55 | -moz-user-select: none; 56 | -o-user-select: none; 57 | user-select: none; 58 | } 59 | 60 | .link { 61 | text-decoration: underline; 62 | cursor: pointer; 63 | } 64 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/common.css_new: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video 6 | { 7 | margin: 0; 8 | padding: 0; 9 | border: 0; 10 | font-size: 100%; 11 | font: inherit; 12 | vertical-align: baseline; 13 | } 14 | /* HTML5 display-role reset for older browsers */ 15 | article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section 16 | { 17 | display: block; 18 | } 19 | 20 | body { 21 | line-height: 1; 22 | } 23 | 24 | ol,ul { 25 | list-style: none; 26 | } 27 | 28 | blockquote,q { 29 | quotes: none; 30 | } 31 | 32 | blockquote:before,blockquote:after,q:before,q:after { 33 | content: ''; 34 | content: none; 35 | } 36 | 37 | table { 38 | border-collapse: collapse; 39 | border-spacing: 0; 40 | } 41 | 42 | /* 43 | USER STYLES 44 | */ 45 | button { 46 | margin: 0; 47 | } 48 | 49 | /* 50 | UTIL 51 | */ 52 | .no-select { 53 | -webkit-user-select: none; 54 | -khtml-user-select: none; 55 | -moz-user-select: none; 56 | -o-user-select: none; 57 | user-select: none; 58 | } 59 | 60 | .link { 61 | text-decoration: underline; 62 | cursor: pointer; 63 | } 64 | 65 | .right { 66 | float: right; 67 | } 68 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/circle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/minicolors/images/circle.gif -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/minicolors/images/gradient.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/minicolors/images/line.gif -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/rainbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/minicolors/images/rainbow.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/trigger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/css/minicolors/images/trigger.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/jquery.miniColors.css: -------------------------------------------------------------------------------- 1 | .miniColors-trigger { 2 | height: 22px; 3 | width: 22px; 4 | background: url("images/trigger.png") center no-repeat; 5 | vertical-align: middle; 6 | margin: 0 .25em; 7 | display: inline-block; 8 | outline: none; 9 | } 10 | 11 | .miniColors-selector { 12 | position: absolute; 13 | width: 175px; 14 | height: 150px; 15 | background: #FFF; 16 | border: solid 1px #BBB; 17 | -moz-box-shadow: 0 0 6px rgba(0, 0, 0, .25); 18 | -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, .25); 19 | box-shadow: 0 0 6px rgba(0, 0, 0, .25); 20 | -moz-border-radius: 5px; 21 | -webkit-border-radius: 5px; 22 | border-radius: 5px; 23 | padding: 5px; 24 | z-index: 999999; 25 | } 26 | 27 | .miniColors-selector.black { 28 | background: #000; 29 | border-color: #000; 30 | } 31 | 32 | .miniColors-colors { 33 | position: absolute; 34 | top: 5px; 35 | left: 5px; 36 | width: 150px; 37 | height: 150px; 38 | background: url("images/gradient.png") center no-repeat; 39 | cursor: crosshair; 40 | } 41 | 42 | .miniColors-hues { 43 | position: absolute; 44 | top: 5px; 45 | left: 160px; 46 | width: 20px; 47 | height: 150px; 48 | background: url("images/rainbow.png") center no-repeat; 49 | cursor: crosshair; 50 | } 51 | 52 | .miniColors-colorPicker { 53 | position: absolute; 54 | width: 11px; 55 | height: 11px; 56 | background: url("images/circle.gif") center no-repeat; 57 | } 58 | 59 | .miniColors-huePicker { 60 | position: absolute; 61 | left: -3px; 62 | width: 26px; 63 | height: 3px; 64 | background: url("images/line.gif") center no-repeat; 65 | } -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/closedhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/img/closedhand.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/creator-nub-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/img/creator-nub-sprite.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/img/favicon.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/grid.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/img/grid.gif -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/octopus_orange_ombre_pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/img/octopus_orange_ombre_pt.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/openhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/img/openhand.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/plus-minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/img/plus-minus.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/97ae33b173beca34d17bf169e91f5b7704fca75f/webapps/wisemapping/mindmaps/img/transparent.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/index.jsp: -------------------------------------------------------------------------------- 1 | <% 2 | 3 | response.sendRedirect("index.html"); 4 | 5 | %> 6 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/ApplicationController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new Application Controller. 3 | * 4 | * @constructor 5 | */ 6 | mindmaps.ApplicationController = function() { 7 | var eventBus = new mindmaps.EventBus(); 8 | var shortcutController = new mindmaps.ShortcutController(); 9 | var commandRegistry = new mindmaps.CommandRegistry(shortcutController); 10 | var undoController = new mindmaps.UndoController(eventBus, commandRegistry); 11 | var mindmapModel = new mindmaps.MindMapModel(eventBus, commandRegistry, undoController); 12 | var clipboardController = new mindmaps.ClipboardController(eventBus, 13 | commandRegistry, mindmapModel); 14 | var helpController = new mindmaps.HelpController(eventBus, commandRegistry); 15 | var printController = new mindmaps.PrintController(eventBus, 16 | commandRegistry, mindmapModel); 17 | var autosaveController = new mindmaps.AutoSaveController(eventBus, mindmapModel); 18 | 19 | /** 20 | * Handles the new document command. 21 | */ 22 | function doNewDocument() { 23 | // close old document first 24 | var doc = mindmapModel.getDocument(); 25 | doCloseDocument(); 26 | 27 | var presenter = new mindmaps.NewDocumentPresenter(eventBus, 28 | mindmapModel, new mindmaps.NewDocumentView()); 29 | presenter.go(); 30 | } 31 | 32 | /** 33 | * Handles the save document command. 34 | */ 35 | function doSaveDocument() { 36 | var presenter = new mindmaps.SaveDocumentPresenter(eventBus, 37 | mindmapModel, new mindmaps.SaveDocumentView(), autosaveController); 38 | presenter.go(); 39 | } 40 | 41 | /** 42 | * Handles the close document command. 43 | */ 44 | function doCloseDocument() { 45 | var doc = mindmapModel.getDocument(); 46 | if (doc) { 47 | // TODO for now simply publish events, should be intercepted by 48 | // someone 49 | mindmapModel.setDocument(null); 50 | } 51 | } 52 | 53 | /** 54 | * Handles the open document command. 55 | */ 56 | function doOpenDocument() { 57 | var presenter = new mindmaps.OpenDocumentPresenter(eventBus, 58 | mindmapModel, new mindmaps.OpenDocumentView()); 59 | presenter.go(); 60 | } 61 | 62 | function doExportDocument() { 63 | var presenter = new mindmaps.ExportMapPresenter(eventBus, 64 | mindmapModel, new mindmaps.ExportMapView()); 65 | presenter.go(); 66 | } 67 | 68 | /** 69 | * Initializes the controller, registers for all commands and subscribes to 70 | * event bus. 71 | */ 72 | this.init = function() { 73 | var newDocumentCommand = commandRegistry 74 | .get(mindmaps.NewDocumentCommand); 75 | newDocumentCommand.setHandler(doNewDocument); 76 | newDocumentCommand.setEnabled(true); 77 | 78 | var openDocumentCommand = commandRegistry 79 | .get(mindmaps.OpenDocumentCommand); 80 | openDocumentCommand.setHandler(doOpenDocument); 81 | openDocumentCommand.setEnabled(true); 82 | 83 | var saveDocumentCommand = commandRegistry 84 | .get(mindmaps.SaveDocumentCommand); 85 | saveDocumentCommand.setHandler(doSaveDocument); 86 | 87 | var closeDocumentCommand = commandRegistry 88 | .get(mindmaps.CloseDocumentCommand); 89 | closeDocumentCommand.setHandler(doCloseDocument); 90 | 91 | var exportCommand = commandRegistry.get(mindmaps.ExportCommand); 92 | exportCommand.setHandler(doExportDocument); 93 | 94 | eventBus.subscribe(mindmaps.Event.DOCUMENT_CLOSED, function() { 95 | saveDocumentCommand.setEnabled(false); 96 | closeDocumentCommand.setEnabled(false); 97 | exportCommand.setEnabled(false); 98 | }); 99 | 100 | eventBus.subscribe(mindmaps.Event.DOCUMENT_OPENED, function() { 101 | saveDocumentCommand.setEnabled(true); 102 | closeDocumentCommand.setEnabled(true); 103 | exportCommand.setEnabled(true); 104 | }); 105 | }; 106 | 107 | /** 108 | * Launches the main view controller. 109 | */ 110 | this.go = function() { 111 | var viewController = new mindmaps.MainViewController(eventBus, 112 | mindmapModel, commandRegistry); 113 | viewController.go(); 114 | 115 | doNewDocument(); 116 | }; 117 | 118 | this.init(); 119 | }; 120 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/AutoSaveController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new AutoSaveController. This controller is able to automatically 3 | * save the document every X minutes. This setting is global for all mindmaps. 4 | * 5 | * @constructor 6 | * @param {mindmaps.EventBus} eventBus 7 | * @param {mindmaps.MindMapModel} mindmapModel 8 | */ 9 | mindmaps.AutoSaveController = function(eventBus, mindmapModel) { 10 | var SAVE_INTERVAL = 1000 * 60; // 1 minute 11 | var timer = null; 12 | 13 | function save() { 14 | console.debug("Autosaving..."); 15 | mindmapModel.saveToLocalStorage(); 16 | } 17 | 18 | function autosave() { 19 | if (!timer) { 20 | timer = setInterval(save, SAVE_INTERVAL); 21 | } 22 | } 23 | 24 | function stopAutosave() { 25 | if (timer) { 26 | clearInterval(timer); 27 | timer = null; 28 | } 29 | } 30 | 31 | /** 32 | * Enable autosave. 33 | */ 34 | this.enable = function() { 35 | autosave(); 36 | mindmapModel.getDocument().setAutoSave(true); 37 | } 38 | 39 | /** 40 | * Disable autosave. 41 | */ 42 | this.disable = function() { 43 | stopAutosave(); 44 | mindmapModel.getDocument().setAutoSave(false); 45 | } 46 | 47 | this.isEnabled = function() { 48 | return mindmapModel.getDocument().isAutoSave(); 49 | } 50 | 51 | this.init = function() { 52 | eventBus.subscribe(mindmaps.Event.DOCUMENT_OPENED, this.documentOpened 53 | .bind(this)); 54 | 55 | eventBus.subscribe(mindmaps.Event.DOCUMENT_CLOSED, this.documentClosed 56 | .bind(this)); 57 | } 58 | 59 | this.documentOpened = function(doc) { 60 | if (this.isEnabled()) { 61 | autosave(); 62 | } 63 | } 64 | 65 | this.documentClosed = function() { 66 | stopAutosave(); 67 | } 68 | 69 | this.init(); 70 | } 71 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/ClipboardController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new ClipboardController. 3 | * Handles copy, cut and paste commands. 4 | * 5 | * @constructor 6 | * 7 | * @param {mindmaps.EventBus} eventBus 8 | * @param {mindmaps.CommandRegistry} commandRegistry 9 | * @param {mindmaps.MindMapModel} mindmapModel 10 | */ 11 | mindmaps.ClipboardController = function(eventBus, commandRegistry, mindmapModel) { 12 | var node, copyCommand, cutCommand, pasteCommand; 13 | 14 | function init() { 15 | copyCommand = commandRegistry.get(mindmaps.CopyNodeCommand); 16 | copyCommand.setHandler(doCopy); 17 | 18 | cutCommand = commandRegistry.get(mindmaps.CutNodeCommand); 19 | cutCommand.setHandler(doCut); 20 | 21 | pasteCommand = commandRegistry.get(mindmaps.PasteNodeCommand); 22 | pasteCommand.setHandler(doPaste); 23 | pasteCommand.setEnabled(false); 24 | 25 | eventBus.subscribe(mindmaps.Event.DOCUMENT_CLOSED, function() { 26 | copyCommand.setEnabled(false); 27 | cutCommand.setEnabled(false); 28 | pasteCommand.setEnabled(false); 29 | }); 30 | 31 | eventBus.subscribe(mindmaps.Event.DOCUMENT_OPENED, function() { 32 | copyCommand.setEnabled(true); 33 | cutCommand.setEnabled(true); 34 | pasteCommand.setEnabled(node != null); 35 | }); 36 | 37 | } 38 | 39 | function copySelectedNode() { 40 | node = mindmapModel.selectedNode.clone(); 41 | pasteCommand.setEnabled(true); 42 | } 43 | 44 | function doCopy() { 45 | copySelectedNode(); 46 | } 47 | 48 | function doCut() { 49 | copySelectedNode(); 50 | mindmapModel.deleteNode(mindmapModel.selectedNode); 51 | } 52 | 53 | function doPaste() { 54 | if (!node) { 55 | return; 56 | } 57 | 58 | // send a cloned copy of our node, so we can paste multiple times 59 | mindmapModel.createNode(node.clone(), mindmapModel.selectedNode); 60 | } 61 | 62 | init(); 63 | }; 64 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/CommandRegistry.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new CommandRegistry. 3 | * 4 | * @constructor 5 | * @param {mindmaps.ShortcutController} [shortcutController] 6 | */ 7 | mindmaps.CommandRegistry = function(shortcutController) { 8 | this.commands = {}; 9 | 10 | function registerShortcut(command) { 11 | if (command.shortcut && command.execute) { 12 | shortcutController.register(command.shortcut, command.execute 13 | .bind(command)); 14 | } 15 | } 16 | 17 | function unregisterShortcut(command) { 18 | if (command.shortcut) { 19 | shortcutController.unregister(command.shortcut); 20 | } 21 | } 22 | 23 | /** 24 | * Returns a command object for the given command type. 25 | * 26 | * @param commandType 27 | * @returns {mindmaps.Command} a command object. 28 | */ 29 | this.get = function(commandType) { 30 | var command = this.commands[commandType]; 31 | if (!command) { 32 | command = new commandType; 33 | this.commands[commandType] = command; 34 | 35 | if (shortcutController) { 36 | registerShortcut(command); 37 | } 38 | } 39 | return command; 40 | }; 41 | 42 | /** 43 | * Removes the command object for the given command type. 44 | * 45 | * @param commandType 46 | */ 47 | this.remove = function(commandType) { 48 | // TODO remove by object 49 | var command = this.commands[commandType]; 50 | if (!command) { 51 | return; 52 | } 53 | 54 | delete this.commands[commandType]; 55 | 56 | if (shortcutController) { 57 | unregisterShortcut(command); 58 | } 59 | }; 60 | }; 61 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/Document.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new Document. 3 | * 4 | * @constructor 5 | */ 6 | mindmaps.Document = function() { 7 | this.id = mindmaps.Util.createUUID(); 8 | this.title = "New Document"; 9 | this.mindmap = new mindmaps.MindMap(); 10 | this.dates = { 11 | created : new Date(), 12 | modified : null 13 | }; 14 | 15 | this.dimensions = new mindmaps.Point(4000, 2000); 16 | this.autosave = false; 17 | }; 18 | 19 | /** 20 | * Creates a new document object from a JSON string. 21 | * 22 | * @static 23 | * @param {String} json 24 | * @returns {mindmaps.Document} 25 | */ 26 | mindmaps.Document.fromJSON = function(json) { 27 | return mindmaps.Document.fromObject(JSON.parse(json)) 28 | }; 29 | 30 | /** 31 | * Creates a new document object from a generic object. 32 | * 33 | * @static 34 | * @param {Object} json 35 | * @returns {mindmaps.Document} 36 | */ 37 | mindmaps.Document.fromObject = function(obj) { 38 | var doc = new mindmaps.Document(); 39 | doc.id = obj.id; 40 | doc.title = obj.title; 41 | doc.mindmap = mindmaps.MindMap.fromObject(obj.mindmap); 42 | doc.dates = { 43 | created : new Date(obj.dates.created), 44 | modified : obj.dates.modified ? new Date(obj.dates.modified) : null 45 | }; 46 | 47 | doc.dimensions = mindmaps.Point.fromObject(obj.dimensions); 48 | doc.autosave = obj.autosave; 49 | 50 | return doc; 51 | }; 52 | 53 | /** 54 | * Called by JSON.stringify(). 55 | * 56 | * @private 57 | */ 58 | mindmaps.Document.prototype.toJSON = function() { 59 | // store dates in milliseconds since epoch 60 | var dates = { 61 | created : this.dates.created.getTime() 62 | }; 63 | 64 | if (this.dates.modified) { 65 | dates.modified = this.dates.modified.getTime(); 66 | } 67 | 68 | return { 69 | id : this.id, 70 | title : this.title, 71 | mindmap : this.mindmap, 72 | dates : dates, 73 | dimensions : this.dimensions, 74 | autosave: this.autosave 75 | }; 76 | }; 77 | 78 | /** 79 | * Returns a JSON representation of the object. 80 | * 81 | * @returns {String} the json. 82 | */ 83 | mindmaps.Document.prototype.serialize = function() { 84 | return JSON.stringify(this); 85 | }; 86 | 87 | /** 88 | * Sort function for Array.sort(). 89 | * 90 | * @static 91 | * @param {mindmaps.Document} doc1 92 | * @param {mindmaps.Document} doc2 93 | */ 94 | mindmaps.Document.sortByModifiedDateDescending = function(doc1, doc2) { 95 | if (doc1.dates.modified > doc2.dates.modified) { 96 | return -1; 97 | } 98 | if (doc1.dates.modified < doc2.dates.modified) { 99 | return 1; 100 | } 101 | return 0; 102 | }; 103 | 104 | /** 105 | * Tells whether this document considerd as "new", that is has not been saved 106 | * yet. 107 | * 108 | * @returns {Boolean} 109 | */ 110 | mindmaps.Document.prototype.isNew = function() { 111 | return this.dates.modified === null; 112 | }; 113 | 114 | /** 115 | * Returns the created date. 116 | * 117 | * @returns {Date} 118 | */ 119 | mindmaps.Document.prototype.getCreatedDate = function() { 120 | return this.dates.created; 121 | }; 122 | 123 | /** 124 | * Gets the width of the document. 125 | * 126 | * @returns {Number} 127 | */ 128 | mindmaps.Document.prototype.getWidth = function() { 129 | return this.dimensions.x; 130 | }; 131 | 132 | /** 133 | * Gets the height of the document. 134 | * 135 | * @returns {Number} 136 | */ 137 | mindmaps.Document.prototype.getHeight = function() { 138 | return this.dimensions.y; 139 | }; 140 | 141 | 142 | mindmaps.Document.prototype.isAutoSave = function() { 143 | return this.autosave; 144 | } 145 | 146 | 147 | /** 148 | * Sets autosave setting. 149 | * 150 | * @param {Boolean} 151 | */ 152 | mindmaps.Document.prototype.setAutoSave = function(autosave) { 153 | this.autosave = autosave; 154 | } 155 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/Event.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Events that the event bus carries. 3 | * 4 | * @namespace 5 | */ 6 | mindmaps.Event = { 7 | /** 8 | * @event 9 | * @param {mindmaps.Document} document 10 | */ 11 | DOCUMENT_OPENED : "DocumentOpenedEvent", 12 | 13 | /** 14 | * @event 15 | * @param {mindmaps.Document} document 16 | */ 17 | DOCUMENT_SAVED : "DocumentSavedEvent", 18 | 19 | /** 20 | * @event 21 | * @param {mindmaps.Document} document 22 | */ 23 | DOCUMENT_CLOSED : "DocumentClosedEvent", 24 | 25 | /** 26 | * @event 27 | * @param {mindmaps.Node} node 28 | * @param {mindmaps.Node} oldSelectedNode 29 | */ 30 | NODE_SELECTED : "NodeSelectedEvent", 31 | 32 | /** 33 | * @event 34 | * @param {mindmaps.Node} node 35 | */ 36 | NODE_DESELECTED : "NodeDeselectedEvent", 37 | 38 | /** 39 | * @event 40 | * @param {mindmaps.Node} node 41 | */ 42 | NODE_MOVED : "NodeMovedEvent", 43 | 44 | /** 45 | * @event 46 | * @param {mindmaps.Node} node 47 | */ 48 | NODE_TEXT_CAPTION_CHANGED : "NodeTextCaptionChangedEvent", 49 | 50 | /** 51 | * Some parameter of the node font attribute has changed. 52 | * 53 | * @event 54 | * @param {mindmaps.Node} node 55 | */ 56 | NODE_FONT_CHANGED : "NodeFontChangedEvent", 57 | 58 | /** 59 | * Preview event for node font color changes. 60 | * 61 | * @event 62 | * @param {mindmaps.Node} node 63 | * @param {String} color 64 | */ 65 | NODE_FONT_COLOR_PREVIEW: "NodeFontColorPreviewEvent", 66 | 67 | /** 68 | * @event 69 | * @param {mindmaps.Node} node 70 | */ 71 | NODE_BRANCH_COLOR_CHANGED : "NodeBranchColorChangedEvent", 72 | 73 | /** 74 | * @event 75 | * @param {mindmaps.Node} node 76 | * @param {String} color 77 | */ 78 | NODE_BRANCH_COLOR_PREVIEW : "NodeBranchColorPreviewEvent", 79 | 80 | /** 81 | * @event 82 | * @param {mindmaps.Node} node 83 | */ 84 | NODE_CREATED : "NodeCreatedEvent", 85 | 86 | /** 87 | * @event 88 | * @param {mindmaps.Node} node 89 | * @param {mindmaps.Node} parent 90 | */ 91 | NODE_DELETED : "NodeDeletedEvent", 92 | 93 | /** 94 | * @event 95 | * @param {mindmaps.Node} node 96 | */ 97 | NODE_OPENED : "NodeOpenedEvent", 98 | 99 | /** 100 | * @event 101 | * @param {mindmaps.Node} node 102 | */ 103 | NODE_CLOSED : "NodeClosedEvent", 104 | 105 | /** 106 | * @event 107 | * @param {Number} zoomFactor 108 | */ 109 | ZOOM_CHANGED : "ZoomChangedEvent", 110 | 111 | /** 112 | * @event 113 | * @param {String} message 114 | */ 115 | NOTIFICATION_INFO: "NotificationInfoEvent", 116 | 117 | /** 118 | * @event 119 | * @param {String} message 120 | */ 121 | NOTIFICATION_WARN: "NotificationWarnEvent", 122 | 123 | /** 124 | * @event 125 | * @param {String} message 126 | */ 127 | NOTIFICATION_ERROR: "NotificationErrorEvent" 128 | }; 129 | 130 | /** 131 | * Simple Event bus powered by EventEmitter. 132 | * 133 | * @constructor 134 | * @augments EventEmitter 135 | * 136 | */ 137 | mindmaps.EventBus = EventEmitter; 138 | 139 | if (mindmaps.DEBUG) { 140 | // overwrite publish func and display amount of listeners 141 | var old = mindmaps.EventBus.prototype.emit; 142 | mindmaps.EventBus.prototype.publish = function(type) { 143 | var l = this.listeners(type).length; 144 | console.log("EventBus > publish: " + type, "(Listeners: " + l + ")"); 145 | 146 | old.apply(this, arguments); 147 | }; 148 | } 149 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/ExportMap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @constructor 4 | */ 5 | mindmaps.ExportMapView = function() { 6 | var self = this; 7 | 8 | // create dialog 9 | var $dialog = $("#template-export-map").tmpl().dialog({ 10 | autoOpen : false, 11 | modal : true, 12 | zIndex : 5000, 13 | width : "auto", 14 | height : "auto", 15 | close : function() { 16 | $(this).dialog("destroy"); 17 | $(this).remove(); 18 | }, 19 | open : function() { 20 | $(this).css({ 21 | "max-width" : $(window).width() * 0.9, 22 | "max-height" : $(window).height() * 0.8 23 | }); 24 | $dialog.dialog("option", "position", "center"); 25 | }, 26 | buttons : { 27 | "Ok" : function() { 28 | $(this).dialog("close"); 29 | } 30 | } 31 | }); 32 | 33 | /** 34 | * Shows the dialog. 35 | * 36 | */ 37 | this.showDialog = function() { 38 | $dialog.dialog("open"); 39 | }; 40 | 41 | /** 42 | * Hides the dialog. 43 | */ 44 | this.hideDialog = function() { 45 | $dialog.dialog("close"); 46 | }; 47 | 48 | this.setImage = function($img) { 49 | $("#export-preview").html($img); 50 | }; 51 | }; 52 | 53 | /** 54 | * 55 | * @constructor 56 | * @param {mindmaps.EventBus} eventBus 57 | * @param {mindmaps.MindMapModel} mindmapModel 58 | * @param {mindmaps.ExportMapView} view 59 | */ 60 | mindmaps.ExportMapPresenter = function(eventBus, mindmapModel, view) { 61 | var renderer = new mindmaps.StaticCanvasRenderer(); 62 | 63 | this.go = function() { 64 | var $img = renderer.renderAsPNG(mindmapModel.getDocument()); 65 | view.setImage($img); 66 | 67 | // slightly delay showing the dialog. otherwise dialog is not correctly 68 | // centered, because the image is inserted too late 69 | setTimeout(function() { 70 | view.showDialog(); 71 | }, 30); 72 | }; 73 | }; 74 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/FloatPanel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new FloatPanelFactory. This factory object can create new instances 3 | * of mindmaps.FloatPanel that are constrained inside the container. 4 | * 5 | * @constructor 6 | * @param container 7 | */ 8 | mindmaps.FloatPanelFactory = function(container) { 9 | var $container = container.getContent(); 10 | var dialogs = []; 11 | var paddingRight = 15; 12 | var paddingTop = 5; 13 | 14 | function setPosition(dialog) { 15 | // reposition dialog on window resize 16 | container.subscribe(mindmaps.CanvasContainer.Event.RESIZED, function() { 17 | dialogs.forEach(function(dialog) { 18 | if (dialog.visible) { 19 | dialog.ensurePosition(); 20 | } 21 | }); 22 | }); 23 | 24 | var ccw = $container.outerWidth(); 25 | var hh = $container.offset().top; 26 | var dw = dialog.width(); 27 | var dh = dialog.height(); 28 | var heightOffset = dialogs.reduce(function(memo, dialog) { 29 | return memo + dialog.height() + paddingTop; 30 | }, 0); 31 | 32 | dialog.setPosition(ccw - dw - paddingRight, hh + paddingTop 33 | + heightOffset); 34 | } 35 | 36 | /** 37 | * Creates a new FloatPanel. 38 | * 39 | * @param {String} caption the float panel title 40 | * @param {jQuery} $content the content as a jquery object 41 | * @returns {mindmaps.FloatPanel} 42 | */ 43 | this.create = function(caption, $content) { 44 | var dialog = new mindmaps.FloatPanel(caption, $container, $content); 45 | setPosition(dialog); 46 | dialogs.push(dialog); 47 | return dialog; 48 | }; 49 | }; 50 | 51 | /** 52 | * A reusable, draggable panel gui element. The panel is contained within the 53 | * container. When a $hideTarget is set, the hide/show animations will show a 54 | * transfer effect. 55 | * 56 | * @constructor 57 | * @param {String} caption the float panel title 58 | * @param {jQuery} $container the surrounding container jquery object 59 | * @param {jQuery} $content the content as a jquery object 60 | */ 61 | mindmaps.FloatPanel = function(caption, $container, $content) { 62 | var self = this; 63 | var animating = false; 64 | 65 | this.caption = caption; 66 | this.visible = false; 67 | this.animationDuration = 400; 68 | 69 | /** 70 | * Replaces the content in the panel. 71 | * 72 | * @param {jQuery} $content 73 | */ 74 | this.setContent = function($content) { 75 | this.clearContent(); 76 | $("div.ui-dialog-content", this.$widget).append($content); 77 | }; 78 | 79 | /** 80 | * Clears the content of the panel. 81 | */ 82 | this.clearContent = function() { 83 | $("div.ui-dialog-content", this.$widget).children().detach(); 84 | }; 85 | 86 | /** 87 | * @private 88 | */ 89 | this.$widget = (function() { 90 | var $panel = $("#template-float-panel").tmpl({ 91 | title : caption 92 | }); 93 | 94 | // hide button 95 | $panel.find(".ui-dialog-titlebar-close").click(function() { 96 | self.hide(); 97 | }); 98 | 99 | // add content panel 100 | if ($content) { 101 | $panel.find(".ui-dialog-content").append($content); 102 | } 103 | 104 | // make draggable, hide, append to container 105 | $panel.draggable({ 106 | containment : "parent", 107 | handle : "div.ui-dialog-titlebar", 108 | opacity : 0.75 109 | }).hide().appendTo($container); 110 | 111 | return $panel; 112 | })(); 113 | 114 | /** 115 | * Hides the panel. Will show transfer effect if $hideTarget is set. 116 | */ 117 | this.hide = function() { 118 | if (!animating && this.visible) { 119 | this.visible = false; 120 | this.$widget.fadeOut(this.animationDuration * 1.5); 121 | 122 | // show transfer effect is hide target is set 123 | if (this.$hideTarget) { 124 | this.transfer(this.$widget, this.$hideTarget); 125 | } 126 | } 127 | }; 128 | 129 | /** 130 | * Shows the panel. Will show transfer effect if $hideTarget is set. 131 | */ 132 | this.show = function() { 133 | if (!animating && !this.visible) { 134 | this.visible = true; 135 | this.$widget.fadeIn(this.animationDuration * 1.5); 136 | this.ensurePosition(); 137 | 138 | // show transfer effect is hide target is set 139 | if (this.$hideTarget) { 140 | this.transfer(this.$hideTarget, this.$widget); 141 | } 142 | } 143 | }; 144 | 145 | /** 146 | * Shows or hides the panel. 147 | */ 148 | this.toggle = function() { 149 | if (this.visible) { 150 | this.hide(); 151 | } else { 152 | this.show(); 153 | } 154 | }; 155 | 156 | /** 157 | * Shows a transfer effect. 158 | * 159 | * @private 160 | * @param {jQuery} $from 161 | * @param {jQuery} $to 162 | */ 163 | this.transfer = function($from, $to) { 164 | animating = true; 165 | var endPosition = $to.offset(), animation = { 166 | top : endPosition.top, 167 | left : endPosition.left, 168 | height : $to.innerHeight(), 169 | width : $to.innerWidth() 170 | }, startPosition = $from.offset(), transfer = $( 171 | '
').appendTo( 172 | document.body).css({ 173 | top : startPosition.top, 174 | left : startPosition.left, 175 | height : $from.innerHeight(), 176 | width : $from.innerWidth(), 177 | position : 'absolute' 178 | }).animate(animation, this.animationDuration, "linear", function() { 179 | // end 180 | transfer.remove(); 181 | animating = false; 182 | }); 183 | }; 184 | 185 | /** 186 | * 187 | * @returns {Number} the width. 188 | */ 189 | this.width = function() { 190 | return this.$widget.outerWidth(); 191 | }; 192 | 193 | /** 194 | * 195 | * @returns {Number} the height. 196 | */ 197 | this.height = function() { 198 | return this.$widget.outerHeight(); 199 | }; 200 | 201 | /** 202 | * 203 | * @returns {Object} the offset 204 | */ 205 | this.offset = function() { 206 | return this.$widget.offset(); 207 | }; 208 | 209 | /** 210 | * Sets the position of the panel relative to the container. 211 | * 212 | * @param {Number} x 213 | * @param {Number} y 214 | */ 215 | this.setPosition = function(x, y) { 216 | this.$widget.offset({ 217 | left : x, 218 | top : y 219 | }); 220 | }; 221 | 222 | /** 223 | * Moves panel into view port if position exceeds the bounds of the 224 | * container. 225 | * 226 | * @private 227 | */ 228 | this.ensurePosition = function() { 229 | var cw = $container.outerWidth(); 230 | var ch = $container.outerHeight(); 231 | var col = $container.offset().left; 232 | var cot = $container.offset().top; 233 | var dw = this.width(); 234 | var dh = this.height(); 235 | var dol = this.offset().left; 236 | var dot = this.offset().top; 237 | 238 | // window width is too small for current dialog position but bigger than 239 | // dialog width 240 | if (cw + col < dw + dol && cw >= dw) { 241 | this.setPosition(cw + col - dw, dot); 242 | } 243 | 244 | // window height is too small for current dialog position but bigger 245 | // than dialog height 246 | if (ch + cot < dh + dot && ch >= dh) { 247 | this.setPosition(dol, ch + cot - dh); 248 | } 249 | }; 250 | 251 | /** 252 | * Sets the hide target for the panel. 253 | * 254 | * @param {jQuery} $target 255 | */ 256 | this.setHideTarget = function($target) { 257 | this.$hideTarget = $target; 258 | }; 259 | }; 260 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/MainViewController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The canvas container is the area in between the toolbar and the statusbar. 3 | * Inside the mind map will be drawn and the floating panels are contained 4 | * within this area. 5 | * 6 | * @constructor 7 | */ 8 | mindmaps.CanvasContainer = function() { 9 | var self = this; 10 | var $content = $("#canvas-container"); 11 | 12 | /** 13 | * @returns {jQuery} 14 | */ 15 | this.getContent = function() { 16 | return $content; 17 | }; 18 | 19 | /** 20 | * Sets the height of the canvas to fit between header and footer. 21 | */ 22 | this.setSize = function() { 23 | var windowHeight = $(window).height(); 24 | var headerHeight = $("#topbar").outerHeight(true); 25 | var footerHeight = $("#bottombar").outerHeight(true); 26 | var height = windowHeight - headerHeight - footerHeight; 27 | $content.height(height); 28 | 29 | var size = new mindmaps.Point($content.width(), height); 30 | self.publish(mindmaps.CanvasContainer.Event.RESIZED, size); 31 | }; 32 | 33 | /** 34 | * Set up the container to accept drag and drop of files from the desktop. 35 | */ 36 | this.acceptFileDrop = function() { 37 | 38 | function ignore(e) { 39 | e.originalEvent.stopPropagation(); 40 | e.originalEvent.preventDefault(); 41 | } 42 | 43 | function handleDragOver(e) { 44 | ignore(e); 45 | } 46 | 47 | function handleDrop(e) { 48 | ignore(e); 49 | 50 | var files = e.originalEvent.dataTransfer.files; 51 | var file = files[0]; 52 | 53 | var reader = new FileReader(); 54 | reader.onload = function() { 55 | self.receivedFileDrop(reader.result); 56 | }; 57 | reader.readAsText(file); 58 | } 59 | 60 | $content.bind('dragover', handleDragOver); 61 | $content.bind('drop', handleDrop); 62 | }; 63 | 64 | this.init = function() { 65 | // recalculate size when window is resized. 66 | $(window).resize(function() { 67 | self.setSize(); 68 | }); 69 | 70 | this.setSize(); 71 | this.acceptFileDrop(); 72 | }; 73 | 74 | /** 75 | * Callback for when a file was dropped onto the container. 76 | * 77 | * @event 78 | * @param {String} result 79 | */ 80 | this.receivedFileDrop = function(result) { 81 | }; 82 | 83 | }; 84 | EventEmitter.mixin(mindmaps.CanvasContainer); 85 | 86 | /** 87 | * Events fired by the container. 88 | * 89 | * @namespace 90 | */ 91 | mindmaps.CanvasContainer.Event = { 92 | /** 93 | * Fired when the container has been resized. 94 | * 95 | * @event 96 | * @param {mindmaps.Point} point the new size 97 | */ 98 | RESIZED : "ResizedEvent" 99 | }; 100 | 101 | /** 102 | * Creates a new MainViewController. The controller is responsible for creating 103 | * all main ui elements. 104 | * 105 | * @constructor 106 | * @param {mindmaps.EventBus} eventBus 107 | * @param {mindmaps.MindMapModel} mindmapModel 108 | * @param {mindmaps.InspectorView} view 109 | */ 110 | mindmaps.MainViewController = function(eventBus, mindmapModel, commandRegistry) { 111 | var zoomController = new mindmaps.ZoomController(eventBus, commandRegistry); 112 | var canvasContainer = new mindmaps.CanvasContainer(); 113 | 114 | /** 115 | * When a file was dropped on the canvas container try to open it. 116 | */ 117 | canvasContainer.receivedFileDrop = function(result) { 118 | try { 119 | var doc = mindmaps.Document.fromJSON(result); 120 | mindmapModel.setDocument(doc); 121 | } catch (e) { 122 | eventBus.publish(mindmaps.Event.NOTIFICATION_ERROR, "Impossible de lire le fichier."); 123 | console.warn("Impossible d'ouvrir une carte mentale par glisser-d\351poser."); 124 | } 125 | }; 126 | 127 | this.go = function() { 128 | canvasContainer.init(); 129 | 130 | // init all presenters 131 | 132 | // toolbar 133 | var toolbar = new mindmaps.ToolBarView(); 134 | var toolbarPresenter = new mindmaps.ToolBarPresenter(eventBus, 135 | commandRegistry, toolbar, mindmapModel); 136 | toolbarPresenter.go(); 137 | 138 | // canvas 139 | var canvas = new mindmaps.DefaultCanvasView(); 140 | var canvasPresenter = new mindmaps.CanvasPresenter(eventBus, 141 | commandRegistry, mindmapModel, canvas, zoomController); 142 | canvasPresenter.go(); 143 | 144 | // statusbar 145 | var statusbar = new mindmaps.StatusBarView(); 146 | var statusbarPresenter = new mindmaps.StatusBarPresenter(eventBus, 147 | statusbar); 148 | statusbarPresenter.go(); 149 | 150 | // floating Panels 151 | var fpf = new mindmaps.FloatPanelFactory(canvasContainer); 152 | 153 | // inspector 154 | var inspectorView = new mindmaps.InspectorView(); 155 | var inspectorPresenter = new mindmaps.InspectorPresenter(eventBus, 156 | mindmapModel, inspectorView); 157 | inspectorPresenter.go(); 158 | 159 | var inspectorPanel = fpf 160 | .create("Contr\364leur", inspectorView.getContent()); 161 | inspectorPanel.show(); 162 | statusbarPresenter.addEntry(inspectorPanel); 163 | 164 | // navigator 165 | var naviView = new mindmaps.NavigatorView(); 166 | var naviPresenter = new mindmaps.NavigatorPresenter(eventBus, naviView, 167 | canvasContainer, zoomController); 168 | naviPresenter.go(); 169 | 170 | var navigatorPanel = fpf.create("Navigateur", naviView.getContent()); 171 | navigatorPanel.show(); 172 | statusbarPresenter.addEntry(navigatorPanel); 173 | }; 174 | }; 175 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/MindMap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Creates a new mind map. 4 | * 5 | * @constructor 6 | * @param {mindmaps.Node} [root] 7 | */ 8 | mindmaps.MindMap = function(root) { 9 | /** 10 | * nodes is only used for quick lookup of a node by id. Each node must be 11 | * registered in this map via createNode() or addNode(node). 12 | */ 13 | this.nodes = new mindmaps.NodeMap(); 14 | 15 | if (root) { 16 | this.root = root; 17 | } else { 18 | this.root = new mindmaps.Node(); 19 | this.root.text.font.size = 20; 20 | this.root.text.font.weight = "bold"; 21 | this.root.text.caption = "Id\351e principale"; 22 | } 23 | 24 | this.addNode(this.root); 25 | }; 26 | 27 | /** 28 | * Creates a new mind map object from JSON String. 29 | * 30 | * @static 31 | * @param {String} json 32 | * @returns {mindmaps.MindMap} 33 | */ 34 | mindmaps.MindMap.fromJSON = function(json) { 35 | return mindmaps.MindMap.fromObject(JSON.parse(json)); 36 | }; 37 | 38 | /** 39 | * Creates a new mind map object from generic object. 40 | * 41 | * @static 42 | * @param {Object} obj 43 | * @returns {mindmaps.MindMap} 44 | */ 45 | mindmaps.MindMap.fromObject = function(obj) { 46 | var root = mindmaps.Node.fromObject(obj.root); 47 | var mm = new mindmaps.MindMap(root); 48 | 49 | // register all nodes in the map 50 | root.forEachDescendant(function(descendant) { 51 | mm.addNode(descendant); 52 | }); 53 | 54 | return mm; 55 | }; 56 | 57 | /** 58 | * Called by JSON.stringify(). 59 | * 60 | * @private 61 | * 62 | */ 63 | mindmaps.MindMap.prototype.toJSON = function() { 64 | var obj = { 65 | root : this.root 66 | }; 67 | return obj; 68 | }; 69 | 70 | /** 71 | * Creates a JSON representation of the mind map. 72 | * 73 | * @returns {String} 74 | */ 75 | mindmaps.MindMap.prototype.serialize = function() { 76 | return JSON.stringify(this); 77 | }; 78 | 79 | /** 80 | * Create a node and add to nodes map. 81 | * 82 | * @returns {mindmaps.Node} 83 | */ 84 | mindmaps.MindMap.prototype.createNode = function() { 85 | var node = new mindmaps.Node(); 86 | this.addNode(node); 87 | return node; 88 | }; 89 | 90 | /** 91 | * Adds an existing node and all its children to the nodes map. 92 | * 93 | * @param {mindmaps.Node} node 94 | */ 95 | mindmaps.MindMap.prototype.addNode = function(node) { 96 | this.nodes.add(node); 97 | 98 | // add all children 99 | var self = this; 100 | node.forEachDescendant(function(descendant) { 101 | self.nodes.add(descendant); 102 | }); 103 | }; 104 | 105 | /** 106 | * Removes a node from the mind map. Severs tie to the parent. 107 | * 108 | * @param {mindmaps.Node} node 109 | */ 110 | mindmaps.MindMap.prototype.removeNode = function(node) { 111 | // detach node from parent 112 | var parent = node.parent; 113 | parent.removeChild(node); 114 | 115 | // clear nodes table: remove node and its children 116 | var self = this; 117 | node.forEachDescendant(function(descendant) { 118 | self.nodes.remove(descendant); 119 | }); 120 | 121 | this.nodes.remove(node); 122 | }; 123 | 124 | /** 125 | * Get the root of the mind map. 126 | * 127 | * @returns {mindmaps.Node} 128 | */ 129 | mindmaps.MindMap.prototype.getRoot = function() { 130 | return this.root; 131 | }; 132 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/MindMapModel.js: -------------------------------------------------------------------------------- 1 | /** 2 | *
  3 |  * Creates a new MindMapModel. 
  4 |  * 
  5 |  * This object represents the underlying mind map model and provides access 
  6 |  * to the document, the mind map and the currently selected node.
  7 |  * 
  8 |  * All changes to the mind map pass through this object, either through calling
  9 |  * methods directly or using the executeAction() method to perform NodeActions.
 10 |  * 
11 | * 12 | * @constructor 13 | * @param {mindmaps.EventBus} eventBus 14 | * @param {mindmaps.CommandRegistry} commandRegistry 15 | */ 16 | mindmaps.MindMapModel = function(eventBus, commandRegistry, undoController) { 17 | var self = this; 18 | this.document = null; 19 | this.selectedNode = null; 20 | 21 | /** 22 | * Gets the current document. 23 | * 24 | * @returns {mindmaps.Document} the current document. 25 | */ 26 | this.getDocument = function() { 27 | return this.document; 28 | }; 29 | 30 | /** 31 | * Sets the current document and will publish a DOCUMENT_OPENED or 32 | * DOCUMENT_CLOSED event. 33 | * 34 | * @param {mindmaps.Document} doc or pass null to close the document 35 | */ 36 | this.setDocument = function(doc) { 37 | this.document = doc; 38 | if (doc) { 39 | eventBus.publish(mindmaps.Event.DOCUMENT_OPENED, doc); 40 | } else { 41 | eventBus.publish(mindmaps.Event.DOCUMENT_CLOSED); 42 | } 43 | }; 44 | 45 | /** 46 | * Gets the current mind map associated with the document. 47 | * 48 | * @returns {mindmaps.MindMap} the mind map or null 49 | */ 50 | this.getMindMap = function() { 51 | if (this.document) { 52 | return this.document.mindmap; 53 | } 54 | return null; 55 | }; 56 | 57 | /** 58 | * Initialise. 59 | * 60 | * @private 61 | */ 62 | this.init = function() { 63 | var createNodeCommand = commandRegistry.get(mindmaps.CreateNodeCommand); 64 | createNodeCommand.setHandler(this.createNode.bind(this)); 65 | 66 | var createSiblingNodeCommand = commandRegistry 67 | .get(mindmaps.CreateSiblingNodeCommand); 68 | createSiblingNodeCommand.setHandler(this.createSiblingNode.bind(this)); 69 | 70 | var deleteNodeCommand = commandRegistry.get(mindmaps.DeleteNodeCommand); 71 | deleteNodeCommand.setHandler(this.deleteNode.bind(this)); 72 | 73 | eventBus.subscribe(mindmaps.Event.DOCUMENT_CLOSED, function() { 74 | createNodeCommand.setEnabled(false); 75 | createSiblingNodeCommand.setEnabled(false); 76 | deleteNodeCommand.setEnabled(false); 77 | }); 78 | 79 | eventBus.subscribe(mindmaps.Event.DOCUMENT_OPENED, function() { 80 | createNodeCommand.setEnabled(true); 81 | createSiblingNodeCommand.setEnabled(true); 82 | deleteNodeCommand.setEnabled(true); 83 | }); 84 | }; 85 | 86 | /** 87 | * Deletes a node or the currently selected one if no argument is passed. 88 | * 89 | * @param {mindmaps.Node} [node] defaults to currently selected. 90 | */ 91 | this.deleteNode = function(node) { 92 | if (!node) { 93 | node = this.selectedNode; 94 | } 95 | var map = this.getMindMap(); 96 | var action = new mindmaps.action.DeleteNodeAction(node, map); 97 | this.executeAction(action); 98 | }; 99 | 100 | /** 101 | * Attaches a new node the mind map. If invoked without arguments, it will 102 | * add a new child to the selected node with an automatically generated 103 | * position. 104 | * 105 | * @param {mindmaps.Node} node the new node 106 | * @param {mindmaps.Node} parent 107 | */ 108 | this.createNode = function(node, parent) { 109 | var map = this.getMindMap(); 110 | if (!(node && parent)) { 111 | parent = this.selectedNode; 112 | var action = new mindmaps.action.CreateAutoPositionedNodeAction( 113 | parent, map); 114 | } else { 115 | var action = new mindmaps.action.CreateNodeAction(node, parent, map); 116 | } 117 | 118 | this.executeAction(action); 119 | }; 120 | 121 | /** 122 | * Creates a new auto positioned node as a sibling to the current selected 123 | * node. 124 | */ 125 | this.createSiblingNode = function() { 126 | var map = this.getMindMap(); 127 | var selected = this.selectedNode; 128 | var parent = selected.getParent(); 129 | 130 | // root nodes dont have a parent 131 | if (parent === null) { 132 | return; 133 | } 134 | 135 | var action = new mindmaps.action.CreateAutoPositionedNodeAction(parent, 136 | map); 137 | this.executeAction(action); 138 | }; 139 | 140 | /** 141 | * Sets the node as the currently selected. 142 | * 143 | * @param {mindmaps.Node} node 144 | */ 145 | this.selectNode = function(node) { 146 | if (node === this.selectedNode) { 147 | return; 148 | } 149 | 150 | var oldSelected = this.selectedNode; 151 | this.selectedNode = node; 152 | eventBus.publish(mindmaps.Event.NODE_SELECTED, node, oldSelected); 153 | }; 154 | 155 | /** 156 | * Changes the caption for the passed node or for the selected one if node 157 | * is null. 158 | * 159 | * @param {mindmaps.Node} node 160 | * @param {String} caption 161 | */ 162 | this.changeNodeCaption = function(node, caption) { 163 | if (!node) { 164 | node = this.selectedNode; 165 | } 166 | 167 | var action = new mindmaps.action.ChangeNodeCaptionAction(node, caption); 168 | this.executeAction(action); 169 | }; 170 | 171 | /** 172 | * Executes a node action. An executed action might raise an event over the 173 | * event bus and cause an undo event to be emitted via 174 | * MindMapModel#undoAction. 175 | * 176 | * @param {mindmaps.Action} action 177 | */ 178 | this.executeAction = function(action) { 179 | // a composite action consists of multiple actions which are 180 | // processed individually. 181 | if (action instanceof mindmaps.action.CompositeAction) { 182 | var execute = this.executeAction.bind(this); 183 | action.forEachAction(execute); 184 | return; 185 | } 186 | 187 | var executed = action.execute(); 188 | 189 | // cancel action if false was returned 190 | if (executed !== undefined && !executed) { 191 | return false; 192 | } 193 | 194 | // publish event 195 | if (action.event) { 196 | if (!Array.isArray(action.event)) { 197 | action.event = [ action.event ]; 198 | } 199 | eventBus.publish.apply(eventBus, action.event); 200 | } 201 | 202 | // register undo function if available 203 | if (action.undo) { 204 | var undoFunc = function() { 205 | self.executeAction(action.undo()); 206 | }; 207 | 208 | // register redo function 209 | if (action.redo) { 210 | var redoFunc = function() { 211 | self.executeAction(action.redo()); 212 | }; 213 | } 214 | 215 | undoController.addUndo(undoFunc, redoFunc); 216 | } 217 | }; 218 | 219 | /** 220 | * Saves a document to the localstorage and publishes DOCUMENT_SAVED event on success. 221 | * 222 | * @returns {Boolean} whether the save was successful. 223 | */ 224 | this.saveToLocalStorage = function() { 225 | var doc = this.document; 226 | doc.dates.modified = new Date(); 227 | doc.title = this.getMindMap().getRoot().getCaption(); 228 | var success = mindmaps.LocalDocumentStorage.saveDocument(doc); 229 | if (success) { 230 | eventBus.publish(mindmaps.Event.DOCUMENT_SAVED, doc); 231 | } 232 | 233 | return success; 234 | } 235 | 236 | this.init(); 237 | }; 238 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/NewDocument.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Unused for now. 3 | * 4 | * @constructor 5 | */ 6 | mindmaps.NewDocumentView = function() { 7 | 8 | }; 9 | 10 | /** 11 | * Creates a new NewDocumentPresenter. This presenter has no view associated 12 | * with it for now. It simply creates a new document. It could in the future 13 | * display a dialog where the user could chose options like document title and 14 | * such. 15 | * 16 | * @constructor 17 | */ 18 | mindmaps.NewDocumentPresenter = function(eventBus, mindmapModel, view) { 19 | 20 | this.go = function() { 21 | var doc = new mindmaps.Document(); 22 | mindmapModel.setDocument(doc); 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/NodeMap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new NodeMap object. Map implementation for nodes. The key is 3 | * automatically set to the node id. 4 | * 5 | * @constructor 6 | */ 7 | mindmaps.NodeMap = function() { 8 | this.nodes = {}; 9 | this.count = 0; 10 | }; 11 | 12 | /** 13 | * Return a node by its ID. 14 | * 15 | * @param {String} nodeId 16 | * @returns {mindmaps.Node} 17 | */ 18 | mindmaps.NodeMap.prototype.get = function(nodeId) { 19 | return this.nodes[nodeId]; 20 | }; 21 | 22 | /** 23 | * Adds a node to the map if it hasn't been added before. 24 | * 25 | * @param {mindmaps.Node} node 26 | * @returns {Boolean} true if added, false otherwise. 27 | */ 28 | mindmaps.NodeMap.prototype.add = function(node) { 29 | if (!this.nodes.hasOwnProperty(node.id)) { 30 | this.nodes[node.id] = node; 31 | this.count++; 32 | return true; 33 | } 34 | return false; 35 | }; 36 | 37 | /** 38 | * Removes a node from the map. 39 | * 40 | * @param {mindmaps.Node} node 41 | * @returns {Boolean} true if removed, false otherwise. 42 | */ 43 | mindmaps.NodeMap.prototype.remove = function(node) { 44 | if (this.nodes.hasOwnProperty(node.id)) { 45 | delete this.nodes[node.id]; 46 | this.count--; 47 | return true; 48 | } 49 | return false; 50 | }; 51 | 52 | /** 53 | * Returns the number of nodes in the map. 54 | * 55 | * @returns {Number} 56 | */ 57 | mindmaps.NodeMap.prototype.size = function() { 58 | return this.count; 59 | }; 60 | 61 | /** 62 | * Returns all nodes in the map. 63 | * 64 | * @returns {Array} 65 | */ 66 | mindmaps.NodeMap.prototype.values = function() { 67 | return Object.keys(this.nodes).map(function(key) { 68 | return this.nodes[key]; 69 | }, this); 70 | }; 71 | 72 | /** 73 | * Iterator for nodes. 74 | * 75 | * @param {Function} callback, first argument should be the node. 76 | */ 77 | mindmaps.NodeMap.prototype.each = function(callback) { 78 | for ( var id in this.nodes) { 79 | callback(this.nodes[id]); 80 | } 81 | }; 82 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/Notification.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new notification and attaches it to the target selector. If the 3 | * selector matches more than one element, the first one is taken. 4 | * 5 | * @constructor 6 | * @param {String} targetSelector 7 | * @param [options] the options 8 | * @param {String} [options.title] the title of the notification 9 | * @param {String} [options.content] the content 10 | * @param {String} [options.position] possible values: topLeft, topMiddle, 11 | * topRight, rightTop, rightMiddle, rightBottom, bottomLeft, 12 | * bottomMiddle, bottomRight, leftTop, leftMiddle, leftBottom 13 | * @param {Integer} [options.padding] 14 | * @param {Integer} [options.expires] 15 | * @param {Boolean} [options.closeButton] 16 | * @param {Integer} [options.maxWidth] 17 | * @param {String} [options.type] possible values: info, warn, error 18 | */ 19 | mindmaps.Notification = function(targetSelector, options) { 20 | var self = this; 21 | options = $.extend({}, mindmaps.Notification.Defaults, options); 22 | 23 | // render template 24 | var $notification = this.$el = $("#template-notification").tmpl(options) 25 | .css({ 26 | "max-width" : options.maxWidth 27 | }).addClass(options.type); 28 | 29 | // notification target 30 | var $target = $(targetSelector); 31 | if ($target.length === 0) { 32 | /** 33 | * Return unfinished, invisible notification if selector didn't match. 34 | * It will simply not show up, and does not have to be handled specially 35 | * by the caller. 36 | */ 37 | return this; 38 | } 39 | 40 | var offset = $target.offset(); 41 | var targetLeft = offset.left; 42 | var targetTop = offset.top; 43 | var targetWidth = $target.outerWidth(); 44 | var targetHeight = $target.outerHeight(); 45 | 46 | // add to dom. we need measurings 47 | $notification.appendTo($("body")); 48 | var notiWidth = $notification.outerWidth(); 49 | var notiHeight = $notification.outerHeight(); 50 | var notiLeft, notiTop; 51 | var padding = options.padding; 52 | 53 | // position 54 | switch (options.position) { 55 | 56 | case "topLeft": 57 | notiTop = targetTop - padding - notiHeight; 58 | notiLeft = targetLeft; 59 | break; 60 | case "topMiddle": 61 | notiTop = targetTop - padding - notiHeight; 62 | if (notiWidth < targetWidth) { 63 | notiLeft = targetLeft + (targetWidth - notiWidth) / 2; 64 | } else { 65 | notiLeft = targetLeft - (notiWidth - targetWidth) / 2; 66 | } 67 | break; 68 | case "topRight": 69 | notiTop = targetTop - padding - notiHeight; 70 | notiLeft = targetLeft + targetWidth - notiWidth; 71 | break; 72 | case "rightTop": 73 | notiTop = targetTop; 74 | 75 | break; 76 | case "rightMiddle": 77 | if (notiHeight < targetHeight) { 78 | notiTop = targetTop + (targetHeight - notiHeight) / 2; 79 | } else { 80 | notiTop = targetTop - (notiHeight - targetHeight) / 2; 81 | } 82 | notiLeft = targetLeft + padding + targetWidth; 83 | break; 84 | case "rightBottom": 85 | notiTop = targetTop + targetHeight - notiHeight; 86 | notiLeft = targetLeft + padding + targetWidth; 87 | break; 88 | case "bottomLeft": 89 | notiTop = targetTop + padding + targetHeight; 90 | notiLeft = targetLeft; 91 | break; 92 | case "bottomMiddle": 93 | notiTop = targetTop + padding + targetHeight; 94 | if (notiWidth < targetWidth) { 95 | notiLeft = targetLeft + (targetWidth - notiWidth) / 2; 96 | } else { 97 | notiLeft = targetLeft - (notiWidth - targetWidth) / 2; 98 | } 99 | break; 100 | case "bottomRight": 101 | notiTop = targetTop + padding + targetHeight; 102 | notiLeft = targetLeft + targetWidth - notiWidth; 103 | break; 104 | case "leftTop": 105 | notiTop = targetTop; 106 | notiLeft = targetLeft - padding - notiWidth; 107 | break; 108 | case "leftMiddle": 109 | if (notiHeight < targetHeight) { 110 | notiTop = targetTop + (targetHeight - notiHeight) / 2; 111 | } else { 112 | notiTop = targetTop - (notiHeight - targetHeight) / 2; 113 | } 114 | notiLeft = targetLeft - padding - notiWidth; 115 | break; 116 | case "leftBottom": 117 | notiTop = targetTop + targetHeight - notiHeight; 118 | notiLeft = targetLeft - padding - notiWidth; 119 | break; 120 | } 121 | 122 | $notification.offset({ 123 | left : notiLeft, 124 | top : notiTop 125 | }); 126 | 127 | // fadeout? 128 | if (options.expires) { 129 | setTimeout(function() { 130 | self.close(); 131 | }, options.expires); 132 | } 133 | 134 | // close button 135 | if (options.closeButton) { 136 | $notification.find(".close-button").click(function() { 137 | self.close(); 138 | }); 139 | } 140 | 141 | // display 142 | $notification.fadeIn(600); 143 | }; 144 | 145 | mindmaps.Notification.prototype = { 146 | /** 147 | * Removes the notification. 148 | */ 149 | close : function() { 150 | var n = this.$el; 151 | n.fadeOut(800, function() { 152 | n.remove(); 153 | this.removed = true; 154 | }); 155 | }, 156 | /** 157 | * Returns whether the notification is still on screen. 158 | * 159 | * @returns {Boolean} 160 | */ 161 | isVisible : function() { 162 | return !this.removed; 163 | }, 164 | /** 165 | * Returns the element as a jQuery object. 166 | * 167 | * @returns {jQuery} 168 | */ 169 | $ : function() { 170 | return this.$el; 171 | } 172 | }; 173 | 174 | /** 175 | * The default options. 176 | */ 177 | mindmaps.Notification.Defaults = { 178 | title : null, 179 | content : "New Notification", 180 | position : "topLeft", 181 | padding : 10, 182 | expires : 0, 183 | closeButton : false, 184 | maxWidth : 500, 185 | type : "info" 186 | }; 187 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/OpenDocument.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new OpenDocumentView. This view shows a dialog from which the user 3 | * can select a mind map from the local storage or a hard disk. 4 | * 5 | * @constructor 6 | */ 7 | mindmaps.OpenDocumentView = function() { 8 | var self = this; 9 | 10 | // create dialog 11 | var $dialog = $("#template-open").tmpl().dialog({ 12 | autoOpen : false, 13 | modal : true, 14 | zIndex : 5000, 15 | width : 550, 16 | close : function() { 17 | $(this).dialog("destroy"); 18 | $(this).remove(); 19 | } 20 | }); 21 | 22 | $dialog.find("input").bind("change", function(e) { 23 | if (self.openExernalFileClicked) { 24 | self.openExernalFileClicked(e); 25 | } 26 | }); 27 | 28 | var $table = $dialog.find(".localstorage-filelist"); 29 | $table.delegate("a.title", "click", function() { 30 | if (self.documentClicked) { 31 | var t = $(this).tmplItem(); 32 | self.documentClicked(t.data); 33 | } 34 | }).delegate("a.delete", "click", function() { 35 | if (self.deleteDocumentClicked) { 36 | var t = $(this).tmplItem(); 37 | self.deleteDocumentClicked(t.data); 38 | } 39 | }); 40 | 41 | /** 42 | * Render list of documents in the local storage 43 | * 44 | * @param {mindmaps.Document[]} docs 45 | */ 46 | this.render = function(docs) { 47 | // empty list and insert list of documents 48 | var $list = $(".document-list", $dialog).empty(); 49 | 50 | $("#template-open-table-item").tmpl(docs, { 51 | format : function(date) { 52 | if (!date) return ""; 53 | 54 | var day = date.getDate(); 55 | var month = date.getMonth() + 1; 56 | var year = date.getFullYear(); 57 | return day + "/" + month + "/" + year; 58 | } 59 | }).appendTo($list); 60 | }; 61 | 62 | /** 63 | * Shows the dialog. 64 | * 65 | * @param {mindmaps.Document[]} docs 66 | */ 67 | this.showOpenDialog = function(docs) { 68 | this.render(docs); 69 | $dialog.dialog("open"); 70 | }; 71 | 72 | /** 73 | * Hides the dialog. 74 | */ 75 | this.hideOpenDialog = function() { 76 | $dialog.dialog("close"); 77 | }; 78 | }; 79 | 80 | /** 81 | * Creates a new OpenDocumentPresenter. The presenter can load documents from 82 | * the local storage or hard disk. 83 | * 84 | * @constructor 85 | * @param {mindmaps.EventBus} eventBus 86 | * @param {mindmaps.MindMapModel} mindmapModel 87 | * @param {mindmaps.OpenDocumentView} view 88 | */ 89 | mindmaps.OpenDocumentPresenter = function(eventBus, mindmapModel, view) { 90 | 91 | // TODO experimental, catch errrs 92 | // http://www.w3.org/TR/FileAPI/#dfn-filereader 93 | /** 94 | * View callback: external file has been selected. Try to read and parse a 95 | * valid mindmaps Document. 96 | * 97 | * @ignore 98 | */ 99 | view.openExernalFileClicked = function(e) { 100 | var files = e.target.files; 101 | var file = files[0]; 102 | 103 | var reader = new FileReader(); 104 | reader.onload = function() { 105 | var doc = mindmaps.Document.fromJSON(reader.result); 106 | mindmapModel.setDocument(doc); 107 | view.hideOpenDialog(); 108 | }; 109 | 110 | reader.readAsText(file); 111 | }; 112 | 113 | /** 114 | * View callback: A document in the local storage list has been clicked. 115 | * Load the document and close view. 116 | * 117 | * @ignore 118 | * @param {mindmaps.Document} doc 119 | */ 120 | view.documentClicked = function(doc) { 121 | mindmapModel.setDocument(doc); 122 | view.hideOpenDialog(); 123 | }; 124 | 125 | /** 126 | * View callback: The delete link the local storage list has been clicked. 127 | * Delete the document, and render list again. 128 | * 129 | * @ignore 130 | * @param {mindmaps.Document} doc 131 | */ 132 | view.deleteDocumentClicked = function(doc) { 133 | // TODO event 134 | mindmaps.LocalDocumentStorage.deleteDocument(doc); 135 | 136 | // re-render view 137 | var docs = mindmaps.LocalDocumentStorage.getDocuments(); 138 | view.render(docs); 139 | }; 140 | 141 | /** 142 | * Initialize. 143 | */ 144 | this.go = function() { 145 | var docs = mindmaps.LocalDocumentStorage.getDocuments(); 146 | docs.sort(mindmaps.Document.sortByModifiedDateDescending); 147 | view.showOpenDialog(docs); 148 | }; 149 | }; 150 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/Point.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Point class. 3 | * 4 | * @constructor 5 | * @param {Number} [x=0] 6 | * @param {Number} [y=0] 7 | */ 8 | mindmaps.Point = function(x, y) { 9 | this.x = x || 0; 10 | this.y = y || 0; 11 | }; 12 | 13 | /** 14 | * Returns a new point object from generic obj. 15 | * 16 | * @static 17 | * @param obj 18 | * @returns {mindmaps.Point} 19 | */ 20 | mindmaps.Point.fromObject = function(obj) { 21 | return new mindmaps.Point(obj.x, obj.y); 22 | }; 23 | 24 | /** 25 | * Clones a the point. 26 | * 27 | * @returns {mindmaps.Point} 28 | */ 29 | mindmaps.Point.prototype.clone = function() { 30 | return new mindmaps.Point(this.x, this.y); 31 | }; 32 | 33 | /** 34 | * Adds a point to the point. 35 | * @param {mindmaps.Point} point 36 | */ 37 | mindmaps.Point.prototype.add = function(point) { 38 | this.x += point.x; 39 | this.y += point.y; 40 | }; 41 | 42 | /** 43 | * Returns a String representation. 44 | * @returns {String} 45 | */ 46 | mindmaps.Point.prototype.toString = function() { 47 | return "{x: " + this.x + " y: " + this.y + "}"; 48 | }; 49 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/PrintController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @constructor 3 | * @param {mindmaps.EventBus} eventBus 4 | * @param {mindmaps.CommandRegistry} commandRegistry 5 | * @param {mindmaps.MindMapModel} mindmapModel 6 | */ 7 | mindmaps.PrintController = function(eventBus, commandRegistry, mindmapModel) { 8 | var printCommand = commandRegistry.get(mindmaps.PrintCommand); 9 | printCommand.setHandler(doPrintDocument); 10 | 11 | var renderer = new mindmaps.StaticCanvasRenderer(); 12 | 13 | function doPrintDocument() { 14 | var $img = renderer.renderAsPNG(mindmapModel.getDocument()); 15 | $("#print-area").html($img); 16 | window.print(); 17 | 18 | // TODO chrome only: after print() opens a new tab, and one switches 19 | // back to the old tab the canvas container has scrolled top-left. 20 | } 21 | 22 | eventBus.subscribe(mindmaps.Event.DOCUMENT_CLOSED, function() { 23 | printCommand.setEnabled(false); 24 | }); 25 | 26 | eventBus.subscribe(mindmaps.Event.DOCUMENT_OPENED, function() { 27 | printCommand.setEnabled(true); 28 | }); 29 | }; 30 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/SaveDocument.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new SaveDocumentView. This view renders a dialog where the user can 3 | * save the mind map. 4 | * 5 | * @constructor 6 | */ 7 | mindmaps.SaveDocumentView = function() { 8 | var self = this; 9 | 10 | var $dialog = $("#template-save").tmpl().dialog({ 11 | autoOpen : false, 12 | modal : true, 13 | zIndex : 5000, 14 | width : 550, 15 | close : function() { 16 | // remove dialog from DOM 17 | $(this).dialog("destroy"); 18 | $(this).remove(); 19 | } 20 | }); 21 | 22 | var $localSorageButton = $("#button-save-localstorage").button().click( 23 | function() { 24 | if (self.localStorageButtonClicked) { 25 | self.localStorageButtonClicked(); 26 | } 27 | }); 28 | 29 | var $autoSaveCheckbox = $("#checkbox-autosave-localstorage").click( 30 | function() { 31 | if (self.autoSaveCheckboxClicked) { 32 | self.autoSaveCheckboxClicked($(this).prop("checked")); 33 | } 34 | }); 35 | 36 | var $hddSaveButton = $("#button-save-hdd").button().downloadify({ 37 | filename : function() { 38 | if (self.fileNameRequested) { 39 | return self.fileNameRequested(); 40 | } 41 | }, 42 | data : function() { 43 | if (self.fileContentsRequested) { 44 | return self.fileContentsRequested(); 45 | } 46 | }, 47 | onComplete : function() { 48 | if (self.saveToHddComplete) { 49 | self.saveToHddComplete(); 50 | } 51 | }, 52 | onError : function() { 53 | console.log("error while saving to hdd"); 54 | }, 55 | swf : 'media/downloadify.swf', 56 | downloadImage : 'img/transparent.png', 57 | width : 65, 58 | height : 29, 59 | append : true 60 | }); 61 | 62 | this.setAutoSaveCheckboxState = function(checked) { 63 | $autoSaveCheckbox.prop("checked", checked); 64 | } 65 | 66 | this.showSaveDialog = function() { 67 | $dialog.dialog("open"); 68 | }; 69 | 70 | this.hideSaveDialog = function() { 71 | $dialog.dialog("close"); 72 | }; 73 | }; 74 | 75 | /** 76 | * Creates a new SaveDocumentPresenter. The presenter can store documents in the 77 | * local storage or to a hard disk. 78 | * 79 | * @constructor 80 | * @param {mindmaps.EventBus} eventBus 81 | * @param {mindmaps.MindMapModel} mindmapModel 82 | * @param {mindmaps.SaveDocumentView} view 83 | * @param {mindmaps.AutoSaveController} autosaveController 84 | */ 85 | mindmaps.SaveDocumentPresenter = function(eventBus, mindmapModel, view, autosaveController) { 86 | /** 87 | * View callback when local storage button was clicked. Saves the document 88 | * in the local storage. 89 | * 90 | * @ignore 91 | */ 92 | view.localStorageButtonClicked = function() { 93 | var success = mindmapModel.saveToLocalStorage(); 94 | if (success) { 95 | view.hideSaveDialog(); 96 | } else { 97 | // TODO display error hint 98 | } 99 | }; 100 | 101 | 102 | /** 103 | * View callback: Enables or disables the autosave function for localstorage. 104 | * 105 | * @ignore 106 | */ 107 | view.autoSaveCheckboxClicked = function(checked) { 108 | if (checked) { 109 | autosaveController.enable(); 110 | } else { 111 | autosaveController.disable(); 112 | } 113 | } 114 | 115 | /** 116 | * View callback: Returns the filename for the document for saving on hard 117 | * drive. 118 | * 119 | * @ignore 120 | * @returns {String} 121 | */ 122 | view.fileNameRequested = function() { 123 | return mindmapModel.getMindMap().getRoot().getCaption() + ".json"; 124 | }; 125 | 126 | /** 127 | * View callback: Returns the serialized document. 128 | * 129 | * @ignore 130 | * @returns {String} 131 | */ 132 | view.fileContentsRequested = function() { 133 | var doc = mindmapModel.getDocument(); 134 | doc.dates.modified = new Date(); 135 | return doc.serialize(); 136 | }; 137 | 138 | /** 139 | * View callback: Saving to the hard drive was sucessful. 140 | * 141 | * @ignore 142 | */ 143 | view.saveToHddComplete = function() { 144 | var doc = mindmapModel.getDocument(); 145 | eventBus.publish(mindmaps.Event.DOCUMENT_SAVED, doc); 146 | view.hideSaveDialog(); 147 | }; 148 | 149 | this.go = function() { 150 | view.setAutoSaveCheckboxState(autosaveController.isEnabled()); 151 | view.showSaveDialog(); 152 | }; 153 | }; 154 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/ShortcutController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new ShortcutController. This object takes care of all keyboard 3 | * shortcuts. 4 | * 5 | * @constructor 6 | */ 7 | mindmaps.ShortcutController = function() { 8 | // set to save shortcuts in 9 | /** 10 | * @private 11 | */ 12 | this.shortcuts = {}; 13 | 14 | /** 15 | * Set the event type and add namespace for later removal. 16 | * 17 | * @param {String} shortcut the key combination 18 | * @param {String} [type="keydown"] 19 | * @returns {String} 20 | */ 21 | function getType(shortcut, type) { 22 | type = type || "keydown"; 23 | return type + "." + shortcut; 24 | } 25 | 26 | /** 27 | * Registers a new application wide shortcut. shortcuts can be 28 | * either a string or an array containing multiple possible 29 | * shortcuts for the same action. 30 | * 31 | * @param {String|Array} shortcuts 32 | * @param {Function} handler 33 | * @param {String} [type="keydown"] 34 | */ 35 | this.register = function(shortcuts, handler, type) { 36 | if (!Array.isArray(shortcuts)) { 37 | shortcuts = [shortcuts]; 38 | } 39 | 40 | var self = this; 41 | shortcuts.forEach(function(shortcut) { 42 | type = getType(shortcut, type); 43 | $(document).bind(type, shortcut, function(e) { 44 | // try best to cancel default actions on shortcuts like ctrl+n 45 | e.stopImmediatePropagation(); 46 | e.stopPropagation(); 47 | e.preventDefault(); 48 | handler(); 49 | return false; 50 | self.shortcut[type] = true 51 | }); 52 | }); 53 | }; 54 | 55 | /** 56 | * Unregisters a application shortcut. 57 | * 58 | * @param {String} shortcut 59 | * @param {String} [type="keydown"] 60 | */ 61 | this.unregister = function(shortcut, type) { 62 | type = getType(shortcut, type); 63 | $(document).unbind(type); 64 | delete this.shortcuts[type]; 65 | }; 66 | 67 | /** 68 | * Removes all shortcuts. 69 | */ 70 | this.unregisterAll = function() { 71 | for ( var shortcut in shortcuts) { 72 | $(document).unbind(shortcut); 73 | } 74 | }; 75 | }; 76 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/StatusBar.js: -------------------------------------------------------------------------------- 1 | // TODO Rename those objects to TaskBar* 2 | 3 | /** 4 | * Creates a new StatusBarView. 5 | * 6 | * @constructor 7 | */ 8 | mindmaps.StatusBarView = function() { 9 | var self = this; 10 | var $statusbar = $("#statusbar"); 11 | 12 | this.init = function() { 13 | }; 14 | 15 | /** 16 | * Creates and adds a new button to the stats baar. 17 | * 18 | * @param {String} id 19 | * @param {String} text 20 | * @returns {jQuery} 21 | */ 22 | this.createButton = function(id, text) { 23 | return $("