Adempiere 3.1.2

This commit is contained in:
vpj-cd 2006-12-07 03:51:37 +00:00
parent 2c02be5c40
commit a603955be7
9 changed files with 0 additions and 2637 deletions

View File

@ -1,730 +0,0 @@
/***********************************************/
/* HTML tag styles */
/********************************************** */
body{
font-family: Arial, sans-serif;
color: #000000;
line-height: normal;
margin: 0px;
padding: 0px;
background-image: url(../images/page_bkgd3.jpg);
background-color: #FFFFFF;
background-repeat: repeat-x;
}
a{
color: #006699;
text-decoration: none;
}
a:link{
color: #006699;
text-decoration: none;
font-weight: normal;
}
a:visited{
color: #006699;
font-weight: normal;
text-decoration: none;
}
a:hover{
color: #006699;
text-decoration: underline;
}
h1, h2, h3, h4, h5, h6, h7 {
font-family: Arial,sans-serif;
margin: 0px;
padding: 0px;
}
ul{
list-style-type: square;
list-style-position: inside;
margin-right: 10px;
}
ul ul{
list-style-type: disc;
}
ul ul ul{
list-style-type: none;
}
label{
color: #333333;
font-family: Arial,sans-serif;
font-size: 80%;
}
ol{
list-style-position: inside;
margin-right: 10px;
}
img{
text-decoration: none;
}
/***********************************************/
/* Layout Divs */
/***********************************************/
/************** #container div styles ************* */
#indexProductbar{
padding: 0px;
background-color: #FFFFFF;
width: 160px;
float: left;
}
#content{
float:right;
width: 596px;
margin: 0px 0px 0px 0px;
color:#333333;
padding: 0px 0px 0px 0px;
}
#indexContent{
width: 419px;
margin: 0px 0px 0px 0px;
color:#333333;
padding: 0px 0px 0px 0px;
background-color: #FFFFFF;
float: left;
}
#fullcontent{
width: 760px;
margin: 0px 0px 0px 0px;
color:#333333;
padding: 0px 0px 0px 0px;
}
#leftPod{
float: left;
margin: 0px;
padding: 0px;
background-repeat: no-repeat;
height: 320px;
width: 160px;
background-image: url(/images/adempiere_guy.jpg);
}
#leftPod2{
width: 127px;
margin: 0px;
padding: 7px 0px 0px 2px;
background-image: url(../images/title_bkgd.jpg);
height: 23px;
float: left;
border-left: solid #CCCCCC 1px;
border-right: solid #CCCCCC 1px;
border-top: solid #CCCCCC 1px;
}
#leftPod3{
width: 129px;
padding: 0px 0px 0px 0px;
text-align: center;
float: left;
border-right: solid #CCCCCC 1px;
border-left: solid #CCCCCC 1px;
}
#leftPod4{
float: none;
margin: 0px;
padding: 0px;
width: 129px;
background-color: #FFFFFF;
}
#rightPod{
float:right;
width: 100%;
border-left: 1px solid #cccccc;
border-bottom: 1px solid #cccccc;
}
#rightPod2{
float:none;
width: 160px;
background-image: url(../images/title_bkgd.jpg);
height: 23px;
text-align: left;
padding: 7px 0px 0px 0px;
background-repeat: no-repeat;
}
#rightPod3{
float:none;
width: 158px;
text-align: center;
margin: 0px 0px 0px 0px;
background-color: #FFFFFF;
}
#rightPod5{
float:none;
width: 158px;
text-align: center;
margin: 0px 0px 0px 0px;
background-color: #FFFFFF;
height: 280px;
padding-top: 25px;
}
/************** #topNav styles ************* */
#topNav{
position: relative;
top: 4px;
height: 22px;
padding: 0px;
margin: -95px 0px 0px 400px;
left: 5px;
width: 350px;
text-align: right;
font-size: 60%;
vertical-align: middle;
}
#topLink{
position: relative;
top: 4px;
height: 22px;
padding: 0px;
margin: 0px;
left: 190px;
width: 500px;
}
a.toplink, a.toplink:visited{
color: #003366;
font-weight: bold;
margin: 0px;
padding: 2px 5px 4px 5px;
text-decoration: none;
border-right-width: 1px;
border-right-style: solid;
border-right-color: #999999;
}
a.toplink:hover{
color: #003366;
font-weight: bold;
text-decoration: underline;
}
a.alttoplink, a.alttoplink:visited{
color: #003366;
font-weight: bold;
margin: 0px;
padding: 2px 5px 4px 5px;
text-decoration: none;
}
a.alttoplink:hover{
color: #003366;
font-weight: bold;
text-decoration: underline;
}
/************* #globalNav styles ************* */
#globalNav{
color: #003366;
white-space: nowrap;
background-image: url(../images/navbar_adempiere.jpg);
background-repeat: no-repeat;
font-family: Arial, Helvetica, sans-serif;
height: 28px;
width: 100%;
}
#globalNav img{
display: block;
}
#globalNav a {
font-size: 90%;
padding: 0 4px 0 0;
}
#globalLink{
position: relative;
top: 4px;
height: 22px;
padding: 0px;
margin: 0px;
left: 190px;
width: 400px;
}
a.glink, a.glink:visited{
font-size: small;
color: #99FFFF;
font-weight: bold;
margin: 0px;
padding: 2px 5px 4px 5px;
text-decoration: none;
border-right-width: 0px;
border-right-style: solid;
border-right-color: #999999;
}
a.glink:hover{
color: #FFFFFF;
text-decoration: none;
}
a.altlink, a.altlink:visited{
font-size: small;
color: #99FFFF;
font-weight: bold;
margin: 0px;
padding: 2px 5px 4px 5px;
text-decoration: none;
}
a.altlink:hover{
color: #FFFFFF;
text-decoration: none;
}
/************** #tabNav styles ************* */
#tabNav{
position: relative;
padding: -10px 0px 5px 20px;
margin: 0px;
left: 25px;
width: 520px;
}
a.tabNav, a.tabNav:visited{
color: #ffffff;
font-weight: bold;
margin: 0px;
padding: 2px 5px 4px 5px;
text-decoration: underline;
}
a.tabNav:hover{
color: #ffffff;
font-weight: bold;
text-decoration: underline;
}
/************** Header styles ************* */
#masthead{
width: 100%;
border-bottom: 1px solid #cccccc;
}
#header{
font-family: Arial, Helvetica, sans-serif;
height: 94px;
width: 100%;
margin: 0;
background-color: #0099CC;
background-image: url(../images/adempiere_5a.jpg);
background-repeat: no-repeat;
font-weight: bolder;
}
#logoHeader{
font-family: Arial, Helvetica, sans-serif;
height: 94px;
width: 100%;
z-index: 10;
}
#navBar{
padding: 0px;
background-color: #eeeeee;
width: 159px;
}
#fullheightcontainer{
margin-left:auto;
margin-right:auto;
position:inherit;
width:760px;
height:100%;
background-color: #FFFFFF;
}
#wrapper{
min-height:100%;
height:100%;
background:#FFFFFF;
}
#wrapp\65 r{
height:auto;
}
* html #wrapper{
height:100%;
width: 760px;
background-color: #FFFFFF;
}
#outer{
z-index:1;
position:relative;
margin-left:160px;
width:440px;
background:#FFFFFF;
height:100%;
}
/***********************************************/
/* Components */
/***********************************************/
/*************** title styles ************* */
#index1{
text-align: center;
background-color: #FFFFFF;
color: #003366;
font-weight: bolder;
font-size: 1.2em;
height: auto;
padding-top: 10px;
}
#index2{
text-align: right;
background-color: #FFFFFF;
color: #0099cc;
font-weight: bold;
font-size: .9em;
padding-right: 10px;
height: auto;
margin-top: 0px;
}
#index3{
text-align: left;
color: #003366;
font-weight: bold;
font-size: 1.0em;
}
#pageName{
margin: 25px 0px 0px 5px;
padding: 0px 0px 0px 20px;
color: #003366;
font-size: 150%;
}
#pageNameimg{
margin: 5px 0px 20px 25px;
padding: 0px 0px 0px 0px;
}
#sectionTitle{
font-weight: bold;
color: #003366;
margin: 0px 0px 0px 0px;
padding: 10px 0px 10px 10px;
}
#sectionTitle2{
font-size: 90%;
font-weight: bold;
color: #003366;
margin: 0px 0px 0px 0px;
padding: 5px 0px 10px 0px;
}
#storyTitle1{
font-size: 115%;
font-weight: bold;
color: #003366;
margin: 20px 10px 10px 25px;
padding: 0px;
}
#storyTitle2{
font-size: 105%;
font-weight: bold;
color: #333333;
margin: 0px 0px 10px 30px;
padding: 0px;
}
#storyTabletitle1{
font-size: 105%;
font-weight: bold;
color: #333333;
margin: 0px 0px 5px 15px;
padding: 0px;
}
#storyTabletitle2{
font-size: 115%;
font-weight: bold;
color: #003366;
margin: 0px 0px 10px 0px;
padding: 0px;
}
#dynamicTitle{
font-size: 100%;
font-weight: bolder;
color: #333333;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 3px;
}
#siteMap1{
font-size: 120%;
font-weight: bold;
color: #006699;
margin: 20px 15px 10px 25px;
padding: 0px;
}
#siteMap2{
font-size: 90%;
font-weight: bold;
color: #006699;
margin: 0px 0px 5px 40px;
padding: 0px;
font-style: normal;
}
#aboutNav{
position: relative;
top: 4px;
height: 22px;
padding: 4px 0px 0px 0px;
margin: 2px 0px 8px 0px;
width: 410px;
text-align: center;
font-size: 90%;
vertical-align: middle;
}
a.aboutNav, a.aboutNav:visited{
font-weight: bold;
margin: 0px;
padding: 2px 5px 4px 5px;
text-decoration: underline;
}
a.aboutNav:hover{
font-weight: bold;
text-decoration: underline;
}
/************* #breadCrumb styles *************/
#breadCrumb{
font-size: 70%;
margin: 5px 0px 0px 20px;
}
/************** .centerPod styles ***************/
.centerPod{
padding: 0px 0px 0px 0px;
font-size: 0.91em;
background-color: #FFFFFF;
margin: 0px 0px 0px 0px;
}
.centerPod2{
background-image: url(../images/title_bkgd.jpg);
height: 31px;
}
.centerPod3{
}
/************** .story styles *****************/
.story{
font-size: 80%;
width: 100%;
}
.story p{
padding: 0px 0px 10px 0px;
margin: 0px 20px 0px 35px;
}
#storyImg{
margin: 10px 10px 10px 30px;
text-align: center;
}
.story a{
text-decoration:underline
}
.story a:visited{
text-decoration:underline
}
.story a:hover{
text-decoration: underline;
}
#storySidebar{
float:right;
width: 158px;
text-align: left;
margin: 0px 1px 10px 10px;
background-color: #FFFFFF;
border: 1px solid #cccccc;
}
/************** .webStore styles *****************/
#webStorecontent{
float:right;
width: 750px;
margin: 0px 0px 0px 0px;
color:#333333;
padding: 0px 10px 0px 0px;
}
.webStore{
font-size: 80%;
width: 100%;
}
.webStore p{
padding: 0px 0px 10px 0px;
margin: 0px 20px 0px 35px;
}
/************* #siteInfo styles ***************/
#siteInfo{
clear: both;
font-size: 75%;
color: #999999;
padding: 5px 5px 5px 5px;
text-align: center;
border-top: 1px solid #cccccc;
}
/************* #search styles ***************/
#search{
padding: 5px 0px 5px 10px;
font-size: 90%;
margin-top: -24px;
margin-left: 596px;
}
#search form{
margin: 0px;
padding: 0px;
}
#search label{
display: block;
margin: 0px;
padding: 0px;
}
#searchStore{
padding: 5px 0px 5px 10px;
font-size: 90%;
margin-top: -24px;
margin-left: 30px;
}
/*********** #navBar link styles ***********/
#navBar ul a:link, #navBar ul a:visited{
display: block;
}
#navBar ul {
list-style: none; margin: 0; padding: 0;
}
#navBar li {border-bottom: 1px solid #EEE;}
html>body #navBar li {border-bottom: none;}
/*********** leftNav styles ***********/
#sectionLinks{
position: relative;
margin: 0px;
padding: 0px;
font-size: 88%;
border-right: 1px solid #cccccc;
border-bottom: 1px solid #cccccc;
}
#sectionLinks h3{
padding: 10px 0px 2px 10px;
}
#sectionLinks a:link{
padding: 2px 0px 2px 10px;
border-top: 1px solid #cccccc;
width: auto;
voice-family: "\"}\"";
voice-family:inherit;
width: auto;
}
#sectionLinks a:visited{
border-top: 1px solid #cccccc;
padding: 2px 0px 2px 10px;
}
#sectionLinks a:hover{
border-top: 1px solid #cccccc;
background-color: #dddddd;
padding: 2px 0px 2px 10px;
}
#lnavFade{
width: 160px;
border: 0px;
height: 100px;
background-color: #FFFFFF;
background-image: url(../images/lnav_fade.jpg);
}
/*********** #login styles ***********/
#login{
position: relative;
margin: 0px;
padding: 10px 0px 10px 10px;
background-color: #FFFFFF;
border-right: 1px solid #cccccc;
}
#loginNew{
font-family: Arial, sans-serif;
color: #FF0000;
font-size: 80%;
text-align: left;
background-color: #FFFFFF;
padding: 10px 0px 10px 10px;
border-right: 1px solid #cccccc;
}
/*********** #subscribe styles ***********/
#subscribe{
text-align: left;
background-color: #eeeeee;
padding: 10px 0px 10px 10px;
border-right: 1px solid #cccccc;
border-top: 1px solid #cccccc;
}
#subscribeLink{
font-family: Arial, sans-serif;
color: #FF0000;
font-size: 90%;
padding-right: 5px;
}
#subscribeLink ul a:link, #navBar ul a:visited, #navBar ul a:link{
display: block;
color: #006699;
}
#subscribeLink ul {
list-style: none; margin: 0; padding: 0;
}
#subscribeLink li {border-bottom: 1px solid #EEE;}
html>body #subscribeLink li {border-bottom: none;}
/*********** .relatedLinks styles ***********/
.relatedLinks{
position: relative;
margin: 0px;
padding: 0px 0px 10px 10px;
font-size: 80%;
color: #006699;
}
.relatedLinks h3{
padding: 10px 0px 2px 0px;
}
.relatedLinks a:link,
.relatedLinks a:visited{
display: block;
color: #000033;
}
.relatedLinks a:hover {
display: block;
color: #000033;
text-decoration: underline;
}
.sitemapLinks1{
position: relative;
margin: 0px;
padding: 3px 0px 5px 65px;
font-size: 80%;
}
.sitemapLinks2{
position: relative;
margin: 0px;
padding: 0px 0px 5px 65px;
font-size: 80%;
}
.sitemapLinks3{
position: relative;
margin: 0px;
padding: 0px 0px 10px 65px;
font-size: 80%;
}
/************** #headlines styles ************* */
#headlines{
margin: 0px;
padding: 0px 0px 0px 0px;
width: 160px;
float: right;
background-color: #FFFFFF;
}
#headlines2{
margin: 0px;
padding: 0px 0px 0px 0px;
width: 160px;
float: right;
background-color: #FFFFFF;
border-left: solid #CCCCCC 1px;
border-right: solid #CCCCCC 1px;
border-top: solid #CCCCCC 1px;
}
#headlines3{
margin: 0px;
padding: 0px 0px 0px 0px;
width: 162px;
float: right;
background-color: #FFFFFF;
}
#headlines p{
padding: 5px 0px 5px 0px;
}
/************** #table styles ************* */
#tableText{
color: #333333;
font-size: 0.7em;
}

View File

@ -1,20 +0,0 @@
.mainDocumentStyle {
background-color: #cfcfcf;
}
/* used in toolbar buttons */
.iconButtonStyle {
background-color: #cfcfcf;
border: 3px groove #e0e0e0;
margin: 0px;
}
.rightLabel {
text-align: right;
white-space: nowrap;
}
.leftLabel {
text-align: left;
white-space: nowrap;
}

View File

@ -1,22 +0,0 @@
/* pink background for required but empty fields */
.requiredTextField {
background-color: #ffd6dd;
}
/* the blue background for filled required fields */
.filledTextField {
background-color: #9191ff;
}
/* orange like the title says */
.orangeTextField {
background-color: #ffc55c;
}
.fixedWidthInputText {
width: 15em;
}
.fillCellTableView {
width: 100%;
}

View File

@ -1,50 +0,0 @@
/*
if you could do multiple inheritance in css this would be perfect for it
not every aspect of this setup is as styled as it should be;
the buttons aren't properly squished together
*/
.baseParentTabStyle {
background-color: inherit;
width: 115px;
}
/* indented first level style tab button */
.baseIndentOneTabStyle {
background-color: inherit;
width: 100px;
}
.baseIndentTwoTabStyle {
background-color: inherit;
width: 85px;
}
.selectedTabStyle {
border-left: 2px inset;
border-top: 2px inset;
border-bottom: 2px inset;
border-right: none;
}
.unselectedTabStyle {
border: 2px outset;
}
/* inherits from selectedTabStyle */
.selectedMouseOverTabStyle {
color: WHITE;
border-left: 2px inset BLACK;
border-top: 2px inset BLACK;
border-bottom: 2px inset BLACK;
border-right: none;
}
.unselectedMouseOverTabStyle {
color: WHITE;
border: 2px outset BLACK;
}
.childTab {
padding-left: 15px;
}

View File

@ -1,21 +0,0 @@
.wideTableStyle {
table-layout: fixed;
border-style: solid;
border-width: 1px;
}
.wideTableHeaderStyle {
white-space: nowrap;
border-right: solid;
border-left: solid;
border-width: 1px;
}
wideTableRowStyle {
border-style: solid;
border-width: 1px;
}
.wideTableCellStyle {
border-style: solid;
border-width: 1px;
}

View File

@ -1,764 +0,0 @@
/*
Copyright 2005 Vitaliy Shevchuk (shevit@users.sourceforge.net)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
AjaxAnywhere.defaultInstanceName = "default";
// constructor;
function AjaxAnywhere() {
this.id = AjaxAnywhere.defaultInstanceName;
this.formName = null;
this.notSupported = false;
this.delayBeforeContentUpdate = true;
this.delayInMillis = 100;
if (window.XMLHttpRequest) {
this.req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
this.req = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
this.req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e1) {
this.notSupported = true;
/* XMLHTTPRequest not supported */
}
}
}
if (this.req == null || typeof this.req == "undefined")
this.notSupported = true;
}
/**
* Stores substitutes SubmitButton names in to redo sustitution if a button was eventually inside a refresh zone.
*/
AjaxAnywhere.prototype.substitutedSubmitButtons = new Array();
AjaxAnywhere.prototype.substitutedSubmitButtonsInfo = new Object();
/**
* Returns a Form object that corresponds to formName property of this AjaxAnywhere class instance.
*/
AjaxAnywhere.prototype.findForm = function () {
var form;
if (this.formName != null)
form = document.forms[this.formName];
else if (document.forms.length > 0)
form = document.forms[0];
if (typeof form != "object")
alert("AjaxAnywhere error: Form with name [" + this.formName + "] not found");
return form;
}
/**
* Binds this instance to window object using "AjaxAnywhere."+this.id as a key.
*/
AjaxAnywhere.prototype.bindById = function () {
var key = "AjaxAnywhere." + this.id;
window[key] = this;
}
/**
* Finds an instance by id.
*/
AjaxAnywhere.findInstance = function(id) {
var key = "AjaxAnywhere." + id;
return window[key];
}
/**
* This function is used to submit all form fields by AJAX request to the server.
* If the form is submited with <input type=submit|image>, submitButton should be a reference to the DHTML object. Otherwise - undefined.
*/
AjaxAnywhere.prototype.submitAJAX = function(additionalPostData, submitButton) {
if (this.notSupported)
return this.onSubmitAjaxNotSupported(additionalPostData, submitButton);
if (additionalPostData == null || typeof additionalPostData == "undefined")
additionalPostData = "";
this.bindById();
var form = this.findForm();
var actionAttrNode = form.attributes["action"].nodeValue;
var url = actionAttrNode == null?null:actionAttrNode.nodeValue;
if ((url == null) || (url == ""))
url = location.href;
var pos = url.indexOf("#");
if (pos!=-1)
url = url.substring(0,pos);
if ((url == null) || (url == ""))
url = location.href;
pos = url.indexOf("#");
if (pos!=-1)
url = url.substring(0,pos);
var zones = this.getZonesToReload(url, submitButton);
if (zones == null) {
// submit in tradiditional way :
this.submitOld(form,submitButton)
return;
}
this.dropPreviousRequest();
this.req.open("POST", url, true);
this.req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
this.req.setRequestHeader("Accept", "text/xml");
var postData = this.preparePostData(submitButton);
if (zones != "")
postData = '&aazones=' + encodeURIComponent(zones) + "&" + postData + "&" + additionalPostData;
else
postData += "&" + additionalPostData;
this.sendPreparedRequest(postData);
}
/**
* sends a GET request to the server.
*/
AjaxAnywhere.prototype.getAJAX = function(url, zonesToRefresh) {
if (this.notSupported)
return this.onGetAjaxNotSupported(url);
this.bindById();
if (zonesToRefresh == null || typeof zonesToRefresh == "undefined")
zonesToRefresh = "";
var urlDependentZones = this.getZonesToReload(url);
if (urlDependentZones == null) {
location.href = url;
return;
}
if (urlDependentZones.length != 0)
zonesToRefresh += "," + urlDependentZones;
this.dropPreviousRequest();
url += (url.indexOf("?") != -1) ? "&" : "?";
url += "aaxmlrequest=true&aa_rand=" + Math.random();
// avoid caching
if (zonesToRefresh != null && zonesToRefresh != "")
url += '&aazones=' + encodeURIComponent(zonesToRefresh);
this.req.open("GET", url, true);
this.req.setRequestHeader("Accept", "text/xml");
this.sendPreparedRequest("");
}
/**
* @private
*/
AjaxAnywhere.prototype.sendPreparedRequest = function (postData) {
var callbackKey = this.id + "_callbackFunction";
if (typeof window[callbackKey] == "undefined")
window[callbackKey] = new Function("AjaxAnywhere.findInstance(\"" + this.id + "\").callback(); ");
this.req.onreadystatechange = window[callbackKey];
this.showLoadingMessage();
this.req.send(postData);
}
/**
* Used internally by AjaxAnywhere. Aborts previous request if not completed.
*/
AjaxAnywhere.prototype.dropPreviousRequest = function() {
if (this.req.readyState != 0 && this.req.readyState != 4) {
// abort previous request if not completed
this.req.abort();
this.handlePrevousRequestAborted();
}
}
/**
* Internally used to prepare Post data.
* If the form is submited with <input type=submit|image>, submitButton is a reference to the DHTML object. Otherwise - undefined.
*/
AjaxAnywhere.prototype.preparePostData = function(submitButton) {
var form = this.findForm();
var result = "&aaxmlrequest=true";
for (var i = 0; i < form.elements.length; i++) {
var el = form.elements[i];
if (el.tagName.toLowerCase() == "select") {
for (var j = 0; j < el.options.length; j++) {
var op = el.options[j];
if (op.selected)
result += "&" + encodeURIComponent(el.name) + "=" + encodeURIComponent(op.value);
}
} else if (el.tagName.toLowerCase() == "textarea") {
result += "&" + encodeURIComponent(el.name) + "=" + encodeURIComponent(el.value);
} else if (el.tagName.toLowerCase() == "input") {
if (el.type.toLowerCase() == "checkbox" || el.type.toLowerCase() == "radio") {
if (el.checked)
result += "&" + encodeURIComponent(el.name) + "=" + encodeURIComponent(el.value);
} else if (el.type.toLowerCase() == "submit") {
if (el == submitButton) // is "el" the submit button that fired the form submit?
result += "&" + encodeURIComponent(el.name) + "=" + encodeURIComponent(el.value);
} else if (el.type.toLowerCase() != "button") {
result += "&" + encodeURIComponent(el.name) + "=" + encodeURIComponent(el.value);
}
}
}
if (typeof submitButton != 'undefined' && submitButton != null && submitButton.type.toLowerCase() == "image") {
if (submitButton.name == null || submitButton.name == "" || typeof submitButton.name == "undefined")
result += "&x=1&y=1"; // .x and .y coordinates calculation is not supported.
else
result += "&" + encodeURIComponent(submitButton.name) + ".x=1&" +
encodeURIComponent(submitButton.name) + ".y=1";
}
return result;
}
/**
* Pauses the thread of execution for the specified number of milliseconds
* @private
*/
function delay(millis) {
date = new Date();
var curDate = null;
do {
curDate = new Date();
}
while (curDate - date < millis);
}
/**
* A callback. internally used
*/
AjaxAnywhere.prototype.callback = function() {
if (this.req.readyState == 4) {
this.onBeforeResponseProcessing();
this.hideLoadingMessage();
if (this.req.status == 200) {
if (this.req.getResponseHeader('content-type').toLowerCase().substring(0, 8) != 'text/xml')
alert("AjaxAnywhere error : content-type in not text/xml : [" + this.req.getResponseHeader('content-type') + "]");
var docs = this.req.responseXML.getElementsByTagName("document");
var redirects = this.req.responseXML.getElementsByTagName("redirect");
var zones = this.req.responseXML.getElementsByTagName("zone");
var exceptions = this.req.responseXML.getElementsByTagName("exception");
var scripts = this.req.responseXML.getElementsByTagName("script");
var images = this.req.responseXML.getElementsByTagName("image");
if (redirects.length != 0) {
var newURL = redirects[0].firstChild.data;
location.href = newURL;
}
if (docs.length != 0) {
var newContent = docs[0].firstChild.data;
//cleanup ressources
delete this.req;
document.close();
document.write(newContent);
document.close();
}
if (images.length != 0) {
var preLoad = new Array(images.length);
for (var i = 0; i < images.length; i++) {
var img = images[i].firstChild;
if (img != null) {
preLoad[i] = new Image();
preLoad[i].src = img.data;
}
}
if (this.delayBeforeContentUpdate) {
delay(this.delayInMillis);
}
}
if (zones.length != 0) {
for (var i = 0; i < zones.length; i++) {
var zoneNode = zones[i];
var name = zoneNode.getAttribute("name");
var id = zoneNode.getAttribute("id");
var fc = zoneNode.firstChild;
var html = (fc == null)?"":fc.data;
var zoneHolder = name!=null?
document.getElementById("aazone." + name):
document.getElementById(id);
if (zoneHolder != null && typeof(zoneHolder) != "undefined") {
zoneHolder.innerHTML = html;
}
}
}
if (exceptions.length != 0) {
var e = exceptions[0];
var type = e.getAttribute("type");
var stackTrace = e.firstChild.data;
this.handleException(type, stackTrace);
}
if (scripts.length != 0) {
for (var $$$$i = 0; $$$$i < scripts.length; $$$$i++) {
// use $$$$i variable to avoid collision with "i" inside user script
var script = scripts[$$$$i].firstChild;
if (script != null) {
script = script.data;
if (script.indexOf("document.write") != -1) {
this.handleException("document.write", "This script contains document.write(), which is not compatible with AjaxAnywhere : \n\n" + script);
} else {
eval(script);
}
}
}
var globals = this.getGlobalScriptsDeclarationsList(script);
if (globals != null)
for (var i in globals) {
var objName = globals[i];
try {
window[objName] = eval(objName);
} catch(e) {
}
}
}
} else {
if (this.req.status != 0)
this.handleHttpErrorCode(this.req.status);
}
this.restoreSubstitutedSubmitButtons();
this.onAfterResponseProcessing();
}
}
/**
* Default sample loading message show function. Overrride it if you like.
*/
AjaxAnywhere.prototype.showLoadingMessage = function() {
var div = document.getElementById("AA_" + this.id + "_loading_div");
if (div == null) {
div = document.createElement("DIV");
document.body.appendChild(div);
div.id = "AA_" + this.id + "_loading_div";
div.innerHTML = "&nbsp;Loading...";
div.style.position = "absolute";
div.style.border = "1 solid black";
div.style.color = "white";
div.style.backgroundColor = "blue";
div.style.width = "100px";
div.style.heigth = "50px";
div.style.fontFamily = "Arial, Helvetica, sans-serif";
div.style.fontWeight = "bold";
div.style.fontSize = "11px";
}
div.style.top = document.body.scrollTop + "px";
div.style.left = (document.body.offsetWidth - 100 - (document.all?20:0)) + "px";
div.style.display = "";
}
/**
* Default sample loading message hide function. Overrride it if you like.
*/
AjaxAnywhere.prototype.hideLoadingMessage = function() {
var div = document.getElementById("AA_" + this.id + "_loading_div");
if (div != null)
div.style.display = "none";
}
/**
* This function is used to facilitatte AjaxAnywhere integration with existing projects/frameworks.
* It substitutes default Form.sumbit().
* The new implementation calls AjaxAnywhere.isFormSubmitByAjax() function to find out if the form
* should be submitted in traditional way or by AjaxAnywhere.
*/
AjaxAnywhere.prototype.substituteFormSubmitFunction = function() {
if (this.notSupported)
return;
this.bindById();
var form = this.findForm();
form.submit_old = form.submit;
var code = "var ajax = AjaxAnywhere.findInstance(\"" + this.id + "\"); " +
"if (typeof ajax !='object' || ! ajax.isFormSubmitByAjax() ) " +
"ajax.findForm().submit_old();" +
" else " +
"ajax.submitAJAX();"
form.submit = new Function(code);
}
/**
* Substitutes the default behavior of &lt;input type=submit|image&gt; to submit the form via AjaxAnywhere.
*
* @param {boolean} indicates if existing onClick handlers should be preserved.
* If keepExistingOnClickHandler==true,
* Existing handler will be called first if it returns false, or if event.returnValue==false, AjaxAnywhere will not
* continue form submission.
* If keepExistingOnClickHandler==false or undefines, existing onClick event handlers will be replaced.
*
* @param {Array} list of submitButtons and submitImages names. If the parameter is omitted or undefined,
* all elements will be processed
*/
AjaxAnywhere.prototype.substituteSubmitButtonsBehavior = function (keepExistingOnClickHandler, elements) {
if (this.notSupported)
return;
var form = this.findForm();
if (elements == null || typeof elements == "undefined") { // process all elements
elements = new Array();
for (var i = 0; i < form.elements.length; i++) {
elements.push(form.elements[i]);
}
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
if (input.type != null && typeof input.type != "undefined" &&
input.type.toLowerCase() == "image" && input.form == form) {
elements.push(input);
}
}
for (var i = 0; i < elements.length; i++) {
var el = elements[i];
if (el.tagName.toLowerCase() == "input" && (el.type.toLowerCase() == "submit"
|| el.type.toLowerCase() == "image")) {
this.substituteSubmitBehavior(el, keepExistingOnClickHandler);
}
}
} else { //process only specified elements
for (var i = 0; i < elements.length; i++) {
var el = elements[i];
if (el == null)
continue;
if (typeof el != "object")
el = form.elements[el];
if (typeof el != "undefined") {
if (el.tagName.toLowerCase() == "input" && (el.type.toLowerCase() == "submit"
|| el.type.toLowerCase() == "image"))
this.substituteSubmitBehavior(el, keepExistingOnClickHandler);
}
}
}
}
/**
* Performs a single element behavior substitution
*
* @private
*/
AjaxAnywhere.prototype.substituteSubmitBehavior = function (el, keepExistingOnClickHandler) {
var inList = false;
for (var i = 0; i < this.substitutedSubmitButtons.length; i++) {
var btnName = this.substitutedSubmitButtons[i];
if (btnName == el.name) {
inList = true;
break;
}
}
if (!inList)
this.substitutedSubmitButtons.push(el.name);
this.substitutedSubmitButtonsInfo[el.name] = keepExistingOnClickHandler;
if (keepExistingOnClickHandler && (typeof el.onclick != "undefined") && ( el.onclick != null) && ( el.onclick != "")) {
el.AA_old_onclick = el.onclick;
}
el.onclick = handleSubmitButtonClick;
el.ajaxAnywhereId = this.id;
}
/**
*
* @private
*/
AjaxAnywhere.prototype.restoreSubstitutedSubmitButtons = function() {
if (this.substitutedSubmitButtons.length == 0)
return;
var form = this.findForm();
for (var i = 0; i < this.substitutedSubmitButtons.length; i++) {
var name = this.substitutedSubmitButtons[i];
var el = form.elements[name];
if (el != null && typeof el != "undefined") {
if (el.onclick != handleSubmitButtonClick) {
var keepExistingOnClickHandler = this.substitutedSubmitButtonsInfo[el.name];
this.substituteSubmitBehavior(el, keepExistingOnClickHandler);
}
} else {
//input type=image
if (name != null && typeof name != "undefined" && name.length != 0) {
var elements = document.getElementsByName(name);
if (elements != null)
for (var j = 0; j < elements.length; j++) {
el = elements[j];
if (el != null && typeof el != "undefined"
&& el.tagName.toLowerCase() == "input"
&& typeof el.type != "undefined" && el.type.toLowerCase() == "image") {
if (el.onclick != handleSubmitButtonClick) {
var keepExistingOnClickHandler = this.substitutedSubmitButtonsInfo[el.name];
this.substituteSubmitBehavior(el, keepExistingOnClickHandler);
}
}
}
}
}
}
}
/**
* @private
*/
function handleSubmitButtonClick(_event) {
if (typeof this.AA_old_onclick != "undefined") {
if (false == this.AA_old_onclick(_event))
return false;
if (typeof window.event != "undefined")
if (window.event.returnValue == false)
return false;
}
var onsubmit = this.form.onsubmit;
if (typeof onsubmit == "function") {
if (false == onsubmit(_event))
return false;
if (typeof window.event != "undefined")
if (window.event.returnValue == false)
return false;
}
AjaxAnywhere.findInstance(this.ajaxAnywhereId).submitAJAX('', this);
return false;
}
/**
* Override this function if you use AjaxAnywhere.substituteFormSubmitFunction() to
* dynamically inform AjaxAnywhere of the method you want to use for the form submission.
*/
AjaxAnywhere.prototype.isFormSubmitByAjax = function () {
return true;
}
/**
* Some browsers (notably IE) do not load images from thier cache when content is updated using
* innerHTML. As a result, each image is re-requested from the server even though the image exists
* in the cache. To work around this issue, AjaxAnywhere preloads images present in the new content
* and intrduces a brief dely (default of 100 milleseconds) before calling innerHTML.
* See http://support.microsoft.com/default.aspx?scid=kb;en-us;319546 for further details.
* This function can be used to change this behaviour.
* @param (boolean) isDelay
*/
AjaxAnywhere.prototype.setDelayBeforeLoad = function (isDelay) {
this.delayBeforeContentUpdate = isDelay;
}
/**
* Returns the current delay behavior.
*/
AjaxAnywhere.prototype.isDelayBeforeLoad = function () {
return this.delayBeforeContentUpdate;
}
/**
* Sets the delay period in milliseconds. The default delay is 100 milliseconds.
* @param (int) delayMillis
*/
AjaxAnywhere.prototype.setDelayTime = function (delayMillis) {
this.delayInMillis = delayMillis;
}
/**
* Returns the delay period in milliseconds.
*/
AjaxAnywhere.prototype.getDelayTime = function () {
return this.delayInMillis;
}
/**
* If an exception is throws on the server-side during AJAX request, it will be processed
* by this function. The default implementation is alert(stackTrace);
* Override it if you need.
*/
AjaxAnywhere.prototype.handleException = function(type, details) {
alert(details);
}
/**
* If an HTTP Error code returned during AJAX request, it will be processed
* by this function. The default implementation is alert(code);
* Override it if you need.
*/
AjaxAnywhere.prototype.handleHttpErrorCode = function(code) {
var details = confirm("AjaxAnywhere default error handler. XMLHttpRequest HTTP Error code:" + code + " \n\n Would you like to view the response content in a new window?");
if (details) {
var win = window.open("", this.id + "_debug_window");
if (win != null) {
win.document.write("<html><body><xmp>" + this.req.responseText);
win.document.close();
win.focus();
} else {
alert("Please, disable your pop-up blocker for this site first.");
}
}
}
/**
* Override it if you need.
*/
AjaxAnywhere.prototype.handlePrevousRequestAborted = function() {
alert("AjaxAnywhere default error handler. INFO: previous AJAX request dropped")
}
/**
* If the HTML received in responce to AJAX request contains JavaScript that defines new
* functions/variables, they must be propagated to the proper context. Override this method
* to return the Array of function/variable names.
*/
AjaxAnywhere.prototype.getGlobalScriptsDeclarationsList = function(script) {
return null;
}
/**
* This function should be overridden by AjaxAnywhere user to implement client-side
* determination of zones to reload.
*
* If the form is submited with &lt;input type=submit|image&gt;, submitButton is a reference to the DHTML object. Otherwise - undefined.
*
* @Returns a comma separated list of zones to reload, or "document.all" to reload
* the whole page. Returns null if the request must be sent in traditional way
*
*/
AjaxAnywhere.prototype.getZonesToReload = function(url, submitButton) {
return this.getZonesToReaload();
// backward compatibility only
}
/**
* depreceted : wrond spelling : Reaload will be removed in later versions
*/
AjaxAnywhere.prototype.getZonesToReaload = function(url, submitButton) {
return "";
}
/**
* Override this method to implement a custom action
*/
AjaxAnywhere.prototype.onRequestSent = function () {
};
/**
* Override this method to implement a custom action
*/
AjaxAnywhere.prototype.onBeforeResponseProcessing = function () {
};
/**
* Override this method to implement a custom action
*/
AjaxAnywhere.prototype.onAfterResponseProcessing = function () {
};
/**
* Provides a default implementation from graceful degradation for getAJAX()
* calls location.href=url if XMLHttpRequest is unavailable, reloading the entire page .
*/
AjaxAnywhere.prototype.onGetAjaxNotSupported = function (url) {
location.href = url;
return false;
};
/**
* Provides a default implementation from graceful degradation for submitAJAX()
* calls form.submit() if XMLHttpRequest is unavailable, reloading the entire page
*/
AjaxAnywhere.prototype.onSubmitAjaxNotSupported = function (additionalPostData, submitButton) {
var form = this.findForm();
var actionAttrNode = form.attributes["action"].nodeValue;
var url = actionAttrNode == null?null:actionAttrNode.nodeValue;
var url_backup = url;
if (typeof additionalPostData != 'undefined' && additionalPostData != null) {
url += (url.indexOf("?") != -1) ? "&" : "?";
url += additionalPostData;
form.attributes["action"].nodeValue= url;
// only POST method allows sending additional
// date by altering form action URL.
form.setAttribute("method", "post");
}
this.submitOld(form,submitButton);
form.attributes["action"].nodeValue= url_backup;
return false;
};
/**
* submit the form in tradiditional way :
* @private
*/
AjaxAnywhere.prototype.submitOld = function (form,submitButton){
var submitHolder = null;
if (submitButton!=null && typeof submitButton!="undefined"){
submitHolder = document.createElement("input");
submitHolder.setAttribute("type","hidden");
submitHolder.setAttribute("name",submitButton.name);
submitHolder.setAttribute("value",submitButton.value);
form.appendChild(submitHolder);
}
if (typeof form.submit_old == "undefined")
form.submit();
else
form.submit_old();
if (submitButton!=null ){
form.removeChild(submitHolder);
}
}
// default instance.
ajaxAnywhere = new AjaxAnywhere();
ajaxAnywhere.bindById();

View File

@ -1,923 +0,0 @@
/*
JSCookMenu v1.31. (c) Copyright 2002-2005 by Heng Yuan
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
ITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// Globals
var _cmIDCount = 0;
var _cmIDName = 'cmSubMenuID'; // for creating submenu id
var _cmTimeOut = null; // how long the menu would stay
var _cmCurrentItem = null; // the current menu item being selected;
var _cmNoAction = new Object (); // indicate that the item cannot be hovered.
var _cmNoClick = new Object (); // similar to _cmNoAction but does not respond to mouseup/mousedown events
var _cmSplit = new Object (); // indicate that the item is a menu split
var _cmItemList = new Array (); // a simple list of items
// default node properties
var _cmNodeProperties =
{
// main menu display attributes
//
// Note. When the menu bar is horizontal,
// mainFolderLeft and mainFolderRight are
// put in <span></span>. When the menu
// bar is vertical, they would be put in
// a separate TD cell.
// HTML code to the left of the folder item
mainFolderLeft: '',
// HTML code to the right of the folder item
mainFolderRight: '',
// HTML code to the left of the regular item
mainItemLeft: '',
// HTML code to the right of the regular item
mainItemRight: '',
// sub menu display attributes
// HTML code to the left of the folder item
folderLeft: '',
// HTML code to the right of the folder item
folderRight: '',
// HTML code to the left of the regular item
itemLeft: '',
// HTML code to the right of the regular item
itemRight: '',
// cell spacing for main menu
mainSpacing: 0,
// cell spacing for sub menus
subSpacing: 0,
// auto disappear time for submenus in milli-seconds
delay: 500
};
//////////////////////////////////////////////////////////////////////
//
// Drawing Functions and Utility Functions
//
//////////////////////////////////////////////////////////////////////
//
// produce a new unique id
//
function cmNewID ()
{
return _cmIDName + (++_cmIDCount);
}
//
// return the property string for the menu item
//
function cmActionItem (item, prefix, isMain, idSub, orient, nodeProperties)
{
// var index = _cmItemList.push (item) - 1;
_cmItemList[_cmItemList.length] = item;
var index = _cmItemList.length - 1;
idSub = (!idSub) ? 'null' : ('\'' + idSub + '\'');
orient = '\'' + orient + '\'';
prefix = '\'' + prefix + '\'';
return ' onmouseover="cmItemMouseOver (this,' + prefix + ',' + isMain + ',' + idSub + ',' + orient + ',' + index + ')" onmouseout="cmItemMouseOut (this,' + nodeProperties.delay + ')" onmousedown="cmItemMouseDown (this,' + index + ')" onmouseup="cmItemMouseUp (this,' + index + ')"';
}
//
// this one is used by _cmNoClick to only take care of onmouseover and onmouseout
// events which are associated with menu but not actions associated with menu clicking/closing
//
function cmNoClickItem (item, prefix, isMain, idSub, orient, nodeProperties)
{
// var index = _cmItemList.push (item) - 1;
_cmItemList[_cmItemList.length] = item;
var index = _cmItemList.length - 1;
idSub = (!idSub) ? 'null' : ('\'' + idSub + '\'');
orient = '\'' + orient + '\'';
prefix = '\'' + prefix + '\'';
return ' onmouseover="cmItemMouseOver (this,' + prefix + ',' + isMain + ',' + idSub + ',' + orient + ',' + index + ')" onmouseout="cmItemMouseOut (this,' + nodeProperties.delay + ')"';
}
function cmNoActionItem (item, prefix)
{
return item[1];
}
function cmSplitItem (prefix, isMain, vertical)
{
var classStr = 'cm' + prefix;
if (isMain)
{
classStr += 'Main';
if (vertical)
classStr += 'HSplit';
else
classStr += 'VSplit';
}
else
classStr += 'HSplit';
var item = eval (classStr);
return cmNoActionItem (item, prefix);
}
//
// draw the sub menu recursively
//
function cmDrawSubMenu (subMenu, prefix, id, orient, nodeProperties)
{
var str = '<div class="' + prefix + 'SubMenu" id="' + id + '"><table summary="sub menu" cellspacing="' + nodeProperties.subSpacing + '" class="' + prefix + 'SubMenuTable">';
var strSub = '';
var item;
var idSub;
var hasChild;
var i;
var classStr;
for (i = 5; i < subMenu.length; ++i)
{
item = subMenu[i];
if (!item)
continue;
hasChild = (item.length > 5);
idSub = hasChild ? cmNewID () : null;
str += '<tr class="' + prefix + 'MenuItem"';
if (item[0] != _cmNoClick)
str += cmActionItem (item, prefix, 0, idSub, orient, nodeProperties);
else
str += cmNoClickItem (item, prefix, 0, idSub, orient, nodeProperties);
str += '>'
if (item == _cmSplit)
{
str += cmSplitItem (prefix, 0, true);
str += '</tr>';
continue;
}
if (item[0] == _cmNoAction || item[0] == _cmNoClick)
{
str += cmNoActionItem (item, prefix);
str += '</tr>';
continue;
}
classStr = prefix + 'Menu';
classStr += hasChild ? 'Folder' : 'Item';
str += '<td class="' + classStr + 'Left">';
if (item[0] != null)
str += item[0];
else
str += hasChild ? nodeProperties.folderLeft : nodeProperties.itemLeft;
str += '<td class="' + classStr + 'Text">' + item[1];
str += '<td class="' + classStr + 'Right">';
if (hasChild)
{
str += nodeProperties.folderRight;
strSub += cmDrawSubMenu (item, prefix, idSub, orient, nodeProperties);
}
else
str += nodeProperties.itemRight;
str += '</td></tr>';
}
str += '</table></div>' + strSub;
return str;
}
//
// The function that builds the menu inside the specified element id.
//
// @param id id of the element
// orient orientation of the menu in [hv][ab][lr] format
// menu the menu object to be drawn
// nodeProperties properties for each menu node
//
function cmDraw (id, menu, orient, nodeProperties, prefix)
{
var obj = cmGetObject (id);
if (!nodeProperties)
nodeProperties = _cmNodeProperties;
if (!prefix)
prefix = '';
var str = '<table summary="main menu" class="' + prefix + 'Menu" cellspacing="' + nodeProperties.mainSpacing + '">';
var strSub = '';
if (!orient)
orient = 'hbr';
var orientStr = String (orient);
var orientSub;
var vertical;
// draw the main menu items
if (orientStr.charAt (0) == 'h')
{
// horizontal menu
orientSub = 'v' + orientStr.substr (1, 2);
str += '<tr>';
vertical = false;
}
else
{
// vertical menu
orientSub = 'v' + orientStr.substr (1, 2);
vertical = true;
}
var i;
var item;
var idSub;
var hasChild;
var classStr;
for (i = 0; i < menu.length; ++i)
{
item = menu[i];
if (!item)
continue;
str += vertical ? '<tr' : '<td';
str += ' class="' + prefix + 'MainItem"';
hasChild = (item.length > 5);
idSub = hasChild ? cmNewID () : null;
str += cmActionItem (item, prefix, 1, idSub, orient, nodeProperties) + '>';
if (item == _cmSplit)
{
str += cmSplitItem (prefix, 1, vertical);
str += vertical? '</tr>' : '</td>';
continue;
}
if (item[0] == _cmNoAction || item[0] == _cmNoClick)
{
str += cmNoActionItem (item, prefix);
str += vertical? '</tr>' : '</td>';
continue;
}
classStr = prefix + 'Main' + (hasChild ? 'Folder' : 'Item');
str += vertical ? '<td' : '<span';
str += ' class="' + classStr + 'Left">';
str += (item[0] == null) ? (hasChild ? nodeProperties.mainFolderLeft : nodeProperties.mainItemLeft)
: item[0];
str += vertical ? '</td>' : '</span>';
str += vertical ? '<td' : '<span';
str += ' class="' + classStr + 'Text">';
str += item[1];
str += vertical ? '</td>' : '</span>';
str += vertical ? '<td' : '<span';
str += ' class="' + classStr + 'Right">';
str += hasChild ? nodeProperties.mainFolderRight : nodeProperties.mainItemRight;
str += vertical ? '</td>' : '</span>';
str += vertical ? '</tr>' : '</td>';
if (hasChild)
strSub += cmDrawSubMenu (item, prefix, idSub, orientSub, nodeProperties);
}
if (!vertical)
str += '</tr>';
str += '</table>' + strSub;
obj.innerHTML = str;
//document.write ("<xmp>" + str + "</xmp>");
}
//////////////////////////////////////////////////////////////////////
//
// Mouse Event Handling Functions
//
//////////////////////////////////////////////////////////////////////
//
// action should be taken for mouse moving in to the menu item
//
function cmItemMouseOver (obj, prefix, isMain, idSub, orient, index)
{
clearTimeout (_cmTimeOut);
if (!obj.cmPrefix)
{
obj.cmPrefix = prefix;
obj.cmIsMain = isMain;
}
var thisMenu = cmGetThisMenu (obj, prefix);
// insert obj into cmItems if cmItems doesn't have obj
if (!thisMenu.cmItems)
thisMenu.cmItems = new Array ();
var i;
for (i = 0; i < thisMenu.cmItems.length; ++i)
{
if (thisMenu.cmItems[i] == obj)
break;
}
if (i == thisMenu.cmItems.length)
{
//thisMenu.cmItems.push (obj);
thisMenu.cmItems[i] = obj;
}
// hide the previous submenu that is not this branch
if (_cmCurrentItem)
{
// occationally, we get this case when user
// move the mouse slowly to the border
if (_cmCurrentItem == thisMenu)
return;
var thatPrefix = _cmCurrentItem.cmPrefix;
var thatMenu = cmGetThisMenu (_cmCurrentItem, thatPrefix);
if (thatMenu != thisMenu.cmParentMenu)
{
if (_cmCurrentItem.cmIsMain)
_cmCurrentItem.className = thatPrefix + 'MainItem';
else
_cmCurrentItem.className = thatPrefix + 'MenuItem';
if (thatMenu.id != idSub)
cmHideMenu (thatMenu, thisMenu, thatPrefix);
}
}
// okay, set the current menu to this obj
_cmCurrentItem = obj;
// just in case, reset all items in this menu to MenuItem
cmResetMenu (thisMenu, prefix);
var item = _cmItemList[index];
var isDefaultItem = cmIsDefaultItem (item);
if (isDefaultItem)
{
if (isMain)
obj.className = prefix + 'MainItemHover';
else
obj.className = prefix + 'MenuItemHover';
}
if (idSub)
{
var subMenu = cmGetObject (idSub);
cmShowSubMenu (obj, prefix, subMenu, orient);
}
var descript = '';
if (item.length > 4)
descript = (item[4] != null) ? item[4] : (item[2] ? item[2] : descript);
else if (item.length > 2)
descript = (item[2] ? item[2] : descript);
window.defaultStatus = descript;
}
//
// action should be taken for mouse moving out of the menu item
//
function cmItemMouseOut (obj, delayTime)
{
if (!delayTime)
delayTime = _cmNodeProperties.delay;
_cmTimeOut = window.setTimeout ('cmHideMenuTime ()', delayTime);
window.defaultStatus = '';
}
//
// action should be taken for mouse button down at a menu item
//
function cmItemMouseDown (obj, index)
{
if (cmIsDefaultItem (_cmItemList[index]))
{
if (obj.cmIsMain)
obj.className = obj.cmPrefix + 'MainItemActive';
else
obj.className = obj.cmPrefix + 'MenuItemActive';
}
}
//
// action should be taken for mouse button up at a menu item
//
function cmItemMouseUp (obj, index)
{
var item = _cmItemList[index];
var link = null, target = '_self';
if (item.length > 2)
link = item[2];
if (item.length > 3 && item[3])
target = item[3];
if (link != null)
{
window.open (link, target);
}
var prefix = obj.cmPrefix;
var thisMenu = cmGetThisMenu (obj, prefix);
var hasChild = (item.length > 5);
if (!hasChild)
{
if (cmIsDefaultItem (item))
{
if (obj.cmIsMain)
obj.className = prefix + 'MainItem';
else
obj.className = prefix + 'MenuItem';
}
cmHideMenu (thisMenu, null, prefix);
}
else
{
if (cmIsDefaultItem (item))
{
if (obj.cmIsMain)
obj.className = prefix + 'MainItemHover';
else
obj.className = prefix + 'MenuItemHover';
}
}
}
//////////////////////////////////////////////////////////////////////
//
// Mouse Event Support Utility Functions
//
//////////////////////////////////////////////////////////////////////
//
// move submenu to the appropriate location
//
// @param obj the menu item that opens up the subMenu
// subMenu the sub menu to be shown
// orient the orientation of the subMenu
//
function cmMoveSubMenu (obj, subMenu, orient)
{
var mode = String (orient);
var p = subMenu.offsetParent;
var subMenuWidth = cmGetWidth (subMenu);
var horiz = cmGetHorizontalAlign (obj, mode, p, subMenuWidth);
if (mode.charAt (0) == 'h')
{
if (mode.charAt (1) == 'b')
subMenu.style.top = (cmGetYAt (obj, p) + cmGetHeight (obj)) + 'px';
else
subMenu.style.top = (cmGetYAt (obj, p) - cmGetHeight (subMenu)) + 'px';
if (horiz == 'r')
subMenu.style.left = (cmGetXAt (obj, p)) + 'px';
else
subMenu.style.left = (cmGetXAt (obj, p) + cmGetWidth (obj) - subMenuWidth) + 'px';
}
else
{
if (horiz == 'r')
subMenu.style.left = (cmGetXAt (obj, p) + cmGetWidth (obj)) + 'px';
else
subMenu.style.left = (cmGetXAt (obj, p) - subMenuWidth) + 'px';
if (mode.charAt (1) == 'b')
subMenu.style.top = (cmGetYAt (obj, p)) + 'px';
else
subMenu.style.top = (cmGetYAt (obj, p) + cmGetHeight (obj) - cmGetHeight (subMenu)) + 'px';
}
}
//
// automatically re-adjust the menu position based on available screen size.
//
function cmGetHorizontalAlign (obj, mode, p, subMenuWidth)
{
var horiz = mode.charAt (2);
if (!(document.body))
return horiz;
var body = document.body;
var browserLeft;
var browserRight;
if (window.innerWidth)
{
// DOM window attributes
browserLeft = window.pageXOffset;
browserRight = window.innerWidth + browserLeft;
}
else if (body.clientWidth)
{
// IE attributes
browserLeft = body.clientLeft;
browserRight = body.clientWidth + browserLeft;
}
else
return horiz;
if (mode.charAt (0) == 'h')
{
if (horiz == 'r' && (cmGetXAt (obj) + subMenuWidth) > browserRight)
horiz = 'l';
if (horiz == 'l' && (cmGetXAt (obj) + cmGetWidth (obj) - subMenuWidth) < browserLeft)
horiz = 'r';
return horiz;
}
else
{
if (horiz == 'r' && (cmGetXAt (obj, p) + cmGetWidth (obj) + subMenuWidth) > browserRight)
horiz = 'l';
if (horiz == 'l' && (cmGetXAt (obj, p) - subMenuWidth) < browserLeft)
horiz = 'r';
return horiz;
}
}
//
// show the subMenu w/ specified orientation
// also move it to the correct coordinates
//
// @param obj the menu item that opens up the subMenu
// subMenu the sub menu to be shown
// orient the orientation of the subMenu
//
function cmShowSubMenu (obj, prefix, subMenu, orient)
{
if (!subMenu.cmParentMenu)
{
// establish the tree w/ back edge
var thisMenu = cmGetThisMenu (obj, prefix);
subMenu.cmParentMenu = thisMenu;
if (!thisMenu.cmSubMenu)
thisMenu.cmSubMenu = new Array ();
//thisMenu.cmSubMenu.push (subMenu);
thisMenu.cmSubMenu[thisMenu.cmSubMenu.length] = subMenu;
}
// position the sub menu
cmMoveSubMenu (obj, subMenu, orient);
subMenu.style.visibility = 'visible';
//
// On IE, controls such as SELECT, OBJECT, IFRAME (before 5.5)
// are window based controls. So, if the sub menu and these
// controls overlap, sub menu would be hidden behind them. Thus
// one needs to turn the visibility of these controls off when the
// sub menu is showing, and turn their visibility back on
// when the sub menu is hiding.
//
if (document.all) // it is IE
{
/* part of Felix Zaslavskiy's fix on hiding controls
not really sure if this part is necessary, but shouldn't
hurt. */
if (!subMenu.cmOverlap)
subMenu.cmOverlap = new Array ();
/*@cc_on @*/
/*@if (@_jscript_version >= 5.5)
@else @*/
cmHideControl ("IFRAME", subMenu);
/*@end @*/
cmHideControl ("SELECT", subMenu);
cmHideControl ("OBJECT", subMenu);
}
}
//
// reset all the menu items to class MenuItem in thisMenu
//
function cmResetMenu (thisMenu, prefix)
{
if (thisMenu.cmItems)
{
var i;
var str;
var items = thisMenu.cmItems;
for (i = 0; i < items.length; ++i)
{
if (items[i].cmIsMain)
str = prefix + 'MainItem';
else
str = prefix + 'MenuItem';
if (items[i].className != str)
items[i].className = str;
}
}
}
//
// called by the timer to hide the menu
//
function cmHideMenuTime ()
{
if (_cmCurrentItem)
{
var prefix = _cmCurrentItem.cmPrefix;
cmHideMenu (cmGetThisMenu (_cmCurrentItem, prefix), null, prefix);
}
}
//
// hide thisMenu, children of thisMenu, as well as the ancestor
// of thisMenu until currentMenu is encountered. currentMenu
// will not be hidden
//
function cmHideMenu (thisMenu, currentMenu, prefix)
{
var str = prefix + 'SubMenu';
// hide the down stream menus
if (thisMenu.cmSubMenu)
{
var i;
for (i = 0; i < thisMenu.cmSubMenu.length; ++i)
{
cmHideSubMenu (thisMenu.cmSubMenu[i], prefix);
}
}
// hide the upstream menus
while (thisMenu && thisMenu != currentMenu)
{
cmResetMenu (thisMenu, prefix);
if (thisMenu.className == str)
{
thisMenu.style.visibility = 'hidden';
cmShowControl (thisMenu);
}
else
break;
thisMenu = cmGetThisMenu (thisMenu.cmParentMenu, prefix);
}
}
//
// hide thisMenu as well as its sub menus if thisMenu is not
// already hidden
//
function cmHideSubMenu (thisMenu, prefix)
{
if (thisMenu.style.visibility == 'hidden')
return;
if (thisMenu.cmSubMenu)
{
var i;
for (i = 0; i < thisMenu.cmSubMenu.length; ++i)
{
cmHideSubMenu (thisMenu.cmSubMenu[i], prefix);
}
}
cmResetMenu (thisMenu, prefix);
thisMenu.style.visibility = 'hidden';
cmShowControl (thisMenu);
}
//
// hide a control such as IFRAME
//
function cmHideControl (tagName, subMenu)
{
var x = cmGetX (subMenu);
var y = cmGetY (subMenu);
var w = subMenu.offsetWidth;
var h = subMenu.offsetHeight;
var i;
for (i = 0; i < document.all.tags(tagName).length; ++i)
{
var obj = document.all.tags(tagName)[i];
if (!obj || !obj.offsetParent)
continue;
// check if the object and the subMenu overlap
var ox = cmGetX (obj);
var oy = cmGetY (obj);
var ow = obj.offsetWidth;
var oh = obj.offsetHeight;
if (ox > (x + w) || (ox + ow) < x)
continue;
if (oy > (y + h) || (oy + oh) < y)
continue;
// if object is already made hidden by a different
// submenu then we dont want to put it on overlap list of
// of a submenu a second time.
// - bug fixed by Felix Zaslavskiy
if(obj.style.visibility == "hidden")
continue;
//subMenu.cmOverlap.push (obj);
subMenu.cmOverlap[subMenu.cmOverlap.length] = obj;
obj.style.visibility = "hidden";
}
}
//
// show the control hidden by the subMenu
//
function cmShowControl (subMenu)
{
if (subMenu.cmOverlap)
{
var i;
for (i = 0; i < subMenu.cmOverlap.length; ++i)
subMenu.cmOverlap[i].style.visibility = "";
}
subMenu.cmOverlap = null;
}
//
// returns the main menu or the submenu table where this obj (menu item)
// is in
//
function cmGetThisMenu (obj, prefix)
{
var str1 = prefix + 'SubMenu';
var str2 = prefix + 'Menu';
while (obj)
{
if (obj.className == str1 || obj.className == str2)
return obj;
obj = obj.parentNode;
}
return null;
}
//
// return true if this item is handled using default handlers
//
function cmIsDefaultItem (item)
{
if (item == _cmSplit || item[0] == _cmNoAction || item[0] == _cmNoClick)
return false;
return true;
}
//
// returns the object baring the id
//
function cmGetObject (id)
{
if (document.all)
return document.all[id];
return document.getElementById (id);
}
//
// functions that obtain the width of an HTML element.
//
function cmGetWidth (obj)
{
var width = obj.offsetWidth;
if (width > 0 || !cmIsTRNode (obj))
return width;
if (!obj.firstChild)
return 0;
// use TABLE's length can cause an extra pixel gap
//return obj.parentNode.parentNode.offsetWidth;
// use the left and right child instead
return obj.lastChild.offsetLeft - obj.firstChild.offsetLeft + cmGetWidth (obj.lastChild);
}
//
// functions that obtain the height of an HTML element.
//
function cmGetHeight (obj)
{
var height = obj.offsetHeight;
if (height > 0 || !cmIsTRNode (obj))
return height;
if (!obj.firstChild)
return 0;
// use the first child's height
return obj.firstChild.offsetHeight;
}
//
// functions that obtain the coordinates of an HTML element
//
function cmGetX (obj)
{
var x = 0;
do
{
x += obj.offsetLeft;
obj = obj.offsetParent;
}
while (obj);
return x;
}
function cmGetXAt (obj, elm)
{
var x = 0;
while (obj && obj != elm)
{
x += obj.offsetLeft;
obj = obj.offsetParent;
}
if (obj == elm)
return x;
return x - cmGetX (elm);
}
function cmGetY (obj)
{
var y = 0;
do
{
y += obj.offsetTop;
obj = obj.offsetParent;
}
while (obj);
return y;
}
function cmIsTRNode (obj)
{
var tagName = obj.tagName;
return tagName == "TR" || tagName == "tr" || tagName == "Tr" || tagName == "tR";
}
//
// get the Y position of the object. In case of TR element though,
// we attempt to adjust the value.
//
function cmGetYAt (obj, elm)
{
var y = 0;
if (!obj.offsetHeight && cmIsTRNode (obj))
{
var firstTR = obj.parentNode.firstChild;
obj = obj.firstChild;
y -= firstTR.firstChild.offsetTop;
}
while (obj && obj != elm)
{
y += obj.offsetTop;
obj = obj.offsetParent;
}
if (obj == elm)
return y;
return y - cmGetY (elm);
}
//
// debug function, ignore :)
//
function cmGetProperties (obj)
{
if (obj == undefined)
return 'undefined';
if (obj == null)
return 'null';
var msg = obj + ':\n';
var i;
for (i in obj)
msg += i + ' = ' + obj[i] + '; ';
return msg;
}

View File

@ -1,59 +0,0 @@
//
// Overrides the original JSCookMenu function to work with MyFaces
//
function cmItemMouseUp (obj, index)
{
var item = _cmItemList[index];
var link = null, target = '_self';
if (item.length > 2)
link = item[2];
if (item.length > 3 && item[3])
target = item[3];
if (link != null)
{
// changes by Richard J. Barbalace
if (link.match(/^\w*:A\]\w*:\/\//) != null ) {
// Link is a URL
link = link.replace(/^\w*:A\]/, ""); // Remove JSF ID
window.open (link, target);
} else if (link.match(/^\w*:A\]\w*:/) != null ) {
// Link is a script method
link = link.replace(/^\w*:A\]\w*:/, ""); // Remove JSF ID
eval(link);
} else {
// Link is a JSF action
var dummyForm = document.forms[target];
dummyForm.elements['jscook_action'].value = link;
dummyForm.submit();
}
}
var prefix = obj.cmPrefix;
var thisMenu = cmGetThisMenu (obj, prefix);
var hasChild = (item.length > 5);
if (!hasChild)
{
if (cmIsDefaultItem (item))
{
if (obj.cmIsMain)
obj.className = prefix + 'MainItem';
else
obj.className = prefix + 'MenuItem';
}
cmHideMenu (thisMenu, null, prefix);
}
else
{
if (cmIsDefaultItem (item))
{
if (obj.cmIsMain)
obj.className = prefix + 'MainItemHover';
else
obj.className = prefix + 'MenuItemHover';
}
}
}

View File

@ -1,48 +0,0 @@
// directory of where all the images are
var cmThemeAdempiereBase = '/adempiere-webapp/images/ThemeAdempiere';
/*
if(myThemeAdempiereBase)
cmThemeAdempiereBase = myThemeAdempiereBase;
*/
var cmThemeAdempiere =
{
// main menu display attributes
//
// Note. When the menu bar is horizontal,
// mainFolderLeft and mainFolderRight are
// put in <span></span>. When the menu
// bar is vertical, they would be put in
// a separate TD cell.
// HTML code to the left of the folder item
mainFolderLeft: '&#160;',
// HTML code to the right of the folder item
mainFolderRight: '&#160;',
// HTML code to the left of the regular item
mainItemLeft: '&#160;',
// HTML code to the right of the regular item
mainItemRight: '&#160;',
// sub menu display attributes
// 0, HTML code to the left of the folder item
folderLeft: '<img alt="" src="' + cmThemeAdempiereBase + 'spacer.gif">',
// 1, HTML code to the right of the folder item
folderRight: '<img alt="" src="' + cmThemeAdempiereBase + 'arrow.gif">',
// 2, HTML code to the left of the regular item
itemLeft: '<img alt="" src="' + cmThemeAdempiereBase + 'spacer.gif">',
// 3, HTML code to the right of the regular item
itemRight: '<img alt="" src="' + cmThemeAdempiereBase + 'blank.gif">',
// 4, cell spacing for main menu
mainSpacing: 0,
// 5, cell spacing for sub menus
subSpacing: 0,
// 6, auto dispear time for submenus in milli-seconds
delay: 500
};
// for horizontal menu split
var cmThemeAdempiereHSplit = [_cmNoAction, '<td class="ThemeAdempiereMenuItemLeft"></td><td colspan="2"><div class="ThemeAdempiereMenuSplit"></div></td>'];
var cmThemeAdempiereMainHSplit = [_cmNoAction, '<td class="ThemeAdempiereMainItemLeft"></td><td colspan="2"><div class="ThemeAdempiereMenuSplit"></div></td>'];
var cmThemeAdempiereMainVSplit = [_cmNoAction, '|'];