diff --git a/shopfloor_mobile/static/wms/src/components/misc.js b/shopfloor_mobile/static/wms/src/components/misc.js index 76c3158033..0c06c8532d 100644 --- a/shopfloor_mobile/static/wms/src/components/misc.js +++ b/shopfloor_mobile/static/wms/src/components/misc.js @@ -388,3 +388,48 @@ Vue.component("screen-loading", { `, }); + +Vue.component("btn-fullscreen", { + data: function() { + return { + fullscreen_on: document.fullscreenElement ? true : false, + }; + }, + computed: { + btn_label: function() { + const transition = this.fullscreen_on ? "exit" : "enter"; + return this.$t("screen.settings.fullscreen." + transition); + }, + }, + methods: { + go_fullscreen: function() { + const elem = document.documentElement; + if (elem.requestFullscreen) { + elem.requestFullscreen(); + } else if (elem.mozRequestFullScreen) { + /* Firefox */ + elem.mozRequestFullScreen(); + } else if (elem.webkitRequestFullscreen) { + /* Chrome, Safari & Opera */ + elem.webkitRequestFullscreen(); + } else if (elem.msRequestFullscreen) { + /* IE/Edge */ + elem.msRequestFullscreen(); + } + this.fullscreen_on = true; + }, + leave_fullscreen: function() { + if (document.exitFullscreen) { + document.exitFullscreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + } else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } + this.fullscreen_on = false; + }, + }, + template: `{{ btn_label }}`, +}); diff --git a/shopfloor_mobile/static/wms/src/i18n.translation.js b/shopfloor_mobile/static/wms/src/i18n.translation.js index ef96b372ba..d2db6e1fa0 100644 --- a/shopfloor_mobile/static/wms/src/i18n.translation.js +++ b/shopfloor_mobile/static/wms/src/i18n.translation.js @@ -21,6 +21,10 @@ export const messages = { name: "Profile", title: "Select profile", }, + fullscreen: { + enter: "Go fullscreen", + exit: "Exit fullscreen", + }, }, }, language: { @@ -73,6 +77,10 @@ export const messages = { name: "Profil", title: "Choisissez un profil", }, + fullscreen: { + enter: "Go fullscreen", + exit: "Exit fullscreen", + }, }, }, language: { @@ -116,6 +124,10 @@ export const messages = { name: "Profil", title: "Wähle Profil", }, + fullscreen: { + enter: "Go fullscreen", + exit: "Exit fullscreen", + }, }, }, language: { diff --git a/shopfloor_mobile/static/wms/src/loginpage.js b/shopfloor_mobile/static/wms/src/loginpage.js index 8be1e8960c..5620f1e400 100644 --- a/shopfloor_mobile/static/wms/src/loginpage.js +++ b/shopfloor_mobile/static/wms/src/loginpage.js @@ -58,11 +58,24 @@ export var LoginPage = Vue.component("login-page", { label="API Key" placeholder="YOUR_API_KEY_HERE" autofocus> - Submit +
+ + + Login + + +
+
+ + + + + +
`, diff --git a/shopfloor_mobile/static/wms/src/settings/settings.js b/shopfloor_mobile/static/wms/src/settings/settings.js index 4205fb530d..c8a1398c35 100644 --- a/shopfloor_mobile/static/wms/src/settings/settings.js +++ b/shopfloor_mobile/static/wms/src/settings/settings.js @@ -21,6 +21,11 @@ export var SettingsControlPanel = Vue.component("settings-control-panel", { + + + + +