diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-10 16:32:05 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-10 16:32:05 +0000 |
commit | 9456cf380a51d4863dd0ee96499763bb32f54284 (patch) | |
tree | 510773dbfd611deb6c399958e728f735d16a2ed2 /mod/riverdashboard/views/default/riverdashboard | |
parent | 90c80171f9f089b4f2448c496e72d33432b5d724 (diff) | |
download | elgg-9456cf380a51d4863dd0ee96499763bb32f54284.tar.gz elgg-9456cf380a51d4863dd0ee96499763bb32f54284.tar.bz2 |
the beginnings of a new activity river with ajax notification and conversation clustering.
git-svn-id: http://code.elgg.org/elgg/trunk@5344 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/riverdashboard/views/default/riverdashboard')
5 files changed, 371 insertions, 157 deletions
diff --git a/mod/riverdashboard/views/default/riverdashboard/container.php b/mod/riverdashboard/views/default/riverdashboard/container.php index f4bfd7f83..a72de9fc4 100644 --- a/mod/riverdashboard/views/default/riverdashboard/container.php +++ b/mod/riverdashboard/views/default/riverdashboard/container.php @@ -1,5 +1,52 @@ -<?php - -?> - -<div id="river_container"><?php echo $vars['body']; ?></div>
\ No newline at end of file +<div id="river_container"><?php echo $vars['body']; ?></div><!-- /river_container -->
+
+<script type="text/JavaScript">
+$(document).ready(function(){
+ var updates = new thewireUpdateChecker(10000);
+ updates.start();
+});
+
+// check for updates on the wire.
+function thewireUpdateChecker(interval) {
+ this.intervalID = null;
+ this.interval = interval;
+ this.url = '<?php echo $vars['url']; ?>mod/riverdashboard/endpoint/ping.php';
+ this.seconds_passed = 0;
+
+ this.start = function() {
+ // needed to complete closure scope.
+ var self = this;
+
+ this.intervalID = setInterval(function() { self.checkUpdates(); }, this.interval);
+ }
+
+ this.checkUpdates = function() {
+ this.seconds_passed += this.interval / 1000;
+ // more closure fun
+ var self = this;
+ $.ajax({
+ 'type': 'GET',
+ 'url': this.url,
+ 'data': {'seconds_passed': this.seconds_passed},
+ 'success': function(data) {
+ if (data) {
+ $('#the-wire-updates-notice').html(data).slideDown();
+ // could crank down the interval here.
+ // if we change the message to simply "New Posts!"
+ // we could stop the polling altogether.
+ }
+ }
+ })
+ }
+
+ this.stop = function() {
+ clearInterval(this.interval);
+ }
+
+ this.changeInterval = function(interval) {
+ this.stop();
+ this.interval = interval;
+ this.start();
+ }
+}
+</script>
diff --git a/mod/riverdashboard/views/default/riverdashboard/css.php b/mod/riverdashboard/views/default/riverdashboard/css.php index d9c36f048..d558b215a 100644 --- a/mod/riverdashboard/views/default/riverdashboard/css.php +++ b/mod/riverdashboard/views/default/riverdashboard/css.php @@ -3,77 +3,13 @@ /** * Elgg riverdashboard CSS * - * @package riverdashboard - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.org/ */ ?> -.sidebarBox #thewire_sidebarInputBox { - width:178px; -} -.sidebarBox .last_wirepost { - margin:20px 0 20px 0; -} -.sidebarBox .last_wirepost .thewire-singlepage { - margin:0; -} -.sidebarBox .last_wirepost .thewire-singlepage .thewire_options { - display:none; -} -.sidebarBox .last_wirepost .thewire-singlepage .note_date { - line-height: 1em; - padding:3px 0 0 0; - width:142px; -} -.sidebarBox .last_wirepost .thewire-singlepage .note_body { - color:#666666; - line-height: 1.2em; -} -.sidebarBox .last_wirepost .thewire-singlepage .thewire-post { - background-position: 130px bottom; -} -.sidebarBox .thewire_characters_remaining { - float:right; -} -.sidebarBox input.thewire_characters_remaining_field { - background: #dedede; -} -.sidebarBox input.thewire_characters_remaining_field:focus { - background: #dedede; - border:none; -} -.sidebarBox input#thewire_submit_button { - margin:2px 0 0 0; - padding:2px 2px 1px 2px; - height:auto; -} -.sidebarBox .membersWrapper { - background: white; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - padding:7px; -} -.sidebarBox .membersWrapper .recentMember { - margin:2px; - float:left; -} -.sidebarBox .membersWrapper .recentMember .usericon img { - width:25px; - height:25px; -} -/* br necessary for ie6 & 7 */ -.sidebarBox .membersWrapper br { - height:0; - line-height:0; -} -.welcomemessage { - background:white; -} + .riverdashboard_filtermenu { margin:10px 0 10px 0; + float:right; } .river_pagination .forward, @@ -107,26 +43,31 @@ *:first-child+html .river_pagination { margin-top:17px; } /* activity widget */ -.collapsable_box_content .river_item p { - color:#333333; -} - .collapsable_box_content .content_area_user_title h2 { - font-size:1.25em; - line-height:1.2em; - margin:0; - padding:0 0 2px 0; - color:#4690d6; + font-size:1.0em; } +.collapsable_box_content .ContentWrapper.ActivityWidget { + +} + .river_content img { margin:2px 0 2px 20px; } +.river_content_title { + margin-left:55px; + +} +.river_content_title a { + font-weight: bold; + /* color:#333333; */ +} + .river_content_display { - border-left:1px solid #ddd; - padding:2px 10px 0 10px; + border-left:1px solid #DDDDDD; font-size:90%; - margin:4px 0 2px 30px; + margin:8px 0 6px 55px; + padding-left:5px; } .river_content_display p { @@ -136,13 +77,219 @@ .following_icon { width:20px; - height:40px; + height:25px; margin:0 2px 0 2px; - background: url(<?php echo $vars['url']; ?>mod/riverdashboard/graphics/follow_icon.png) no-repeat left top; + background: url(<?php echo $vars['url']; ?>mod/riverdashboard/graphics/follow_icon.png) no-repeat left -7px; } .river_content_display div.usericon a.icon img { - width:40px; - height:40px; + width:25px; + height:25px; +} + + +/* *************************************** + ACTIVITY RIVER +*************************************** */ +.river_item_list { + border-top:1px solid #cccccc; +} +.river_item p { + margin:0; +} +.river_item { + border-bottom:1px solid #cccccc; + padding:7px 0 10px 0; +/* + margin-top:5px; + margin-bottom:5px; +*/ } +.river_item_annotation { + +} +span.more_comments { + +} +.river_more_comments { + display:block; + float:right; + padding:2px 4px 7px 30px; + text-align:right; + width:auto; +} +.river_comments { + margin:5px 0 0 55px; + width:auto; +} +.comment_wrapper { + margin-left:34px; +} +.comment_link { + margin-left:55px; +} + +.river_comment_owner_icon { + float:left; + margin:0 8px 4px 2px; +} + +.river_comment { + background-color: #f8f8f8; + padding:3px; + margin-bottom:3px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; +} +.river_comment.penultimate { + background-color: #eeeeee; +} +.river_comment.latest { + background-color: #dedede; + margin-bottom:0; +} + +.river_item_time { + font-size:90%; + color:#666666; +} +.river_item .river_item_useravatar { + float:left; + margin:3px 0 0 1px; +} +/* IE6 fix */ +* html .river_item p { + /* padding:3px 0 3px 20px; */ +} +/* IE7 */ +*:first-child+html .river_item p { + /* min-height:17px; */ +} + +/* .river_object_blog_update, */ + +.river_object_blog_create, +.river_object_page_create, +.river_object_page_update { + float:left; + width:26px; + height:32px; + border:none; + background-color: transparent; + margin-right:6px; + margin-top:2px; +} +.river_object_blog_create { + background-image: url(<?php echo $vars['url']; ?>mod/riverdashboard/graphics/icon_activity_blogs.png); + background-position: left top; + background-repeat: no-repeat; +} +.river_object_page_create, +.river_object_page_update { + background-image: url(<?php echo $vars['url']; ?>mod/riverdashboard/graphics/icon_activity_pages.png); + background-position: left top; + background-repeat: no-repeat; +} + + +.collapsable_box_content .river_user_update { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_user_profileupdate { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_user_profileiconupdate { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_annotate { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_bookmarks_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_bookmarks.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_bookmarks_comment { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_status_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_status.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_file_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_files.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_file_update { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_files.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_file_comment { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_widget_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_forums_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_forums_update { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_widget_update { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_blog_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_blog_update { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_blog_comment { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_forumtopic_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; +} +.collapsable_box_content .river_user_friend { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_relationship_friend_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_relationship_member_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_thewire_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_thewire.gif) no-repeat left -1px; +} +.collapsable_box_content .river_group_join { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_groupforumtopic_annotate { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_groupforumtopic_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_sitemessage_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px; +} +.collapsable_box_content .river_user_messageboard { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_page_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_page_update { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_page_top_create { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_page_top_update { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_page_top_comment { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +} +.collapsable_box_content .river_object_page_comment { + background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +} + diff --git a/mod/riverdashboard/views/default/riverdashboard/menu.php b/mod/riverdashboard/views/default/riverdashboard/menu.php new file mode 100644 index 000000000..44084cec9 --- /dev/null +++ b/mod/riverdashboard/views/default/riverdashboard/menu.php @@ -0,0 +1,28 @@ +<?php
+/**
+ * Elgg activity stream menu
+ */
+$allselect = ''; $friendsselect = ''; $mineselect = ''; $display_option = '';
+switch($vars['orient']) {
+ case 'all': $allselect = 'class="selected"';
+ break;
+ case 'friends': $friendsselect = 'class="selected"';
+ $display_option = '&display=friends';
+ break;
+ case 'mine': $mineselect = 'class="selected"';
+ $display_option = '&display=mine';
+ break;
+}
+?>
+<div id="Submenu"><ul>
+<?php
+ if(isloggedin()){
+?>
+ <li <?php echo $allselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/"><?php echo elgg_echo('all'); ?></a></li>
+ <li <?php echo $friendsselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/?display=friends"><?php echo elgg_echo('friends'); ?></a></li>
+ <li <?php echo $mineselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/?display=mine"><?php echo elgg_echo('mine'); ?></a></li>
+
+<?php
+ }
+?>
+</ul></div>
\ No newline at end of file diff --git a/mod/riverdashboard/views/default/riverdashboard/nav.php b/mod/riverdashboard/views/default/riverdashboard/nav.php index 43d5723ca..db868db51 100644 --- a/mod/riverdashboard/views/default/riverdashboard/nav.php +++ b/mod/riverdashboard/views/default/riverdashboard/nav.php @@ -1,54 +1,53 @@ -<?php - - $contents = array(); - $contents['all'] = 'all'; - if (!empty($vars['config']->registered_entities)) { - foreach ($vars['config']->registered_entities as $type => $ar) { - foreach ($vars['config']->registered_entities[$type] as $object) { - if (!empty($object )) { - $keyname = 'item:'.$type.':'.$object; - } else $keyname = 'item:'.$type; - $contents[$keyname] = "{$type},{$object}"; - } - } - } - - $allselect = ''; $friendsselect = ''; $mineselect = ''; - switch($vars['orient']) { - case '': $allselect = 'class="selected"'; - break; - case 'friends': $friendsselect = 'class="selected"'; - break; - case 'mine': $mineselect = 'class="selected"'; - break; - } - -?> - -<div class="contentWrapper"> - <div id="elgg_horizontal_tabbed_nav"> - <ul> - <li <?php echo $allselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&callback=true'); return false;" href="?display="><?php echo elgg_echo('all'); ?></a></li> - <li <?php echo $friendsselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?display=friends&content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&callback=true'); return false;" href="?display=friends"><?php echo elgg_echo('friends'); ?></a></li> - <li <?php echo $mineselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?display=mine&content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&callback=true'); return false;" href="?display=mine"><?php echo elgg_echo('mine'); ?></a></li> - </ul> - </div> - - <div class="riverdashboard_filtermenu"> - <select name="content" id="content" onchange="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?callback=true&display='+$('input#display').val() + '&content=' + $('select#content').val());"> - <?php - - foreach($contents as $label => $content) { - if (("{$vars['type']},{$vars['subtype']}" == $content) || - (empty($vars['subtype']) && $content == 'all')) { - $selected = 'selected="selected"'; - } else $selected = ''; - echo "<option value=\"{$content}\" {$selected}>".elgg_echo($label)."</option>"; - } - - ?> - </select> - <input type="hidden" name="display" id="display" value="<?php echo htmlentities($vars['orient']); ?>" /> - <!-- <input type="submit" value="<?php echo elgg_echo('filter'); ?>" /> --> - </div> -<!-- </div> --> +<?php
+
+$contents = array();
+$contents['all'] = 'all';
+if (!empty($vars['config']->registered_entities)) {
+ foreach ($vars['config']->registered_entities as $type => $ar) {
+ foreach ($vars['config']->registered_entities[$type] as $object) {
+ if($object != 'helppage'){
+ if (!empty($object )) {
+ $keyname = 'item:'.$type.':'.$object;
+ } else $keyname = 'item:'.$type;
+ $contents[$keyname] = "{$type},{$object}";
+ }
+ }
+ }
+}
+
+$allselect = ''; $friendsselect = ''; $mineselect = ''; $display_option = '';
+switch($vars['orient']) {
+ case '': $allselect = 'class="selected"';
+ break;
+ case 'friends': $friendsselect = 'class="selected"';
+ $display_option = '&display=friends';
+ break;
+ case 'mine': $mineselect = 'class="selected"';
+ $display_option = '&display=mine';
+ break;
+}
+?>
+<div class="ContentWrapper">
+ <div class="riverdashboard_filtermenu">
+ <?php
+ $location_filter = "<select onchange=\"window.open(this.options[this.selectedIndex].value,'_top')\" name=\"file_filter\" class='Notstyled' >";
+ $current = get_input('subtype');
+ foreach($contents as $label => $content) {
+ $get_values = explode(",", $content);
+ //select the current filter
+ if($get_values[1] == $current)
+ $selected = "SELECTED";
+ //set the drop down filter
+ if($content[0] && $content[1])
+ $location_filter .= "<option {$selected} class='Nomenuoption' value=\"{$CONFIG->url}mod/riverdashboard/index.php?type={$get_values[0]}&subtype={$get_values[1]}{$display_option}\" >" . elgg_echo($label) . "</option>";
+ //reset selected
+ $selected = '';
+ }
+ $location_filter .= "</select>";
+ echo $location_filter;
+ ?>
+ <input type="hidden" name="display" id="display" value="<?php echo htmlentities($vars['orient']); ?>" />
+ </div>
+<!-- </div> don't close ContentWrapper here, it happens later -->
+
+<div id="the-wire-updates-notice" class="ContentWrapper clearfloat"></div>
diff --git a/mod/riverdashboard/views/default/riverdashboard/welcome.php b/mod/riverdashboard/views/default/riverdashboard/welcome.php index 23541c0ac..ac809c2a0 100644 --- a/mod/riverdashboard/views/default/riverdashboard/welcome.php +++ b/mod/riverdashboard/views/default/riverdashboard/welcome.php @@ -1,17 +1,10 @@ -<?php - - /** - * Elgg thewire view page - * - * @package ElggTheWire - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - */ - -?> -<div id="content_area_user_title"> -<h2><?php echo sprintf(elgg_echo('welcome:user'), $_SESSION['user']->name); ?></h2> +<?php
+
+ /**
+ * Elgg thewire view page
+ */
+
+?>
+<div id="content_area_user_title">
+<h2><?php echo sprintf(elgg_echo('welcome:user'), $_SESSION['user']->name); ?></h2>
</div>
\ No newline at end of file |