Monotone-Parent: 6f946a78a43cf1914cfbcff43562c9c0ed48a1b0

Monotone-Revision: 1816a792f1f7aa94e6d90dc5abea13dcd55ac0c6

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-07-25T18:42:21
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-07-25 18:42:21 +00:00
parent c4f917942d
commit ef0b52dfe6
2 changed files with 1 additions and 113 deletions
+1 -5
View File
@@ -1,11 +1,7 @@
{ /* -*-java-*- */
requires = ( MAIN, MainUI, CommonUI, Mailer, MailPartViewers ); /* , Sieve */
publicResources = ("uix.css",
"mailer.css",
"mailer.js",
"generic.js",
"searchfield.js",
publicResources = ("generic.js",
"UIxAppointmentEditor.js",
"UIxContactEditor.js",
"UIxMailToSelection.js",
-108
View File
@@ -1,108 +0,0 @@
/*
Copyright (C) 2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
/* JavaScript for SOGo Mailer */
var didStop = false;
var field = null;
var firstValue = "";
var isRegistered = false;
var lastKeyPress = null;
var submitAfterMS = 500;
function ml_reloadTableView(searchtext, elementid) {
var http = createHTTPClient();
if (http) {
var viewURL, url;
var hasQueryPara;
// TODO: properly parse query parameters
viewURL = this.location.href;
hasQueryPara = viewURL.indexOf("?") == -1 ? false : true;
url = (hasQueryPara ? "&" : "?") + "noframe=1&search=";
url = url + encodeURIComponent(searchtext);
// alert("GET " + url);
url = viewURL + url;
http.open("GET", url, false);
http.send(null);
if (http.status != 200) {
alert("Could not reload view.");
}
else {
var tv;
tv = document.getElementById(elementid)
tv.innerHTML = http.responseText;
}
}
}
function ml_reloadSearchIfFieldChanged() {
if (field) {
if (field.value && field.value != firstValue) {
ml_reloadTableView(field.value, "cl_tableview_reloadroot");
firstValue = field.value;
}
}
}
function ml_timeoutCallback() {
if (didStop) {
didStop = false;
return;
}
var now = new Date().getTime();
if ((now - lastKeyPress) < submitAfterMS) {
setTimeout("ml_timeoutCallback()", 10);
isRegistered = true;
return;
}
ml_reloadSearchIfFieldChanged();
isRegistered = false;
}
function ml_activateSearchField(sender, _submitTimeout) {
didStop = false;
field = sender;
firstValue = field.value;
submitAfterMS = _submitTimeout;
return true;
}
function ml_deactivateSearchField(sender) {
didStop = true;
field = null;
firstValue = "";
return true;
}
function ml_searchFieldKeyPressed(sender) {
lastKeyPress = new Date().getTime();
if (isRegistered)
return;
setTimeout("ml_timeoutCallback()", 10);
isRegistered = true;
return true;
}