forked from extern/egroupware
replacing egw.LAB with egw_LAB, as egw object is shared by all iframes and popups, while LAB has to work on document
This commit is contained in:
parent
f9b72b05ac
commit
792f1b26cc
@ -180,7 +180,7 @@ class etemplate_new extends etemplate_widget_template
|
||||
<div id="' . $this->name .'" class="et2_container"></div>
|
||||
<script>
|
||||
// Wait for all files to be loaded & executed first
|
||||
egw.LAB.wait(function() {
|
||||
egw_LAB.wait(function() {
|
||||
egw.langRequire(window, '.json_encode($langRequire).');
|
||||
egw(window).includeJS('.json_encode(egw_framework::get_script_links(true, true)). // return and clear
|
||||
',function() {
|
||||
@ -211,7 +211,7 @@ class etemplate_new extends etemplate_widget_template
|
||||
<div id="container" class="et2_container"></div>
|
||||
<script>
|
||||
// Wait for all files to be loaded & executed first
|
||||
egw.LAB.wait(function() {
|
||||
egw_LAB.wait(function() {
|
||||
egw.langRequire(window, '.json_encode($langRequire).');
|
||||
egw(window).ready(function() {
|
||||
// Initialize application js
|
||||
@ -239,7 +239,7 @@ class etemplate_new extends etemplate_widget_template
|
||||
if(egw_json_response::isJSONResponse())
|
||||
{
|
||||
$response = egw_json_response::get();
|
||||
echo '<script>egw.LAB.wait(function() {egw_json_request.prototype.handleResponse(';
|
||||
echo '<script>egw_LAB.wait(function() {egw_json_request.prototype.handleResponse(';
|
||||
ob_flush();
|
||||
$response->sendResult();
|
||||
unset($response);
|
||||
|
@ -55,7 +55,7 @@ class etemplate_et2_widgets
|
||||
<div id="widget_list"></div>
|
||||
<div id="widget_container"></div>
|
||||
<script>
|
||||
egw.LAB.wait(function() {
|
||||
egw_LAB.wait(function() {
|
||||
var wb = new widget_browser(
|
||||
document.getElementById("widget_list"),
|
||||
document.getElementById("widget_container")
|
||||
|
@ -312,7 +312,7 @@ class etemplate_old extends boetemplate
|
||||
if($output_mode == 2)
|
||||
{
|
||||
$html .= "\n".'<script language="javascript">'."\n";
|
||||
$html .= 'egw.LAB.wait($j(document).ready(function() { popup_resize();}));'."\n";
|
||||
$html .= 'egw_LAB.wait($j(document).ready(function() { popup_resize();}));'."\n";
|
||||
$html .= '</script>';
|
||||
}
|
||||
|
||||
|
@ -920,7 +920,7 @@ class nextmatch_widget
|
||||
|
||||
return '
|
||||
<script type="text/javascript">
|
||||
egw.LAB.wait(function() {$j(document).ready(function() {
|
||||
egw_LAB.wait(function() {$j(document).ready(function() {
|
||||
// Initialize the action manager and add some actions to it
|
||||
var actionManager = egw_getActionManager("'.$app.'");
|
||||
var objectManager = egw_getObjectManager("'.$app.'");
|
||||
|
@ -19,7 +19,7 @@ if ($GLOBALS['egw_info']['user']['apps']['notifications'])
|
||||
$popup_poll_interval = empty($notification_config['popup_poll_interval']) ? 60 : $notification_config['popup_poll_interval'];
|
||||
echo '<script src="'. $GLOBALS['egw_info']['server']['webserver_url']. '/notifications/js/notificationajaxpopup.js?'.
|
||||
filemtime(EGW_SERVER_ROOT.'/notifications/js/notificationajaxpopup.js'). '" type="text/javascript"></script>';
|
||||
echo '<script type="text/javascript">var lab = egw.LAB || $LAB; lab.wait(function(){egwpopup_init("'.$popup_poll_interval.'");});</script>';
|
||||
echo '<script type="text/javascript">var lab = egw_LAB || $LAB; lab.wait(function(){egwpopup_init("'.$popup_poll_interval.'");});</script>';
|
||||
echo '
|
||||
<div id="egwpopup" style="display: none; z-index: 999;">
|
||||
<div id="egwpopup_header">'.lang('Notification'). '<span style="float:right;">'.
|
||||
|
@ -885,8 +885,8 @@ abstract class egw_framework
|
||||
$java_script .= '<script type="text/javascript" src="'. $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/labjs/LAB.src.js"'." ></script>\n".
|
||||
'<script type="text/javascript">
|
||||
// Loads files in parallel, executes serially
|
||||
window.egw.LAB = $LAB.setOptions({AlwaysPreserveOrder:true,BasePath:"'.$GLOBALS['egw_info']['server']['webserver_url'].'/"});
|
||||
window.egw.LAB.script(
|
||||
window.egw_LAB = $LAB.setOptions({AlwaysPreserveOrder:true,BasePath:"'.$GLOBALS['egw_info']['server']['webserver_url'].'/"});
|
||||
window.egw_LAB.script(
|
||||
'.json_encode(array_map(function($str){return substr($str,1);}, $to_include, array(1))).').wait(function() {'."\n".$after.'});
|
||||
</script>';
|
||||
|
||||
@ -905,7 +905,7 @@ window.egw.LAB.script(
|
||||
$GLOBALS['egw_info']['flags']['java_script'] = preg_replace(array('/(<script[^>]*>)([^<]*)/is','/<\/script>/'),array('$2',''),$GLOBALS['egw_info']['flags']['java_script']);
|
||||
if(trim($GLOBALS['egw_info']['flags']['java_script']) != '')
|
||||
{
|
||||
$java_script .= '<script type="text/javascript">window.egw.LAB.wait(function() {'.$GLOBALS['egw_info']['flags']['java_script'] . "});</script>\n";
|
||||
$java_script .= '<script type="text/javascript">window.egw_LAB.wait(function() {'.$GLOBALS['egw_info']['flags']['java_script'] . "});</script>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1226,7 +1226,7 @@ window.egw.LAB.script(
|
||||
{
|
||||
if($what == 'onLoad')
|
||||
{
|
||||
$js .= 'onLoad="egw.LAB.wait(function() {'. htmlspecialchars($data).'})"';
|
||||
$js .= 'onLoad="egw_LAB.wait(function() {'. htmlspecialchars($data).'})"';
|
||||
continue;
|
||||
}
|
||||
$js .= ' '.$what.'="' . htmlspecialchars($data) . '"';
|
||||
|
@ -206,7 +206,7 @@ function resize_'.$id.'()
|
||||
{
|
||||
$j("#'.$id.'").width(egw_getWindowInnerWidth()-20).height(egw_getWindowInnerHeight()-33);
|
||||
}
|
||||
egw.LAB.wait(function() {
|
||||
egw_LAB.wait(function() {
|
||||
$j(document).ready(function()
|
||||
{
|
||||
resize_'.$id.'();
|
||||
|
@ -295,7 +295,7 @@ class html
|
||||
if($enhanced) {
|
||||
egw_framework::validate_file('/phpgwapi/js/jquery/chosen/chosen.jquery.js');
|
||||
egw_framework::includeCSS('/phpgwapi/js/jquery/chosen/chosen.css',null,false);
|
||||
$out .= "<script>var lab = egw.LAB || \$LAB; lab.wait(function() {\$j(function() {if(\$j().chosen) \$j('select[name=\"$name\"]').chosen();});})</script>\n";
|
||||
$out .= "<script>var lab = egw_LAB || \$LAB; lab.wait(function() {\$j(function() {if(\$j().chosen) \$j('select[name=\"$name\"]').chosen();});})</script>\n";
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
@ -558,7 +558,7 @@ class html
|
||||
'
|
||||
<script type="text/javascript">
|
||||
window.CKEDITOR_BASEPATH="'.$GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/ckeditor/";
|
||||
egw.LAB.wait(function() {
|
||||
egw_LAB.wait(function() {
|
||||
CKEDITOR.replace("'.$_name.'", '.egw_ckeditor_config::get_ckeditor_config($_mode,
|
||||
$pxheight, $expanded, $_start_path).');
|
||||
CKEDITOR.addCss("body { margin: 5px; }");
|
||||
@ -1208,7 +1208,7 @@ egw.LAB.wait(function() {
|
||||
$html = self::div("\n",'id="'.$tree.'"',$_divClass).$html;
|
||||
$html .= "<script type='text/javascript'>\n";
|
||||
$html .= "var $tree;";
|
||||
$html .= "egw.LAB.wait(function() {";
|
||||
$html .= "egw_LAB.wait(function() {";
|
||||
$html .= "$tree = new dhtmlXTreeObject('$tree','100%','100%',0);\n";
|
||||
$html .= "$tree.parentObject.style.overflow='auto';\n"; // dhtmlXTree constructor has hidden hardcoded
|
||||
if (translation::charset() == 'utf-8') $html .= "if ($tree.setEscapingMode) $tree.setEscapingMode('utf8');\n";
|
||||
|
@ -135,7 +135,7 @@ class jscalendar
|
||||
|
||||
$js = '<script type="text/javascript">
|
||||
'.(!$useicon ? ' document.getElementById("'.$name.'").readOnly=true;' : '').
|
||||
' egw.LAB.wait(function() {
|
||||
' egw_LAB.wait(function() {
|
||||
Calendar.setup({
|
||||
inputField : "'.$name.'",'.(!$useicon ? '' : '
|
||||
button : "'.$name.'-trigger"').',
|
||||
@ -227,7 +227,7 @@ function monthClicked(calendar,monthstart) {
|
||||
}
|
||||
' : '').'
|
||||
|
||||
egw.LAB.wait(function() {
|
||||
egw_LAB.wait(function() {
|
||||
Calendar.setup({
|
||||
flat : "'.$id.'",
|
||||
flatCallback : dateChanged'.($weekUrl ? ',
|
||||
|
@ -318,7 +318,7 @@ class uiaccountsel
|
||||
}
|
||||
// jDots needs a little re-do, since it plays with the layout
|
||||
$html .= "<script>
|
||||
egw.LAB.wait(function() {
|
||||
egw_LAB.wait(function() {
|
||||
if (\$j().chosen)
|
||||
window.setTimeout(function() {
|
||||
\$j('#$element_id').unchosen().chosen({placeholder_text: '".lang('Select multiple accounts')."'});
|
||||
|
@ -67,7 +67,7 @@ egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
|
||||
}
|
||||
}
|
||||
// setting AlwaysPreserverOrder: true, 'til we have some other means of ensuring dependency resolution
|
||||
(egw.LAB || $LAB.setOptions({AlwaysPreserveOrder:true,BasePath:_prefix})).script(_jsFiles).wait(function(){
|
||||
(egw_LAB || $LAB.setOptions({AlwaysPreserveOrder:true,BasePath:_prefix})).script(_jsFiles).wait(function(){
|
||||
_callback.call(_context);
|
||||
});
|
||||
},
|
||||
|
@ -174,7 +174,7 @@ class idots_framework extends egw_framework
|
||||
self::validate_file('/phpgwapi/config.php');
|
||||
self::validate_file('/phpgwapi/images.php',array('template' => $GLOBALS['egw_info']['user']['preferences']['common']['template_set']));
|
||||
$content .= '<script type="text/javascript">
|
||||
egw.LAB.wait(function() {egw.set_preferences('.json_encode($GLOBALS['egw_info']['user']['preferences']['common']).', "common");
|
||||
egw_LAB.wait(function() {egw.set_preferences('.json_encode($GLOBALS['egw_info']['user']['preferences']['common']).', "common");
|
||||
egw.set_user('.$GLOBALS['egw']->accounts->json($GLOBALS['egw_info']['user']['account_id']).');});
|
||||
</script>'."\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user