Browse Source

REPORT-14865 更新日志推送=>改用 withComponent 方法

research/10.0
plough 6 years ago
parent
commit
e513ef1a86
  1. 23
      designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateDialog.java
  2. 135
      designer-base/src/main/resources/com/fr/design/ui/onlineupdate/push/pushUpdate.html
  3. 20
      designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.css
  4. 99
      designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.js

23
designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateDialog.java

@ -3,6 +3,12 @@ package com.fr.design.update.push;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.ui.ModernUIPane; import com.fr.design.ui.ModernUIPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.web.struct.AssembleComponent;
import com.fr.web.struct.Atom;
import com.fr.web.struct.browser.RequestClient;
import com.fr.web.struct.category.ScriptPath;
import com.fr.web.struct.category.StylePath;
import com.fr.web.struct.impl.FineUI;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -34,7 +40,22 @@ class DesignerPushUpdateDialog extends UIDialog {
contentPane.setLayout(new BorderLayout()); contentPane.setLayout(new BorderLayout());
jsPane = new ModernUIPane.Builder<Model>() jsPane = new ModernUIPane.Builder<Model>()
.withEMB("/com/fr/design/ui/onlineupdate/push/pushUpdate.html").namespace("Pool").build(); .withComponent(new AssembleComponent() {
@Override
public ScriptPath script(RequestClient req) {
return ScriptPath.build("/com/fr/design/ui/update/push/pushUpdate.js");
}
@Override
public StylePath style(RequestClient req) {
return StylePath.build("/com/fr/design/ui/update/push/pushUpdate.css");
}
@Override
public Atom[] refer() {
return new Atom[]{FineUI.KEY};
}
}).namespace("Pool").build();
contentPane.add(jsPane); contentPane.add(jsPane);
} }

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

@ -1,135 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Push Update</title>
<link rel="stylesheet" href="emb:/com/fr/web/ui/fineui.min.css"/>
<script src="emb:/com/fr/web/ui/fineui.min.js"></script>
<style>
.title {
font-size: 30px;
}
.desc {
margin-top: 35px;
}
.moreInfo {
margin-top: 15px;
}
.buttonGroup {
margin-top: 35px;
}
.button-ignore {
}
body {
padding-left: 30px;
padding-top: 30px;
color: white;
}
</style>
</head>
<body>
<script>
function i18nText(key) {
return Pool.data.i18nText(key);
}
window.addEventListener("load", function (ev) {
var title = BI.createWidget({
type: "bi.vertical",
items: [
{
type: "bi.label",
text: i18nText("Fine-Design_Find_New_Version"),
cls: "title",
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: {
type: 'bi.button',
text: i18nText("Fine-Design_Remind_Me_Next_Time"),
level: 'ignore',
height: 30,
handler: function() {
Pool.data.remindNextTime();
}
},
lgap: 10
},
{
el: {
type: 'bi.button',
text: i18nText("Fine-Design_Skip_This_Version"),
level: 'ignore',
height: 30,
handler: function() {
Pool.data.skipThisVersion();
}
},
lgap: 10
}
]
});
BI.createWidget({
type:"bi.vertical",
element: "body",
cls: "container",
items: [
title,
desc,
moreInfo,
buttonGroup
]
});
$(".container").css("background", "url(" + Pool.data.getBackgroundUrl() + ")");
$(".button-ignore").css({
"background-color": "white",
"border": "1px solid white"
});
});
</script>
</body>
</html>

20
designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.css

@ -0,0 +1,20 @@
.title {
font-size: 30px;
}
.desc {
margin-top: 35px;
}
.moreInfo {
margin-top: 15px;
}
.buttonGroup {
margin-top: 35px;
}
.button-ignore {
}
body {
padding-left: 30px;
padding-top: 30px;
color: white;
}

99
designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.js

@ -0,0 +1,99 @@
function i18nText(key) {
return Pool.data.i18nText(key);
}
window.addEventListener("load", function (ev) {
var title = BI.createWidget({
type: "bi.vertical",
items: [
{
type: "bi.label",
text: i18nText("Fine-Design_Find_New_Version"),
cls: "title",
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: {
type: 'bi.button',
text: i18nText("Fine-Design_Remind_Me_Next_Time"),
level: 'ignore',
height: 30,
handler: function() {
Pool.data.remindNextTime();
}
},
lgap: 10
},
{
el: {
type: 'bi.button',
text: i18nText("Fine-Design_Skip_This_Version"),
level: 'ignore',
height: 30,
handler: function() {
Pool.data.skipThisVersion();
}
},
lgap: 10
}
]
});
BI.createWidget({
type:"bi.vertical",
element: "body",
cls: "container",
items: [
title,
desc,
moreInfo,
buttonGroup
]
});
$(".container").css("background", "url(" + Pool.data.getBackgroundUrl() + ")");
$(".button-ignore").css({
"background-color": "white",
"border": "1px solid white"
});
});
Loading…
Cancel
Save