This commit is contained in:
friendica 2014-02-02 14:07:33 -08:00
commit cf85fec919
4 changed files with 44 additions and 20 deletions

View File

@ -889,8 +889,8 @@ function smilies($s, $sample = false) {
|| (local_user() && intval(get_pconfig(local_user(),'system','no_smilies'))))
return $s;
$s = preg_replace_callback('{<(pre|code)>(?<target>.*?)</\1>}ism','smile_encode',$s);
$s = preg_replace_callback('/<[a-z]+ (?<target>.*?)>/ism','smile_encode',$s);
$s = preg_replace_callback('{<(pre|code)>.*?</\1>}ism','smile_shield',$s);
$s = preg_replace_callback('/<[a-z]+ .*?>/ism','smile_shield',$s);
$texts = array(
'&lt;3',
@ -981,20 +981,18 @@ function smilies($s, $sample = false) {
$s = str_replace($params['texts'],$params['icons'],$params['string']);
}
$s = preg_replace_callback(
'/<!--base64:(.*?)-->/ism',
function ($m) { return base64url_decode($m[1]); },
$s
);
$s = preg_replace_callback('/<!--base64:(.*?)-->/ism', 'smile_unshield', $s);
return $s;
}
function smile_shield($m) {
return '<!--base64:' . base64url_encode($m[0]) . '-->';
}
function smile_encode($m) {
$cleartext = $m['target'];
return str_replace($cleartext,'<!--base64:' . base64url_encode($cleartext) . '-->',$m[0]);
function smile_unshield($m) {
return base64url_decode($m[1]);
}
// expand <3333 to the correct number of hearts

31
view/css/mod_chat.css Normal file
View File

@ -0,0 +1,31 @@
.chatContainer {
height: 100%;
width: 100%;
}
.chatTopBar {
float: left;
height: 400px;
width: 650px;
overflow-y: auto;
}
.chatUsers {
float: right;
width: 120px;
height: 100%;
border: 1px solid #000;
}
.chatBottomBar {
position: relative;
bottom: 0;
height: 150px;
margin-top: 20px;
}
section {
padding-bottom: 0;
}

View File

@ -44,7 +44,7 @@ a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link {
text-decoration: none;
}
a:hover, .fakelink:hover { color: #44AAFF; text-decoration: underline; }
a:hover, .fakelink:hover { color: $link_colour; text-decoration: underline; }
.fakelink {
cursor: pointer;

View File

@ -1,14 +1,14 @@
<h1>{{$room_name}}</h1>
<div id="chatContainer" style="height: 100%; width: 100%;">
<div id="chatContainer"">
<div id="chatTopBar" style="float: left; height: 400px; width: 650px; overflow-y: auto;">
<div id="chatTopBar">
<div id="chatLineHolder"></div>
</div>
<div id="chatUsers" style="float: right; width: 120px; height: 100%; border: 1px solid #000;" ></div>
<div id="chatUsers"></div>
<div class="clear"></div>
<div id="chatBottomBar" style="position: relative; bottom: 0; height: 150px; margin-top: 20px;">
<div id="chatBottomBar">
<div class="tip"></div>
<form id="chat-form" method="post" action="#">
@ -22,11 +22,6 @@
</div>
</div>
<style>
section {
padding-bottom: 0;
}
</style>
<script>
var room_id = {{$room_id}};