├── webapps └── wisemapping │ ├── mindmaps │ ├── index.jsp │ ├── img │ │ ├── grid.gif │ │ ├── favicon.png │ │ ├── openhand.png │ │ ├── closedhand.png │ │ ├── plus-minus.png │ │ ├── transparent.png │ │ ├── creator-nub-sprite.png │ │ └── octopus_orange_ombre_pt.png │ ├── media │ │ └── downloadify.swf │ ├── css │ │ ├── minicolors │ │ │ ├── images │ │ │ │ ├── circle.gif │ │ │ │ ├── line.gif │ │ │ │ ├── gradient.png │ │ │ │ ├── rainbow.png │ │ │ │ └── trigger.png │ │ │ └── jquery.miniColors.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 │ │ ├── common.css │ │ ├── common.css_new │ │ └── about.css │ ├── js │ │ ├── NewDocument.js │ │ ├── PrintController.js │ │ ├── Point.js │ │ ├── CommandRegistry.js │ │ ├── AutoSaveController.js │ │ ├── ExportMap.js │ │ ├── ClipboardController.js │ │ ├── NodeMap.js │ │ ├── ZoomController.js │ │ ├── ShortcutController.js │ │ ├── UndoController.js │ │ ├── libs │ │ │ ├── jquery.mousewheel.js │ │ │ ├── downloadify.min.js │ │ │ ├── jquery.hotkeys.js │ │ │ ├── dragscrollable.js │ │ │ └── events.js │ │ ├── MindMap.js │ │ ├── Event.js │ │ ├── StatusBar.js │ │ ├── Document.js │ │ ├── ApplicationController.js │ │ ├── OpenDocument.js │ │ ├── SaveDocument.js │ │ ├── Storage.js │ │ ├── MainViewController.js │ │ ├── Notification.js │ │ ├── Util.js │ │ ├── UndoManager.js │ │ ├── MindMapModel.js │ │ └── FloatPanel.js │ ├── README.md │ ├── cache.appcache │ └── about.html │ ├── favicon.ico │ ├── images │ ├── favicon.ico │ ├── framindmap.png │ └── mindmaps.png │ ├── WEB-INF │ └── lib │ │ └── wise-webapp-4.0.3.jar │ ├── framindmap.html │ ├── jsp │ ├── userForgotPasswordError.jsp │ ├── footer.jsp │ ├── userForgotPasswordSuccess.jsp │ ├── userForgotPassword.jsp │ ├── template.jsp │ ├── userRegistrationSuccess.jsp │ ├── mindmapHistory.jsp │ ├── header.jsp │ ├── login.jsp │ ├── mindmapEmbed.jsp │ ├── mindmapPrint.jsp │ ├── framindmap.jsp │ ├── mindmapPublish.jsp │ ├── mindmapEditor.jsp │ ├── mindmapExport.jsp │ ├── labelIconList.jsp │ └── userRegistration.jsp │ └── css │ └── pageHeaders.css ├── .gitmodules ├── .gitignore ├── _src └── wise-webapp │ └── src │ └── main │ └── resources │ ├── mail │ ├── confirmationMail.vm │ ├── baseLayout.vm │ └── newCollaboration.vm │ └── samples │ └── tutorial.vm ├── service └── wisemapping ├── README.md ├── contexts └── wisemapping.xml └── etc └── jetty.xml /webapps/wisemapping/mindmaps/index.jsp: -------------------------------------------------------------------------------- 1 | <% 2 | 3 | response.sendRedirect("index.html"); 4 | 5 | %> 6 | -------------------------------------------------------------------------------- /webapps/wisemapping/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/favicon.ico -------------------------------------------------------------------------------- /webapps/wisemapping/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/images/favicon.ico -------------------------------------------------------------------------------- /webapps/wisemapping/images/framindmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/images/framindmap.png -------------------------------------------------------------------------------- /webapps/wisemapping/images/mindmaps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/images/mindmaps.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/grid.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/img/grid.gif -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/img/favicon.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/openhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/img/openhand.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "webapps/wisemapping/nav"] 2 | path = webapps/wisemapping/nav 3 | url = https://git.framasoft.org/framasoft/framanav.git 4 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/closedhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/img/closedhand.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/plus-minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/img/plus-minus.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/img/transparent.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/media/downloadify.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/media/downloadify.swf -------------------------------------------------------------------------------- /webapps/wisemapping/WEB-INF/lib/wise-webapp-4.0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/WEB-INF/lib/wise-webapp-4.0.3.jar -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/creator-nub-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/img/creator-nub-sprite.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/circle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/css/minicolors/images/circle.gif -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/css/minicolors/images/line.gif -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/img/octopus_orange_ombre_pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/img/octopus_orange_ombre_pt.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/bg_fallback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/css/Aristo/images/bg_fallback.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/icon_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/css/Aristo/images/icon_sprite.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/progress_bar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/css/Aristo/images/progress_bar.gif -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/css/minicolors/images/gradient.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/rainbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/css/minicolors/images/rainbow.png -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/minicolors/images/trigger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/webapps/wisemapping/mindmaps/css/minicolors/images/trigger.png -------------------------------------------------------------------------------- /webapps/wisemapping/framindmap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/css/Aristo/images/slider_handles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/framasoft/framindmap/HEAD/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/HEAD/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/HEAD/webapps/wisemapping/mindmaps/css/Aristo/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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/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/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/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.

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/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/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/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 | -------------------------------------------------------------------------------- /_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 | -------------------------------------------------------------------------------- /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/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/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/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 | -------------------------------------------------------------------------------- /_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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | <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/mindmaps/js/UndoController.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates a new UndoController. The undo controller manages an instance of 3 | * UndoManager and delegates all undo and redo commands to the undo manager. 4 | * 5 | * @constructor 6 | * @param {mindmaps.EventBus} eventBus 7 | * @param {mindmaps.CommandRegistry} commandRegistry 8 | */ 9 | mindmaps.UndoController = function(eventBus, commandRegistry) { 10 | 11 | /** 12 | * Initialise. 13 | * 14 | * @private 15 | */ 16 | this.init = function() { 17 | this.undoManager = new UndoManager(128); 18 | this.undoManager.stateChanged = this.undoStateChanged.bind(this); 19 | 20 | this.undoCommand = commandRegistry.get(mindmaps.UndoCommand); 21 | this.undoCommand.setHandler(this.doUndo.bind(this)); 22 | 23 | this.redoCommand = commandRegistry.get(mindmaps.RedoCommand); 24 | this.redoCommand.setHandler(this.doRedo.bind(this)); 25 | 26 | eventBus.subscribe(mindmaps.Event.DOCUMENT_OPENED, this.documentOpened 27 | .bind(this)); 28 | 29 | eventBus.subscribe(mindmaps.Event.DOCUMENT_CLOSED, this.documentClosed 30 | .bind(this)); 31 | }; 32 | 33 | /** 34 | * Handler for state changed event from undo manager. 35 | */ 36 | this.undoStateChanged = function() { 37 | this.undoCommand.setEnabled(this.undoManager.canUndo()); 38 | this.redoCommand.setEnabled(this.undoManager.canRedo()); 39 | }; 40 | 41 | /** 42 | * @see mindmaps.UndoManager#addUndo 43 | */ 44 | this.addUndo = function(undoFunc, redoFunc) { 45 | this.undoManager.addUndo(undoFunc, redoFunc); 46 | }; 47 | 48 | /** 49 | * Handler for undo command. 50 | */ 51 | this.doUndo = function() { 52 | this.undoManager.undo(); 53 | }; 54 | 55 | /** 56 | * Handler for redo command. 57 | */ 58 | this.doRedo = function() { 59 | this.undoManager.redo(); 60 | }; 61 | 62 | /** 63 | * Handler for document opened event. 64 | */ 65 | this.documentOpened = function() { 66 | this.undoManager.reset(); 67 | this.undoStateChanged(); 68 | }; 69 | 70 | /** 71 | * Handler for document closed event. 72 | */ 73 | this.documentClosed = function() { 74 | this.undoManager.reset(); 75 | this.undoStateChanged(); 76 | }; 77 | 78 | this.init(); 79 | }; 80 | -------------------------------------------------------------------------------- /_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 | -------------------------------------------------------------------------------- /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/js/libs/jquery.mousewheel.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) 2 | * Licensed under the MIT License (LICENSE.txt). 3 | * 4 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 5 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 6 | * Thanks to: Seamus Leahy for adding deltaX and deltaY 7 | * 8 | * Version: 3.0.4 9 | * 10 | * Requires: 1.2.2+ 11 | */ 12 | 13 | (function($) { 14 | 15 | var types = ['DOMMouseScroll', 'mousewheel']; 16 | 17 | $.event.special.mousewheel = { 18 | setup: function() { 19 | if ( this.addEventListener ) { 20 | for ( var i=types.length; i; ) { 21 | this.addEventListener( types[--i], handler, false ); 22 | } 23 | } else { 24 | this.onmousewheel = handler; 25 | } 26 | }, 27 | 28 | teardown: function() { 29 | if ( this.removeEventListener ) { 30 | for ( var i=types.length; i; ) { 31 | this.removeEventListener( types[--i], handler, false ); 32 | } 33 | } else { 34 | this.onmousewheel = null; 35 | } 36 | } 37 | }; 38 | 39 | $.fn.extend({ 40 | mousewheel: function(fn) { 41 | return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); 42 | }, 43 | 44 | unmousewheel: function(fn) { 45 | return this.unbind("mousewheel", fn); 46 | } 47 | }); 48 | 49 | 50 | function handler(event) { 51 | var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; 52 | event = $.event.fix(orgEvent); 53 | event.type = "mousewheel"; 54 | 55 | // Old school scrollwheel delta 56 | if ( event.wheelDelta ) { delta = event.wheelDelta/120; } 57 | if ( event.detail ) { delta = -event.detail/3; } 58 | 59 | // New school multidimensional scroll (touchpads) deltas 60 | deltaY = delta; 61 | 62 | // Gecko 63 | if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { 64 | deltaY = 0; 65 | deltaX = -1*delta; 66 | } 67 | 68 | // Webkit 69 | if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } 70 | if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } 71 | 72 | // Add event and delta to the front of the arguments 73 | args.unshift(event, delta, deltaX, deltaY); 74 | 75 | return $.event.handle.apply(this, args); 76 | } 77 | 78 | })(jQuery); -------------------------------------------------------------------------------- /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/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/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/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/libs/downloadify.min.js: -------------------------------------------------------------------------------- 1 | /*! Downloadify 0.2 (c) 2009 by Douglas Neiner. Licensed under the MIT license */ 2 | /* See http://github.com/dcneiner/Downloadify for license and more info */ 3 | (function(){Downloadify=window.Downloadify={queue:{},uid:new Date().getTime(),getTextForSave:function(a){var b=Downloadify.queue[a];if(b)return b.getData();return""},getFileNameForSave:function(a){var b=Downloadify.queue[a];if(b)return b.getFilename();return""},getDataTypeForSave:function(a){var b=Downloadify.queue[a];if(b)return b.getDataType();return""},saveComplete:function(a){var b=Downloadify.queue[a];if(b)b.complete();return true},saveCancel:function(a){var b=Downloadify.queue[a];if(b)b.cancel();return true},saveError:function(a){var b=Downloadify.queue[a];if(b)b.error();return true},addToQueue:function(a){Downloadify.queue[a.queue_name]=a},getUID:function(a){if(a.id=="")a.id='downloadify_'+Downloadify.uid++;return a.id}};Downloadify.create=function(a,b){var c=(typeof(a)=="string"?document.getElementById(a):a);return new Downloadify.Container(c,b)};Downloadify.Container=function(d,e){var f=this;f.el=d;f.enabled=true;f.dataCallback=null;f.filenameCallback=null;f.data=null;f.filename=null;var g=function(){f.options=e;if(!f.options.append)f.el.innerHTML="";f.flashContainer=document.createElement('span');f.el.appendChild(f.flashContainer);f.queue_name=Downloadify.getUID(f.flashContainer);if(typeof(f.options.filename)==="function")f.filenameCallback=f.options.filename;else if(f.options.filename)f.filename=f.options.filename;if(typeof(f.options.data)==="function")f.dataCallback=f.options.data;else if(f.options.data)f.data=f.options.data;var a={queue_name:f.queue_name,width:f.options.width,height:f.options.height};var b={allowScriptAccess:'always'};var c={id:f.flashContainer.id,name:f.flashContainer.id};if(f.options.enabled===false)f.enabled=false;if(f.options.transparent===true)b.wmode="transparent";if(f.options.downloadImage)a.downloadImage=f.options.downloadImage;swfobject.embedSWF(f.options.swf,f.flashContainer.id,f.options.width,f.options.height,"10",null,a,b,c);Downloadify.addToQueue(f)};f.enable=function(){var a=document.getElementById(f.flashContainer.id);a.setEnabled(true);f.enabled=true};f.disable=function(){var a=document.getElementById(f.flashContainer.id);a.setEnabled(false);f.enabled=false};f.getData=function(){if(!f.enabled)return"";if(f.dataCallback)return f.dataCallback();else if(f.data)return f.data;else return""};f.getFilename=function(){if(f.filenameCallback)return f.filenameCallback();else if(f.filename)return f.filename;else return""};f.getDataType=function(){if(f.options.dataType)return f.options.dataType;return"string"};f.complete=function(){if(typeof(f.options.onComplete)==="function")f.options.onComplete()};f.cancel=function(){if(typeof(f.options.onCancel)==="function")f.options.onCancel()};f.error=function(){if(typeof(f.options.onError)==="function")f.options.onError()};g()};Downloadify.defaultOptions={swf:'media/downloadify.swf',downloadImage:'images/download.png',width:100,height:30,transparent:true,append:false,dataType:"string"}})();if(typeof(jQuery)!="undefined"){(function($){$.fn.downloadify=function(b){return this.each(function(){b=$.extend({},Downloadify.defaultOptions,b);var a=Downloadify.create(this,b);$(this).data('Downloadify',a)})}})(jQuery)};if(typeof(MooTools)!='undefined'){Element.implement({downloadify:function(a){a=$merge(Downloadify.defaultOptions,a);return this.store('Downloadify',Downloadify.create(this,a))}})}; -------------------------------------------------------------------------------- /webapps/wisemapping/mindmaps/js/libs/jquery.hotkeys.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Hotkeys Plugin 3 | * Copyright 2010, John Resig 4 | * Dual licensed under the MIT or GPL Version 2 licenses. 5 | * 6 | * Based upon the plugin by Tzury Bar Yochay: 7 | * http://github.com/tzuryby/hotkeys 8 | * 9 | * Original idea by: 10 | * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ 11 | */ 12 | 13 | (function(jQuery){ 14 | 15 | jQuery.hotkeys = { 16 | version: "0.8", 17 | 18 | specialKeys: { 19 | 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", 20 | 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", 21 | 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", 22 | 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 23 | 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", 24 | 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", 25 | 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta" 26 | }, 27 | 28 | shiftNums: { 29 | "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", 30 | "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", 31 | ".": ">", "/": "?", "\\": "|" 32 | } 33 | }; 34 | 35 | function keyHandler( handleObj ) { 36 | // Only care when a possible input has been specified 37 | if ( typeof handleObj.data !== "string" ) { 38 | return; 39 | } 40 | 41 | var origHandler = handleObj.handler, 42 | keys = handleObj.data.toLowerCase().split(" "); 43 | 44 | handleObj.handler = function( event ) { 45 | // Don't fire in text-accepting inputs that we didn't directly bind to 46 | if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) || 47 | event.target.type === "text") ) { 48 | return; 49 | } 50 | 51 | // Keypress represents characters, not special keys 52 | var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ], 53 | character = String.fromCharCode( event.which ).toLowerCase(), 54 | key, modif = "", possible = {}; 55 | 56 | // check combinations (alt|ctrl|shift+anything) 57 | if ( event.altKey && special !== "alt" ) { 58 | modif += "alt+"; 59 | } 60 | 61 | if ( event.ctrlKey && special !== "ctrl" ) { 62 | modif += "ctrl+"; 63 | } 64 | 65 | // TODO: Need to make sure this works consistently across platforms 66 | if ( event.metaKey && !event.ctrlKey && special !== "meta" ) { 67 | modif += "meta+"; 68 | } 69 | 70 | if ( event.shiftKey && special !== "shift" ) { 71 | modif += "shift+"; 72 | } 73 | 74 | if ( special ) { 75 | possible[ modif + special ] = true; 76 | 77 | } else { 78 | possible[ modif + character ] = true; 79 | possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true; 80 | 81 | // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" 82 | if ( modif === "shift+" ) { 83 | possible[ jQuery.hotkeys.shiftNums[ character ] ] = true; 84 | } 85 | } 86 | 87 | for ( var i = 0, l = keys.length; i < l; i++ ) { 88 | if ( possible[ keys[i] ] ) { 89 | return origHandler.apply( this, arguments ); 90 | } 91 | } 92 | }; 93 | } 94 | 95 | jQuery.each([ "keydown", "keyup", "keypress" ], function() { 96 | jQuery.event.special[ this ] = { add: keyHandler }; 97 | }); 98 | 99 | })( jQuery ); -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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 $("
44 | 45 |
46 |


47 |
48 | Se connecter » 49 |
50 | 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/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/Storage.js: -------------------------------------------------------------------------------- 1 | // TODO store a wrapper object with doc title, modified date and document as string in localstorage. 2 | // in open document window show wrapper object and only parse document on demand. 3 | // when many large documents are stored in LS, opening of window takes a rather long time 4 | mindmaps.LocalStorage = (function() { 5 | return { 6 | put : function(key, value) { 7 | localStorage.setItem(key, value); 8 | }, 9 | get : function(key) { 10 | return localStorage.getItem(key); 11 | }, 12 | clear : function() { 13 | localStorage.clear(); 14 | } 15 | }; 16 | })(); 17 | 18 | mindmaps.SessionStorage = (function() { 19 | return { 20 | put : function(key, value) { 21 | sessionStorage.setItem(key, value); 22 | }, 23 | get : function(key) { 24 | return sessionStorage.getItem(key); 25 | }, 26 | clear : function() { 27 | sessionStorage.clear(); 28 | } 29 | }; 30 | })(); 31 | 32 | /** 33 | * @namespace 34 | */ 35 | mindmaps.LocalDocumentStorage = (function() { 36 | var prefix = "mindmaps.document."; 37 | 38 | var getDocumentByKey = function(key) { 39 | var json = localStorage.getItem(key); 40 | if (json === null) { 41 | return null; 42 | } 43 | 44 | /** 45 | * Catch any SytaxErrors when document can't be parsed. 46 | */ 47 | try { 48 | return mindmaps.Document.fromJSON(json); 49 | } catch (error) { 50 | console.error("Error while loading document from local storage", 51 | error); 52 | return null; 53 | } 54 | }; 55 | 56 | /** 57 | * Public API 58 | * @scope mindmaps.LocalDocumentStorage 59 | */ 60 | return { 61 | /** 62 | * Saves a document to the localstorage. Overwrites the old document if 63 | * one with the same id exists. 64 | * 65 | * @param {mindmaps.Document} doc 66 | * 67 | * @returns {Boolean} true if save was successful, false otherwise. 68 | */ 69 | saveDocument : function(doc) { 70 | try { 71 | localStorage.setItem(prefix + doc.id, doc.serialize()); 72 | return true; 73 | } catch (error) { 74 | // QUOTA_EXCEEDED 75 | console.error("Error while saving document to local storage", 76 | error); 77 | return false; 78 | } 79 | }, 80 | 81 | /** 82 | * Loads a document from the local storage. 83 | * 84 | * @param {String} docId 85 | * 86 | * @returns {mindmaps.Document} the document or null if not found. 87 | */ 88 | loadDocument : function(docId) { 89 | return getDocumentByKey(prefix + docId); 90 | }, 91 | 92 | /** 93 | * Finds all documents in the local storage object. 94 | * 95 | * @returns {Array} an Array of documents 96 | */ 97 | getDocuments : function() { 98 | var documents = []; 99 | // search localstorage for saved documents 100 | for ( var i = 0, max = localStorage.length; i < max; i++) { 101 | var key = localStorage.key(i); 102 | // value is a document if key confirms to prefix 103 | if (key.indexOf(prefix) == 0) { 104 | var doc = getDocumentByKey(key); 105 | if (doc) { 106 | documents.push(doc); 107 | } 108 | } 109 | } 110 | return documents; 111 | }, 112 | 113 | /** 114 | * Gets all document ids found in the local storage object. 115 | * 116 | * @returns {Array} an Array of document ids 117 | */ 118 | getDocumentIds : function() { 119 | var ids = []; 120 | // search localstorage for saved documents 121 | for ( var i = 0, max = localStorage.length; i < max; i++) { 122 | var key = localStorage.key(i); 123 | // value is a document if key confirms to prefix 124 | if (key.indexOf(prefix) == 0) { 125 | ids.push(key.substring(prefix.length)); 126 | } 127 | } 128 | return ids; 129 | }, 130 | 131 | /** 132 | * Deletes a document from the local storage. 133 | * 134 | * @param {mindmaps.Document} doc 135 | */ 136 | deleteDocument : function(doc) { 137 | localStorage.removeItem(prefix + doc.id); 138 | }, 139 | 140 | /** 141 | * Deletes all documents from the local storage. 142 | */ 143 | deleteAllDocuments : function() { 144 | this.getDocuments().forEach(this.deleteDocument); 145 | } 146 | }; 147 | })(); 148 | -------------------------------------------------------------------------------- /_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 | -------------------------------------------------------------------------------- /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/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/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/Util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @namespace 3 | */ 4 | mindmaps.Util = mindmaps.Util || {}; 5 | 6 | /** 7 | * Creates a UUID in compliance with RFC4122. 8 | * 9 | * @static 10 | * @returns {String} a unique id 11 | */ 12 | mindmaps.Util.createUUID = function() { 13 | // http://www.ietf.org/rfc/rfc4122.txt 14 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { 15 | var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); 16 | return v.toString(16); 17 | }); 18 | }; 19 | 20 | /** 21 | * Returns an ID used by model objects. 22 | * 23 | * @returns {String} id 24 | */ 25 | mindmaps.Util.getId = function() { 26 | return mindmaps.Util.createUUID(); 27 | }; 28 | 29 | /** 30 | * Creates a random color. 31 | * 32 | * @returns {String} color in hex format 33 | */ 34 | mindmaps.Util.randomColor = function() { 35 | // http://stackoverflow.com/questions/1484506/random-color-generator-in-javascript/5365036#5365036 36 | // return "#"+((1<<24)*Math.random()|0).toString(16); 37 | 38 | // http://paulirish.com/2009/random-hex-color-code-snippets/#comment-34808 39 | // return '#'+~~(Math.random()*(1<<24)).toString(16); 40 | 41 | // http://paulirish.com/2009/random-hex-color-code-snippets/#comment-34878 42 | return (function(h) { 43 | return '#000000'.substr(0, 7 - h.length) + h; 44 | })((~~(Math.random() * (1 << 24))).toString(16)); 45 | }; 46 | 47 | 48 | mindmaps.Util.getUrlParams = function() { 49 | // http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript/2880929#2880929 50 | var urlParams = {}; 51 | var e, 52 | a = /\+/g, // Regex for replacing addition symbol with a space 53 | r = /([^&=]+)=?([^&]*)/g, 54 | d = function (s) { return decodeURIComponent(s.replace(a, " ")); }, 55 | q = window.location.search.substring(1); 56 | 57 | while (e = r.exec(q)) 58 | urlParams[d(e[1])] = d(e[2]); 59 | 60 | return urlParams; 61 | }; 62 | 63 | function timeit(func, caption) { 64 | var start = new Date().getTime(); 65 | func(); 66 | var stop = new Date().getTime(); 67 | var diff = stop - start; 68 | console.log(caption || "", diff, "ms"); 69 | } 70 | 71 | mindmaps.Util.distance = function(offsetX, offsetY) { 72 | return Math.sqrt(offsetX * offsetX + offsetY * offsetY); 73 | }; 74 | 75 | 76 | /** 77 | * test Default documents 78 | */ 79 | 80 | function getBinaryMapWithDepth(depth) { 81 | var mm = new mindmaps.MindMap(); 82 | var root = mm.root; 83 | 84 | function createTwoChildren(node, depth) { 85 | if (depth === 0) { 86 | return; 87 | } 88 | 89 | var left = mm.createNode(); 90 | left.text.caption = "Node " + left.id; 91 | node.addChild(left); 92 | createTwoChildren(left, depth - 1); 93 | 94 | var right = mm.createNode(); 95 | right.text.caption = "Node " + right.id; 96 | node.addChild(right); 97 | createTwoChildren(right, depth - 1); 98 | } 99 | 100 | // depth 10: about 400kb, 800kb in chrome 101 | // depth 12: about 1600kb 102 | // depth 16: 25mb 103 | var depth = depth || 10; 104 | createTwoChildren(root, depth); 105 | 106 | // generate positions for all nodes. 107 | // tree grows balanced from left to right 108 | root.offset = new mindmaps.Point(400, 400); 109 | // var offset = Math.pow(2, depth-1) * 10; 110 | var offset = 80; 111 | var c = root.children.values(); 112 | setOffset(c[0], 0, -offset); 113 | setOffset(c[1], 0, offset); 114 | function setOffset(node, depth, offsetY) { 115 | node.offset = new mindmaps.Point((depth + 1) * 50, offsetY); 116 | 117 | if (node.isLeaf()) { 118 | return; 119 | } 120 | 121 | var c = node.children.values(); 122 | var left = c[0]; 123 | setOffset(left, depth + 1, offsetY - offsetY / 2); 124 | 125 | var right = c[1]; 126 | setOffset(right, depth + 1, offsetY + offsetY / 2); 127 | } 128 | 129 | // color nodes 130 | c[0].branchColor = mindmaps.Util.randomColor(); 131 | c[0].forEachDescendant(function(node) { 132 | node.branchColor = mindmaps.Util.randomColor(); 133 | }); 134 | c[1].branchColor = mindmaps.Util.randomColor(); 135 | c[1].forEachDescendant(function(node) { 136 | node.branchColor = mindmaps.Util.randomColor(); 137 | }); 138 | 139 | return mm; 140 | } 141 | 142 | /** 143 | *
144 |  *        r
145 |  *    /     |        \
146 |  *   0    1     2
147 |  *       / \     / | \  \
148 |  *        10  11  20 21 22 23
149 |  *        |
150 |  *        100
151 |  *        |
152 |  *        1000
153 |  * 
154 | */ 155 | function getDefaultTestMap() { 156 | var mm = new mindmaps.MindMap(); 157 | var root = mm.root; 158 | 159 | var n0 = mm.createNode(); 160 | var n1 = mm.createNode(); 161 | var n2 = mm.createNode(); 162 | root.addChild(n0); 163 | root.addChild(n1); 164 | root.addChild(n2); 165 | 166 | var n10 = mm.createNode(); 167 | var n11 = mm.createNode(); 168 | n1.addChild(n10); 169 | n1.addChild(n11); 170 | 171 | var n20 = mm.createNode(); 172 | var n21 = mm.createNode(); 173 | var n22 = mm.createNode(); 174 | var n23 = mm.createNode(); 175 | n2.addChild(n20); 176 | n2.addChild(n21); 177 | n2.addChild(n22); 178 | n2.addChild(n23); 179 | 180 | var n100 = mm.createNode(); 181 | n10.addChild(n100); 182 | 183 | var n1000 = mm.createNode(); 184 | n100.addChild(n1000); 185 | 186 | return mm; 187 | } 188 | 189 | function getDefaultTestDocument() { 190 | var doc = new mindmaps.Document(); 191 | doc.title = "test document"; 192 | doc.mindmap = getDefaultTestMap(); 193 | 194 | return doc; 195 | } 196 | 197 | function getSimpleMap() { 198 | var mm = new mindmaps.MindMap(); 199 | var root = mm.root; 200 | 201 | var n0 = mm.createNode(); 202 | var n1 = mm.createNode(); 203 | root.addChild(n0); 204 | root.addChild(n1); 205 | 206 | return mm; 207 | } 208 | -------------------------------------------------------------------------------- /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 |
    7 |
  • Faire un brainstorming
  • 8 |
  • Ordonner ses idées
  • 9 |
  • Apprendre et faire apprendre une leçon
  • 10 |
  • Réaliser des classifications
  • 11 |
  • Identifier les éléments importants
  • 12 |
13 |

Pourquoi utiliser Framindmap ?

14 |
    15 |
  • C'est un logiciel libre et gratuit,
  • 16 |
  • utilisable en ligne, par tous et sans installation.
  • 17 |
  • Vos cartes peuvent être partagées
  • 18 |
  • modifiées à plusieurs (mais pas en temps réel),
  • 19 |
  • téléchargées sous différents formats (freemind, images, texte…)
  • 20 |
  • et vous pouvez même les insérer dans votre site web.
  • 21 |
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 |
    63 |
  • Microsoft Internet Explorer 9+
  • 64 |
  • Google Chrome 19+
  • 65 |
  • Firefox 12+
  • 66 |
  • Safari 5+
  • 67 |
  • Opera 11+
  • 68 |
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/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/mindmaps/js/libs/dragscrollable.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery dragscrollable Plugin 3 | * version: 1.0 (25-Jun-2009) 4 | * Copyright (c) 2009 Miquel Herrera 5 | * 6 | * Dual licensed under the MIT and GPL licenses: 7 | * http://www.opensource.org/licenses/mit-license.php 8 | * http://www.gnu.org/licenses/gpl.html 9 | * 10 | * Modified by David Richard (2011) 11 | * - added delegateMode option 12 | */ 13 | ; 14 | (function($) { // secure $ jQuery alias 15 | 16 | /** 17 | *
 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 | 	 * 
53 | */ 54 | $.fn.dragscrollable = function(options) { 55 | 56 | var settings = $.extend({ 57 | dragSelector : '>:first', 58 | acceptPropagatedEvent : true, 59 | preventDefault : true, 60 | delegateMode : false 61 | }, options || {}); 62 | 63 | var dragscroll = { 64 | mouseDownHandler : function(event) { 65 | // mousedown, left click, check propagation 66 | // if (event.which != 1 67 | // || (!event.data.acceptPropagatedEvent && event.target != 68 | // this)) { 69 | // return false; 70 | // } 71 | 72 | // fix: 73 | // http://plugins.jquery.com/content/problems-input-boxes-inside-elements-draggable-area 74 | if (event.which != 1) { 75 | return false; 76 | } else if (!event.data.acceptPropagatedEvent) { 77 | if ((event.target.localName == "input") 78 | || (event.target.localName == "textarea")) { 79 | return true; 80 | } else if (event.target != this) { 81 | return false; 82 | } 83 | } 84 | 85 | // Initial coordinates will be the last when dragging 86 | event.data.lastCoord = { 87 | left : event.clientX, 88 | top : event.clientY 89 | }; 90 | 91 | $.event.add(document, "mouseup", dragscroll.mouseUpHandler, 92 | event.data); 93 | $.event.add(document, "mousemove", dragscroll.mouseMoveHandler, 94 | event.data); 95 | if (event.data.preventDefault) { 96 | event.preventDefault(); 97 | return false; 98 | } 99 | }, 100 | mouseMoveHandler : function(event) { // User is dragging 101 | // How much did the mouse move? 102 | var delta = { 103 | left : (event.clientX - event.data.lastCoord.left), 104 | top : (event.clientY - event.data.lastCoord.top) 105 | }; 106 | 107 | // Set the scroll position relative to what ever the scroll is 108 | // now 109 | event.data.scrollable.scrollLeft(event.data.scrollable 110 | .scrollLeft() 111 | - delta.left); 112 | event.data.scrollable.scrollTop(event.data.scrollable 113 | .scrollTop() 114 | - delta.top); 115 | 116 | // Save where the cursor is 117 | event.data.lastCoord = { 118 | left : event.clientX, 119 | top : event.clientY 120 | }; 121 | if (event.data.preventDefault) { 122 | event.preventDefault(); 123 | return false; 124 | } 125 | 126 | }, 127 | mouseUpHandler : function(event) { // Stop scrolling 128 | $.event.remove(document, "mousemove", 129 | dragscroll.mouseMoveHandler); 130 | $.event.remove(document, "mouseup", dragscroll.mouseUpHandler); 131 | if (event.data.preventDefault) { 132 | event.preventDefault(); 133 | return false; 134 | } 135 | } 136 | }; 137 | 138 | // set up the initial events 139 | this.each(function() { 140 | // closure object data for each scrollable element 141 | var data = { 142 | scrollable : $(this), 143 | acceptPropagatedEvent : settings.acceptPropagatedEvent, 144 | preventDefault : settings.preventDefault 145 | }; 146 | 147 | // Set mouse initiating event on the desired descendant 148 | if (settings.delegateMode) { 149 | $(this).delegate(settings.dragSelector, 'mousedown', data, 150 | dragscroll.mouseDownHandler); 151 | } else { 152 | $(this).find(settings.dragSelector).bind('mousedown', data, 153 | dragscroll.mouseDownHandler); 154 | } 155 | 156 | }); 157 | }; // end plugin dragscrollable 158 | 159 | })(jQuery); // confine scope 160 | -------------------------------------------------------------------------------- /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/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/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 |
    4 |
  • 5 |
  • 6 |
  • 7 |
  • 8 |
  • 9 |
  • 10 |
  • 11 |
  • 12 |
  • 13 | 14 |
  • 15 |
  • 16 |
  • 17 |
  • 18 |
  • 19 |
  • 20 |
  • 21 |
  • 22 |
  • 23 |
  • 24 |
  • 25 |
  • 26 |
  • 27 |
  • 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 |
  • 59 |
  • 60 |
  • 61 |
  • 62 |
  • 63 |
  • 64 |
  • 65 |
  • 66 |
  • 67 |
  • 68 |
  • 69 |
  • 70 |
  • 71 |
  • 72 |
  • 73 |
  • 74 |
  • 75 |
  • 76 |
  • 77 |
  • 78 |
  • 79 |
  • 80 |
  • 81 |
  • 82 |
  • 83 |
  • 84 |
  • 85 |
  • 86 |
  • 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 |
  • 122 |
  • 123 |
  • 124 |
  • 125 |
  • 126 |
  • 127 |
  • 128 | 129 |
  • 130 |
  • 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/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 |
4 | 5 | 43 | 44 |
45 |


46 |
47 | Se connecter » 48 |
49 | 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/mindmaps/js/libs/events.js: -------------------------------------------------------------------------------- 1 | /*! 2 | // Copyright Joyent, Inc. and other Node contributors. 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a 5 | // copy of this software and associated documentation files (the 6 | // "Software"), to deal in the Software without restriction, including 7 | // without limitation the rights to use, copy, modify, merge, publish, 8 | // distribute, sublicense, and/or sell copies of the Software, and to permit 9 | // persons to whom the Software is furnished to do so, subject to the 10 | // following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included 13 | // in all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 18 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 21 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | /* 25 | * modified 10/06/2011 (david): 26 | * - make compatabile for browser 27 | * - added augment function 28 | * - added aliases publish, subscribe, unsubscribe 29 | */ 30 | var EventEmitter = function() { 31 | }; 32 | 33 | // By default EventEmitters will print a warning if more than 34 | // 10 listeners are added to it. This is a useful default which 35 | // helps finding memory leaks. 36 | // 37 | EventEmitter.prototype.setMaxListeners = function(n) { 38 | if (!this._events) 39 | this._events = {}; 40 | this._events.maxListeners = n; 41 | }; 42 | 43 | EventEmitter.prototype.emit = function(type) { 44 | // If there is no 'error' event listener then throw. 45 | if (type === 'error') { 46 | if (!this._events 47 | || !this._events.error 48 | || (Array.isArray(this._events.error) && !this._events.error.length)) { 49 | if (arguments[1] instanceof Error) { 50 | throw arguments[1]; // Unhandled 'error' event 51 | } else { 52 | throw new Error("Uncaught, unspecified 'error' event."); 53 | } 54 | return false; 55 | } 56 | } 57 | 58 | if (!this._events) 59 | return false; 60 | var handler = this._events[type]; 61 | if (!handler) 62 | return false; 63 | 64 | if (typeof handler == 'function') { 65 | switch (arguments.length) { 66 | // fast cases 67 | case 1: 68 | handler.call(this); 69 | break; 70 | case 2: 71 | handler.call(this, arguments[1]); 72 | break; 73 | case 3: 74 | handler.call(this, arguments[1], arguments[2]); 75 | break; 76 | // slower 77 | default: 78 | var args = Array.prototype.slice.call(arguments, 1); 79 | handler.apply(this, args); 80 | } 81 | return true; 82 | 83 | } else if (Array.isArray(handler)) { 84 | var args = Array.prototype.slice.call(arguments, 1); 85 | 86 | var listeners = handler.slice(); 87 | for ( var i = 0, l = listeners.length; i < l; i++) { 88 | listeners[i].apply(this, args); 89 | } 90 | return true; 91 | 92 | } else { 93 | return false; 94 | } 95 | }; 96 | 97 | EventEmitter.prototype.publish = EventEmitter.prototype.emit; 98 | 99 | // EventEmitter is defined in src/node_events.cc 100 | // EventEmitter.prototype.emit() is also defined there. 101 | EventEmitter.prototype.addListener = function(type, listener) { 102 | if ('function' !== typeof listener) { 103 | throw new Error('addListener only takes instances of Function'); 104 | } 105 | 106 | if (!this._events) 107 | this._events = {}; 108 | 109 | // To avoid recursion in the case that type == "newListeners"! Before 110 | // adding it to the listeners, first emit "newListeners". 111 | this.emit('newListener', type, listener); 112 | 113 | if (!this._events[type]) { 114 | // Optimize the case of one listener. Don't need the extra array object. 115 | this._events[type] = listener; 116 | } else if (Array.isArray(this._events[type])) { 117 | 118 | // If we've already got an array, just append. 119 | this._events[type].push(listener); 120 | 121 | // Check for listener leak 122 | if (!this._events[type].warned) { 123 | var m; 124 | if (this._events.maxListeners !== undefined) { 125 | m = this._events.maxListeners; 126 | } else { 127 | m = 10; 128 | } 129 | 130 | if (m && m > 0 && this._events[type].length > m) { 131 | this._events[type].warned = true; 132 | console.error('(node) warning: possible EventEmitter memory ' 133 | + 'leak detected. %d listeners added. ' 134 | + 'Use emitter.setMaxListeners() to increase limit.', 135 | this._events[type].length); 136 | console.trace(); 137 | } 138 | } 139 | } else { 140 | // Adding the second element, need to change to array. 141 | this._events[type] = [ this._events[type], listener ]; 142 | } 143 | 144 | return this; 145 | }; 146 | 147 | EventEmitter.prototype.on = EventEmitter.prototype.subscribe = EventEmitter.prototype.addListener; 148 | 149 | EventEmitter.prototype.once = function(type, listener) { 150 | if ('function' !== typeof listener) { 151 | throw new Error('.once only takes instances of Function'); 152 | } 153 | 154 | var self = this; 155 | function g() { 156 | self.removeListener(type, g); 157 | listener.apply(this, arguments); 158 | } 159 | ; 160 | 161 | g.listener = listener; 162 | self.on(type, g); 163 | 164 | return this; 165 | }; 166 | 167 | EventEmitter.prototype.removeListener = function(type, listener) { 168 | if ('function' !== typeof listener) { 169 | throw new Error('removeListener only takes instances of Function'); 170 | } 171 | 172 | // does not use listeners(), so no side effect of creating _events[type] 173 | if (!this._events || !this._events[type]) 174 | return this; 175 | 176 | var list = this._events[type]; 177 | 178 | if (Array.isArray(list)) { 179 | var position = -1; 180 | for ( var i = 0, length = list.length; i < length; i++) { 181 | if (list[i] === listener 182 | || (list[i].listener && list[i].listener === listener)) { 183 | position = i; 184 | break; 185 | } 186 | } 187 | 188 | if (position < 0) 189 | return this; 190 | list.splice(position, 1); 191 | if (list.length == 0) 192 | delete this._events[type]; 193 | } else if (list === listener 194 | || (list.listener && list.listener === listener)) { 195 | delete this._events[type]; 196 | } 197 | 198 | return this; 199 | }; 200 | 201 | EventEmitter.prototype.unsubscribe = EventEmitter.prototype.removeListener; 202 | 203 | EventEmitter.prototype.removeAllListeners = function(type) { 204 | if (arguments.length === 0) { 205 | this._events = {}; 206 | return this; 207 | } 208 | 209 | // does not use listeners(), so no side effect of creating _events[type] 210 | if (type && this._events && this._events[type]) 211 | this._events[type] = null; 212 | return this; 213 | }; 214 | 215 | EventEmitter.prototype.listeners = function(type) { 216 | if (!this._events) 217 | this._events = {}; 218 | if (!this._events[type]) 219 | this._events[type] = []; 220 | if (!Array.isArray(this._events[type])) { 221 | this._events[type] = [ this._events[type] ]; 222 | } 223 | return this._events[type]; 224 | }; 225 | 226 | /** 227 | * Augment an object with the EventEmitter mixin 228 | * 229 | * @param {object} obj The object to be augmented 230 | */ 231 | EventEmitter.mixin = function(obj) { 232 | for ( var method in EventEmitter.prototype) { 233 | if (!obj.prototype[method]) { 234 | obj.prototype[method] = EventEmitter.prototype[method]; 235 | } 236 | } 237 | }; --------------------------------------------------------------------------------