mass mobile update, interface cleanup and restyling.
authorMatt <matt@uncensored.citadel.org>
Sun, 3 Aug 2008 11:32:41 +0000 (11:32 +0000)
committerMatt <matt@uncensored.citadel.org>
Sun, 3 Aug 2008 11:32:41 +0000 (11:32 +0000)
webcit/messages.c
webcit/roomops.c
webcit/static/mobile.css
webcit/static/mobile.js
webcit/static/msgcontrols.m.html [new file with mode: 0644]
webcit/static/roombanner.m.html
webcit/webcit.c

index 972da57ad998c99b397daadc1194201b0126160b..19806559ad45b559155caa9e4cfb091f302a7a40 100644 (file)
@@ -1429,7 +1429,20 @@ void print_message(void) {
        wDumpContent(0);
 }
 
-
+/* 
+ * Mobile browser view of message
+ *
+ * @param msg_num_as_string Message number as a string instead of as a long int 
+ */
+void mobile_message_view(void) {
+  long msgnum = 0L;
+  msgnum = StrTol(WC->UrlFragment1);
+  output_headers(1, 0, 0, 0, 0, 1);
+  begin_burst();
+  do_template("msgcontrols");
+  read_message(msgnum,1, "");
+  wDumpContent(0);
+}
 
 /**
  * \brief Display a message's headers
@@ -1833,12 +1846,12 @@ void display_mobile_summary(int num) {
                (WC->summ[num].is_new ? "bold" : "normal"),
                WC->summ[num].msgnum
        );
-               wprintf("<span>%s</span>",WC->summ[num].from);
+               wprintf("<span class=\"from\">%s</span>",WC->summ[num].from);
                wprintf("<span style=\"float: right;\">");
                webcit_fmt_date(datebuf, WC->summ[num].date, 1);        /* brief */
-       escputs(datebuf);
+               escputs(datebuf);
                wprintf("</span><br/><span class=\"subject\">");
-               wprintf(WC->summ[num].subj);
+               escputs(WC->summ[num].subj);
                wprintf("</span></div><div id=\"m_%ld\" class=\"msgview\" onMouseDown=\"\"></div></div>",WC->summ[num].msgnum);
 }
 
@@ -2527,7 +2540,7 @@ void readloop(char *oper)
                maxmsgs = 9999999;
        }
 
-       if (is_summary || WCC->is_mobile) {                     /**< fetch header summary */
+       if (is_summary) {                       /**< fetch header summary */
                snprintf(cmd, sizeof(cmd), "MSGS %s|%s||1",
                        (!strcmp(oper, "do_search") ? "SEARCH" : "ALL"),
                        (!strcmp(oper, "do_search") ? bstr("query") : "")
@@ -2537,6 +2550,10 @@ void readloop(char *oper)
        } 
        if (WCC->is_mobile) {
                maxmsgs = 20;
+               snprintf(cmd, sizeof(cmd), "MSGS %s|%s||1",
+                       (!strcmp(oper, "do_search") ? "SEARCH" : "ALL"),
+                       (!strcmp(oper, "do_search") ? bstr("query") : "")
+               );
                SortBy =  eRDate;
        }
 
@@ -3824,6 +3841,7 @@ InitModule_MSG
        WebcitAddUrlHandler(HKEY("confirm_move_msg"), confirm_move_msg, 0);
        WebcitAddUrlHandler(HKEY("msg"), embed_message, NEED_URL|AJAX);
        WebcitAddUrlHandler(HKEY("printmsg"), print_message, NEED_URL);
+       WebcitAddUrlHandler(HKEY("mobilemsg"), mobile_message_view, NEED_URL);
        WebcitAddUrlHandler(HKEY("msgheaders"), display_headers, NEED_URL);
        return ;
 }
index 7be6ff4f046e4d5c614904ee939c6c814f838b72..2a3070d88811ed2de6831f752521eb7919570f2a 100644 (file)
@@ -502,12 +502,13 @@ void embed_room_banner(char *got, int navbar_style) {
        );
        svcallback("ROOMPIC", embed_room_graphic);
        svcallback("ROOMINFO", readinfo);
-       svcallback("VIEWOMATIC", embed_view_o_matic);
+       svcallback("VIEWOMATIC", embed_view_o_matic); 
        svcallback("SEARCHOMATIC", embed_search_o_matic);
-       svcallback("START", offer_start_page);
-
+       svcallback("START", offer_start_page); 
        do_template("roombanner");
-       if (navbar_style != navbar_none) {
+       // roombanner contains this for mobile
+       if (navbar_style != navbar_none && !WC->is_mobile) { 
 
                wprintf("<div id=\"navbar\"><ul>");
 
index e21f3046f6d554c292e526da30812fcab53542f0..9315005c97aa66a0debf13eb389b58acdb89bdf7 100644 (file)
@@ -1,3 +1,5 @@
+body {
+}
 #button li {
        display: inline; 
        padding-right: 5px;
@@ -9,13 +11,13 @@ img {
        border: none;
        text-decoration: none;
 }
-#message_list div {
-       border-top: 1px solid black;
-       border-bottom: 1px solid black;
-       background-color: gray;
+#message_list div div {
+       border-bottom: 1px dotted black;
+       padding: 5px 5px 5px 5px;
+       /* background-color: white; */
 }
 .subject {
-       font-style: italic;
+       color: gray;
 }
 body[orient="portrait"] {
        max-width: 320px;
@@ -26,7 +28,10 @@ body {
 }
 .msgview {
        display: none;
-       background-color: white;
+       background-color: white !important;
+}
+.message_content {
+    background-color: white;
 }
 #login_form label, #login_form input, #login_form select, #login_form div{
        display: list-item;
@@ -37,4 +42,24 @@ body {
        display: inline;
        padding-right: 5px;
 }
-
+#navbar ul li img {
+       vertical-align: middle;
+}
+#navbar ul li a {
+       text-decoration: none;
+}
+.sticky {
+    background-color: gray;
+    border: 1px solid black;
+    width: 100%;
+}
+#vcontent {
+}
+.roomname {
+       background-color: #022750;
+       color: white;
+       border-radius: 5px;
+}
+.roomname img{
+       vertical-align: middle;
+}
index 273a6303180ba2c562d37529e3aeaa71fe21474c..331827d183d90914529520b083a70b8fae28ccd3 100644 (file)
@@ -1,6 +1,6 @@
 var currentMsgDisplay = null;
 function CtdlLoadMsgMouseDown(event, msgnum) {
-       if (currentMsgDisplay != null) {
+  /*   if (currentMsgDisplay != null) {
                currentMsgDisplay.style.display = "none";
        } 
        var id = "m_"+msgnum;
@@ -18,7 +18,8 @@ req.onreadystatechange = function (aEvt) {
       currentMsgDisplay.innerHTML = "Error loading message";
   }
 };
-req.send(null);
+req.send(null); */
+  window.location = "/mobilemsg/"+msgnum;
 }
 function CtdlHideMsg() {
        currentMsgDisplay.style.display = "none";
diff --git a/webcit/static/msgcontrols.m.html b/webcit/static/msgcontrols.m.html
new file mode 100644 (file)
index 0000000..9d46757
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title><?CURRENT_USER> - <?SERV_HUMANNODE></title>
+<meta name="MSSmartTagsPreventParsing" content="TRUE" >
+<meta name="keywords" content="groupware messaging collaboration" >
+<link href="/static/mobile.css" rel="stylesheet" type="text/css">
+<script type="text/javascript" src="/static/mobile.js"></script>
+<meta name="viewport" content="width=980, initial-scale = 0.5"/>
+<base href="/"/>
+</head>
+<body>
+<div class="sticky">
+  <div class="mcontrols">
+    <button onmousedown="history.go(-1)">Back to message list</button> <button>Reply to this
+  message</button> <button>Move to trash</button>
+  </div>
+</div>
+<div id="vcontent">
index 2fcfb2edf432531039bec3f977594d1a429c314b..a026fa08c085d12edaab23b0c7513c3fd6491dbe 100644 (file)
@@ -1,13 +1,7 @@
 <!-- start roombanner.html -->
 <div class="room_banner" >
-<?ROOMPIC>
-<h1><?ROOMNAME></h1>
-<?ROOMINFO>
-<p class="nummsgs"><?NUMMSGS></p>
+<h1 class="roomname"><?ROOMPIC> <?ROOMNAME></h1>
+<p><?ROOMINFO> <?NUMMSGS></p>
+<p><?START> <?SEARCHOMATIC></p>
 </div>
-<ul class="room_actions">
-<li class="start_page"><?START></li>
-<li class="search"><?SEARCHOMATIC></li>
-<li class="view"><?VIEWOMATIC></li>
-</ul>
 <!-- end roombanner.html -->
index a21c5316c5709662d47f6a57ebc93beb72f58302..bc0fd53178d7cb2bbbf0ee9226be080f25a0aafe 100644 (file)
@@ -1310,7 +1310,10 @@ int is_mobile_ua(char *user_agent) {
        return 1;
       } else if (strstr(user_agent, "Opera Mobi") != NULL) {
        return 1;
-      }
+      } else if (strstr(user_agent, "Firefox/2.0.0 Opera 9.51 Beta") != NULL) {
+                // For some reason a new install of Opera 9.51beta decided to spoof.
+         return 1;
+         }
       return 0;
 }