aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-14 23:13:18 -0800
committerfriendica <info@friendica.com>2012-02-14 23:13:18 -0800
commit03171fd7deeb8e564478273ebdbee77eeab4a6cd (patch)
tree1eff806720631bcbaf0a119444c9fd1731d37b0b
parentf86593965389e2592ae41c7e7f5cb6dcfc7a660f (diff)
downloadvolse-hubzilla-03171fd7deeb8e564478273ebdbee77eeab4a6cd.tar.gz
volse-hubzilla-03171fd7deeb8e564478273ebdbee77eeab4a6cd.tar.bz2
volse-hubzilla-03171fd7deeb8e564478273ebdbee77eeab4a6cd.zip
preliminary qcomment support, [nosmile] tag to disable smiley processing
-rwxr-xr-xinclude/bb2diaspora.php2
-rwxr-xr-xinclude/bbcode.php5
-rwxr-xr-xinclude/conversation.php5
-rwxr-xr-xinclude/text.php5
-rwxr-xr-xview/comment_item.tpl6
-rwxr-xr-xview/head.tpl12
-rwxr-xr-xview/theme/duepuntozero/style.css14
7 files changed, 45 insertions, 4 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 9a29b05a2..c26b0c334 100755
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -212,7 +212,7 @@ function bb2diaspora($Text,$preserve_nl = false) {
$Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", 'http://vimeo.com/$1',$Text);
-
+ $Text = str_replace('[nosmile]','',$Text);
// oembed tag
// $Text = oembed_bbcode2html($Text);
diff --git a/include/bbcode.php b/include/bbcode.php
index 1df2ad725..cae867eb8 100755
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -174,7 +174,10 @@ upper-alpha;">$2</ul>' ,$Text);
$Text = preg_replace("/\[table border=0\](.*?)\[\/table\]/sm", '<table border="0" >$1</table>' ,$Text);
$Text = str_replace('[hr]','<hr />', $Text);
-
+
+ // This is actually executed in prepare_body()
+
+ $Text = str_replace('[nosmile]','',$Text);
// Check for font change text
$Text = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/sm","<span style=\"font-family: $1;\">$2</span>",$Text);
diff --git a/include/conversation.php b/include/conversation.php
index 8a0fd00fb..2ea9b603f 100755
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -522,6 +522,9 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
}
+// $qcomment = array(':-)','LOL','ROTFL','[smile]');
+ $qcomment = null;
+
if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
$comment = replace_macros($cmnt_tpl,array(
'$return_path' => '',
@@ -529,6 +532,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
'$type' => (($mode === 'profile') ? 'wall-comment' : 'net-comment'),
'$id' => $item['item_id'],
'$parent' => $item['parent'],
+ '$qcomment' => $qcomment,
'$profile_uid' => $profile_owner,
'$mylink' => $a->contact['url'],
'$mytitle' => t('This is you'),
@@ -634,7 +638,6 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
// Build the HTML
$body = prepare_body($item,true);
-
$tmp_item = replace_macros($template,array(
'$type' => implode("",array_slice(split("/",$item['verb']),-1)),
diff --git a/include/text.php b/include/text.php
index 082d907ff..0cd7f114e 100755
--- a/include/text.php
+++ b/include/text.php
@@ -878,7 +878,10 @@ function prepare_text($text) {
require_once('include/bbcode.php');
- $s = smilies(bbcode($text));
+ if(stristr($text,'[nosmile]'))
+ $s = bbcode($text);
+ else
+ $s = smilies(bbcode($text));
return $s;
}}
diff --git a/view/comment_item.tpl b/view/comment_item.tpl
index a28fc411a..b29735227 100755
--- a/view/comment_item.tpl
+++ b/view/comment_item.tpl
@@ -12,6 +12,12 @@
</div>
<div class="comment-edit-photo-end"></div>
<textarea id="comment-edit-text-$id" class="comment-edit-text-empty" name="body" onFocus="commentOpen(this,$id);" onBlur="commentClose(this,$id);" >$comment</textarea>
+ {{ if $qcomment }}
+ {{ for $qcomment as $qc }}
+ <span class="fakelink qcomment" onclick="commentInsert(this,$id); return false;" >$qc</span>
+ &nbsp;
+ {{ endfor }}
+ {{ endif }}
<div class="comment-edit-text-end"></div>
<div class="comment-edit-submit-wrapper" id="comment-edit-submit-wrapper-$id" style="display: none;" >
diff --git a/view/head.tpl b/view/head.tpl
index 9fe5a63b3..70d830faa 100755
--- a/view/head.tpl
+++ b/view/head.tpl
@@ -46,6 +46,18 @@
}
}
+
+ function commentInsert(obj,id) {
+ var tmpStr = $("#comment-edit-text-" + id).val();
+ if(tmpStr == '$comment') {
+ tmpStr = '';
+ $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ openMenu("comment-edit-submit-wrapper-" + id);
+ }
+ $("#comment-edit-text-" + id).val(tmpStr + $(obj).html());
+ }
+
function showHideComments(id) {
if( $('#collapsed-comments-' + id).is(':visible')) {
$('#collapsed-comments-' + id).hide();
diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css
index fbbcaab68..cf7505ad0 100755
--- a/view/theme/duepuntozero/style.css
+++ b/view/theme/duepuntozero/style.css
@@ -2953,3 +2953,17 @@ div.jGrowl div.info {
color: #ffffff;
padding-left: 58px;
}
+
+.qcomment {
+ border: 1px solid #EEE;
+ padding: 3px;
+}
+
+.qcomment {
+ opacity: 0;
+ filter:alpha(opacity=0);
+}
+.qcomment:hover {
+ opacity: 1.0;
+ filter:alpha(opacity=100);
+}