]> err.no Git - scalable-opengroupware.org/commitdiff
work on tableview reloading DHTML
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 22 Feb 2005 23:09:17 +0000 (23:09 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 22 Feb 2005 23:09:17 +0000 (23:09 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@602 d1b88da0-ebda-0310-925b-ed51d893ca5b

16 files changed:
SOGo/UI/Contacts/UIxContactsListView.m
SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/UIxMailMainFrame.m
SOGo/UI/Mailer/Version
SOGo/UI/Mailer/mailer.js
SOGo/UI/MailerContacts/ChangeLog
SOGo/UI/MailerContacts/GNUmakefile
SOGo/UI/MailerContacts/UIxMailContactList.m
SOGo/UI/MailerContacts/Version
SOGo/UI/MailerContacts/mailercontacts.js
SOGo/UI/MailerContacts/product.plist
SOGo/UI/Templates/ChangeLog
SOGo/UI/Templates/Mailer/UIxMailToolbar.wox [moved from SOGo/UI/Templates/UIxMailToolbar.wox with 100% similarity]
SOGo/UI/Templates/Mailer/UIxMailTree.wox [moved from SOGo/UI/Templates/UIxMailTree.wox with 100% similarity]
SOGo/UI/Templates/UIxMailContactList.wox
SOGo/UI/Templates/UIxMailMainFrame.wox

index b50cd46423b98bd8ff6a454d1d827f3bcc750e46..a028b42e39aaf3806752d1bdcbd5f3f5572be1fc 100644 (file)
@@ -46,6 +46,8 @@
   ASSIGNCOPY(self->searchText, _txt);
 }
 - (id)searchText {
+  if (self->searchText == nil)
+    [self setSearchText:[[[self context] request] formValueForKey:@"search"]];
   return self->searchText;
 }
 
@@ -56,6 +58,7 @@
   if ([s length] == 0)
     return nil;
   
+  // TODO: just use qualifier vars
   qs = [NSString stringWithFormat:
                   @"(sn isCaseInsensitiveLike: '%@*') OR "
                   @"(givenname isCaseInsensitiveLike: '%@*') OR "
@@ -92,7 +95,7 @@
   NSArray     *records;
   EOQualifier *q;
   
-  if (self->filteredRecords)
+  if (self->filteredRecords != nil)
     return self->filteredRecords;
   
   records = [[self clientObject] fetchCoreInfos];
index d6adc542109fe56a303604347d2790012097f29b..2228fc617e734464decd53636ed383b6f36b2acc 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-22  Helge Hess  <helge.hess@opengroupware.org>
+
+       * UIxMailMainFrame.m: added ability not to generate the HTML frame 
+         (v0.9.120)
+
 2005-02-20  Helge Hess  <helge.hess@opengroupware.org>
 
        * moved UIxMailSizeFormatter to MailPartViewers (v0.9.119)
index 8bc55ebe9be1a930ee36a090856c5ee47f7f2dce..1917e7c4a5ac6274f8a8b13a8f88b5ba747953ff 100644 (file)
   NSString *rootURL;
   NSString *userRootURL;
   id       item;
-  BOOL     hideFolderTree;
+  struct {
+    int hideFolderTree:1;
+    int hideFrame:1;
+    int reserved:30;
+  } mmfFlags;
 }
 
 - (NSString *)rootURL;
@@ -68,10 +72,17 @@ static NSString *treeRootClassName = nil;
 }
 
 - (void)setHideFolderTree:(BOOL)_flag {
-   self->hideFolderTree = _flag;
+   self->mmfFlags.hideFolderTree = _flag ? 1 : 0;
 }
 - (BOOL)hideFolderTree {
-  return self->hideFolderTree;
+  return self->mmfFlags.hideFolderTree ? YES : NO;
+}
+
+- (void)setHideFrame:(BOOL)_flag {
+   self->mmfFlags.hideFrame = _flag ? 1 : 0;
+}
+- (BOOL)hideFrame {
+  return self->mmfFlags.hideFrame ? YES : NO;
 }
 
 - (void)setTitle:(NSString *)_value {
index 2a7eccc4af31420e36a6ed449c7d335bc3689a8d..e5c391c65583b95177d0288ae9c684664b6cd6c1 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=119
+SUBMINOR_VERSION:=120
 
 # v0.9.100 requires libNGMime        v4.5.213
 # v0.9.99  requires libNGMime        v4.5.212
index 5ded4a96682a02d24bd6a76aae13a56c71c3c046..b97829f4b4e23d811da5f806f6809d83af1dd58c 100644 (file)
@@ -193,6 +193,18 @@ function clickedNewFilter(sender) {
 
 /* generic stuff */
 
+function ml_stripActionInURL(url) {
+  if (url[url.length - 1] != '/') {
+    var i;
+    
+    i = url.lastIndexOf("/");
+    if (i != -1) url = url.substring(0, i);
+  }
+  if (url[url.length - 1] != '/') // ensure trailing slash
+    url = url + "/";
+  return url;
+}
+
 function escapeHTML(s) {
         s = s.replace(/&/g, "&amp;");
         s = s.replace(/</g, "&lt;");
@@ -384,11 +396,38 @@ var isRegistered = false;
 var lastKeyPress = null;
 var submitAfterMS = 500;
 
+function ml_reloadTableView(searchtext, elementid) {
+  var http = createHTTPClient();
+
+  if (http) {
+    var viewURL, url;
+    var hasQueryPara;
+    
+    viewURL      = this.location.href;
+    hasQueryPara = viewURL.indexOf("?") == -1 ? false : true;
+    url          = viewURL.replace(/\/tb\.view/, "/tb.view?noframe=1");
+    url = url + (hasQueryPara ? "&search=" : "?search=") + searchtext;
+    
+    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 != firstValue) {
       // TODO: we should just reload the tableview, not the whole page
-      document.pageform.submit();
+      //document.pageform.submit();
+      ml_reloadTableView(field.value, "cl_tableview_reloadroot");
     }
   }
 }
index d4eca3b3f998efc9cb2af38ca0fe6dde53e28d1b..f9c44d2793cbe56fc67eb404c35a12e3f266e9f9 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-22  Helge Hess  <helge.hess@opengroupware.org>
+
+       * UIxMailContactList.m: hide frame if "noframe" query parameter is set
+         (v0.9.7)
+
 2005-02-18  Helge Hess  <helge.hess@opengroupware.org>
 
        * mailercontacts.js: added some function to allow inline editing of
index c4c72cf1e95441f7b59a03d78b1abc01c1fe8c38..87543a8008afce510cf54c0f1b64e457569990c6 100644 (file)
@@ -14,6 +14,7 @@ MailerContactsUI_OBJC_FILES += \
        UIxMailContactList.m    \
        UIxMailContactEditor.m  \
 
+
 MailerContactsUI_RESOURCE_FILES += \
        Version                 \
        product.plist           \
index 16e65637c58fe5f900c0b30b5caa93c86ffb6bf2..10a80e0b16a0aa5b10a7f01cca2f081a41efcf2e 100644 (file)
 
 @implementation UIxMailContactList
 
+/* frame */
+
+- (BOOL)hideFrame {
+  return [[[[self context] request] formValueForKey:@"noframe"] boolValue];
+}
+
 /* title */
 
 - (NSString *)objectTitle {
index dacebf417846ced1b9e5b49e7f4eec58257348e5..bf17f4596ded6ffb6d3d335d8ac3719c8465a561 100644 (file)
@@ -1,5 +1,5 @@
 # version file
 
-SUBMINOR_VERSION:=6
+SUBMINOR_VERSION:=7
 
 # v0.9.5 requires MailerUI v0.9.116
index 536253cf9957c5a70b249619522e7adc945f94cd..ac4f2e41f61885c62cbb1cc66823db1db363c366 100644 (file)
@@ -39,18 +39,6 @@ function cl_lowlight(sender) {
 
 /* edit field */
 
-function cl_stripActionInURL(url) {
-  if (url[url.length - 1] != '/') {
-    var i;
-
-    i = url.lastIndexOf("/");
-    if (i != -1) url = url.substring(0, i);
-  }
-  if (url[url.length - 1] != '/') // ensure trailing slash
-    url = url + "/";
-  return url;
-}
-
 function cl_saveFieldValue(sender, keyName) {
   var http = createHTTPClient();
 
@@ -60,7 +48,7 @@ function cl_saveFieldValue(sender, keyName) {
     var url      = window.location.href;
     var content;
     
-    url = cl_stripActionInURL(url);
+    url = ml_stripActionInURL(url);
     url = url + recordID + "/patchOneField";
     // TODO: confuses SOPE?!: url = url + "?jsonly=1"
     
index bf5803875d67eb520b17631677f23123abdcbdca..f8d68b2e191313e72bc30117dd8aff82a9a0c1a6 100644 (file)
           protectedBy = "View";
           pageName    = "UIxMailContactList"; 
         };
+        "tb.tableview" = { /* same like above without the frame */
+          protectedBy = "View";
+          pageName    = "UIxMailContactListPart"; 
+        };
+        
         "tb.compose" = {
           protectedBy = "View";
           actionClass = "UIxMailEditorAction"; 
index a337a039d92280d3822a0d8200bc05a94a2de560..4ff3d346e4b38c5d0713e1f007c6a9c3ca036de3 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-22  Helge Hess  <helge.hess@opengroupware.org>
+
+       * UIxMailMainFrame.wox: removed debug code, use new SOPE container tag
+         to allow for frameless pages
+
 2005-02-21  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * UIxTimeDateControl.wox: disable time control on demand
index cac769e370b167450b8417d5fb7b32f606de69fc..daa1c0f7c76c7fbf95e6745934d58ed95631cc8f 100644 (file)
@@ -8,6 +8,7 @@
   xmlns:label="OGo:label"
   className="UIxMailMainFrame"
   title="panelTitle"
+  hideFrame="hideFrame"
 >
 <!--
   TODO: had a form like this:
@@ -21,6 +22,7 @@
                                var:queryDictionary="queryParameters"
 -->
 
+<var:if condition="hideFrame" const:negate="YES">
 <style>
 span.cl_inline {
   width: 100%;
@@ -53,9 +55,11 @@ input.cl_inlinefield {
       </td>
     </tr>
   </table>
+</var:if>
 
+ <div id="cl_tableview_reloadroot">
   <div class="embedwhite_out">
-    <div class="embedwhite_in">
+    <div class="embedwhite_in" id="cl_tableview">
 
       <table border="0" width="100%" cellspacing="0" cellpadding="1">
         <tr class="tableview">
@@ -135,8 +139,11 @@ input.cl_inlinefield {
       </table>
     </div>
   </div>
+ </div>
 
+<var:if condition="hideFrame" const:negate="YES">
   <script language="JavaScript">
     document.pageform.search.focus();
   </script>
+</var:if>
 </var:component>
index a419b307a19f44ce27c5204c1104776e763924f6..7ecb19af885773609ff814265967742a2bfe57fb 100644 (file)
@@ -1,4 +1,11 @@
 <?xml version="1.0" standalone="yes"?>
+<container xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:var="http://www.skyrix.com/od/binding"
+      xmlns:const="http://www.skyrix.com/od/constant"
+      xmlns:rsrc="OGo:url"
+      xmlns:label="OGo:label"
+>
+  <var:if condition="hideFrame" const:negate="YES">
 <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:var="http://www.skyrix.com/od/binding"
       xmlns:const="http://www.skyrix.com/od/constant"
         </td>
       </tr>
     </table>
-    
-    
-    <!-- debugging -->
-    <var:if condition="isUIxDebugEnabled">
-      <table border="0" width="100%">
-        <tr>
-          <td colspan="2">
-            <hr />
-            <table border="0" style="font-size: 9pt;">
-              <tr>
-                <td valign="top">clientObject:</td>
-                <td valign="top"><var:string value="clientObject" /></td>
-              </tr>
-              <tr>
-                <td valign="top">IMAP4-URL:</td>
-                <td valign="top"><var:string
-                    value="clientObject.imap4URL.absoluteString" /></td>
-              </tr>
-              <tr>
-                <td valign="top">traversal stack:</td>
-                <td valign="top">
-                  <var:foreach list="context.objectTraversalStack" item="item">
-                    <var:string value="item" /><br />
-                  </var:foreach>
-                </td>
-              </tr>
-              <tr>
-                <td valign="top">traversal path:</td>
-                <td valign="top">
-                  <var:foreach list="context.soRequestTraversalPath"
-                               item="item" const:separator=" => ">
-                    <var:string value="item" />
-                  </var:foreach>
-                </td>
-              </tr>
-              <tr>
-                <td valign="top">request type:</td>
-                <td valign="top"><var:string value="context.soRequestType"/>
-                </td>
-              </tr>
-              <tr>
-                <td valign="top">path info:</td>
-                <td valign="top"><var:string value="context.pathInfo"/></td>
-              </tr>
-              <tr>
-                <td valign="top">rootURL:</td>
-                <td valign="top"><var:string value="context.rootURL"/></td>
-              </tr>
-              <tr>
-                <td valign="top">active user:</td>
-                <td valign="top"><var:string value="context.activeUser"/></td>
-              </tr>
-            </table>
-          </td>
-        </tr>
-      </table>
-    </var:if>
    </form>
   </body>
 </html>
+   </var:if>
+
+  <var:if condition="hideFrame">
+    <var:component-content/>
+  </var:if>
+</container>