diff options
author | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-08 15:45:41 +0000 |
---|---|---|
committer | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-08 15:45:41 +0000 |
commit | 21e4f3681d9f936af24e6a44868628ceeb53ddf9 (patch) | |
tree | 419674d729dfeaa389a6159ca8e9a4bdeed5fda8 /mod/thewire/views | |
parent | fd75f66c772983c871ee5ed06d702dbb24ecac07 (diff) | |
download | elgg-21e4f3681d9f936af24e6a44868628ceeb53ddf9.tar.gz elgg-21e4f3681d9f936af24e6a44868628ceeb53ddf9.tar.bz2 |
Updates to thewire interface
git-svn-id: http://code.elgg.org/elgg/trunk@5302 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/thewire/views')
-rw-r--r-- | mod/thewire/views/default/object/thewire.php | 105 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/css.php | 168 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/forms/add.php | 38 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/profile_status.php | 10 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/scripts/counter.js | 16 |
5 files changed, 133 insertions, 204 deletions
diff --git a/mod/thewire/views/default/object/thewire.php b/mod/thewire/views/default/object/thewire.php index 3e8e53124..738ab96ba 100644 --- a/mod/thewire/views/default/object/thewire.php +++ b/mod/thewire/views/default/object/thewire.php @@ -1,9 +1,9 @@ <?php /** - * Elgg thewire note view + * Elgg Wire Posts Listings * - * @package ElggTheWire + * @package thewire * @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 @@ -14,89 +14,54 @@ * @uses $vars['entity'] Optionally, the note to view */ - if (isset($vars['entity'])) { - - $user_name = $vars['entity']->getOwnerEntity()->name; - - //if the note is a reply, we need some more info - - $note_url = ''; - $note_owner = elgg_echo("thewire:notedeleted"); - +if (isset($vars['entity'])) { + $user_name = $vars['entity']->getOwnerEntity()->name; + + //if the note is a reply, we need some more info + $note_url = ''; + $note_owner = elgg_echo("thewire:notedeleted"); ?> -<div class="thewire-singlepage"> - <div class="thewire-post"> - - <!-- the actual shout --> - <div class="note_body"> +<div class="wire_post"> + <div class="wire_post_contents clearfloat radius8"> - <div class="thewire_icon"> + <div class="wire_post_icon"> <?php - echo elgg_view("profile/icon",array('entity' => $vars['entity']->getOwnerEntity(), 'size' => 'small')); + echo elgg_view("profile/icon",array('entity' => $vars['entity']->getOwnerEntity(), 'size' => 'tiny')); ?> </div> - <div class="thewire_options"> - - <a href="<?php echo $vars['url']; ?>mod/thewire/add.php?wire_username=<?php echo $vars['entity']->getOwnerEntity()->username; ?>" class="reply"><?php echo elgg_echo('thewire:reply'); ?></a> - <?php -/* //only have a reply option for main notes, not other replies - if($vars['entity']->parent == 0){ - ?> - <a href="<?php echo $vars['url']; ?>mod/thewire/reply.php?note_id=<?php echo $vars['entity']->guid; ?>" class="reply">reply</a> - <?php - } -*/ - ?> - <div class="clearfloat"></div> - <?php - - // if the user looking at thewire post can edit, show the delete link + <div class="wire_post_options"> + <a href="<?php echo $vars['url']; ?>mod/thewire/add.php?wire_username=<?php echo $vars['entity']->getOwnerEntity()->username; ?>" class="action_button reply small"><?php echo elgg_echo('thewire:reply'); ?></a> + <?php + // if the user looking at thewire post can edit, show the delete link if ($vars['entity']->canEdit()) { - - - echo "<div class='delete_note'>" . elgg_view("output/confirmlink",array( - 'href' => $vars['url'] . "action/thewire/delete?thewirepost=" . $vars['entity']->getGUID(), - 'text' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm'), - )) . "</div>"; - - } //end of can edit if statement - ?> + echo "<div class='delete_button'>" . elgg_view("output/confirmlink",array( + 'href' => $vars['url'] . "action/thewire/delete?thewirepost=" . $vars['entity']->getGUID(), + 'text' => elgg_echo('delete'), + 'confirm' => elgg_echo('deleteconfirm'), + )) . "</div>"; + } + ?> </div> - - - <?php - echo "<b>{$user_name}: </b>"; - - - $desc = $vars['entity']->description; - - $desc = preg_replace('/\@([A-Za-z0-9\_\.\-]*)/i','@<a href="' . $vars['url'] . 'pg/thewire/$1">$1</a>',$desc); - echo parse_urls($desc); - ?> - - <div class="clearfloat"></div> - </div> - <div class="note_date"> - - <?php - + <div class="wire_post_info"> + <a href="<?php echo $vars['url']; ?>pg/thewire/<?php echo $vars['entity']->getOwnerEntity()->username; ?>"><?php echo $user_name; ?></a> + <?php + $desc = $vars['entity']->description; + $desc = preg_replace('/\@([A-Za-z0-9\_\.\-]*)/i','@<a href="' . $vars['url'] . 'pg/thewire/$1">$1</a>',$desc); + echo parse_urls($desc); + ?> + <p class="entity_subtext"> + <?php echo elgg_echo("thewire:wired") . " " . sprintf(elgg_echo("thewire:strapline"), friendly_time($vars['entity']->time_created) ); - echo " via " . elgg_echo($vars['entity']->method) . "."; - - ?> + ?> + </p> </div> - - </div> </div> <?php - - } - +} ?>
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/css.php b/mod/thewire/views/default/thewire/css.php index 6491af2ed..9f460458d 100644 --- a/mod/thewire/views/default/thewire/css.php +++ b/mod/thewire/views/default/thewire/css.php @@ -11,126 +11,90 @@ */ ?> -/* widget */ -.thewire-singlepage { - margin:0 10px 0 10px; +/* new wire post form */ +.new_wire_post { + margin:10px 0 15px 0; + padding-bottom:15px; + border-bottom: 1px solid #dedede; } -.thewire-singlepage .note_body { +.new_wire_post input[type="submit"] { + margin:3px 0 0 0; + float:right; +} +.new_wire_post textarea { + width: 719px; + height: 52px; + padding: 2px 5px 5px 5px; + font-size: 120%; + color:#333333; +} +.character_count { + width: 642px; + color:#666666; +} +.character_count input { + color:#666666; + border:none; + font-size: 100%; + font-weight: bold; + padding:0 2px 0 0; + margin:0; + text-align: right; background: white; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; } -.collapsable_box_content .note_body { - line-height:1.2em; +.character_count input:focus { + border:none; + background:white; } -.thewire-singlepage .thewire-post { + + +/* wire posts listings */ +.wire_post { + padding-bottom:10px; margin-bottom:5px; - background:transparent url(<?php echo $vars['url']; ?>mod/thewire/graphics/thewire_speech_bubble.gif) no-repeat right bottom; -} -.thewire-post { - background:#cccccc; - margin-bottom:10px; + background-image: url(<?php echo $vars['url']; ?>mod/thewire/graphics/thewire_speech_bubble.gif); + background-repeat: no-repeat; + background-position: right bottom; } -.thewire-post .note_date { - font-size:90%; - color:#666666; - padding:0; +.wire_post_contents { + background-color: #eeeeee; + margin:0; + padding:5px; + line-height: 1.2em; + min-height: 34px; + position: relative; } -.thewire_icon { +.wire_post_icon { float:left; - margin:0 8px 4px 2px; + margin-right:8px; } -.note_body { - margin:0; - padding:6px 4px 4px 4px; - min-height: 40px; - line-height: 1.4em; +.wire_post_info { + margin-top:-3px; + float:left; + width:620px; } -.thewire_options { +.wire_post_options { float:right; width:65px; } -.thewire-post .reply { - font: 11px/100% Arial, Helvetica, sans-serif; - font-weight: bold; - color: #ffffff; - background:#999999; - border: 2px solid #999999; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - width: auto; - padding: 0 3px 2px 3px; - margin:0 0 5px 5px; - cursor: pointer; +.wire_post_options .action_button.reply.small { float:right; } -.thewire-post .reply:hover { - background: #4690d6; - border: 2px solid #4690d6; - color:white; - text-decoration: none; -} -.thewire-post .delete_note { - width:14px; - height:14px; - margin:3px 0 0 0; - float:right; +.wire_post_options .delete_button { + position: absolute; + bottom:5px; + right:5px; } -.thewire-post .delete_note a { - display:block; - cursor: pointer; - width:14px; - height:14px; - background: url("<?php echo $vars['url']; ?>_graphics/icon_customise_remove.png") no-repeat 0 0; - text-indent: -9000px; -} -.thewire-post .delete_note a:hover { - background-position: 0 -16px; -} -/* IE 6 fix */ -* html .thewire-post .delete_note a { background-position-y: 2px; } -* html .thewire-post .delete_note a:hover { background-position-y: -14px; } -.post_to_wire { - background: white; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - margin:0 10px 10px 10px; - padding:10px; -} -.post_to_wire input[type="submit"] { - margin:0; -} -/* reply form */ -textarea#thewire_large-textarea { - width: 664px; - height: 40px; - padding: 6px; - font-family: Arial, 'Trebuchet MS','Lucida Grande', sans-serif; - font-size: 100%; - color:#666666; -} -/* IE 6 fix */ -* html textarea#thewire_large-textarea { - width: 642px; +/* latest wire post on profile page */ +.wire_post .action_button.update.small { + float:right; + padding:4px; + position: absolute; + bottom:5px; + right:5px; } -input.thewire_characters_remaining_field { - color:#333333; - border:none; - font-size: 100%; - font-weight: bold; - padding:0 2px 0 0; - margin:0; - text-align: right; - background: white; -} -input.thewire_characters_remaining_field:focus { - border:none; - background:white; -} -.thewire_characters_remaining { - text-align: right; -} + diff --git a/mod/thewire/views/default/thewire/forms/add.php b/mod/thewire/views/default/thewire/forms/add.php index cf9ff15e6..60d7914ea 100644 --- a/mod/thewire/views/default/thewire/forms/add.php +++ b/mod/thewire/views/default/thewire/forms/add.php @@ -15,30 +15,20 @@ if (!empty($wire_user)) { $msg = '@' . $wire_user . ' '; } else { $msg = ''; } ?> -<div class="post_to_wire"> +<div class="new_wire_post clearfloat"> <h3><?php echo elgg_echo("thewire:doing"); ?></h3> -<script> -function textCounter(field,cntfield,maxlimit) { - // if too long...trim it! - if (field.value.length > maxlimit) { - field.value = field.value.substring(0, maxlimit); - } else { - // otherwise, update 'characters left' counter - cntfield.value = maxlimit - field.value.length; - } -} -</script> - - <form action="<?php echo $vars['url']; ?>action/thewire/add" method="post" name="noteForm"> - <?php - $display .= "<textarea name='note' value='' onKeyDown=\"textCounter(document.noteForm.note,document.noteForm.remLen1,140)\" onKeyUp=\"textCounter(document.noteForm.note,document.noteForm.remLen1,140)\" id=\"thewire_large-textarea\">{$msg}</textarea>"; - $display .= "<div class='thewire_characters_remaining'><input readonly type=\"text\" name=\"remLen1\" size=\"3\" maxlength=\"3\" value=\"140\" class=\"thewire_characters_remaining_field\">"; - echo $display; - echo elgg_echo("thewire:charleft") . "</div>"; - echo elgg_view('input/securitytoken'); - ?> - <input type="hidden" name="method" value="site" /> - <input type="submit" value="<?php echo elgg_echo('save'); ?>" /> - </form> +<script type="text/javascript" src="<?php echo $vars['url']; ?>mod/thewire/views/default/thewire/scripts/counter.js"></script> +<form action="<?php echo $vars['url']; ?>action/thewire/add" method="post" name="new_post"> + <?php + $action_txt = elgg_echo('post'); + $display .= "<textarea name='new_post_textarea' value='' onKeyDown=\"textCounter(document.new_post.new_post_textarea,document.new_post.remLen1,140)\" onKeyUp=\"textCounter(document.new_post.new_post_textarea,document.new_post.remLen1,140)\">{$msg}</textarea>"; + $display .= "<input type='submit' class='action_button' value='{$action_txt}' />"; + $display .= "<div class='character_count'><input readonly type=\"text\" name=\"remLen1\" size=\"3\" maxlength=\"3\" value=\"140\">"; + echo $display; + echo elgg_echo("thewire:charleft") . "</div>"; + echo elgg_view('input/securitytoken'); + ?> + <input type="hidden" name="method" value="site" /> +</form> </div> <?php echo elgg_view('input/urlshortener'); ?>
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/profile_status.php b/mod/thewire/views/default/thewire/profile_status.php index 890b8b9c3..fa8ccd76b 100644 --- a/mod/thewire/views/default/thewire/profile_status.php +++ b/mod/thewire/views/default/thewire/profile_status.php @@ -1,7 +1,7 @@ <?php /** - * New wire post view for the activity stream + * Latest wire post on profile activity page */ $owner = $vars['entity']->guid; @@ -13,16 +13,16 @@ if($latest_wire){ foreach($latest_wire as $lw){ $content = $lw->description; - $time = "<span> (" . friendly_time($lw->time_created) . ")</span>"; + $time = "<p class='entity_subtext'> (" . friendly_time($lw->time_created) . ")</p>"; } } if($latest_wire){ - echo "<div class=\"profile_status\">"; + echo "<div class='wire_post'><div class='wire_post_contents clearfloat radius8'>"; echo $content; if($owner == $_SESSION['user']->guid) - echo " <a class=\"status_update\" href=\"{$url_to_wire}\">update</a>"; + echo " <a class='action_button update small' href=\"{$url_to_wire}\">update</a>"; echo $time; - echo "</div>"; + echo "</div></div>"; } ?>
\ No newline at end of file diff --git a/mod/thewire/views/default/thewire/scripts/counter.js b/mod/thewire/views/default/thewire/scripts/counter.js index 3a1ebdbc5..7486bd1de 100644 --- a/mod/thewire/views/default/thewire/scripts/counter.js +++ b/mod/thewire/views/default/thewire/scripts/counter.js @@ -1,6 +1,16 @@ -// I need to move this into a JS folder for the plugin +/** + * Elgg thewire text counter + * + * @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/ + * + * @question - do we want users to be able to edit thewire? + * + * @uses $vars['entity'] Optionally, the note to view -/* <!-- Dynamic Version by: Nannette Thacker --> <!-- http://www.shiningstar.net --> <!-- Original by : Ronnie T. Moore --> @@ -16,4 +26,4 @@ function textCounter(field,cntfield,maxlimit) { // otherwise, update 'characters left' counter cntfield.value = maxlimit - field.value.length; } -} +}
\ No newline at end of file |