IDEMPIERE-5137 Login page reload continuously using http (#1158)
Improve error message, change: This request has been blocked, the content must be served over HTTPS by Direct http:// is forbidden - please use https:// instead with the SSL port used in your installation Improve indentation of the whole script (readability) Change EOL character to unix
This commit is contained in:
parent
68db1fd3b7
commit
497c93fc63
|
|
@ -1,264 +1,266 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright (C) 2007 Ashley G Ramdass.
|
Copyright (C) 2007 Ashley G Ramdass.
|
||||||
-->
|
-->
|
||||||
<?page style="height:100%"?>
|
<?page style="height:100%"?>
|
||||||
<?init zscript="theme.zs" ?>
|
<?init zscript="theme.zs" ?>
|
||||||
<?meta http-equiv="X-UA-Compatible" content="IE=edge" ?>
|
<?meta http-equiv="X-UA-Compatible" content="IE=edge" ?>
|
||||||
<?meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" ?>
|
<?meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" ?>
|
||||||
<?meta name="apple-mobile-web-app-capable" content="yes"?>
|
<?meta name="apple-mobile-web-app-capable" content="yes"?>
|
||||||
<?meta name="mobile-web-app-capable" content="yes"?>
|
<?meta name="mobile-web-app-capable" content="yes"?>
|
||||||
<?link rel="icon" type="image/png" href="${browserIcon}"?>
|
<?link rel="icon" type="image/png" href="${browserIcon}"?>
|
||||||
<?link rel="stylesheet" type="text/css" href="${themeStyleSheet}"?>
|
<?link rel="stylesheet" type="text/css" href="${themeStyleSheet}"?>
|
||||||
<?link rel="stylesheet" type="text/css" href="${themeStyleSheetByBrowser}"?>
|
<?link rel="stylesheet" type="text/css" href="${themeStyleSheetByBrowser}"?>
|
||||||
<?link rel="stylesheet" type="text/css" href="css/PAPanel.css"?>
|
<?link rel="stylesheet" type="text/css" href="css/PAPanel.css"?>
|
||||||
<?link rel="manifest" href="manifest.json"?>
|
<?link rel="manifest" href="manifest.json"?>
|
||||||
<?style content="
|
<?style content="
|
||||||
.z-grid-header > table > tbody > tr.z-columns > th.z-column.hiddencol > .z-column-content {
|
.z-grid-header > table > tbody > tr.z-columns > th.z-column.hiddencol > .z-column-content {
|
||||||
white-space: nowrap !important;
|
white-space: nowrap !important;
|
||||||
text-overflow: unset !important;
|
text-overflow: unset !important;
|
||||||
}
|
}
|
||||||
"?>
|
"?>
|
||||||
<zk>
|
<zk>
|
||||||
<script><![CDATA[
|
<script><![CDATA[
|
||||||
if (window.location.protocol == 'https:')
|
if (window.location.protocol == 'https:') {
|
||||||
{
|
|
||||||
|
zk.load("jawwa.atmosphere");
|
||||||
zk.load("jawwa.atmosphere");
|
zk.load("org.idempiere.websocket");
|
||||||
zk.load("org.idempiere.websocket");
|
zk.load("adempiere.local.storage");
|
||||||
zk.load("adempiere.local.storage");
|
zk.load("html2canvas");
|
||||||
zk.load("html2canvas");
|
zk.load("org.idempiere.commons");
|
||||||
zk.load("org.idempiere.commons");
|
zk.load("jquery.maskedinput");
|
||||||
zk.load("jquery.maskedinput");
|
zk.load("photobooth");
|
||||||
zk.load("photobooth");
|
|
||||||
|
zk.afterLoad(function() {
|
||||||
zk.afterLoad(function() {
|
zk._Erbx.push = function(msg) {
|
||||||
zk._Erbx.push = function(msg) {
|
if (console) console.log(msg);
|
||||||
if (console) console.log(msg);
|
};
|
||||||
};
|
|
||||||
|
zk.$package('id.zk');
|
||||||
zk.$package('id.zk');
|
|
||||||
|
id.zk.Extend = zk.$extends(zk.Object, {}, {
|
||||||
id.zk.Extend = zk.$extends(zk.Object, {}, {
|
fakeOnchange: function(wgt) {
|
||||||
fakeOnchange: function (wgt) {
|
// just sent fake event when control is textfield and value is not yet sync to server
|
||||||
// just sent fake event when control is textfield and value is not yet sync to server
|
if ((wgt.$instanceof(zul.inp.Textbox) || wgt.$instanceof(zul.inp.Decimalbox)) && wgt.$n().value != wgt.getText())
|
||||||
if ((wgt.$instanceof(zul.inp.Textbox) || wgt.$instanceof(zul.inp.Decimalbox)) && wgt.$n().value != wgt.getText())
|
zAu.send(new zk.Event(zk.Widget.$(wgt), 'onChange', {
|
||||||
zAu.send(new zk.Event(zk.Widget.$(wgt), 'onChange',{"value":wgt.$n().value}));
|
"value": wgt.$n().value
|
||||||
|
}));
|
||||||
else if (zk.$import("ckez.CKeditor") != undefined && wgt.$instanceof(ckez.CKeditor)){//https://www.zkoss.org/javadoc/latest/jsdoc/_global_/zk.html#$import(_global_.String)
|
|
||||||
// CKEditor extend from zul.Widget not from wget zul.inp.InputWidget
|
else if (zk.$import("ckez.CKeditor") != undefined && wgt.$instanceof(ckez.CKeditor)) { //https://www.zkoss.org/javadoc/latest/jsdoc/_global_/zk.html#$import(_global_.String)
|
||||||
// so some behavior is not same standard input
|
// CKEditor extend from zul.Widget not from wget zul.inp.InputWidget
|
||||||
// this code bring from ckez.CKeditor.onBlur
|
// so some behavior is not same standard input
|
||||||
var editor = wgt._editor;
|
// this code bring from ckez.CKeditor.onBlur
|
||||||
|
var editor = wgt._editor;
|
||||||
if (wgt._tidChg) {
|
|
||||||
clearInterval(wgt._tidChg);
|
if (wgt._tidChg) {
|
||||||
wgt._tidChg = null;
|
clearInterval(wgt._tidChg);
|
||||||
}
|
wgt._tidChg = null;
|
||||||
|
}
|
||||||
if (!editor.document)
|
|
||||||
editor.document = editor.element.getDocument();
|
if (!editor.document)
|
||||||
|
editor.document = editor.element.getDocument();
|
||||||
if (wgt.$class._checkEditorDirty(editor)) { // Issue #13
|
|
||||||
var val = editor.getData();
|
if (wgt.$class._checkEditorDirty(editor)) { // Issue #13
|
||||||
wgt._value = val; //save for onRestore
|
var val = editor.getData();
|
||||||
//ZKCK-16, 17 use sendAhead to make sure onChange always happens first
|
wgt._value = val; //save for onRestore
|
||||||
wgt.fire('onChange', {value: val});
|
//ZKCK-16, 17 use sendAhead to make sure onChange always happens first
|
||||||
editor.resetDirty();
|
wgt.fire('onChange', {
|
||||||
}
|
value: val
|
||||||
}
|
});
|
||||||
},
|
editor.resetDirty();
|
||||||
|
}
|
||||||
fireOnInitEdit: function (wgt) {
|
}
|
||||||
// sent even to indicate field is start edit, this event sent new value to server but now don't use this data.
|
},
|
||||||
if (wgt.$instanceof(zul.inp.Textbox))
|
|
||||||
zAu.send(new zk.Event(zk.Widget.$(wgt), 'onInitEdit',{"value":wgt.$n().value}));
|
fireOnInitEdit: function(wgt) {
|
||||||
}
|
// sent even to indicate field is start edit, this event sent new value to server but now don't use this data.
|
||||||
});
|
if (wgt.$instanceof(zul.inp.Textbox))
|
||||||
});
|
zAu.send(new zk.Event(zk.Widget.$(wgt), 'onInitEdit', {
|
||||||
|
"value": wgt.$n().value
|
||||||
zk.afterLoad('zul.inp', function () {
|
}));
|
||||||
|
}
|
||||||
// should filter out for only component inside standard window or component wish fire this event,
|
});
|
||||||
// or ever rise other event like start editting to distinguish with true onChange event
|
});
|
||||||
zk.override(zul.inp.InputWidget.prototype, "doInput_", function (evt) {
|
|
||||||
this.$doInput_(evt);
|
zk.afterLoad('zul.inp', function() {
|
||||||
|
|
||||||
if (this.get ("isOnStardardWindow") == 'false' || this.get ("isChangeEventWhenEditing") != true){
|
// should filter out for only component inside standard window or component wish fire this event,
|
||||||
return; // don't waste time to check component don't lay on standard window
|
// or ever rise other event like start editting to distinguish with true onChange event
|
||||||
}
|
zk.override(zul.inp.InputWidget.prototype, "doInput_", function(evt) {
|
||||||
|
this.$doInput_(evt);
|
||||||
var domElemOfLayout = jq('#' + this.$n().id).closest(".adwindow-layout"); // return a array
|
|
||||||
if (domElemOfLayout.length == 0){
|
if (this.get("isOnStardardWindow") == 'false' || this.get("isChangeEventWhenEditing") != true) {
|
||||||
this.set ("isOnStardardWindow", "false");// next time don't waste time to check this component
|
return; // don't waste time to check component don't lay on standard window
|
||||||
// in case, you move this component to a standard window, please update this properties at client by javascript Widget.set ()
|
}
|
||||||
// or at server by java function component.setWidgetOverride
|
|
||||||
}else{
|
var domElemOfLayout = jq('#' + this.$n().id).closest(".adwindow-layout"); // return a array
|
||||||
var winLayoutWg = zk.Widget.$(domElemOfLayout);
|
if (domElemOfLayout.length == 0) {
|
||||||
if (winLayoutWg == null){
|
this.set("isOnStardardWindow", "false"); // next time don't waste time to check this component
|
||||||
;// do nothing, this case rare happen because ".adwindow-layout" always is a component
|
// in case, you move this component to a standard window, please update this properties at client by javascript Widget.set ()
|
||||||
}else{
|
// or at server by java function component.setWidgetOverride
|
||||||
var isEditting = winLayoutWg.get ("isEditting");
|
} else {
|
||||||
// winLayoutWg should cache to improve perfomance
|
var winLayoutWg = zk.Widget.$(domElemOfLayout);
|
||||||
if (isEditting == "false"){
|
if (winLayoutWg == null) {
|
||||||
winLayoutWg.set ("isEditting", "true");
|
; // do nothing, this case rare happen because ".adwindow-layout" always is a component
|
||||||
id.zk.Extend.fireOnInitEdit (this);//fire change event to move to edit
|
} else {
|
||||||
}
|
var isEditting = winLayoutWg.get("isEditting");
|
||||||
}
|
// winLayoutWg should cache to improve perfomance
|
||||||
}
|
if (isEditting == "false") {
|
||||||
});
|
winLayoutWg.set("isEditting", "true");
|
||||||
|
id.zk.Extend.fireOnInitEdit(this); //fire change event to move to edit
|
||||||
|
}
|
||||||
zk.override(zk.Widget.prototype, "onAutofill", function (evt) {
|
}
|
||||||
id.zk.Extend.fakeOnchange (this);//fire change event to move to edit
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
zk.override(zul.inp.Textbox.prototype, "bind_", function (dt, skipper, after) {
|
zk.override(zk.Widget.prototype, "onAutofill", function(evt) {
|
||||||
if (!this.$bind_)
|
id.zk.Extend.fakeOnchange(this); //fire change event to move to edit
|
||||||
return;
|
});
|
||||||
|
|
||||||
this.$bind_(dt, skipper, after);
|
zk.override(zul.inp.Textbox.prototype, "bind_", function(dt, skipper, after) {
|
||||||
|
if (!this.$bind_)
|
||||||
var txtid = this.getId()
|
return;
|
||||||
if (txtid != "txtUserId" && txtid != "txtPassword" ){
|
|
||||||
return;
|
this.$bind_(dt, skipper, after);
|
||||||
}
|
|
||||||
|
var txtid = this.getId()
|
||||||
this.domListen_(this.$n(), "onChange", "onAutofill");
|
if (txtid != "txtUserId" && txtid != "txtPassword") {
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zk.override(zul.inp.Textbox.prototype, "unbind_", function (dt, skipper) {
|
this.domListen_(this.$n(), "onChange", "onAutofill");
|
||||||
if (!this.$unbind_)
|
});
|
||||||
return;
|
|
||||||
|
zk.override(zul.inp.Textbox.prototype, "unbind_", function(dt, skipper) {
|
||||||
this.$unbind_(dt, skipper);
|
if (!this.$unbind_)
|
||||||
|
return;
|
||||||
var txtid = this.getId()
|
|
||||||
if (txtid != "txtUserId" && txtid != "txtPassword" ){
|
this.$unbind_(dt, skipper);
|
||||||
return;
|
|
||||||
}
|
var txtid = this.getId()
|
||||||
|
if (txtid != "txtUserId" && txtid != "txtPassword") {
|
||||||
this.domUnlisten_(this.$n(), "onChange", "onAutofill"); //unlisten
|
return;
|
||||||
});
|
}
|
||||||
|
|
||||||
zk.override(zul.inp.Combobox.prototype, "doKeyDown_", function (evt) {
|
this.domUnlisten_(this.$n(), "onChange", "onAutofill"); //unlisten
|
||||||
// avoid confuse of idempiere shortcut key and function key of combobox
|
});
|
||||||
if ( (evt.altKey || evt.ctrlKey || evt.shiftKey) &&
|
|
||||||
(evt.keyCode == 33 || evt.keyCode == 34 || evt.keyCode == 35 || evt.keyCode == 36 || evt.keyCode == 38 || evt.keyCode == 40 || evt.keyCode == 37 || evt.keyCode == 39) ){//page up | page down | end | home | up | down | left | write
|
zk.override(zul.inp.Combobox.prototype, "doKeyDown_", function(evt) {
|
||||||
|
// avoid confuse of idempiere shortcut key and function key of combobox
|
||||||
if (this.isOpen())//close drop down if already open. it will let combobox select current item, it's consistent with lost focus
|
if ((evt.altKey || evt.ctrlKey || evt.shiftKey) &&
|
||||||
this.close({sendOnOpen: true});
|
(evt.keyCode == 33 || evt.keyCode == 34 || evt.keyCode == 35 || evt.keyCode == 36 || evt.keyCode == 38 || evt.keyCode == 40 || evt.keyCode == 37 || evt.keyCode == 39)) { //page up | page down | end | home | up | down | left | write
|
||||||
|
|
||||||
return;
|
if (this.isOpen()) //close drop down if already open. it will let combobox select current item, it's consistent with lost focus
|
||||||
// TODO:current idempiere use alt + down/up to move child parrent tab, but combobox also use it to open, close drop down
|
this.close({
|
||||||
// at the moment, idempiere shortcut is more useful, so just get it work
|
sendOnOpen: true
|
||||||
}else{
|
});
|
||||||
this.$doKeyDown_(evt);
|
|
||||||
}
|
return;
|
||||||
|
// TODO:current idempiere use alt + down/up to move child parrent tab, but combobox also use it to open, close drop down
|
||||||
});
|
// at the moment, idempiere shortcut is more useful, so just get it work
|
||||||
|
} else {
|
||||||
|
this.$doKeyDown_(evt);
|
||||||
});
|
}
|
||||||
|
|
||||||
zk.afterLoad('zul.mesh', function () {
|
});
|
||||||
|
|
||||||
zk.override(zul.mesh.Paging.prototype, "bind_", function () {
|
});
|
||||||
this.$bind_.apply(this, arguments);
|
|
||||||
if (this._totalSize == 0x7fffffff){
|
zk.afterLoad('zul.mesh', function() {
|
||||||
jq(".z-paging-text", this).text(" / ?");
|
|
||||||
}
|
zk.override(zul.mesh.Paging.prototype, "bind_", function() {
|
||||||
});
|
this.$bind_.apply(this, arguments);
|
||||||
|
if (this._totalSize == 0x7fffffff) {
|
||||||
|
jq(".z-paging-text", this).text(" / ?");
|
||||||
zk.override(zul.mesh.Paging.prototype, "infoText_",
|
}
|
||||||
function () {
|
});
|
||||||
//this.$infoText_.apply(this, arguments);
|
|
||||||
var acp = this._activePage,
|
zk.override(zul.mesh.Paging.prototype, "infoText_",
|
||||||
psz = this._pageSize,
|
function() {
|
||||||
tsz = this._totalSize,
|
//this.$infoText_.apply(this, arguments);
|
||||||
|
var acp = this._activePage,
|
||||||
lastItem = (acp + 1) * psz,
|
psz = this._pageSize,
|
||||||
dash = '';
|
tsz = this._totalSize,
|
||||||
|
|
||||||
if ('os' != this.getMold())
|
lastItem = (acp + 1) * psz,
|
||||||
dash = ' - ' + (lastItem > tsz ? tsz : lastItem);
|
dash = '';
|
||||||
|
|
||||||
if (this._totalSize == 0x7fffffff)
|
if ('os' != this.getMold())
|
||||||
tsz = "?";
|
dash = ' - ' + (lastItem > tsz ? tsz : lastItem);
|
||||||
|
|
||||||
return '[ ' + (acp * psz + 1) + dash + ' / ' + tsz + ' ]';
|
if (this._totalSize == 0x7fffffff)
|
||||||
});
|
tsz = "?";
|
||||||
});
|
|
||||||
|
return '[ ' + (acp * psz + 1) + dash + ' / ' + tsz + ' ]';
|
||||||
zk.afterLoad('calendar', function () {
|
});
|
||||||
zk.override(calendar.Event.prototype, "calculate_", function () {
|
});
|
||||||
if (typeof this.event === "undefined" || this.event == null) {
|
|
||||||
return;
|
zk.afterLoad('calendar', function() {
|
||||||
}
|
zk.override(calendar.Event.prototype, "calculate_", function() {
|
||||||
this.$calculate_.apply(this, arguments);
|
if (typeof this.event === "undefined" || this.event == null) {
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
zk.override(calendar.Event.prototype, "unbind_", function() {
|
this.$calculate_.apply(this, arguments);
|
||||||
var node = this.$n();
|
});
|
||||||
if (typeof node === "undefined") {
|
|
||||||
return;
|
zk.override(calendar.Event.prototype, "unbind_", function() {
|
||||||
}
|
var node = this.$n();
|
||||||
if (typeof this.$unbind_ === "undefined") {
|
if (typeof node === "undefined") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$unbind_.apply(this, arguments);
|
if (typeof this.$unbind_ === "undefined") {
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
zk.override(calendar.CalendarsMonth.prototype, "onSize", function () {
|
this.$unbind_.apply(this, arguments);
|
||||||
var cmp = this.$n();
|
});
|
||||||
if (typeof cmp === "undefined" || cmp == null) {
|
|
||||||
return;
|
zk.override(calendar.CalendarsMonth.prototype, "onSize", function() {
|
||||||
}
|
var cmp = this.$n();
|
||||||
this.$onSize.apply(this, arguments);
|
if (typeof cmp === "undefined" || cmp == null) {
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
zk.override(calendar.CalendarsDefault.prototype, "onSize", function () {
|
this.$onSize.apply(this, arguments);
|
||||||
var cmp = this.$n();
|
});
|
||||||
if (typeof cmp === "undefined" || cmp == null) {
|
|
||||||
return;
|
zk.override(calendar.CalendarsDefault.prototype, "onSize", function() {
|
||||||
}
|
var cmp = this.$n();
|
||||||
this.$onSize.apply(this, arguments);
|
if (typeof cmp === "undefined" || cmp == null) {
|
||||||
});
|
return;
|
||||||
});
|
}
|
||||||
|
this.$onSize.apply(this, arguments);
|
||||||
zk.afterLoad("zul.mesh", function () {
|
});
|
||||||
var _xFrozen = {};
|
});
|
||||||
zk.override(zul.mesh.Frozen.prototype, _xFrozen, {
|
|
||||||
_doScrollNow: function() {
|
zk.afterLoad("zul.mesh", function() {
|
||||||
var result = _xFrozen._doScrollNow.apply(this, arguments);
|
var _xFrozen = {};
|
||||||
/*Patch: add class to non-visible columns*/
|
zk.override(zul.mesh.Frozen.prototype, _xFrozen, {
|
||||||
var mesh = this.parent;
|
_doScrollNow: function() {
|
||||||
if (mesh.head) {
|
var result = _xFrozen._doScrollNow.apply(this, arguments);
|
||||||
var totalCols = mesh.head.nChildren,
|
/*Patch: add class to non-visible columns*/
|
||||||
hdcol = mesh.ehdfaker.firstChild;
|
var mesh = this.parent;
|
||||||
|
if (mesh.head) {
|
||||||
for (var faker, i = 0; hdcol && i < totalCols; hdcol = hdcol.nextSibling, i++) {
|
var totalCols = mesh.head.nChildren,
|
||||||
if (hdcol.style.width.indexOf('0.001px') != -1 || hdcol.style.width.indexOf('0px') != -1) {
|
hdcol = mesh.ehdfaker.firstChild;
|
||||||
jq(zk.$(hdcol).$n()).addClass("hiddencol");
|
|
||||||
} else {
|
for (var faker, i = 0; hdcol && i < totalCols; hdcol = hdcol.nextSibling, i++) {
|
||||||
jq(zk.$(hdcol).$n()).removeClass("hiddencol");
|
if (hdcol.style.width.indexOf('0.001px') != -1 || hdcol.style.width.indexOf('0px') != -1) {
|
||||||
}
|
jq(zk.$(hdcol).$n()).addClass("hiddencol");
|
||||||
}
|
} else {
|
||||||
}
|
jq(zk.$(hdcol).$n()).removeClass("hiddencol");
|
||||||
return result;
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
});
|
return result;
|
||||||
|
}
|
||||||
} //window.location.protocol check
|
});
|
||||||
else
|
});
|
||||||
{
|
|
||||||
alert("This request has been blocked, the content must be served over HTTPS");
|
} //window.location.protocol check
|
||||||
}
|
else {
|
||||||
]]>
|
alert("Direct http:// is forbidden - please use https:// instead with the SSL port used in your installation");
|
||||||
</script>
|
}
|
||||||
<include src="${themePreference}" if="${execution.getScheme() == 'https'}"/>
|
]]>
|
||||||
<window use="org.adempiere.webui.AdempiereWebUI" if="${execution.getScheme() == 'https'}"/>
|
</script>
|
||||||
</zk>
|
<include src="${themePreference}" if="${execution.getScheme() == 'https'}"/>
|
||||||
|
<window use="org.adempiere.webui.AdempiereWebUI" if="${execution.getScheme() == 'https'}"/>
|
||||||
|
</zk>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue