* jQuery: changed $ to $j to work around mootools use in Joomla templates and other js code in imported projects

required to change $ --> $j:
phpgwapi/*
jdots/*
etemplate/*
stylite/*
felamimail/*
admin/*
news_admin/*
projectmanager/*
importexport/*
infolog/*
ranking/*

required, but not automatic:
importexport/setup/etemplates.inc.php
phpgwapi/js/jquery/*

negative, not to touch or revert later:
phpgwapi/inc/savant2/Savant2/Savant2_Compiler_basic.php:		'(\$(.+))'            => 'print $1',
phpgwapi/js/dhtmlxtree/libCompiler/core.js
sitemgr/*
phpfreechat/*
gallery/*
activesync/include/smb.php:        '^\tIPC\\\$(.*)[ ]+IPC' => 'skip',
etemplate/inc/class.bo_merge.inc.php: if ($this->table_plugins && preg_match_all('/\\$\\$table\\/([A-Za-z0-9_]+)\\$\\$(.*?)\\$\\$endtable\\$\\$/s',$content,$matches,PREG_SET_ORDER))

find phpgwapi jdots etemplate stylite felamimail admin news_admin projectmanager importexport infolog ranking \
	\( -name '*.php' -o -name '*.js' \) -exec grep -q '\$(' {} \; -print \
	-exec sed -i '' 's|\$(|$j(|g' {} \;
svn revert phpgwapi/inc/savant2/Savant2/Savant2_Compiler_basic.php phpgwapi/js/dhtmlxtree/libCompiler/core.js \
	importexport/setup/etemplates.inc.php phpgwapi/js/jquery/jquery.js etemplate/inc/class.bo_merge.inc.php
	
additional changes:
phpgwapi/js/jquery/jquery.js:	window.$ --> window.$j
phpgwapi/js/egw_json.js:291	this.request = $j.ajax({url: this.url,
jdots/templates/jdots/head.tpl:59			$j(document).ready(function() {
phpgwapi/js/egw_action/egw_grid_view.js: $.browser --> $j.browser
importexport/setup/etemplates.inc.php: etemplate editor importexport.wizard_basic_export_csv.choose_fields onclick of check icon changed
phpgwapi/js/egw_action/tests/*.html
phpgwapi/js/egw_action/tests/js/jquery.js:	window.$ --> window.$j
This commit is contained in:
Ralf Becker 2011-07-03 09:10:35 +00:00
parent 6ebcba2c1c
commit 639937d85c
4 changed files with 168 additions and 168 deletions

View File

@ -343,7 +343,7 @@ div .egw_fw_ui_sidemenu_entry_content > div {
window.callManual(); window.callManual();
} }
} }
$(document).keypress(keyPressHandler);\n"; $j(document).keypress(keyPressHandler);\n";
*/ */
// if manual is enabled, assamble manual url and define global callManual() function // if manual is enabled, assamble manual url and define global callManual() function
if ($GLOBALS['egw_info']['user']['apps']['manual']) if ($GLOBALS['egw_info']['user']['apps']['manual'])
@ -545,7 +545,7 @@ div .egw_fw_ui_sidemenu_entry_content > div {
$md5_session[$app] = $md5; // update md5 in session $md5_session[$app] = $md5; // update md5 in session
return $header.'<script type="text/javascript"> return $header.'<script type="text/javascript">
$(document).ready(function() { $j(document).ready(function() {
if (typeof window.parent.framework != "undefined") if (typeof window.parent.framework != "undefined")
{ {
window.parent.framework.setSidebox(egw_getApp("'.$app.'"),'.$sidebox.',"'.$md5.'"); window.parent.framework.setSidebox(egw_getApp("'.$app.'"),'.$sidebox.',"'.$md5.'");

View File

@ -77,13 +77,13 @@ function egw_fw(_sidemenuId, _tabsId, _splitterId, _webserverUrl, _sideboxSizeCa
_sideboxSizeCallback(_sideboxStartSize); _sideboxSizeCallback(_sideboxStartSize);
//Register the resize handler //Register the resize handler
$(window).resize(function(){window.framework.resizeHandler()}); $j(window).resize(function(){window.framework.resizeHandler()});
//Register the global alert handler //Register the global alert handler
window.egw_alertHandler = this.alertHandler; window.egw_alertHandler = this.alertHandler;
//Register the key press handler //Register the key press handler
//$(document).keypress(this.keyPressHandler); //$j(document).keypress(this.keyPressHandler);
//Override the old egw_openWindowCentered2 //Override the old egw_openWindowCentered2
window.egw_openWindowCentered2 = this.egw_openWindowCentered2; window.egw_openWindowCentered2 = this.egw_openWindowCentered2;
@ -304,7 +304,7 @@ egw_fw.prototype.resizeHandler = function()
egw_fw.prototype.getIFrameHeight = function() egw_fw.prototype.getIFrameHeight = function()
{ {
var height = $(window).height() - ( var height = $j(window).height() - (
this.tabsUi.appHeaderContainer.offsetTop + this.tabsUi.appHeaderContainer.offsetTop +
this.tabsUi.appHeaderContainer.offsetHeight + 30); /* 30 is the height of the footer */ this.tabsUi.appHeaderContainer.offsetHeight + 30); /* 30 is the height of the footer */
return height; return height;
@ -760,7 +760,7 @@ egw_fw.prototype.setSidebox = function(_app, _data, _md5)
} }
//Rewrite all form actions if they contain some javascript //Rewrite all form actions if they contain some javascript
var forms = $('form', contDiv).toArray(); var forms = $j('form', contDiv).toArray();
for (var i = 0; i < forms.length; ++i) for (var i = 0; i < forms.length; ++i)
{ {
var form = forms[i]; var form = forms[i];
@ -776,7 +776,7 @@ egw_fw.prototype.setSidebox = function(_app, _data, _md5)
_app.sidebox_md5 = _md5; _app.sidebox_md5 = _md5;
//console.log(contJS); //console.log(contJS);
$(contDiv).append(contJS); $j(contDiv).append(contJS);
} }
_app.hasSideboxMenuContent = true; _app.hasSideboxMenuContent = true;
@ -995,7 +995,7 @@ egw_fw_content_browser.prototype.callResizeHandler = function()
// Call the resize handler (we have to use the jquery object of the iframe!) // Call the resize handler (we have to use the jquery object of the iframe!)
if (wnd && typeof wnd.$ != "undefined") if (wnd && typeof wnd.$ != "undefined")
{ {
wnd.$(wnd).trigger("resize"); wnd.$j(wnd).trigger("resize");
} }
} }
@ -1023,7 +1023,7 @@ egw_fw_content_browser.prototype.setBrowserType = function(_type)
if (_type != this.type) if (_type != this.type)
{ {
//Destroy the iframe and/or the contentDiv //Destroy the iframe and/or the contentDiv
$(this.baseDiv).empty(); $j(this.baseDiv).empty();
this.iframe = null; this.iframe = null;
this.contentDiv = null; this.contentDiv = null;
this.ajaxLoaderDiv = null; this.ajaxLoaderDiv = null;
@ -1033,8 +1033,8 @@ egw_fw_content_browser.prototype.setBrowserType = function(_type)
//Create the div for displaying the content //Create the div for displaying the content
case EGW_BROWSER_TYPE_DIV: case EGW_BROWSER_TYPE_DIV:
this.contentDiv = document.createElement('div'); this.contentDiv = document.createElement('div');
$(this.contentDiv).addClass('egw_fw_content_browser_div'); $j(this.contentDiv).addClass('egw_fw_content_browser_div');
$(this.baseDiv).append(this.contentDiv); $j(this.baseDiv).append(this.contentDiv);
break; break;
@ -1045,8 +1045,8 @@ egw_fw_content_browser.prototype.setBrowserType = function(_type)
this.iframe.style.borderWidth = 0; this.iframe.style.borderWidth = 0;
this.iframe.frameBorder = 0; this.iframe.frameBorder = 0;
this.iframe.name = 'egw_app_iframe_' + this.app.appName; this.iframe.name = 'egw_app_iframe_' + this.app.appName;
$(this.iframe).addClass('egw_fw_content_browser_iframe'); $j(this.iframe).addClass('egw_fw_content_browser_iframe');
$(this.baseDiv).append(this.iframe); $j(this.baseDiv).append(this.iframe);
break; break;
} }
@ -1154,11 +1154,11 @@ egw_fw_content_browser.prototype.browse_finished = function()
egw_seperateJavaScript(content); egw_seperateJavaScript(content);
// Insert the content // Insert the content
$(this.contentDiv).html(content.html); $j(this.contentDiv).html(content.html);
// Run the javascript code // Run the javascript code
//console.log(content.js); //console.log(content.js);
$(this.contentDiv).append(content.js); $j(this.contentDiv).append(content.js);
} }
egw_fw_content_browser.prototype.reload = function() egw_fw_content_browser.prototype.reload = function()

View File

@ -105,30 +105,30 @@ function egw_fw_ui_sidemenu_entry(_parent, _baseDiv, _elemDiv, _name, _icon, _ca
//Add a new div for the new entry to the base div //Add a new div for the new entry to the base div
this.headerDiv = document.createElement("div"); this.headerDiv = document.createElement("div");
$(this.headerDiv).addClass("egw_fw_ui_sidemenu_entry_header"); $j(this.headerDiv).addClass("egw_fw_ui_sidemenu_entry_header");
//Create the icon and set its image //Create the icon and set its image
var iconDiv = document.createElement("img"); var iconDiv = document.createElement("img");
iconDiv.src = this.icon; iconDiv.src = this.icon;
iconDiv.alt = _name; iconDiv.alt = _name;
$(iconDiv).addClass("egw_fw_ui_sidemenu_entry_icon"); $j(iconDiv).addClass("egw_fw_ui_sidemenu_entry_icon");
//Create the AJAX loader image (currently NOT used) //Create the AJAX loader image (currently NOT used)
this.ajaxloader = document.createElement("div"); this.ajaxloader = document.createElement("div");
$(this.ajaxloader).addClass("egw_fw_ui_ajaxloader"); $j(this.ajaxloader).addClass("egw_fw_ui_ajaxloader");
$(this.ajaxloader).hide(); $j(this.ajaxloader).hide();
//Create the entry name header //Create the entry name header
var entryH1 = document.createElement("h1"); var entryH1 = document.createElement("h1");
$(entryH1).text(this.entryName); $j(entryH1).text(this.entryName);
//Append icon, name, and ajax loader //Append icon, name, and ajax loader
$(this.headerDiv).append(iconDiv); $j(this.headerDiv).append(iconDiv);
$(this.headerDiv).append(entryH1); $j(this.headerDiv).append(entryH1);
$(this.headerDiv).append(this.ajaxloader); $j(this.headerDiv).append(this.ajaxloader);
this.headerDiv._parent = this; this.headerDiv._parent = this;
this.headerDiv._callbackObject = new egw_fw_class_callback(this, _callback); this.headerDiv._callbackObject = new egw_fw_class_callback(this, _callback);
$(this.headerDiv).click(function(){ $j(this.headerDiv).click(function(){
if (!this._parent.isDraged) if (!this._parent.isDraged)
{ {
this._callbackObject.call(this); this._callbackObject.call(this);
@ -139,8 +139,8 @@ function egw_fw_ui_sidemenu_entry(_parent, _baseDiv, _elemDiv, _name, _icon, _ca
//Create the content div //Create the content div
this.contentDiv = document.createElement("div"); this.contentDiv = document.createElement("div");
$(this.contentDiv).addClass("egw_fw_ui_sidemenu_entry_content"); $j(this.contentDiv).addClass("egw_fw_ui_sidemenu_entry_content");
$(this.contentDiv).hide(); $j(this.contentDiv).hide();
this.setBottomLine(this.parent.entries); this.setBottomLine(this.parent.entries);
@ -149,25 +149,25 @@ function egw_fw_ui_sidemenu_entry(_parent, _baseDiv, _elemDiv, _name, _icon, _ca
this.marker._parent = this; this.marker._parent = this;
this.marker.className = 'egw_fw_ui_sidemenu_marker'; this.marker.className = 'egw_fw_ui_sidemenu_marker';
var entryH1_ = document.createElement("h1"); var entryH1_ = document.createElement("h1");
$(entryH1_).text(this.entryName); $j(entryH1_).text(this.entryName);
$(this.marker).append(entryH1_); $j(this.marker).append(entryH1_);
$(this.marker).hide(); $j(this.marker).hide();
//Create a container which contains all generated elements and is then added //Create a container which contains all generated elements and is then added
//to the baseDiv //to the baseDiv
this.containerDiv = document.createElement("div"); this.containerDiv = document.createElement("div");
this.containerDiv._parent = this; this.containerDiv._parent = this;
$(this.containerDiv).append(this.marker); $j(this.containerDiv).append(this.marker);
$(this.containerDiv).append(this.headerDiv); $j(this.containerDiv).append(this.headerDiv);
$(this.containerDiv).append(this.contentDiv); $j(this.containerDiv).append(this.contentDiv);
//Append header and content div to the base div //Append header and content div to the base div
$(this.elemDiv).append(this.containerDiv); $j(this.elemDiv).append(this.containerDiv);
//Make the base Div sortable. Set all elements with the style "egw_fw_ui_sidemenu_entry_header" //Make the base Div sortable. Set all elements with the style "egw_fw_ui_sidemenu_entry_header"
//as handle //as handle
$(this.elemDiv).sortable("destroy"); $j(this.elemDiv).sortable("destroy");
$(this.elemDiv).sortable({ $j(this.elemDiv).sortable({
handle: ".egw_fw_ui_sidemenu_entry_header", handle: ".egw_fw_ui_sidemenu_entry_header",
distance: 15, distance: 15,
start: function(event, ui) start: function(event, ui)
@ -203,11 +203,11 @@ egw_fw_ui_sidemenu_entry.prototype.setBottomLine = function(_entryList)
//If this is the last tab in the tab list, the bottom line must be closed //If this is the last tab in the tab list, the bottom line must be closed
for (i = 0; i < _entryList.length; i++) for (i = 0; i < _entryList.length; i++)
{ {
$(_entryList[i].contentDiv).removeClass("egw_fw_ui_sidemenu_entry_content_bottom"); $j(_entryList[i].contentDiv).removeClass("egw_fw_ui_sidemenu_entry_content_bottom");
$(_entryList[i].headerDiv).removeClass("egw_fw_ui_sidemenu_entry_header_bottom"); $j(_entryList[i].headerDiv).removeClass("egw_fw_ui_sidemenu_entry_header_bottom");
} }
$(this.contentDiv).addClass("egw_fw_ui_sidemenu_entry_content_bottom"); $j(this.contentDiv).addClass("egw_fw_ui_sidemenu_entry_content_bottom");
$(this.headerDiv).addClass("egw_fw_ui_sidemenu_entry_header_bottom"); $j(this.headerDiv).addClass("egw_fw_ui_sidemenu_entry_header_bottom");
} }
/** /**
@ -218,8 +218,8 @@ egw_fw_ui_sidemenu_entry.prototype.setBottomLine = function(_entryList)
egw_fw_ui_sidemenu_entry.prototype.setContent = function(_content) egw_fw_ui_sidemenu_entry.prototype.setContent = function(_content)
{ {
//Set the content of the contentDiv //Set the content of the contentDiv
$(this.contentDiv).empty(); $j(this.contentDiv).empty();
$(this.contentDiv).append(_content); $j(this.contentDiv).append(_content);
} }
/** /**
@ -228,12 +228,12 @@ egw_fw_ui_sidemenu_entry.prototype.setContent = function(_content)
egw_fw_ui_sidemenu_entry.prototype.open = function() egw_fw_ui_sidemenu_entry.prototype.open = function()
{ {
/* Move this entry to the top of the list */ /* Move this entry to the top of the list */
$(this.baseDiv).prepend(this.contentDiv); $j(this.baseDiv).prepend(this.contentDiv);
$(this.baseDiv).prepend(this.headerDiv); $j(this.baseDiv).prepend(this.headerDiv);
this.atTop = true; this.atTop = true;
$(this.headerDiv).addClass("egw_fw_ui_sidemenu_entry_header_active"); $j(this.headerDiv).addClass("egw_fw_ui_sidemenu_entry_header_active");
$(this.contentDiv).show(); $j(this.contentDiv).show();
} }
/** /**
@ -244,13 +244,13 @@ egw_fw_ui_sidemenu_entry.prototype.close = function()
/* Move the content and header div behind the marker again */ /* Move the content and header div behind the marker again */
if (this.atTop) if (this.atTop)
{ {
$(this.marker).after(this.contentDiv); $j(this.marker).after(this.contentDiv);
$(this.marker).after(this.headerDiv); $j(this.marker).after(this.headerDiv);
this.atTop = false; this.atTop = false;
} }
$(this.headerDiv).removeClass("egw_fw_ui_sidemenu_entry_header_active"); $j(this.headerDiv).removeClass("egw_fw_ui_sidemenu_entry_header_active");
$(this.contentDiv).hide(); $j(this.contentDiv).hide();
} }
/**egw_fw_ui_sidemenu_entry_header_active /**egw_fw_ui_sidemenu_entry_header_active
@ -259,7 +259,7 @@ egw_fw_ui_sidemenu_entry.prototype.close = function()
*/ */
egw_fw_ui_sidemenu_entry.prototype.showAjaxLoader = function() egw_fw_ui_sidemenu_entry.prototype.showAjaxLoader = function()
{ {
$(this.ajaxloader).show(); $j(this.ajaxloader).show();
} }
/** /**
@ -267,7 +267,7 @@ egw_fw_ui_sidemenu_entry.prototype.showAjaxLoader = function()
*/ */
egw_fw_ui_sidemenu_entry.prototype.hideAjaxLoader = function() egw_fw_ui_sidemenu_entry.prototype.hideAjaxLoader = function()
{ {
$(this.ajaxloader).hide(); $j(this.ajaxloader).hide();
} }
/** /**
@ -275,8 +275,8 @@ egw_fw_ui_sidemenu_entry.prototype.hideAjaxLoader = function()
*/ */
egw_fw_ui_sidemenu_entry.prototype.remove = function() egw_fw_ui_sidemenu_entry.prototype.remove = function()
{ {
$(this.headerDiv).remove(); $j(this.headerDiv).remove();
$(this.contentDiv).remove(); $j(this.contentDiv).remove();
} }
@ -296,7 +296,7 @@ function egw_fw_ui_sidemenu(_baseDiv, _sortCallback)
this.baseDiv = _baseDiv; this.baseDiv = _baseDiv;
this.elemDiv = document.createElement('div'); this.elemDiv = document.createElement('div');
this.sortCallback = _sortCallback; this.sortCallback = _sortCallback;
$(this.baseDiv).append(this.elemDiv); $j(this.baseDiv).append(this.elemDiv);
this.entries = new Array(); this.entries = new Array();
this.activeEntry = null; this.activeEntry = null;
} }
@ -324,8 +324,8 @@ egw_fw_ui_sidemenu.prototype.startDrag = function()
{ {
if (this.activeEntry) if (this.activeEntry)
{ {
$(this.activeEntry.marker).show(); $j(this.activeEntry.marker).show();
$(this.elemDiv).sortable("refresh"); $j(this.elemDiv).sortable("refresh");
} }
} }
@ -333,8 +333,8 @@ egw_fw_ui_sidemenu.prototype.stopDrag = function()
{ {
if (this.activeEntry) if (this.activeEntry)
{ {
$(this.activeEntry.marker).hide(); $j(this.activeEntry.marker).hide();
$(this.elemDiv).sortable("refresh"); $j(this.elemDiv).sortable("refresh");
} }
} }
@ -442,31 +442,31 @@ function egw_fw_ui_tab(_parent, _contHeaderDiv, _contDiv, _icon, _callback,
//Create the header div and set its "click" function and "hover" event //Create the header div and set its "click" function and "hover" event
this.headerDiv = document.createElement("span"); this.headerDiv = document.createElement("span");
this.headerDiv._position = _pos; this.headerDiv._position = _pos;
$(this.headerDiv).addClass("egw_fw_ui_tab_header"); $j(this.headerDiv).addClass("egw_fw_ui_tab_header");
//Create a new callback object and attach it to the header div //Create a new callback object and attach it to the header div
this.headerDiv._callbackObject = new egw_fw_class_callback(this, _callback); this.headerDiv._callbackObject = new egw_fw_class_callback(this, _callback);
$(this.headerDiv).click( $j(this.headerDiv).click(
function(){ function(){
this._callbackObject.call(this); this._callbackObject.call(this);
}); });
//Attach the hover effect to the header div //Attach the hover effect to the header div
$(this.headerDiv).hover( $j(this.headerDiv).hover(
function() { function() {
if (!$(this).hasClass("egw_fw_ui_tab_header_active")) if (!$j(this).hasClass("egw_fw_ui_tab_header_active"))
$(this).addClass("egw_fw_ui_tab_header_hover"); $j(this).addClass("egw_fw_ui_tab_header_hover");
}, },
function() { function() {
$(this).removeClass("egw_fw_ui_tab_header_hover") $j(this).removeClass("egw_fw_ui_tab_header_hover")
} }
); );
//Create the close button and append it to the header div //Create the close button and append it to the header div
this.closeButton = document.createElement("span"); this.closeButton = document.createElement("span");
this.closeButton._callbackObject = new egw_fw_class_callback(this, _closeCallback); this.closeButton._callbackObject = new egw_fw_class_callback(this, _closeCallback);
$(this.closeButton).addClass("egw_fw_ui_tab_close_button"); $j(this.closeButton).addClass("egw_fw_ui_tab_close_button");
$(this.closeButton).click( $j(this.closeButton).click(
function(){ function(){
//Only call the close callback if the tab is set closeable //Only call the close callback if the tab is set closeable
if (this._callbackObject.context.closeable) if (this._callbackObject.context.closeable)
@ -484,33 +484,33 @@ function egw_fw_ui_tab(_parent, _contHeaderDiv, _contDiv, _icon, _callback,
} }
else else
{ {
$(this.headerDiv).append(this.closeButton); $j(this.headerDiv).append(this.closeButton);
} }
//Create the icon and append it to the header div //Create the icon and append it to the header div
var icon = document.createElement("img"); var icon = document.createElement("img");
$(icon).addClass("egw_fw_ui_tab_icon"); $j(icon).addClass("egw_fw_ui_tab_icon");
icon.src = _icon; icon.src = _icon;
icon.alt = 'Tab icon'; icon.alt = 'Tab icon';
$(this.headerDiv).append(icon); $j(this.headerDiv).append(icon);
//Create the title h1 and append it to the header div //Create the title h1 and append it to the header div
this.headerH1 = document.createElement("h1"); this.headerH1 = document.createElement("h1");
this.setTitle(''); this.setTitle('');
$(this.headerDiv).append(this.headerH1); $j(this.headerDiv).append(this.headerH1);
if (typeof jQuery.browser['msie'] != 'undefined') if (typeof jQuery.browser['msie'] != 'undefined')
{ {
$(this.headerDiv).append(this.closeButton); $j(this.headerDiv).append(this.closeButton);
} }
this.contentDiv = document.createElement("div"); this.contentDiv = document.createElement("div");
$(this.contentDiv).addClass("egw_fw_ui_tab_content"); $j(this.contentDiv).addClass("egw_fw_ui_tab_content");
$(this.contentDiv).hide(); $j(this.contentDiv).hide();
//Sort the element in at the given position //Sort the element in at the given position
var _this = this; var _this = this;
var $_children = $(this.contHeaderDiv).children(); var $_children = $j(this.contHeaderDiv).children();
var _cnt = $_children.size(); var _cnt = $_children.size();
if (_cnt > 0 && _pos > -1) if (_cnt > 0 && _pos > -1)
@ -518,22 +518,22 @@ function egw_fw_ui_tab(_parent, _contHeaderDiv, _contDiv, _icon, _callback,
$_children.each(function(i) { $_children.each(function(i) {
if (_pos <= this._position) if (_pos <= this._position)
{ {
$(this).before(_this.headerDiv); $j(this).before(_this.headerDiv);
return false; return false;
} }
else if (i == (_cnt - 1)) else if (i == (_cnt - 1))
{ {
$(this).after(_this.headerDiv); $j(this).after(_this.headerDiv);
return false; return false;
} }
}); });
} }
else else
{ {
$(this.contHeaderDiv).append(this.headerDiv); $j(this.contHeaderDiv).append(this.headerDiv);
} }
$(this.contDiv).append(this.contentDiv); $j(this.contDiv).append(this.contentDiv);
} }
/** /**
@ -544,8 +544,8 @@ function egw_fw_ui_tab(_parent, _contHeaderDiv, _contDiv, _icon, _callback,
egw_fw_ui_tab.prototype.setTitle = function(_title) egw_fw_ui_tab.prototype.setTitle = function(_title)
{ {
this.title = _title; this.title = _title;
$(this.headerH1).empty(); $j(this.headerH1).empty();
$(this.headerH1).text(_title); $j(this.headerH1).text(_title);
} }
/** /**
@ -555,8 +555,8 @@ egw_fw_ui_tab.prototype.setTitle = function(_title)
*/ */
egw_fw_ui_tab.prototype.setContent = function(_content) egw_fw_ui_tab.prototype.setContent = function(_content)
{ {
$(this.contentDiv).empty(); $j(this.contentDiv).empty();
$(this.contentDiv).append(_content); $j(this.contentDiv).append(_content);
} }
/** /**
@ -565,8 +565,8 @@ egw_fw_ui_tab.prototype.setContent = function(_content)
*/ */
egw_fw_ui_tab.prototype.show = function() egw_fw_ui_tab.prototype.show = function()
{ {
$(this.headerDiv).addClass("egw_fw_ui_tab_header_active"); $j(this.headerDiv).addClass("egw_fw_ui_tab_header_active");
$(this.contentDiv).show(); $j(this.contentDiv).show();
} }
/** /**
@ -574,8 +574,8 @@ egw_fw_ui_tab.prototype.show = function()
*/ */
egw_fw_ui_tab.prototype.hide = function() egw_fw_ui_tab.prototype.hide = function()
{ {
$(this.headerDiv).removeClass("egw_fw_ui_tab_header_active"); $j(this.headerDiv).removeClass("egw_fw_ui_tab_header_active");
$(this.contentDiv).hide(); $j(this.contentDiv).hide();
} }
/** /**
@ -584,8 +584,8 @@ egw_fw_ui_tab.prototype.hide = function()
egw_fw_ui_tab.prototype.remove = function() egw_fw_ui_tab.prototype.remove = function()
{ {
this.hide(); this.hide();
$(this.contentDiv).remove(); $j(this.contentDiv).remove();
$(this.headerDiv).remove(); $j(this.headerDiv).remove();
} }
/** /**
@ -597,9 +597,9 @@ egw_fw_ui_tab.prototype.setCloseable = function(_closeable)
{ {
this.closeable = _closeable; this.closeable = _closeable;
if (_closeable) if (_closeable)
$(this.closeButton).show(); $j(this.closeButton).show();
else else
$(this.closeButton).hide(); $j(this.closeButton).hide();
} }
@ -620,17 +620,17 @@ function egw_fw_ui_tabs(_contDiv)
//Create a div for the tab headers //Create a div for the tab headers
this.contHeaderDiv = document.createElement("div"); this.contHeaderDiv = document.createElement("div");
$(this.contHeaderDiv).addClass("egw_fw_ui_tabs_header"); $j(this.contHeaderDiv).addClass("egw_fw_ui_tabs_header");
$(this.contDiv).append(this.contHeaderDiv); $j(this.contDiv).append(this.contHeaderDiv);
this.appHeaderContainer = document.createElement("div"); this.appHeaderContainer = document.createElement("div");
$(this.appHeaderContainer).addClass("egw_fw_ui_app_header_container"); $j(this.appHeaderContainer).addClass("egw_fw_ui_app_header_container");
$(this.contDiv).append(this.appHeaderContainer); $j(this.contDiv).append(this.appHeaderContainer);
this.appHeader = document.createElement("div"); this.appHeader = document.createElement("div");
$(this.appHeader).addClass("egw_fw_ui_app_header"); $j(this.appHeader).addClass("egw_fw_ui_app_header");
$(this.appHeader).hide(); $j(this.appHeader).hide();
$(this.appHeaderContainer).append(this.appHeader); $j(this.appHeaderContainer).append(this.appHeader);
this.tabs = Array(); this.tabs = Array();
@ -647,13 +647,13 @@ egw_fw_ui_tabs.prototype.setAppHeader = function(_text)
{ {
if (_text != "") if (_text != "")
{ {
$(this.appHeader).empty(); $j(this.appHeader).empty();
$(this.appHeader).append("<span style=\"color:gray \">&raquo;</span> " + _text); $j(this.appHeader).append("<span style=\"color:gray \">&raquo;</span> " + _text);
$(this.appHeader).show(); $j(this.appHeader).show();
} }
else else
{ {
$(this.appHeader).hide(); $j(this.appHeader).hide();
} }
} }
@ -842,25 +842,25 @@ function egw_fw_ui_category(_contDiv, _name, _title, _content, _callback, _anima
//Create the ui divs //Create the ui divs
this.headerDiv = document.createElement('div'); this.headerDiv = document.createElement('div');
$(this.headerDiv).addClass('egw_fw_ui_category'); $j(this.headerDiv).addClass('egw_fw_ui_category');
//Add the text //Add the text
var entryH1 = document.createElement('h1'); var entryH1 = document.createElement('h1');
$(entryH1).append(_title); $j(entryH1).append(_title);
$(this.headerDiv).append(entryH1); $j(this.headerDiv).append(entryH1);
//Add the content //Add the content
this.contentDiv = document.createElement('div'); this.contentDiv = document.createElement('div');
this.contentDiv._parent = this; this.contentDiv._parent = this;
$(this.contentDiv).addClass('egw_fw_ui_category_content'); $j(this.contentDiv).addClass('egw_fw_ui_category_content');
$(this.contentDiv).append(_content); $j(this.contentDiv).append(_content);
$(this.contentDiv).hide(); $j(this.contentDiv).hide();
//Add content and header to the content div, add some magic jQuery code in order to make it foldable //Add content and header to the content div, add some magic jQuery code in order to make it foldable
this.headerDiv._parent = this; this.headerDiv._parent = this;
$(this.headerDiv).click( $j(this.headerDiv).click(
function() { function() {
if (!$(this).hasClass('egw_fw_ui_category_active')) if (!$j(this).hasClass('egw_fw_ui_category_active'))
{ {
this._parent.open(false); this._parent.open(false);
} }
@ -869,23 +869,23 @@ function egw_fw_ui_category(_contDiv, _name, _title, _content, _callback, _anima
this._parent.close(false); this._parent.close(false);
} }
}); });
$(this.contDiv).append(this.headerDiv); $j(this.contDiv).append(this.headerDiv);
$(this.contDiv).append(this.contentDiv); $j(this.contDiv).append(this.contentDiv);
} }
egw_fw_ui_category.prototype.open = function(_instantly) egw_fw_ui_category.prototype.open = function(_instantly)
{ {
this.callback.call(this, true); this.callback.call(this, true);
$(this.headerDiv).addClass('egw_fw_ui_category_active'); $j(this.headerDiv).addClass('egw_fw_ui_category_active');
if (_instantly) if (_instantly)
{ {
$(this.contentDiv).show(); $j(this.contentDiv).show();
this.animationCallback(); this.animationCallback();
} }
else else
{ {
$(this.contentDiv).slideDown(200, function() { $j(this.contentDiv).slideDown(200, function() {
this._parent.animationCallback.call(this._parent); this._parent.animationCallback.call(this._parent);
}); });
} }
@ -894,16 +894,16 @@ egw_fw_ui_category.prototype.open = function(_instantly)
egw_fw_ui_category.prototype.close = function(_instantly) egw_fw_ui_category.prototype.close = function(_instantly)
{ {
this.callback.call(this, false); this.callback.call(this, false);
$(this.headerDiv).removeClass('egw_fw_ui_category_active'); $j(this.headerDiv).removeClass('egw_fw_ui_category_active');
if (_instantly) if (_instantly)
{ {
$(this.contentDiv).hide(); $j(this.contentDiv).hide();
this.animationCallback(); this.animationCallback();
} }
else else
{ {
$(this.contentDiv).slideUp(200, function() { $j(this.contentDiv).slideUp(200, function() {
this._parent.animationCallback.call(this._parent); this._parent.animationCallback.call(this._parent);
}); });
} }
@ -912,8 +912,8 @@ egw_fw_ui_category.prototype.close = function(_instantly)
egw_fw_ui_category.prototype.remove = function() egw_fw_ui_category.prototype.remove = function()
{ {
//Delete the content and header div //Delete the content and header div
$(this.contDiv).remove(); $j(this.contDiv).remove();
$(this.headerDiv).remove(); $j(this.headerDiv).remove();
} }
/** /**
@ -942,11 +942,11 @@ function egw_fw_ui_scrollarea(_contDiv)
//Wrap a new "scroll" div around the content of the content div //Wrap a new "scroll" div around the content of the content div
this.scrollDiv = document.createElement("div"); this.scrollDiv = document.createElement("div");
this.scrollDiv.style.position = "relative"; this.scrollDiv.style.position = "relative";
$(this.scrollDiv).addClass("egw_fw_ui_scrollarea"); $j(this.scrollDiv).addClass("egw_fw_ui_scrollarea");
//Mousewheel handler //Mousewheel handler
var self = this; var self = this;
$(this.scrollDiv).mousewheel(function(e, delta) { $j(this.scrollDiv).mousewheel(function(e, delta) {
if (delta) if (delta)
{ {
self.scrollDelta(- delta * 30); self.scrollDelta(- delta * 30);
@ -955,53 +955,53 @@ function egw_fw_ui_scrollarea(_contDiv)
//Create a container which contains the up/down buttons and the scrollDiv //Create a container which contains the up/down buttons and the scrollDiv
this.outerDiv = document.createElement("div"); this.outerDiv = document.createElement("div");
$(this.outerDiv).addClass("egw_fw_ui_scrollarea_outerdiv"); $j(this.outerDiv).addClass("egw_fw_ui_scrollarea_outerdiv");
$(this.outerDiv).append(this.scrollDiv); $j(this.outerDiv).append(this.scrollDiv);
$(this.contDiv).children().appendTo(this.scrollDiv); $j(this.contDiv).children().appendTo(this.scrollDiv);
$(this.contDiv).append(this.outerDiv); $j(this.contDiv).append(this.outerDiv);
this.contentDiv = this.scrollDiv; this.contentDiv = this.scrollDiv;
//Create the "up" and the "down" button //Create the "up" and the "down" button
this.btnUp = document.createElement("span"); this.btnUp = document.createElement("span");
$(this.btnUp).addClass("egw_fw_ui_scrollarea_button"); $j(this.btnUp).addClass("egw_fw_ui_scrollarea_button");
$(this.btnUp).addClass("egw_fw_ui_scrollarea_button_up"); $j(this.btnUp).addClass("egw_fw_ui_scrollarea_button_up");
$(this.btnUp).hide(); $j(this.btnUp).hide();
this.btnUp._parent = this; this.btnUp._parent = this;
$(this.btnUp).mouseenter(function(){ $j(this.btnUp).mouseenter(function(){
this._parent.mouseOverToggle(true, -1); this._parent.mouseOverToggle(true, -1);
$(this).addClass("egw_fw_ui_scrollarea_button_hover"); $j(this).addClass("egw_fw_ui_scrollarea_button_hover");
}); });
$(this.btnUp).click(function(){ $j(this.btnUp).click(function(){
this._parent.setScrollPos(0); this._parent.setScrollPos(0);
}); });
$(this.btnUp).mouseleave(function(){ $j(this.btnUp).mouseleave(function(){
this._parent.mouseOverToggle(false, -1); this._parent.mouseOverToggle(false, -1);
$(this).removeClass("egw_fw_ui_scrollarea_button_hover"); $j(this).removeClass("egw_fw_ui_scrollarea_button_hover");
}); });
$(this.outerDiv).prepend(this.btnUp); $j(this.outerDiv).prepend(this.btnUp);
this.btnDown = document.createElement("span"); this.btnDown = document.createElement("span");
$(this.btnDown).addClass("egw_fw_ui_scrollarea_button"); $j(this.btnDown).addClass("egw_fw_ui_scrollarea_button");
$(this.btnDown).addClass("egw_fw_ui_scrollarea_button_down"); $j(this.btnDown).addClass("egw_fw_ui_scrollarea_button_down");
$(this.btnDown).hide(); $j(this.btnDown).hide();
this.btnDown._parent = this; this.btnDown._parent = this;
$(this.btnDown).mouseenter(function(){ $j(this.btnDown).mouseenter(function(){
this._parent.mouseOverToggle(true, 1); this._parent.mouseOverToggle(true, 1);
$(this).addClass("egw_fw_ui_scrollarea_button_hover"); $j(this).addClass("egw_fw_ui_scrollarea_button_hover");
}); });
$(this.btnDown).click(function() { $j(this.btnDown).click(function() {
this._parent.setScrollPos(this._parent.maxScrollPos); this._parent.setScrollPos(this._parent.maxScrollPos);
}); });
$(this.btnDown).mouseleave(function(){ $j(this.btnDown).mouseleave(function(){
this._parent.mouseOverToggle(false, 1); this._parent.mouseOverToggle(false, 1);
$(this).removeClass("egw_fw_ui_scrollarea_button_hover"); $j(this).removeClass("egw_fw_ui_scrollarea_button_hover");
}); });
$(this.outerDiv).prepend(this.btnDown); $j(this.outerDiv).prepend(this.btnDown);
//Update - read height of the children elements etc. //Update - read height of the children elements etc.
this.update(); this.update();
@ -1014,9 +1014,9 @@ egw_fw_ui_scrollarea.prototype.setScrollPos = function(_pos)
if (_pos <= 0) if (_pos <= 0)
{ {
if (this.btnUpEnabled) if (this.btnUpEnabled)
$(this.btnUp).addClass("egw_fw_ui_scrollarea_button_disabled"); $j(this.btnUp).addClass("egw_fw_ui_scrollarea_button_disabled");
if (!this.btnDownEnabled) if (!this.btnDownEnabled)
$(this.btnDown).removeClass("egw_fw_ui_scrollarea_button_disabled"); $j(this.btnDown).removeClass("egw_fw_ui_scrollarea_button_disabled");
this.btnDownEnabled = true; this.btnDownEnabled = true;
this.btnUpEnabled = false; this.btnUpEnabled = false;
@ -1025,9 +1025,9 @@ egw_fw_ui_scrollarea.prototype.setScrollPos = function(_pos)
else if (_pos >= this.maxScrollPos) else if (_pos >= this.maxScrollPos)
{ {
if (this.btnDownEnabled) if (this.btnDownEnabled)
$(this.btnDown).addClass("egw_fw_ui_scrollarea_button_disabled"); $j(this.btnDown).addClass("egw_fw_ui_scrollarea_button_disabled");
if (!this.btnUpEnabled) if (!this.btnUpEnabled)
$(this.btnUp).removeClass("egw_fw_ui_scrollarea_button_disabled"); $j(this.btnUp).removeClass("egw_fw_ui_scrollarea_button_disabled");
this.btnDownEnabled = false; this.btnDownEnabled = false;
this.btnUpEnabled = true; this.btnUpEnabled = true;
@ -1036,9 +1036,9 @@ egw_fw_ui_scrollarea.prototype.setScrollPos = function(_pos)
else else
{ {
if (!this.btnUpEnabled) if (!this.btnUpEnabled)
$(this.btnUp).removeClass("egw_fw_ui_scrollarea_button_disabled"); $j(this.btnUp).removeClass("egw_fw_ui_scrollarea_button_disabled");
if (!this.btnDownEnabled) if (!this.btnDownEnabled)
$(this.btnDown).removeClass("egw_fw_ui_scrollarea_button_disabled"); $j(this.btnDown).removeClass("egw_fw_ui_scrollarea_button_disabled");
this.btnUpEnabled = true; this.btnUpEnabled = true;
this.btnDownEnabled = true; this.btnDownEnabled = true;
} }
@ -1059,17 +1059,17 @@ egw_fw_ui_scrollarea.prototype.toggleButtons = function(_visible)
{ {
if (_visible) if (_visible)
{ {
$(this.btnDown).show(); $j(this.btnDown).show();
$(this.btnUp).show(); $j(this.btnUp).show();
this.buttonHeight = $(this.btnDown).outerHeight(); this.buttonHeight = $j(this.btnDown).outerHeight();
this.maxScrollPos = this.contHeight - this.boxHeight; this.maxScrollPos = this.contHeight - this.boxHeight;
this.setScrollPos(this.scrollPos); this.setScrollPos(this.scrollPos);
} }
else else
{ {
this.scrollDiv.style.top = '0'; this.scrollDiv.style.top = '0';
$(this.btnDown).hide(); $j(this.btnDown).hide();
$(this.btnUp).hide(); $j(this.btnUp).hide();
} }
this.buttonsVisible = _visible; this.buttonsVisible = _visible;
@ -1078,8 +1078,8 @@ egw_fw_ui_scrollarea.prototype.toggleButtons = function(_visible)
egw_fw_ui_scrollarea.prototype.update = function() egw_fw_ui_scrollarea.prototype.update = function()
{ {
//Get the height of the content and the outer box //Get the height of the content and the outer box
this.contHeight = $(this.scrollDiv).outerHeight(); this.contHeight = $j(this.scrollDiv).outerHeight();
this.boxHeight = $(this.contDiv).height(); this.boxHeight = $j(this.contDiv).height();
this.toggleButtons(this.contHeight > this.boxHeight); this.toggleButtons(this.contHeight > this.boxHeight);
this.setScrollPos(this.scrollPos); this.setScrollPos(this.scrollPos);
@ -1181,7 +1181,7 @@ function egw_fw_ui_splitter(_contDiv, _orientation, _resizeCallback, _constraint
//Create the actual splitter div //Create the actual splitter div
this.splitterDiv = document.createElement('div'); this.splitterDiv = document.createElement('div');
this.splitterDiv._parent = this; this.splitterDiv._parent = this;
$(this.splitterDiv).addClass("egw_fw_ui_splitter"); $j(this.splitterDiv).addClass("egw_fw_ui_splitter");
//Setup the options for the dragable object //Setup the options for the dragable object
var dragoptions = { var dragoptions = {
@ -1207,24 +1207,24 @@ function egw_fw_ui_splitter(_contDiv, _orientation, _resizeCallback, _constraint
{ {
case EGW_SPLITTER_HORIZONTAL: case EGW_SPLITTER_HORIZONTAL:
dragoptions.axis = 'y'; dragoptions.axis = 'y';
$(this.splitterDiv).addClass("egw_fw_ui_splitter_horizontal"); $j(this.splitterDiv).addClass("egw_fw_ui_splitter_horizontal");
break; break;
case EGW_SPLITTER_VERTICAL: case EGW_SPLITTER_VERTICAL:
dragoptions.axis = 'x'; dragoptions.axis = 'x';
$(this.splitterDiv).addClass("egw_fw_ui_splitter_vertical"); $j(this.splitterDiv).addClass("egw_fw_ui_splitter_vertical");
break; break;
} }
$(this.splitterDiv).draggable(dragoptions); $j(this.splitterDiv).draggable(dragoptions);
//Handle mouse hovering of the splitter div //Handle mouse hovering of the splitter div
$(this.splitterDiv).mouseenter(function() { $j(this.splitterDiv).mouseenter(function() {
$(this).addClass("egw_fw_ui_splitter_hover"); $j(this).addClass("egw_fw_ui_splitter_hover");
}); });
$(this.splitterDiv).mouseleave(function() { $j(this.splitterDiv).mouseleave(function() {
$(this).removeClass("egw_fw_ui_splitter_hover"); $j(this).removeClass("egw_fw_ui_splitter_hover");
}); });
$(this.contDiv).append(this.splitterDiv); $j(this.contDiv).append(this.splitterDiv);
} }
egw_fw_ui_splitter.prototype.clipDelta = function(_delta) egw_fw_ui_splitter.prototype.clipDelta = function(_delta)
@ -1274,12 +1274,12 @@ egw_fw_ui_splitter.prototype.dragHandler = function(event, ui)
case EGW_SPLITTER_HORIZONTAL: case EGW_SPLITTER_HORIZONTAL:
var old = ui.offset.top - this.startPos; var old = ui.offset.top - this.startPos;
clipped = this.clipDelta(old); clipped = this.clipDelta(old);
$(this.splitterDiv).data('draggable').offset.click.top += (old - clipped); $j(this.splitterDiv).data('draggable').offset.click.top += (old - clipped);
break; break;
case EGW_SPLITTER_VERTICAL: case EGW_SPLITTER_VERTICAL:
var old = ui.offset.left - this.startPos; var old = ui.offset.left - this.startPos;
clipped = this.clipDelta(old); clipped = this.clipDelta(old);
$(this.splitterDiv).data('draggable').offset.click.left += (old - clipped); $j(this.splitterDiv).data('draggable').offset.click.left += (old - clipped);
break; break;
}*/ }*/
} }

View File

@ -56,7 +56,7 @@
document.getElementById('egw_fw_sidebar').style.width = _size + 'px'; document.getElementById('egw_fw_sidebar').style.width = _size + 'px';
} }
$(document).ready(function() { $j(document).ready(function() {
framework = new egw_fw("egw_fw_sidemenu", "egw_fw_tabs", "egw_fw_splitter", framework = new egw_fw("egw_fw_sidemenu", "egw_fw_tabs", "egw_fw_splitter",
"{webserver_url}", egw_setSideboxSize, {sidebox_width}, {sidebox_min_width}); "{webserver_url}", egw_setSideboxSize, {sidebox_width}, {sidebox_min_width});
} }