Browse Source

REPORT-14865 更新日志推送=>国际化

research/10.0
plough 5 years ago
parent
commit
d842f295bb
  1. 4
      designer-base/src/main/java/com/fr/design/onlineupdate/push/DesignerPushUpdateDialog.java
  2. 222
      designer-base/src/main/resources/com/fr/design/ui/onlineupdate/push/pushUpdate.html

4
designer-base/src/main/java/com/fr/design/onlineupdate/push/DesignerPushUpdateDialog.java

@ -120,6 +120,10 @@ class DesignerPushUpdateDialog extends UIDialog {
exit(); exit();
} }
public String i18nText(String key) {
return com.fr.design.i18n.Toolkit.i18nText(key);
}
private void exit() { private void exit() {
DesignerPushUpdateDialog.this.dialogExit(); DesignerPushUpdateDialog.this.dialogExit();
} }

222
designer-base/src/main/resources/com/fr/design/ui/onlineupdate/push/pushUpdate.html

@ -30,148 +30,104 @@
</head> </head>
<body> <body>
<script> <script>
// var EVENT_POPULATE = "EVENT_POPULATE"; function i18nText(key) {
return Pool.data.i18nText(key);
// var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; }
//
// var observer = new MutationObserver(function(mutations) {
// mutations.forEach(function(mutation) {
// if (mutation.type === "attributes" && window.Pool) {
// console.log("attributes changed");
// window.fireEvent(EVENT_POPULATE);
// }
// });
// });
//
// observer.observe(window, {
// attributes: true //configure it to listen to attribute changes
// });
window.addEventListener("load", function (ev) { window.addEventListener("load", function (ev) {
// alert(window.Pool.data); var title = BI.createWidget({
// todo: 开发临时方案 type: "bi.vertical",
// setTimeout(function () { items: [
{
console.log(window.Pool.data); type: "bi.label",
var title = BI.createWidget({ text: i18nText("Fine-Design_Find_New_Version"),
type: "bi.vertical", cls: "title",
items: [ textAlign: "left"
{ },
type: "bi.label", {
text: "发现新版本", type: "bi.label",
cls: "title", text: Pool.data.getVersion(),
textAlign: "left" textAlign: "left"
}, }
{ ]
type: "bi.label", });
text: Pool.data.getVersion(),
textAlign: "left" var desc = BI.createWidget({
type: "bi.vertical",
cls: "desc",
items: [
{
type: "bi.label",
text: Pool.data.getContent(),
textAlign: "left"
}
]
});
var moreInfo = BI.createWidget({
type: "bi.text_button",
text: i18nText("Fine-Design_Basic_More_Information"),
cls: "moreInfo",
textAlign: "left"
});
var buttonGroup = BI.createWidget({
type: 'bi.left',
cls: "buttonGroup",
items: [
{
type: 'bi.button',
text: i18nText("Fine-Design_Update_Now"),
level: 'common',
height: 30,
handler: function() {
Pool.data.updateNow();
} }
] },
}); {
el: {
var desc = BI.createWidget({
type: "bi.vertical",
cls: "desc",
items: [
{
type: "bi.label",
// text: "1) xxx",
text: Pool.data.getContent(),
textAlign: "left"
}
// {
// type: "bi.label",
// text: "2) ldsnvls df",
// textAlign: "left"
// }
]
});
var moreInfo = BI.createWidget({
type: "bi.text_button",
text: "更多信息",
cls: "moreInfo",
textAlign: "left"
});
var buttonGroup = BI.createWidget({
type: 'bi.left',
cls: "buttonGroup",
items: [
{
type: 'bi.button', type: 'bi.button',
text: '立即更新', text: i18nText("Fine-Design_Remind_Me_Next_Time"),
level: 'common', level: 'ignore',
height: 30, height: 30,
handler: function() { handler: function() {
Pool.data.updateNow(); Pool.data.remindNextTime();
} }
}, },
{ lgap: 10
el: { },
type: 'bi.button', {
text: '下次启动提醒我', el: {
level: 'ignore', type: 'bi.button',
height: 30, text: i18nText("Fine-Design_Skip_This_Version"),
handler: function() { level: 'ignore',
Pool.data.remindNextTime(); height: 30,
} handler: function() {
}, Pool.data.skipThisVersion();
lgap: 10 }
}, },
{ lgap: 10
el: { }
type: 'bi.button', ]
text: '跳过此版本', });
level: 'ignore',
height: 30, BI.createWidget({
handler: function() { type:"bi.vertical",
Pool.data.skipThisVersion(); element: "body",
} cls: "container",
}, items: [
lgap: 10 title,
} desc,
] moreInfo,
}); buttonGroup
]
BI.createWidget({ });
type:"bi.vertical",
element: "body", $(".container").css("background", "url(" + Pool.data.getBackgroundUrl() + ")");
cls: "container", $(".button-ignore").css({
items: [ "background-color": "white",
title, "border": "1px solid white"
desc, });
moreInfo,
buttonGroup
]
});
$(".container").css("background", "url(" + Pool.data.getBackgroundUrl() + ")");
$(".button-ignore").css({
"background-color": "white",
"border": "1px solid white"
});
// }, 2000);
// setTimeout(function() {
// // alert(Pool.data);
// alert(Pool.data.getName() + " " + Pool.data.getAge());
// }, 2000);
// Pool.update = function () {
// Pool.data.setAge(12);
// Pool.data.setName("Tom");
// return Pool.data;
// };
}); });
</script> </script>

Loading…
Cancel
Save