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/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/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/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.
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.
-- « 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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/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/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/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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://framagit.org)
2 |
3 |  **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 |  **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 |
--------------------------------------------------------------------------------
/webapps/wisemapping/mindmaps/js/ZoomController.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Creates a new ZoomController. Object that controls the zoom setting.
3 | *
4 | * @constructor
5 | * @param {mindmaps.EventBus} eventBus
6 | */
7 | mindmaps.ZoomController = function(eventBus, commandRegistry) {
8 | var self = this;
9 |
10 | /**
11 | * @constant
12 | */
13 | this.ZOOM_STEP = 0.25;
14 |
15 | /**
16 | * @constant
17 | */
18 | this.MAX_ZOOM = 3;
19 |
20 | /**
21 | * @constant
22 | */
23 | this.MIN_ZOOM = 0.25;
24 |
25 | /**
26 | * @constant
27 | */
28 | this.DEFAULT_ZOOM = 1;
29 |
30 | /**
31 | * @private
32 | */
33 | this.zoomFactor = this.DEFAULT_ZOOM;
34 |
35 | /**
36 | * Sets the zoom factor if param is within MIN_ZOOM and MAX_ZOOM bounds.
37 | *
38 | * @param {Number} factor
39 | */
40 | this.zoomTo = function(factor) {
41 | if (factor <= this.MAX_ZOOM && factor >= this.MIN_ZOOM) {
42 | this.zoomFactor = factor;
43 | eventBus.publish(mindmaps.Event.ZOOM_CHANGED, factor);
44 | }
45 | };
46 |
47 | /**
48 | * Zooms in by ZOOM_STEP.
49 | *
50 | * @returns {Number} the new zoomFactor.
51 | */
52 | this.zoomIn = function() {
53 | this.zoomFactor += this.ZOOM_STEP;
54 | if (this.zoomFactor > this.MAX_ZOOM) {
55 | this.zoomFactor -= this.ZOOM_STEP;
56 | } else {
57 | eventBus.publish(mindmaps.Event.ZOOM_CHANGED, this.zoomFactor);
58 | }
59 |
60 | return this.zoomFactor;
61 | };
62 |
63 | /**
64 | * Zooms out by ZOOM_STEP,
65 | *
66 | * @returns {Number} the new zoomFactor.
67 | */
68 | this.zoomOut = function() {
69 | this.zoomFactor -= this.ZOOM_STEP;
70 | if (this.zoomFactor < this.MIN_ZOOM) {
71 | this.zoomFactor += this.ZOOM_STEP;
72 | } else {
73 | eventBus.publish(mindmaps.Event.ZOOM_CHANGED, this.zoomFactor);
74 | }
75 |
76 | return this.zoomFactor;
77 | };
78 |
79 | /**
80 | * Reset zoom factor when document was closed.
81 | *
82 | * @ignore
83 | */
84 | eventBus.subscribe(mindmaps.Event.DOCUMENT_CLOSED, function(doc) {
85 | self.zoomTo(self.DEFAULT_ZOOM);
86 | });
87 | };
88 |
--------------------------------------------------------------------------------
/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/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 |
21 |
22 | ${requestScope.viewTitle}
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
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 |
Attention : Sur la version actuellement installée de Wisemapping, l’export en pdf ou jpg/png ne fonctionne pas. Nous avons donc désactivé cette fonctionnalité. Lorsqu’une version plus récente du logiciel corrigera ce bug, nous la proposerons à nouveau.
49 |
50 |
51 |
52 |
53 |
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 :
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 :
18 | * Adds the ability to manage elements scroll by dragging
19 | * one or more of its descendant elements. Options parameter
20 | * allow to specifically select which inner elements will
21 | * respond to the drag events.
22 | *
23 | * options properties:
24 | * ------------------------------------------------------------------------
25 | * dragSelector | jquery selector to apply to each wrapped element
26 | * | to find which will be the dragging elements.
27 | * | Defaults to '>:first' which is the first child of
28 | * | scrollable element
29 | * ------------------------------------------------------------------------
30 | * acceptPropagatedEvent| Will the dragging element accept propagated
31 | * | events? default is yes, a propagated mouse event
32 | * | on a inner element will be accepted and processed.
33 | * | If set to false, only events originated on the
34 | * | draggable elements will be processed.
35 | * ------------------------------------------------------------------------
36 | * preventDefault | Prevents the event to propagate further effectivey
37 | * | dissabling other default actions. Defaults to true
38 | * ------------------------------------------------------------------------
39 | * delegateMode | Attach the dragSelector using $.delegate() instead of $.bind()
40 | *
41 | * usage examples:
42 | * To add the scroll by drag to the element id=viewport when dragging its
43 | * first child accepting any propagated events
44 | * $('#viewport').dragscrollable();
45 | * To add the scroll by drag ability to any element div of class viewport
46 | * when dragging its first descendant of class dragMe responding only to
47 | * evcents originated on the '.dragMe' elements.
48 | * $('div.viewport').dragscrollable({dragSelector:'.dragMe:first',
49 | * acceptPropagatedEvent: false});
50 | * Notice that some 'viewports' could be nested within others but events
51 | * would not interfere as acceptPropagatedEvent is set to false.
52 | *
10 | Contrairement à ce qui est indiqué dans le tutoriel vidéo, les exports en pdf ou en jpg/png ne fonctionnent pas sur cette version de Wisemapping. Nous les avons donc désactivés.
11 |
12 |
78 |
81 |
82 |
83 |
84 |
85 |
100 |
--------------------------------------------------------------------------------
/webapps/wisemapping/mindmaps/js/UndoManager.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Creates a new UndoManager
3 | *
4 | * @constructor
5 | * @param {Integer} [maxStackSize=64]
6 | */
7 | function UndoManager(maxStackSize) {
8 | this.maxStackSize = maxStackSize || 64;
9 |
10 | var State = {
11 | UNDO : "undo",
12 | REDO : "redo"
13 | };
14 |
15 | var self = this;
16 | var undoStack = new UndoManager.CircularStack(this.maxStackSize);
17 | var redoStack = new UndoManager.CircularStack(this.maxStackSize);
18 | var undoContext = false;
19 | var currentAction = null;
20 | var currentState = null;
21 |
22 | var onStateChange = function() {
23 | if (self.stateChanged) {
24 | self.stateChanged();
25 | }
26 | };
27 |
28 | var callAction = function(action) {
29 | currentAction = action;
30 | undoContext = true;
31 | switch (currentState) {
32 | case State.UNDO:
33 | action.undo();
34 | break;
35 | case State.REDO:
36 | action.redo();
37 | break;
38 | }
39 | undoContext = false;
40 | };
41 |
42 | /**
43 | * Register an undo operation. A call to .undo() will cause the undo
44 | * function to be executed. If you omit the second argument and the undo
45 | * function will cause the registration of another undo operation, then this
46 | * operation will be used as the redo function.
47 | *
48 | * If you provide both arguments, a call to addUndo() during an undo() or
49 | * redo() will have no effect.
50 | *
51 | *
52 | * @param {Function} undoFunc The function that should undo the changes.
53 | * @param {Function} [redoFunc] The function that should redo the undone
54 | * changes.
55 | */
56 | this.addUndo = function(undoFunc, redoFunc) {
57 | if (undoContext) {
58 | /**
59 | * If we are currently undoing an action and don't have a redo
60 | * function yet, store the undo function to the undo function, which
61 | * is in turn the redo function.
62 | */
63 | if (currentAction.redo == null && currentState == State.UNDO) {
64 | currentAction.redo = undoFunc;
65 | }
66 | } else {
67 | /**
68 | * We are not undoing right now. Store the functions as an action.
69 | */
70 | var action = {
71 | undo : undoFunc,
72 | redo : redoFunc
73 | };
74 | undoStack.push(action);
75 | // clear redo stack
76 | redoStack.clear();
77 |
78 | onStateChange();
79 | }
80 | };
81 |
82 | /**
83 | * Undoes the last action.
84 | */
85 | this.undo = function() {
86 | if (this.canUndo()) {
87 | currentState = State.UNDO;
88 | var action = undoStack.pop();
89 | callAction(action);
90 |
91 | if (action.redo) {
92 | redoStack.push(action);
93 | }
94 |
95 | onStateChange();
96 | }
97 | };
98 |
99 | /**
100 | * Redoes the last action.
101 | */
102 | this.redo = function() {
103 | if (this.canRedo()) {
104 | currentState = State.REDO;
105 | var action = redoStack.pop();
106 | callAction(action);
107 |
108 | if (action.undo) {
109 | undoStack.push(action);
110 | }
111 |
112 | onStateChange();
113 | }
114 | };
115 |
116 | /**
117 | *
118 | * @returns {Boolean} true if undo is possible, false otherwise.
119 | */
120 | this.canUndo = function() {
121 | return !undoStack.isEmpty();
122 | };
123 |
124 | /**
125 | *
126 | * @returns {Boolean} true if redo is possible, false otherwise.
127 | */
128 | this.canRedo = function() {
129 | return !redoStack.isEmpty();
130 | };
131 |
132 | /**
133 | * Resets this instance of the undo manager.
134 | */
135 | this.reset = function() {
136 | undoStack.clear();
137 | redoStack.clear();
138 | undoContext = false;
139 | currentAction = null;
140 | currentState = null;
141 |
142 | onStateChange();
143 | };
144 |
145 | /**
146 | * Event that is fired when undo or redo state changes.
147 | *
148 | * @event
149 | */
150 | this.stateChanged = function() {
151 | };
152 | }
153 |
154 | /**
155 | * Creates a new CircularStack. This is a stack implementation backed by a
156 | * circular buffer where the oldest entries automatically are overwritten when
157 | * new items are pushed onto the stack and the maximum size has been reached.
158 | *
159 | * @constructor
160 | * @param {Integer} [maxSize=32]
161 | */
162 | UndoManager.CircularStack = function(maxSize) {
163 | this.maxSize = maxSize || 32;
164 | this.buffer = [];
165 | this.nextPointer = 0;
166 | };
167 |
168 | /**
169 | * Pushes a new item onto the stack.
170 | *
171 | * @param {Any} item
172 | */
173 | UndoManager.CircularStack.prototype.push = function(item) {
174 | this.buffer[this.nextPointer] = item;
175 | this.nextPointer = (this.nextPointer + 1) % this.maxSize;
176 | };
177 |
178 | /**
179 | * Checks whether the stack is empty.
180 | *
181 | * @returns {Boolean} true if empty, false otherwise.
182 | */
183 | UndoManager.CircularStack.prototype.isEmpty = function() {
184 | if (this.buffer.length === 0) {
185 | return true;
186 | }
187 |
188 | var prevPointer = this.getPreviousPointer();
189 | if (prevPointer === null) {
190 | return true;
191 | } else {
192 | return this.buffer[prevPointer] === null;
193 | }
194 | };
195 |
196 | /**
197 | * Gets the position of the previously inserted item in the buffer.
198 | *
199 | * @private
200 | * @returns {Integer} the previous pointer position or null if no previous
201 | * exists.
202 | */
203 | UndoManager.CircularStack.prototype.getPreviousPointer = function() {
204 | if (this.nextPointer > 0) {
205 | return this.nextPointer - 1;
206 | } else {
207 | if (this.buffer.length < this.maxSize) {
208 | return null;
209 | } else {
210 | return this.maxSize - 1;
211 | }
212 | }
213 | };
214 |
215 | /**
216 | * Clears the stack.
217 | */
218 | UndoManager.CircularStack.prototype.clear = function() {
219 | this.buffer.length = 0;
220 | this.nextPointer = 0;
221 | };
222 |
223 | /**
224 | * Returns and removes the top most item of the stack.
225 | *
226 | * @returns {Any} the last inserted item or null if stack is empty.
227 | */
228 | UndoManager.CircularStack.prototype.pop = function() {
229 | if (this.isEmpty()) {
230 | return null;
231 | }
232 |
233 | var previousPointer = this.getPreviousPointer();
234 | var item = this.buffer[previousPointer];
235 | this.buffer[previousPointer] = null;
236 | this.nextPointer = previousPointer;
237 |
238 | return item;
239 | };
240 |
241 | /**
242 | * Returns but not removes the top most item of the stack.
243 | *
244 | * @returns {Any} the last inserted item or null if stack is empty.
245 | */
246 | UndoManager.CircularStack.prototype.peek = function() {
247 | if (this.isEmpty()) {
248 | return null;
249 | }
250 | return this.buffer[this.getPreviousPointer()];
251 | };
252 |
--------------------------------------------------------------------------------
/webapps/wisemapping/jsp/labelIconList.jsp:
--------------------------------------------------------------------------------
1 | <%@page pageEncoding="UTF-8" %>
2 |
3 |
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/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/jsp/userRegistration.jsp:
--------------------------------------------------------------------------------
1 | <%@page pageEncoding="UTF-8" %>
2 | <%@include file="/jsp/init.jsp" %>
3 |
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 |