Start point upgrade HTML UI with Adempiere 3.5.3a

This commit is contained in:
vinhpt 2009-05-13 07:24:51 +00:00
parent 88dd91f29d
commit 87dea94baa
5 changed files with 2099 additions and 2028 deletions

View File

@ -19,7 +19,7 @@
* than modifying calendar.js itself).
*/
// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $
// $Id: calendar-setup.js,v 1.1 2009/04/15 11:27:37 vinhpt Exp $
/**
* This function "patches" an input field (or other element) to use a calendar

View File

@ -12,7 +12,7 @@
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
*/
// $Id: calendar.js,v 1.51 2005/03/07 16:44:31 mishoo Exp $
// $Id: calendar.js,v 1.1 2009/04/15 11:27:37 vinhpt Exp $
/** The Calendar object constructor. */
Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {

View File

@ -2,7 +2,7 @@ var isIE = (navigator.userAgent.indexOf("MSIE") != -1);
/****************************************************************************
* Compiere (c) Jorg Janke - All rights reseverd
* $Id: menu.js,v 1.1 2006/04/21 18:03:35 jjanke Exp $
* $Id: menu.js,v 1.1 2009/04/15 11:27:37 vinhpt Exp $
*
* Menu - show/hide sub-menues - tested in IE 6 end Mozila 1.7
***************************************************************************/
@ -46,3 +46,83 @@ function changeMenu (evt)
} // changeMenu
var oldItem=null;
var flag=true;
// Expands enough nodes to expose an LI with a given ID
function searchMenu(treeId,str,evt,target) {
if (evt.keyCode==13||evt.keyCode==10) {
if ((evt.ctrlKey||evt.altKey||evt.shiftKey) && oldItem!=null) {
window.open(oldItem.firstChild.href,target);
} else {
var ul = document.getElementById(treeId);
if (ul != null) {
deselectAll();
var o = expandCollapseList(ul,str);
if (o!=null) {
if (o.scrollIntoView) o.scrollIntoView(false);
selectItem(o.firstChild);
oldItem = o;
}
}
}
}
}
// Performs 3 functions:
// a) Expand all nodes
// b) Collapse all nodes
// c) Expand all nodes to reach a certain ID
function expandCollapseList(ul,str) {
if (!ul.childNodes || ul.childNodes.length==0) return null;
// Iterate LIs
for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
var item = ul.childNodes[itemi];
if (item != null && item.firstChild != null) {
var fitem = item.firstChild;
if (flag && fitem.nodeName == "A" && fitem.innerHTML.match(str) != null) {
flag = false;
return item;
}
if (item == oldItem) flag=true;
}
if (item.nodeName == "LI") {
// Iterate things in this LI
for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) {
var sitem = item.childNodes[sitemi];
if (sitem.nodeName=="UL") {
var o = expandCollapseList(sitem,str);
if (o!=null) {
sitem.style.display="";
item.style.listStyleImage="url(/adempiere/images/mOpen.gif)";
return o;
}
}
}
}
}
}
function selectItem(obj)
{
if (document.selection)
{
var range = document.body.createTextRange();
range.moveToElementText(obj);
range.select();
}
else if (window.getSelection)
{
var range = document.createRange();
range.selectNode(obj);
window.getSelection().addRange(range);
}
}
function deselectAll()
{
if (document.selection)
document.selection.empty();
else if (window.getSelection)
window.getSelection().removeAllRanges();
}

View File

@ -1,11 +1,11 @@
/****************************************************************************
* Compiere (c) Jorg Janke - All rights reseverd
* $Id: standard.js,v 1.1 2006/04/21 18:03:35 jjanke Exp $
* $Id: standard.js,v 1.1 2009/04/15 11:27:37 vinhpt Exp $
*
* General Header Script shared by Web UI and WebStore
***************************************************************************/
var cvs = '$Id: standard.js,v 1.1 2006/04/21 18:03:35 jjanke Exp $';
var cvs = '$Id: standard.js,v 1.1 2009/04/15 11:27:37 vinhpt Exp $';
var isIE = (navigator.userAgent.indexOf("MSIE") != -1);

View File

@ -1,6 +1,6 @@
/****************************************************************************
* Compiere (c) Jorg Janke - All rights reseverd
* $Id: window.js,v 1.1 2006/04/21 18:03:35 jjanke Exp $
* $Id: window.js,v 1.1 2009/04/15 11:27:37 vinhpt Exp $
*
* Web UI Window Utilities
***************************************************************************/
@ -205,21 +205,10 @@ function getRealValue (myValue)
function popUp(URL,name) {
day = new Date();
var id = day.getTime();
var callWindow;
browser = navigator.appName
var callWindow = window;
if(browser=="Netscape" ){
if(window.parentopener){
callWindow = window.parentopener;
window.close();
}
else{
callWindow = window;
}
}
var openwindow = eval("page" + id + " = window.open(URL, '" + name + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=300,left = 212,top = 234');");
openwindow.parentopener = callWindow;
var openwindow = eval("page" + id + " = window.open(URL, '" + name + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=600,height=400,left = 212,top = 234');");
openwindow.opener = callWindow;
}
/****************************************************************************
@ -255,7 +244,8 @@ function startLookup (columnName, processid, page)
function startZoom (TableID, RecordID)
{
var url = "WWindow?AD_Table_ID=" + TableID+"&AD_Record_ID="+RecordID;
parent.WWindow.location = '/adempiere/' + url;
//parent.WWindow.location = '/adempiere/' + url;
popUp('/adempiere/' + url, 'WTable' + TableID);
return false; // do not submit page
} // startZoom
@ -291,7 +281,7 @@ function startUpdate (column)
* Lookup Field Updated - submit
*/
function startLookUpdate(column, name1, value1, name2, value2)
{
{ /*
browser = navigator.appName
if(browser=="Netscape" ){
@ -299,8 +289,9 @@ function startLookUpdate(column, name1, value1, name2, value2)
}
else{
var d = opener.document;
}
}*/
var d = opener.document;
window.close();
d.getElementById(name2).focus();
d.getElementById(name1).value =value1;