mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-08-20 04:30:42 +02:00
Integrate Designer location with the editor ...
This commit is contained in:
parent
2757a5ddb4
commit
7752ac0dc1
@ -24,7 +24,7 @@ mindplot.Designer = new Class({
|
||||
$assert(divElement, "divElement must be defined");
|
||||
|
||||
// Set up i18n location ...
|
||||
mindplot.Messages.init(options.location);
|
||||
mindplot.Messages.init(options.locale);
|
||||
|
||||
this._options = options;
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
|
||||
mindplot.Messages = new Class({
|
||||
Static:{
|
||||
init:function (location) {
|
||||
var locale = $defined(location) ? location : 'en';
|
||||
init:function (locale) {
|
||||
locale = $defined(locale) ? locale : 'en';
|
||||
mindplot.Messages.__bundle = mindplot.Messages.BUNDLES[locale];
|
||||
console.log(mindplot.Messages.__bundle);
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ mindplot.widget.Menu = new Class({
|
||||
this._addButton('redoEdition', false, false, function () {
|
||||
designer.redo();
|
||||
});
|
||||
this._registerTooltip('redoEdition', $msg('REDO'), "meta+Y");
|
||||
this._registerTooltip('redoEdition', $msg('REDO'), "meta+shift+Z");
|
||||
|
||||
|
||||
this._addButton('addTopic', true, false, function () {
|
||||
|
@ -108,7 +108,7 @@ function loadDesignerOptions(jsonConf) {
|
||||
height:parseInt(window.innerHeight - 70), // Footer and Header
|
||||
width:parseInt(window.innerWidth)
|
||||
};
|
||||
result = {readOnly:false, zoom:0.85, saveOnLoad:true, size:containerSize, viewPort:viewPort, container:'mindplot', location:'en'};
|
||||
result = {readOnly:false, zoom:0.85, saveOnLoad:true, size:containerSize, viewPort:viewPort, container:'mindplot', locale:'en'};
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -30,12 +30,14 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
|
||||
@Controller
|
||||
public class MindmapController {
|
||||
@ -134,6 +136,10 @@ public class MindmapController {
|
||||
String result;
|
||||
if (mindmap.hasPermissions(Utils.getUser(), CollaborationRole.EDITOR)) {
|
||||
model.addAttribute("mindmap", mindmapBean);
|
||||
|
||||
// Configure default locale for the editor ...
|
||||
final Locale locale = LocaleContextHolder.getLocale();
|
||||
model.addAttribute("locale", locale.getLanguage());
|
||||
result = "mindmapEditor";
|
||||
} else {
|
||||
result = "redirect:view";
|
||||
|
@ -10,7 +10,7 @@
|
||||
<%--@elvariable id="editorTryMode" type="java.lang.String"--%>
|
||||
<%--@elvariable id="mapXml" type="com.wisemapping.model.User"--%>
|
||||
<%
|
||||
User user = Utils.getUser(true);
|
||||
User user = Utils.getUser();
|
||||
if (user != null) {
|
||||
request.setAttribute("principal", user);
|
||||
}
|
||||
@ -44,6 +44,7 @@
|
||||
var userOptions = ${mindmap.properties};
|
||||
options.zoom = userOptions.zoom;
|
||||
options.readOnly = ${!!readOnlyMode};
|
||||
options.locale = '${locale}';
|
||||
|
||||
// Set map id ...
|
||||
options.mapId = mapId;
|
||||
|
Loading…
Reference in New Issue
Block a user