Skip to content

Instantly share code, notes, and snippets.

@Maxdamantus
Last active July 14, 2016 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Maxdamantus/a2cb39e7e2ab00028916dd3984ee1023 to your computer and use it in GitHub Desktop.
Save Maxdamantus/a2cb39e7e2ab00028916dd3984ee1023 to your computer and use it in GitHub Desktop.
diff --git a/MessagingWidgetsSMSConversation.css b/MessagingWidgetsSMSConversation.css
index abd78db..cd5bbc9 100644
--- a/MessagingWidgetsSMSConversation.css
+++ b/MessagingWidgetsSMSConversation.css
@@ -8,6 +8,11 @@
body {
margin-left: 16px;
margin-right: 16px;
+ font-size: 5px !important;
+}
+
+.MessageTimeStamp {
+ font-family: monospace !important;
}
/**
@@ -18,6 +23,7 @@ div.Message {
padding-bottom: 8px;
display: table;
width: 100%;
+ display: inline !important;
}
div.Message.Other {
@@ -42,7 +48,7 @@ div.BubbleSelf {
margin-right: 0px;
margin-left: 0px;
- display: table-cell;
+// display: table-cell;
/* overflow: hidden; this bugs mouse events. see bug #123077 */
}
@@ -56,7 +62,7 @@ div.BubbleOther {
vertical-align: middle;
padding: 4px 8px;
- display: table-cell;
+// display: table-cell;
min-height: 56px;
/* overflow: hidden; this bugs mouse events. see bug #123077 */
margin-right: 4px;
@@ -66,7 +72,7 @@ div.BubbleSpacer {
padding: 0px;
margin: 0px;
vertical-align: middle;
- display: table-cell;
+// display: table-cell;
height: 52px;
}
@@ -79,7 +85,7 @@ div.BubbleSelfClicked {
text-shadow: 0.1em 0.1em #000;
- display: table-cell;
+// display: table-cell;
/* overflow: hidden; this bugs mouse events. see bug #123077 */
}
@@ -92,7 +98,7 @@ div.BubbleOtherClicked {
vertical-align: middle;
padding: 4px 8px;
- display: table-cell;
+// display: table-cell;
min-height: 56px;
/* overflow: hidden; this bugs mouse events. see bug #123077 */
}
@@ -112,7 +118,7 @@ div.BubbleOtherClicked {
*/
div.Avatar {
- display: table-cell;
+ display: none;
vertical-align: middle;
padding-right: 2px;
width: 64px;
@@ -156,7 +162,7 @@ div.MessageRight {
padding-left: 16px;
white-space: nowrap;
text-align: right;
- display: inline-block;
+ text-size: 10px;
}
img.MessageBusinessCardImg {
diff --git a/MessagingWidgetsSMSConversation.html b/MessagingWidgetsSMSConversation.html
index 43b4824..136ff99 100644
--- a/MessagingWidgetsSMSConversation.html
+++ b/MessagingWidgetsSMSConversation.html
@@ -6,8 +6,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html>
<head>
- <link rel="stylesheet" type="text/css" href="MessagingWidgetsSMSConversation.css"></link>
- <link rel="stylesheet" type="text/css" href="/etc/hildon/theme/css/colors.css" id="ThemeCSSLink"></link>
+ <link rel="stylesheet" type="text/css" href="better.css"></link>
<script type="text/javascript" src="MessagingWidgetsSMSConversation.js"></script>
</head>
@@ -16,14 +15,14 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<body class="DefaultBackgroundColor DefaultTextColor SystemFont" onload="MessagingWidgetsSMSConversation_init()">
<div id="MessageContainerSelf" class="Message Self">
<div id="MessageSelf" class="MessagingBubbleSelfBackgroundColor MessagingBubbleBorderColor BubbleSelf">
- <span id="MessageSenderNameSelf" class="MessageNameField AccentColor2 Self"></span>
- <span id="MessageTextSelf" class="MessageText Self"></span>
<div class="MessageRight Self">
<img id="MessageBusinessCardImgSelf" class="MessageBusinessCardImg" src=""/>
<span id="MessageTimeStampSelf" class="MessageTimeStamp SecondaryTextColor Self SmallSystemFont">12:30 PM</span>
<span id="MessageDeliveryTimeStampSelf" class="MessageDeliveryTimeStamp SecondaryTextColor Self SmallSystemFont"> | 1:30 PM</span>
<img id="MessageStatusImgSelf" class="MessageStatusImg" src=""/>
</div>
+ <span id="MessageSenderNameSelf" class="MessageNameField AccentColor2 Self"></span>
+ <span id="MessageTextSelf" class="MessageText Self"></span>
</div>
</div>
<div id="MessageContainerOther" class="Message Other">
@@ -32,15 +31,15 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
</div>
<div id="MessageOther" class="MessagingBubbleOtherBackgroundColor MessagingBubbleBorderColor BubbleOther">
<div class="BubbleSpacer">
- <img id="MessagePresenceOther" src="" class="MessagePresence"/>
- <span id="MessageSenderNameOther" class="MessageNameField AccentColor1 Other"></span>
- <span id="MessageTextOther" class="MessageText Other"></span>
<div class="MessageRight Other">
<img id="MessageBusinessCardImgOther" class="MessageBusinessCardImg" src=""/>
<span id="MessageTimeStampOther" class="MessageTimeStamp SecondaryTextColor Other SmallSystemFont">12:30 PM</span>
<span id="MessageDeliveryTimeStampOther" class="MessageDeliveryTimeStamp SecondaryTextColor Other SmallSystemFont"> | 1:30 PM</span>
<img id="MessageStatusImgOther" class="MessageStatusImg" src=""/>
</div>
+ <img id="MessagePresenceOther" src="" class="MessagePresence"/>
+ <span id="MessageSenderNameOther" class="MessageNameField AccentColor1 Other"></span>
+ <span id="MessageTextOther" class="MessageText Other"></span>
</div>
</div>
</div>
diff --git a/MessagingWidgetsSMSConversation.js b/MessagingWidgetsSMSConversation.js
index 4646145..c0d4c0b 100644
--- a/MessagingWidgetsSMSConversation.js
+++ b/MessagingWidgetsSMSConversation.js
@@ -293,6 +293,13 @@ MessagingWidgetsRenderer_fixPresence (
}
}
+function fmtDate(str){
+ var dayTime = str.split(" | ");
+ if (dayTime.length != 2)
+ return str;
+ return dayTime[0].split("/").reverse().join("-") + " " + dayTime[1];
+}
+
/**
* MessagingWidgetsRenderer_messageNode:
* @item: The message.
@@ -433,7 +440,8 @@ MessagingWidgetsRenderer_messageNode (item, add_to_top)
bubble_cell.onmouseup = MessagingWidgetsRenderer_messageReleaseBubble;
if (item.name_str != "") {
- name_tag.textContent = item.name_str;
+ //name_tag.textContent = item.name_str;
+ name_tag.textContent = item.self? "<" : ">";
}
message_txt.innerHTML = item.message_str.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
@@ -443,7 +451,7 @@ MessagingWidgetsRenderer_messageNode (item, add_to_top)
}
time_tag.style.display = myShowTimes;
- time_tag.innerHTML = item.time_str;
+ time_tag.textContent = fmtDate(item.time_str);
delivery_time_tag.style.display = myShowTimes;
delivery_time_tag.innerHTML = item.delivery_str;
@@ -866,7 +874,7 @@ function MessagingWidgetsRenderer_setMaxMessages (max)
**/
function MessagingWidgetsRenderer_setCSS (file)
{
- document.getElementById("ThemeCSSLink").href = file;
+// document.getElementById("ThemeCSSLink").href = file;
MessagingWidgetsSMSConversation_alert("set: "+file+" as theme CSS file.");
return;
diff --git a/better.css b/better.css
new file mode 100644
index 0000000..5e064b7
--- /dev/null
+++ b/better.css
@@ -0,0 +1,29 @@
+body {
+ margin: 0px;
+}
+
+div.MessageRight {
+ display: inline;
+}
+
+span.MessageTimeStamp, span.MessageNameField {
+ font-family: monospace;
+}
+
+span.MessageNameField {
+ color: #ff0000;
+}
+
+span.MessageTimeStamp, span.MessageText, span.MessageNameField {
+ font-size: 12px;
+}
+
+div.Message.Self {
+ background-color: #000000;
+ color: #ffffff;
+}
+
+div.Message.Other {
+ background-color: #333333;
+ color: #ffffff;
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment