Kaynağa Gözat

some minor fixes

ppwwyyxx 11 yıl önce
ebeveyn
işleme
4065a9bbac

+ 3 - 2
lib/static/gen_smiley_css.py

@@ -1,7 +1,7 @@
 #!/usr/bin/env python2
 # -*- coding: UTF-8 -*-
-# File: gen_emoji_css.py
-# Date: Sat Dec 20 17:50:57 2014 +0800
+# File: gen_smiley_css.py
+# Date: Sun Dec 21 23:13:23 2014 +0800
 # Author: Yuxin Wu <[email protected]>
 
 import os
@@ -12,6 +12,7 @@ DIR_PATH = os.path.dirname(os.path.abspath(__file__))
 OUTPUT_FILE = os.path.join(DIR_PATH, 'smiley.css')
 
 HEAD = """.smiley {
+    padding: 1px;
     background-position: -2px -2px;
     background-repeat: norepeat;
     width: 20px;

+ 5 - 2
lib/static/parse_tencent_smiley.py

@@ -1,7 +1,7 @@
 #!/usr/bin/env python2
 # -*- coding: UTF-8 -*-
-# File: parse_tencent_emoji.py
-# Date: Sat Dec 20 17:52:20 2014 +0800
+# File: parse_tencent_smiley.py
+# Date: Sun Dec 21 23:35:36 2014 +0800
 # Author: Yuxin Wu <[email protected]>
 
 import xml.etree.ElementTree as ET
@@ -22,6 +22,9 @@ for child in root:
         assert len(lst) == 105
         for idx, v in enumerate(lst):
             if type(v) == str:
+                # two code appears in the xml.. don't know why
+                v = v.replace('&lt;', '<')
+                v = v.replace('&amp;', '&')
                 v = v.decode('utf-8')
             smileys[v] = idx
 

+ 1 - 0
lib/static/smiley.css

@@ -1,4 +1,5 @@
 .smiley {
+    padding: 1px;
     background-position: -2px -2px;
     background-repeat: norepeat;
     width: 20px;

+ 21 - 17
lib/static/template.html

@@ -4,23 +4,31 @@
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <title>WeChat</title>
   <link rel="stylesheet" type="text/css" href="http://localhost:8000/wx.css">
+  <style type="text/css">
+  .me .avatar {{
+    background-size: 100%;
+    background-image: url("data:image/jpeg;base64,{avatar_me}");
+  }}
+  .you .avatar {{
+    background-size: 100%;
+    background-image: url("data:image/jpeg;base64,{avatar_you}");
+  }}
+  </style>
   {extra_css}
   {extra_js}
 </head>
 
 <body>
   <div id="chat" class="chatPanel normalPanel">
-    <div class="chatContainer" style="min-height:85%;">
-      <div class="chatMainPanel" id="chatMainPanel" style="padding-top:40px;">
-        <div class="chatTitle" style="margin-top: -40px;">
-          <div class="chatNameWrap">
-            <p class="chatName" id="messagePanelTitle">{talker}</p>
-          </div>
+    <div class="chatMainPanel" id="chatMainPanel" style="padding-top:40px;">
+      <div class="chatTitle" style="margin-top: -40px;">
+        <div class="chatNameWrap">
+          <p class="chatName" id="messagePanelTitle">{talker}</p>
         </div>
-        <div class="chatScorll" style="height: 100%; overflow-y: scroll; position: relative; font-family:initial;">
-          <div id="chat_chatmsglist" class="chatContent" style="position: absolute;">
-            {messages}
-          </div>
+      </div>
+      <div class="chatScorll" style="position: relative; font-family:initial;">
+        <div id="chat_chatmsglist" class="chatContent" style="position: absolute;">
+          {messages}
         </div>
       </div>
     </div>
@@ -37,14 +45,10 @@ var playVoice = function(event) {{
 
 $(document).ready(function() {{
     $(".fancybox").fancybox({{
-      // fancybox will otherwise scroll page to top
-      helpers: {{ overlay : {{ locked : false}}}}
-    }});
-
-    // initialize avatar, avoid repeatly inserting the same base64 img into html
-    $('.me .avatar').each(function(_, e) {{ e.src = "data:image/jpg;base64,{avatar_me}"; }})
-    $('.you .avatar').each(function(_, e) {{ e.src = "data:image/jpg;base64,{avatar_you}"; }})
+        // fancybox will otherwise scroll page to top
+helpers: {{ overlay : {{ locked : false}}}}
 }});
+    }});
   </script>
 </body>
 </html>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
lib/static/tencent-smiley.json


+ 2 - 63
lib/static/wx.css

@@ -10,33 +10,6 @@ body {
   text-overflow: ellipsis;
   word-wrap: normal;
 }
-.loadingIcon {
-  height: 20px;
-  width: 20px;
-  margin: 20px auto;
-  background: url(../images/ico_loading11844c2.gif) no-repeat center;
-}
-.chatPanel .unreadDot {
-  position: absolute;
-  background: url(../images/button_chat20067a.png) no-repeat -5px -980px;
-  width: 28px;
-  height: 24px;
-  margin: -7px 0 0 -21px;
-  left: 64px;
-  text-align: center;
-  line-height: 25px;
-  font-size: 12px;
-  color: #FFF;
-  _left: -5px;
-}
-.chatPanel .unreadDotS {
-  position: absolute;
-  left: 45px;
-  top: 1px;
-  width: 19px;
-  height: 19px;
-  background: url(../images/button_chat20067a.png) no-repeat -156px -1008px;
-}
 /* reset */
 html,
 body,
@@ -165,7 +138,6 @@ table {
 html,
 body {
   height: 100%;
-  min-height: 755px;
   background: #4e5359 repeat 0 0;
   color: #666;
   font: 14px/1.5 Helvetica, Arial, Tahoma;
@@ -198,33 +170,6 @@ a:active {
 .lightText {
   color: #ccc;
 }
-.loadingMask {
-  position: absolute;
-  top: 0px;
-  left: 0px;
-  width: 415px;
-  height: 356px;
-  margin-left: -17px;
-  margin-top: -33px;
-  background-color: #000;
-  background: rgba(0, 0, 0, 0.5) url(../images/ico_loading11844c2.gif) no-repeat center;
-  opacity: 0.5;
-  z-index: 101;
-  border-radius: 0px 0px 4px 4px;
-  filter: alpha(opacity=50);
-}
-.loadingMaskWind {
-  margin: auto;
-  width: 100%;
-  height: 100%;
-  border-radius: 4px;
-  -moz-border-radius: 4px;
-  -webkit-border-radius: 4px;
-  background-color: #000;
-  opacity: 0.5;
-  filter: alpha(opacity=50);
-}
-
 .chatPanel .chatScorll::-webkit-scrollbar {
   width: 8px;
   height: 12px;
@@ -1305,7 +1250,7 @@ a.btnSecondary:active {
   /*ie hack*/
   _height: 400px;
 }
-.chatPanel .chatContainer {
+.chatPanel {
   /*background:#fff;*/
   position: relative;
   border-radius: 2px 2px 6px 6px;
@@ -1330,13 +1275,9 @@ a.btnSecondary:active {
   -o-border-radius: 4px 4px 0 0;
   -ms-border-radius: 4px 4px 0 0;
 }
-/*single and group chat*/
-.chatPanel .chatNameWrap {
+.chatPanel .chatName {
   border-radius: 6px 6px 0 0;
   text-align: center;
-  font-size: 16px;
-}
-.chatPanel .chatNameWrap .chatName {
   margin: 0 auto;
   width: 600px;
   white-space: nowrap;
@@ -1396,8 +1337,6 @@ a.btnSecondary:active {
 .chatItem .avatar {
   width: 38px;
   height: 38px;
-  border: 1px solid #ccc\9;
-  border: 1px solid #FFF;
   box-shadow: 0px 1px 0px #B3B6BA;
 }
 .chatItem .cloud {

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor