- centralized all xmlhtmlreq in one file

- fixed bug that windows could not be resized smaller then it initial size
- fixed the shortcut settings bug
This commit is contained in:
Pim Snel 2005-07-13 15:30:53 +00:00
parent 50ab75e58a
commit c933bc081b
9 changed files with 60 additions and 117 deletions

View File

@ -158,6 +158,7 @@ a.appTitles,.appTitles
#divAppboxHeader
{
/*width:100%;*/

View File

@ -153,7 +153,7 @@ function saveSize(idotsName) {
w = xDT.prop(idotsName, 'wWidth');
h = xDT.prop(idotsName, 'wHeight');
url = strXmlUrl + "/write_size.php?title=" + title + "&w=" + w + "&h=" + h;
url = strXmlUrl + "/write_settings.php?action=write_size&title=" + title + "&w=" + w + "&h=" + h;
var found = false;
for(i = 0; i < aTitle.length; i++)
{

View File

@ -307,7 +307,7 @@ function mouseUp(id,e)
y2 = findPosY(mObj);
x2 = findPosX(mObj);
mObj.onmousemove = "";
strXmlUrl2 = strXmlUrl + "write_shortcut_setting.php?id=" + id + "&top=" + y2 + "&left=" + x2;
strXmlUrl2 = strXmlUrl + "/write_settings.php?action=shortcut_sets&id=" + id + "&top=" + y2 + "&left=" + x2;
createPos(mObj, x2,y2);
if (window.XMLHttpRequest)
{

View File

@ -225,8 +225,10 @@ function xDesktop(respath,sdt,maxwin,_fmain) { // resourcepath,
wHeight = ChooseSize(wHeight);
(wWidth > 0 && wWidth <= 10000) ? wWidth = wWidth : wWidth = 300;
(wHeight > 0 && wHeight <= 10000) ? wHeight = wHeight : wHeight = 200;
_property(wName,"wWidth",wWidth); // default window width
_property(wName,"wHeight",wHeight); // default window height
// _property(wName,"wWidth",wWidth); //fixme this must be set in preferences // default window width
// _property(wName,"wHeight",wHeight); //fixme this must be set in preferences // default window height
_property(wName,"wWidth",300); //fixme this must be set in preferences // default window width
_property(wName,"wHeight",200); //fixme this must be set in preferences // default window height
_property(wName,"wWidthOrg",_property(wName,"wWidth")); // save Org width Value
_property(wName,"wHeightOrg",_property(wName,"wHeight")); // save Org height Values
_cbe(wName).resizeTo(wWidth,wHeight);
@ -238,8 +240,9 @@ function xDesktop(respath,sdt,maxwin,_fmain) { // resourcepath,
_property(wName,"zIndex",p_zIndex);
_setSkin(wName,wSkin);
_cbe(wName).zIndex(p_zIndex);
_taskbar();
return wName;
_taskbar();
_resizeWindow(wName,wWidth,wHeight,wPos); // workaround
return wName;
}
function _resizeWindow(wName,wWidth,wHeight,wPos) {
if (! xDTwin.window(wName)) return;

View File

@ -323,7 +323,7 @@
else
{
//this checks if the rootwindow exist
//this is the url to goto when rootwindow not exist
$var['rooturl'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . '/index.php?cd=yes';
//set some shortcut vars

View File

@ -30,7 +30,6 @@ function start() {
idotsW = "xD" + new Date().getUTCMilliseconds();
if(default_app != "") {
openX(default_title, default_app);
}
}
@ -41,7 +40,7 @@ function start() {
<!-- BEGIN show_clock -->
<div id="taskbar"><IMG SRC="{iconpath}/launch.png" onClick="displayLaunch();" id="launch"><div id="tb" OnClick="sdt();"><img src="{iconpath}/show_desktop.png"></div><div id="tasks"></div><div id="clock" onclick="openX('{calendarTitle}', 'calendar/index.php');"></div></div>
<div id="taskbar"><img src="{iconpath}/launch.png" onClick="displayLaunch();" id="launch"><div id="tb" OnClick="sdt();"><img src="{iconpath}/show_desktop.png"></div><div id="tasks"></div><div id="clock" onclick="openX('{calendarTitle}', 'calendar/index.php');"></div></div>
<a id="warning" onClick="warning();">
<img src="{serverpath}/phpgwapi/templates/idots2/js/x-desktop/xDT/skins/IDOTS2/idea.png" alt="New notification">
</a>
@ -51,7 +50,7 @@ function start() {
<!-- BEGIN no_clock -->
<div id="taskbar"><IMG SRC="{iconpath}/launch.png" onClick="displayLaunch();" id="launch"><div id="tb" OnClick="sdt();"><img src="{iconpath}/show_desktop.png"></div><div id="tasks"></div></div>
<div id="taskbar"><img src="{iconpath}/launch.png" onClick="displayLaunch();" id="launch"><div id="tb" OnClick="sdt();"><img src="{iconpath}/show_desktop.png"></div><div id="tasks"></div></div>
<a id="warning" class="noclock" onClick="warning();">
<img src="{serverpath}/phpgwapi/templates/idots2/js/x-desktop/xDT/skins/IDOTS2/idea.png" alt="New notification">
</a>
@ -185,7 +184,7 @@ sidebox_open();
<div class="sidebox">
<div class="sidebox_title">{lang_title}</div>
<table style="width:100%">
<table style="width:100%;background-color:#eeeeee;">
<!-- END sidebox -->
<!-- BEGIN sidebox_footer -->

View File

@ -47,6 +47,49 @@
break;
}
}
}
elseif($_GET[action]=='shortcut_sets')
{
$id = $_GET["id"];
$top = $_GET["top"];
$left = $_GET["left"];
echo $id." ".$top." ".$left;
$GLOBALS['phpgw']->preferences->read_repository();
if($GLOBALS['phpgw_info']['user']['preferences']['phpgwapi'])
{
foreach($GLOBALS['phpgw_info']['user']['preferences']['phpgwapi'] as $shortcut => $shortcut_data)
{
if($shortcut_data['title'] == $id)
{
$shortcut_data['top'] = $top;
$shortcut_data['left'] = $left;
$GLOBALS['phpgw']->preferences->change('phpgwapi',$shortcut,$shortcut_data);
$GLOBALS['phpgw']->preferences->save_repository(True);
}
}
}
}
elseif($_GET[action]=='write_size')
{
$title = $_GET["title"];
$width = $_GET["w"];
$height= $_GET["h"];
echo $title." ".$width." ".$height;
$GLOBALS['phpgw']->preferences->read_repository();
foreach($GLOBALS['phpgw_info']['user']['apps'] as $name => $data)
{
if($data['title'] == $title) {
$size['name'] = $name;
$size['width'] = $width;
$size['height'] = $height;
$GLOBALS['phpgw']->preferences->change('phpgwapi','size_'.$name,$size);
$GLOBALS['phpgw']->preferences->save_repository(True);
}
}
}
echo "</response>";

View File

@ -1,53 +0,0 @@
<?php
/**************************************************************************\
* eGroupWare *
* http://www.egroupware.org *
* This file is written by Rob van Kraanen <rvkraanen@gmail.com> *
* Copyright 2005 Lingewoud BV - www.lingewoud.com *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'disable_Template_class' => True,
'currentapp' => 'notifywindow'
);
include('../../../header.inc.php');
header("Content-type: text/xml");
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
echo '<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>';
echo "\r\n<response>\r\n";
$id = $_GET["id"];
$top = $_GET["top"];
$left = $_GET["left"];
echo $id." ".$top." ".$left;
$GLOBALS['phpgw']->preferences->read_repository();
if($GLOBALS['phpgw_info']['user']['preferences']['phpgwapi'])
{
foreach($GLOBALS['phpgw_info']['user']['preferences']['phpgwapi'] as $shortcut => $shortcut_data)
{
if($shortcut_data['title'] == $id)
{
$shortcut_data['top'] = $top;
$shortcut_data['left'] = $left;
$GLOBALS['phpgw']->preferences->change('phpgwapi',$shortcut,$shortcut_data);
$GLOBALS['phpgw']->preferences->save_repository(True);
}
}
}
echo "</response>";
?>

View File

@ -1,50 +0,0 @@
<?php
/**************************************************************************\
* eGroupWare *
* http://www.egroupware.org *
* This file is written by Edo van Bruggen <edovanbruggen@raketnet.nl> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'disable_Template_class' => True,
'currentapp' => 'notifywindow'
);
include('../../../header.inc.php');
header("Content-type: text/xml");
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
echo '<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>';
echo "\r\n<response>\r\n";
$title = $_GET["title"];
$width = $_GET["w"];
$height= $_GET["h"];
echo $title." ".$width." ".$height;
$GLOBALS['phpgw']->preferences->read_repository();
foreach($GLOBALS['phpgw_info']['user']['apps'] as $name => $data)
{
if($data['title'] == $title) {
$size['name'] = $name;
$size['width'] = $width;
$size['height'] = $height;
$GLOBALS['phpgw']->preferences->change('phpgwapi','size_'.$name,$size);
$GLOBALS['phpgw']->preferences->save_repository(True);
}
}
echo "</response>";
?>