]> git.mxchange.org Git - friendica.git/commitdiff
preliminary qcomment support, [nosmile] tag to disable smiley processing
authorfriendica <info@friendica.com>
Wed, 15 Feb 2012 07:13:18 +0000 (23:13 -0800)
committerfriendica <info@friendica.com>
Wed, 15 Feb 2012 07:13:18 +0000 (23:13 -0800)
include/bb2diaspora.php
include/bbcode.php
include/conversation.php
include/text.php
view/comment_item.tpl
view/head.tpl
view/theme/duepuntozero/style.css

index 9a29b05a2a8549e5673769739f8efbdf84637bcb..c26b0c33419882c9e6efb0fc2f54247098d9018f 100755 (executable)
@@ -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);
index 1df2ad72523ceb773a85828cf15131a49149bd78..cae867eb8cd8588b35f164a3489c31748c1734f3 100755 (executable)
@@ -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);
index 8a0fd00fb7513796b8a0add36cb80c08862ea091..2ea9b603f2add9d8d784019f7d412802f532d5c5 100755 (executable)
@@ -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)),
index 082d907ff608738211cc3766f887b0331988fe44..0cd7f114e4dee0b8a9a37ba462d3d35da0e1bb28 100755 (executable)
@@ -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;
 }}
index a28fc411a549a33cf61938166356de95a9b39a16..b29735227beab42d8202fd6f17a67f942281c01e 100755 (executable)
                                </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;" >
index 9fe5a63b3b0ac24d78bb02010ef5e49f48c6035a..70d830faa784956087eb9f99ff8b1bd804b01309 100755 (executable)
                }
        }
 
+
+       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();
index fbbcaab688240f4c46c31f031d9c4f3916fa61b9..cf7505ad0f6fe26b4420e4f567d2a29f9077ac6d 100755 (executable)
@@ -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);
+}