]> git.mxchange.org Git - friendica.git/commitdiff
show members of locked conversations
authorMike Macgirvin <mike@macgirvin.com>
Thu, 30 Sep 2010 05:11:26 +0000 (22:11 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Thu, 30 Sep 2010 05:11:26 +0000 (22:11 -0700)
include/main.js
include/nav.php
index.php
mod/display.php
mod/lockview.php [new file with mode: 0644]
mod/network.php
mod/profile.php
view/theme/default/style.css

index fcb6677d32a379eca640078de3b92e39ff294ace..6d743c4f4922c01dc7429c7baa9332bfb7174360 100644 (file)
                $(node).css('height',16);
        }
 
-       // Since ajax is asynchronous, we will give a few seconds for
-       // the first ajax call (setting like/dislike), then run the
-       // updater to pick up any changes and display on the page.
+       // Since our ajax calls are asynchronous, we will give a few 
+       // seconds for the first ajax call (setting like/dislike), then 
+       // run the updater to pick up any changes and display on the page.
        // The updater will turn any rotators off when it's done. 
        // This function will have returned long before any of these
        // events have completed and therefore there won't be any
                if(timer) clearTimeout(timer);
                timer = setTimeout(NavUpdate,3000);
        }
+
+       function getPosition(e) {
+               e = e || window.event;
+               var cursor = {x:0, y:0};
+               if ( e.pageX > 0 || e.pageY > 0 ) {
+                       cursor.x = e.pageX;
+                       cursor.y = e.pageY;
+               }
+               else {
+                       if( e.clientX > 0 || e.clientY > 0 ) {
+                               cursor.x = e.clientX;
+                               cursor.y = e.clientY;
+                       }
+                       else {
+                               if( e.x > 0 || e.y > 0 ) {
+                                       cursor.x = e.x;
+                                       cursor.y = e.y;
+                               }
+                       }
+               }
+               return cursor;
+       }
+
+       var lockvisible = false;
+
+       function lockview(event,id) {
+               if(lockvisible) {
+                       lockviewhide();
+               }
+               else {
+                       lockvisible = true;
+                       $.get('lockview/' + id, function(data) {
+                               cursor = getPosition(event);
+                               $('#panel').html(data);
+                               $('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
+                               $('#panel').show();
+                       });
+               }
+       }
+
+       function lockviewhide() {
+               lockvisible = false;
+               $('#panel').hide();
+       }
+
index 7f6aea17f447904e0e8c4df296c46f3f629f1474..48b935aae3dea1ca5cc17130fde3d397fe7ac39f 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+$a->page['nav'] .= '<div id="panel" style="display: none;"></div>' ;
+
 if(x($_SESSION['uid'])) {
                $a->page['nav'] .= '<a id="nav-logout-link" class="nav-link" href="logout">' . t('Logout') . "</a>\r\n";
 }
index 898a1c37a30c3b474bfaa6dbd353084dbdc4acc5..f86fbe13843802bc3d08abf125070f819be51c1e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -86,7 +86,8 @@ if(x($_SESSION,'sysmsg')) {
 
 // Feel free to comment out this line on production sites.
 $a->page['content'] .= $debug_text;
-$a->page['content'] .= '<div id="pause"></div>';
+
+$a->page['content'] .=  '<div id="pause"></div>';
 // build page
 
 
index d0bbf54bf0d3ae846cf0ce53666f4393e0d7f9c0..451b9d64437c5957bac446280116edadb269b87f 100644 (file)
@@ -151,10 +151,9 @@ function display_content(&$a) {
 
                        $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
                                || strlen($item['deny_cid']) || strlen($item['deny_gid']))
-                               ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" alt="Private Message" /></div>'
+                               ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
                                : '<div class="wall-item-lock"></div>');
 
-
                        if(can_write_wall($a,$a->profile['uid'])) {
                                if($item['last-child']) {
                                        $comment = replace_macros($cmnt_tpl,array(
diff --git a/mod/lockview.php b/mod/lockview.php
new file mode 100644 (file)
index 0000000..b8f4318
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+
+
+function lockview_content(&$a) {
+
+       $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
+       if(! $item_id)
+               killme();
+
+       $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
+               intval($item_id)
+       );
+       if(! count($r))
+               killme();
+       $item = $r[0];
+       if($item['uid'] != local_user())
+               killme();
+
+
+       $allowed_users = expand_acl($item['allow_cid']);
+       $allowed_groups = expand_acl($item['allow_gid']);
+       $deny_users = expand_acl($item['deny_cid']);
+       $deny_groups = expand_acl($item['deny_gid']);
+
+       $o = t('Visible to:') . '<br />';
+       $l = array();
+
+       if(count($allowed_groups)) {
+               $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
+                       dbesc(implode(', ', $allowed_groups))
+               );
+               if(count($r))
+                       foreach($r as $rr) 
+                               $l[] = '<b>' . $rr['name'] . '</b>';
+       }
+       if(count($allowed_users)) {
+               $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
+                       dbesc(implode(', ',$allowed_users))
+               );
+               if(count($r))
+                       foreach($r as $rr) 
+                               $l[] = $rr['name'];
+
+       }
+
+       if(count($deny_groups)) {
+               $r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
+                       dbesc(implode(', ', $deny_groups))
+               );
+               if(count($r))
+                       foreach($r as $rr) 
+                               $l[] = '<b><strike>' . $rr['name'] . '</strike></b>';
+       }
+       if(count($deny_users)) {
+               $r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
+                       dbesc(implode(', ',$deny_users))
+               );
+               if(count($r))
+                       foreach($r as $rr) 
+                               $l[] = '<strike>' . $rr['name'] . '</strike>';
+
+       }
+
+       echo $o . implode(', ', $l);
+       killme();
+
+}
index b0daecac43ba84f301baa8d39b58319b50312f12..ac5664b4fc173eb2e64d985961209e313e48e050 100644 (file)
@@ -173,13 +173,11 @@ function network_content(&$a, $update = 0) {
                        if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) 
                                continue;
 
-
                        $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
                                || strlen($item['deny_cid']) || strlen($item['deny_gid']))
-                               ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" alt="Private Message" /></div>'
+                               ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
                                : '<div class="wall-item-lock"></div>');
 
-
                        // Top-level wall post not written by the wall owner (wall-to-wall)
                        // First figure out who owns it. 
 
index bf9c0f758326989100182ecd04e5939a8e54ddda..de0ae5745a3b31c73327c113c6af41fff3ae90b4 100644 (file)
@@ -309,12 +309,9 @@ function profile_content(&$a, $update = 0) {
 
                        $lock = (($item['uid'] == get_uid()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
                                || strlen($item['deny_cid']) || strlen($item['deny_gid']))
-                               ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" alt="Private Message" /></div>'
+                               ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
                                : '<div class="wall-item-lock"></div>');
 
-
-
-
                        if(can_write_wall($a,$a->profile['profile_uid'])) {
                                if($item['id'] == $item['parent']) {
                                        $likebuttons = replace_macros($like_tpl,array('$id' => $item['id']));
index 90bd3f8c22408fb7230c15f1f8b230c6e7bb94e4..bd147131cdd8919b78ab4d035dd904278f3e9cf1 100644 (file)
@@ -16,6 +16,9 @@ a:hover {
        margin-top: 15px;
        margin-bottom: 15px;
 }
+.lockview {
+       cursor: pointer;
+}
 
 .fakelink:hover {
        color: #0000FF;
@@ -46,6 +49,16 @@ img {
        top: 12px;
        left: 42%;
 }
+
+#panel {
+       background-color: ivory;
+       position: absolute;
+       z-index: 2;
+       width: 30%;
+       padding: 25px;
+       border: 1px solid #444;
+}
+
 code {
        font-family: monospace;
        white-space: pre;