diff --git a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateDialog.java b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateDialog.java index 434c7fd1a..92f02e39d 100644 --- a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateDialog.java +++ b/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.ui.ModernUIPane; 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 java.awt.BorderLayout; @@ -34,7 +40,22 @@ class DesignerPushUpdateDialog extends UIDialog { contentPane.setLayout(new BorderLayout()); jsPane = new ModernUIPane.Builder() - .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); } diff --git a/designer-base/src/main/resources/com/fr/design/ui/onlineupdate/push/pushUpdate.html b/designer-base/src/main/resources/com/fr/design/ui/onlineupdate/push/pushUpdate.html deleted file mode 100644 index e0007c9dc..000000000 --- a/designer-base/src/main/resources/com/fr/design/ui/onlineupdate/push/pushUpdate.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Push Update - - - - - - - - \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.css b/designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.css new file mode 100644 index 000000000..dfbcc6851 --- /dev/null +++ b/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; +} \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.js b/designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.js new file mode 100644 index 000000000..543ce292f --- /dev/null +++ b/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" + }); +}); \ No newline at end of file