bluecardlogin.js
The complete code for bluecardlogin.js used in Loading Screen Rules from external files is:
(function () {
zScope.hostSurfer.register({
id: 'bluecardLogin',
match: [
{ text: "USERNAME", row: 19, col: 55 },
{ text: "PASSWORD", row: 20, col: 55 }
],
apply: {
fields: [
{ name: 'shopsLastUpdate', row: 18, col: 29, len: 8 },
{ name: 'accountsLastUpdate', row: 18, col: 62, len: 8 },
{ name: 'username', row: 19, col: 67, len: 6 },
{ name: 'password', row: 20, col: 67, len: 6 },
{ name: 'newPassword', row: 21, col: 67, len: 6 }
],
render: {
view: {
template:
"<div style='font-size: 10pt; margin: 5px'>" +
"<h1>Blue Card / User Login</h1>" +
"<p> </p>" +
"<p>{{hs.data.R18C9}} {{hs.data.commerceLastUpdate}} — " +
"{{hs.data.R18C39}} {{hs.data.accountsLastUpdate}}</p>" +
"<p> </p>" +
"<p>Username: <input type='text' size=13 maxlength=6 hs-field='hs.data.username'/></p>" +
"<p>Password: <input type='password' size=13 maxlength=6 hs-field='hs.data.password'/></p>" +
"<p>New Password: <input type='password' size=13 maxlength='6' hs-field='hs.data.newPassword'/></p>" +
"<p> </p>" +
"<p><button id='login_btn' tabindex=0 onclick='hs.navigate(\"main\")'>Sign in</button> " +
"<button id='exit_btn' tabindex=0 onclick='hs.navigate(\"exit\")'>Exit</button></p></div>"
}
},
actions: {
main: function (hs) { hs.enter(); },
exit: function (hs) { hs.pf1(); }
}
}
});
})();
This file has to be included into the screen rule repository declared as baseUrl HostSurfer constructor parameter attribute.