2005-07-21 Helge Hess <helge.hess@opengroupware.org>
+ * UIxMailListView.m: load JavaScript from a file (UIxMailListView.js)
+ instead of embedding it into the page (v0.9.163)
+
* UIxMailView.m: do not fetch full message info for 304 existance
checks but rather call -doesMailExist (v0.9.162)
[self messageUidString]];
}
-- (NSString *)jsCode {
- static NSString *script = \
- @"var rowSelectionCount = 0;\n"
- @"\n"
- @"validateControls();\n"
- @"\n"
- @"function showElement(e, shouldShow) {\n"
- @" e.style.display = shouldShow ? \"\" : \"none\";\n"
- @"}\n"
- @"\n"
- @"function enableElement(e, shouldEnable) {\n"
- @" if(!e)\n"
- @" return;\n"
- @" if(shouldEnable) {\n"
- @" if(e.hasAttribute(\"disabled\"))\n"
- @" e.removeAttribute(\"disabled\");\n"
- @" }\n"
- @" else {\n"
- @" e.setAttribute(\"disabled\", \"1\");\n"
- @" }\n"
- @"}\n"
- @"\n"
- @"function toggleRowSelectionStatus(sender) {\n"
- @" rowID = sender.value;\n"
- @" tr = document.getElementById(rowID);\n"
- @" if(sender.checked) {\n"
- @" tr.className = \"tableview_selected\";\n"
- @" rowSelectionCount += 1;\n"
- @" }\n"
- @" else {\n"
- @" tr.className = \"tableview\";\n"
- @" rowSelectionCount -= 1;\n"
- @" }\n"
- @" this.validateControls();\n"
- @"}\n"
- @"\n"
- @"function validateControls() {\n"
- @" var e = document.getElementById(\"moveto\");\n"
- @" this.enableElement(e, rowSelectionCount > 0);\n"
- @"}\n"
- @"\n"
- @"function moveTo(uri) {\n"
- @" alert(\"MoveTo: \" + uri);\n"
- @"}\n"
- @"";
- return script;
-}
-
/* error redirects */
- (id)redirectToViewWithError:(id)_error {
- (id)defaultAction {
/* check etag to see whether we really must rerender */
if (mailETag != nil ) {
+ /*
+ Note: There is one thing which *can* change for an existing message,
+ those are the IMAP4 flags (and annotations, which we do not use).
+ Since we don't render the flags, it should be OK, if this changes
+ we must embed the flagging into the etag.
+ */
NSString *s;
if ((s = [[[self context] request] headerForKey:@"if-none-match"])) {
# version file
-SUBMINOR_VERSION:=162
+SUBMINOR_VERSION:=163
# v0.9.140 requires SoObjects/Mailer v0.9.100
# v0.9.134 requires libSOGo v0.9.41
title="panelTitle"
hideFrame="hideFrame"
>
+ <script language="JavaScript" rsrc:src="UIxMailListView.js">
+ <!-- space required -->
+ </script>
+
<var:component className="UIxMailFilterPanel" qualifier="qualifier"
hideFrame="hideFrame" />
<div id="cl_tableview_reloadroot">
<div class="embedwhite_out">
<div class="embedwhite_in">
- <script language="JavaScript">
- <var:string value="jsCode" const:escapeHTML="NO" />
- </script>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
<tr class="tableview">
<td class="tbtv_headercell" width="17">
</div>
<script language="JavaScript">
- markMailReadInWindow(window.opener,
- '<var:string value="clientObject.nameInContainer"/>');
+ if (window.opener) {
+ markMailReadInWindow(window.opener,
+ '<var:string value="clientObject.nameInContainer"/>');
+ }
</script>
</var:component>
+2005-07-21 Helge Hess <helge.hess@opengroupware.org>
+
+ * mailer.js: fixed a bug with calling the opener on errors
+
2005-07-20 Helge Hess <helge.hess@opengroupware.org>
* mailer.js: use POST instead of GET for toggling the mail read flag,
--- /dev/null
+var rowSelectionCount = 0;
+
+validateControls();
+
+function showElement(e, shouldShow) {
+ e.style.display = shouldShow ? "" : "none";
+}
+
+function enableElement(e, shouldEnable) {
+ if(!e)
+ return;
+ if(shouldEnable) {
+ if(e.hasAttribute("disabled"))
+ e.removeAttribute("disabled");
+ }
+ else {
+ e.setAttribute("disabled", "1");
+ }
+}
+
+function toggleRowSelectionStatus(sender) {
+ rowID = sender.value;
+ tr = document.getElementById(rowID);
+ if(sender.checked) {
+ tr.className = "tableview_selected";
+ rowSelectionCount += 1;
+ }
+ else {
+ tr.className = "tableview";
+ rowSelectionCount -= 1;
+ }
+ this.validateControls();
+}
+
+function validateControls() {
+ var e = document.getElementById("moveto");
+ this.enableElement(e, rowSelectionCount > 0);
+}
+
+function moveTo(uri) {
+ alert("MoveTo: " + uri);
+}
function markMailInWindow(win, msguid, markread) {
var msgDiv;
-
+
msgDiv = win.document.getElementById("div_" + msguid);
if (msgDiv) {
if (markread) {
return false;
}
function markMailReadInWindow(win, msguid) {
+ /* this is called by UIxMailView with window.opener */
return markMailInWindow(win, msguid, true);
}
if (http.status != 200) {
// TODO: refresh page?
alert("Message Mark Failed: " + http.statusText);
- window.opener.location.reload();
+ window.location.reload();
}
else {
markMailInWindow(window, msguid, markread);
}
}
else {
- window.opener.location.href = url;
+ window.location.href = url;
}
}