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