/** * Copyright 2005 Darren L. Spurgeon * Copyright 2007 Jens Kapitza * * 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. */ /** * Global Variables */ AJAX_DEFAULT_PARAMETER = "ajaxParameter"; AJAX_PORTLET_MAX = 1; AJAX_PORTLET_MIN = 2; AJAX_PORTLET_CLOSE = 3; AJAX_CALLOUT_OVERLIB_DEFAULT = "STICKY,CLOSECLICK,DELAY,250,TIMEOUT,5000,VAUTO,WRAPMAX,240,CSSCLASS,FGCLASS,'olfg',BGCLASS,'olbg',CGCLASS,'olcg',CAPTIONFONTCLASS,'olcap',CLOSEFONTCLASS,'olclo',TEXTFONTCLASS,'oltxt'"; /** * Type Detection */ function isAlien(a) { return isObject(a) && typeof a.constructor != 'function'; } function isArray(a) { return isObject(a) && a.constructor == Array; } function isBoolean(a) { return typeof a == 'boolean'; } function isEmpty(o) { var i, v; if (isObject(o)) { for (i in o) { v = o[i]; if (isUndefined(v) && isFunction(v)) { return false; } } } return true; } function isFunction(a) { return typeof a == 'function'; } function isNull(a) { return typeof a == 'object' && !a; } function isNumber(a) { return typeof a == 'number' && isFinite(a); } function isObject(a) { return (a && typeof a == 'object') || isFunction(a); } function isString(a) { return typeof a == 'string'; } function isUndefined(a) { return typeof a == 'undefined'; } /** * Utility Functions */ function addOnLoadEvent(func) { var oldonload = window.onload; if (isFunction(func)) { if (!isFunction(oldonload)) { window.onload = func; } else { window.onload = function() { oldonload(); func(); }; } } else { if (isObject(func) && isFunction(func.onload)) { // callback event? window.onload = function() { if (isFunction(oldonload)) { oldonload(); } // onload des objektes aufrufen func.onload(); }; } } } /* * Extract querystring from a URL */ function extractQueryString(url) { return ( (url.indexOf('?') >= 0) && (url.indexOf('?') < (url.length-1))) ? url.substr(url.indexOf('?')+1): ''; } /* * Trim the querystring from a URL */ function trimQueryString(url) { return (url.indexOf('?') >= 0) ? url.substring(0, url.indexOf('?')) : url; } function delimitQueryString(qs) { var ret = ''; var params = ""; if (qs.length > 0) { params = qs.split('&'); for (i=0; i 0) { ret += ','; } ret += params[i]; } } return ret; } function trim(str) { return str.replace(/^\s*/,"").replace(/\s*$/,""); } // encode , = function buildParameterString(parameterList) { var returnString = ''; var params = (parameterList || '').split(','); if (params !== null) { for (p=0; p