diff --git a/include/conversation.php b/include/conversation.php index 6aad2485a7..aeb30177f4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -268,6 +268,10 @@ function conversation(&$a, $items, $mode, $update) { $blowhard = 0; $blowhard_count = 0; + // array with html for each thread (parent+comments) + $treads = array(); + $treadsid = -1; + foreach($items as $item) { $comment = ''; @@ -294,7 +298,7 @@ function conversation(&$a, $items, $mode, $update) { $toplevelprivate = (($toplevelpost && $item['private']) ? true : false); $item_writeable = (($item['writable'] || $item['self']) ? true : false); - if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) { + /*if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) { $blowhard_count ++; if($blowhard_count == 3) { $o .= ''; } $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) - ? '
' . t('Private Message') . '
' - : '
'); + ? t('Private Message') + : false); // Top-level wall post not written by the wall owner (wall-to-wall) @@ -427,7 +434,20 @@ function conversation(&$a, $items, $mode, $update) { $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$select' => t('Select'), '$delete' => t('Delete'))); - $star = (($profile_owner == local_user() && $toplevelpost) ? '' : ''); + $star = false; + + if ($profile_owner == local_user() && $toplevelpost) { + $isstarred = (($item['starred']) ? "starred" : "hidden"); + + $star = array( + 'do' => t("add star"), + 'undo' => t("remove star"), + 'classdo' => (($item['starred']) ? "hidden" : ""), + 'classundo' => (($item['starred']) ? "" : "hidden"), + 'starred' => t('starred'), + ); + } + $photo = $item['photo']; @@ -508,6 +528,7 @@ function conversation(&$a, $items, $mode, $update) { '$owner_name' => $owner_name, '$plink' => get_plink($item), '$edpost' => $edpost, + '$isstarred' => $isstarred, '$star' => $star, '$drop' => $drop, '$vote' => $likebuttons, @@ -520,7 +541,7 @@ function conversation(&$a, $items, $mode, $update) { $arr = array('item' => $item, 'output' => $tmp_item); call_hooks('display_item', $arr); - $o .= $arr['output']; + $treads[$treadsid] .= $arr['output']; } } @@ -529,10 +550,15 @@ function conversation(&$a, $items, $mode, $update) { // if author collapsing is in force but didn't get closed, close it off now. if($blowhard_count >= 3) - $o .= ''; + $treads[$treadsid] .= ''; - if($dropping) - $o .= '
'; + $page_template = get_markup_template("conversation.tpl"); + $o .= replace_macros($page_template, array( + '$treads' => $treads, + '$dropping' => $dropping, + )); + //if($dropping) + // $o .= '
'; return $o; } diff --git a/include/text.php b/include/text.php index 1f038c49ca..a22faa1a5e 100644 --- a/include/text.php +++ b/include/text.php @@ -834,9 +834,14 @@ function feed_salmonlinks($nick) { if(! function_exists('get_plink')) { function get_plink($item) { $a = get_app(); - $plink = (((x($item,'plink')) && (! $item['private'])) ? '' : ''); - return $plink; + if (x($item,'plink') && (! $item['private'])){ + return array( + 'href' => $item['plink'], + 'title' => t('link to source'), + ); + } else { + return false; + } }} if(! function_exists('unamp')) { diff --git a/js/main.js b/js/main.js index d5d38062e9..f08b669e3d 100644 --- a/js/main.js +++ b/js/main.js @@ -71,6 +71,7 @@ /* popup menus */ $('a[rel^=#]').click(function(e){ menu = $( $(this).attr('rel') ); + e.preventDefault(); e.stopPropagation(); if (menu.attr('popup')=="false") return false; $(this).parent().toggleClass("selected"); @@ -261,17 +262,22 @@ } function dostar(ident) { - $('#like-rotator-' + ident.toString()).show(); - $.get('starred/' + ident.toString(), function(data) { + ident = ident.toString(); + $('#like-rotator-' + ident).show(); + $.get('starred/' + ident, function(data) { if(data.match(/1/)) { - $('#starred-' + ident.toString()).addClass('starred'); - $('#starred-' + ident.toString()).removeClass('unstarred'); + $('#starred-' + ident).addClass('starred'); + $('#starred-' + ident).removeClass('hidden'); + $('#star-' + ident).addClass('hidden'); + $('#unstar-' + ident).removeClass('hidden'); } else { - $('#starred-' + ident.toString()).addClass('unstarred'); - $('#starred-' + ident.toString()).removeClass('starred'); + $('#starred-' + ident).addClass('hidden'); + $('#starred-' + ident).removeClass('starred'); + $('#star-' + ident).removeClass('hidden'); + $('#unstar-' + ident).addClass('hidden'); } - $('#like-rotator-' + ident.toString()).hide(); + $('#like-rotator-' + ident).hide(); }); } diff --git a/view/conversation.tpl b/view/conversation.tpl new file mode 100644 index 0000000000..339302638a --- /dev/null +++ b/view/conversation.tpl @@ -0,0 +1,5 @@ +{{ for $treads as $tread }} +
+ $tread +
+{{ endfor }} diff --git a/view/theme/duepuntozero/wall_item.tpl b/view/theme/duepuntozero/wall_item.tpl new file mode 100644 index 0000000000..5c467a1193 --- /dev/null +++ b/view/theme/duepuntozero/wall_item.tpl @@ -0,0 +1,49 @@ +
+
+
+
+ + $name + + menu +
+
    + $item_photo_menu +
+
+
+
+
+ $lock +
$location
+
+
+
+ $name +
$ago
+ +
+
+
$title
+
+
$body
+
+
+ $vote + $plink + $edpost + $star + $drop +
+
+
+
$like
+
$dislike
+
+ $comment +
+ +
+
diff --git a/view/theme/quattro/colors.less b/view/theme/quattro/colors.less index b5a203b947..12b0d08a66 100644 --- a/view/theme/quattro/colors.less +++ b/view/theme/quattro/colors.less @@ -65,3 +65,5 @@ @NoticeColor: @Grey1; @NoticeBackgroundColor: #511919; + +@ThreadBackgroundColor: #f6f7f8; diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index 14d1dfa1c6..e96095c245 100644 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -31,6 +31,8 @@ a:hover {color: @LinkHover; text-decoration: underline; } .left { float: left; } .right { float: right; } +.hidden { display: none; } + .tool { height: auto; overflow: auto; @@ -253,4 +255,55 @@ section { padding:0px 20px 0px 10px; } - +/* wall item */ +.tread-wrapper { + background-color: @ThreadBackgroundColor; + position: relative; + padding: 10px; + margin-bottom: 20px; +} +.wall-item-decor { position: absolute; left: 790px; top: -10px; width: 16px;} +.wall-item-container { + display: table; + width: 780px; + margin-bottom: 10px; + + .wall-item-item, + .wall-item-bottom { display: table-row; } + .wall-item-info { + display: table-cell; + vertical-align: top; + text-align: left; + width: 60px; + + .wall-item-photo-wrapper { position: relative; } + .wall-item-photo { width: 48px; height: 48px; } + + .wall-item-photo-menu-button { + display: none; + position: absolute; + left: -4px; + top: 28px; + } + .wall-item-photo-menu { display: none; } + + } + .wall-item-content { + display: table-cell; + font-size: 12px; + max-width: 720px; + word-wrap: break-word; + } + .wall-item-content img { max-width: 710px; } + .wall-item-links, + .wall-item-actions { display: table-cell; } + + .wall-item-ago { padding-right: 40px; } +} +.wall-item-container.comment { + .wall-item-photo { width: 32px; height: 32px; margin-left: 16px;} + .wall-item-photo-menu-button { + top: 13px !important; + left: 10px !important; + } +} diff --git a/view/theme/quattro/style.css b/view/theme/quattro/style.css index 6ff9c70c7a..a6ea358696 100644 --- a/view/theme/quattro/style.css +++ b/view/theme/quattro/style.css @@ -14,6 +14,40 @@ .icon.text { text-indent: 0px; } +.icon.s10 { + width: 10px; + height: 10px; +} +.icon.s10.notify { + background-image: url("../../../images/icons/10/notify_off.png"); +} +.icon.s10.gear { + background-image: url("../../../images/icons/10/gear.png"); +} +.icon.s10.add { + background-image: url("../../../images/icons/10/add.png"); +} +.icon.s10.delete { + background-image: url("../../../images/icons/10/delete.png"); +} +.icon.s10.edit { + background-image: url("../../../images/icons/10/edit.png"); +} +.icon.s10.star { + background-image: url("../../../images/icons/10/star.png"); +} +.icon.s10.menu { + background-image: url("../../../images/icons/10/menu.png"); +} +.icon.s10.link { + background-image: url("../../../images/icons/10/link.png"); +} +.icon.s10.lock { + background-image: url("../../../images/icons/10/lock.png"); +} +.icon.s10.unlock { + background-image: url("../../../images/icons/10/unlock.png"); +} .icon.s16 { width: 22px; height: 22px; @@ -33,9 +67,21 @@ .icon.s16.edit { background-image: url("../../../images/icons/16/edit.png"); } -.icon.s16.start { +.icon.s16.star { background-image: url("../../../images/icons/16/star.png"); } +.icon.s16.menu { + background-image: url("../../../images/icons/16/menu.png"); +} +.icon.s16.link { + background-image: url("../../../images/icons/16/link.png"); +} +.icon.s16.lock { + background-image: url("../../../images/icons/16/lock.png"); +} +.icon.s16.unlock { + background-image: url("../../../images/icons/16/unlock.png"); +} .icon.s22 { width: 22px; height: 22px; @@ -55,9 +101,55 @@ .icon.s22.edit { background-image: url("../../../images/icons/22/edit.png"); } -.icon.s22.start { +.icon.s22.star { background-image: url("../../../images/icons/22/star.png"); } +.icon.s22.menu { + background-image: url("../../../images/icons/22/menu.png"); +} +.icon.s22.link { + background-image: url("../../../images/icons/22/link.png"); +} +.icon.s22.lock { + background-image: url("../../../images/icons/22/lock.png"); +} +.icon.s22.unlock { + background-image: url("../../../images/icons/22/unlock.png"); +} +.icon.s48 { + width: 48px; + height: 48px; +} +.icon.s48.notify { + background-image: url("../../../images/icons/22/notify_off.png"); +} +.icon.s48.gear { + background-image: url("../../../images/icons/22/gear.png"); +} +.icon.s48.add { + background-image: url("../../../images/icons/22/add.png"); +} +.icon.s48.delete { + background-image: url("../../../images/icons/22/delete.png"); +} +.icon.s48.edit { + background-image: url("../../../images/icons/22/edit.png"); +} +.icon.s48.star { + background-image: url("../../../images/icons/22/star.png"); +} +.icon.s48.menu { + background-image: url("../../../images/icons/22/menu.png"); +} +.icon.s48.link { + background-image: url("../../../images/icons/22/link.png"); +} +.icon.s48.lock { + background-image: url("../../../images/icons/22/lock.png"); +} +.icon.s48.unlock { + background-image: url("../../../images/icons/22/unlock.png"); +} /* global */ body { font-family: Liberation Sans, helvetica, arial, clean, sans-serif; @@ -85,6 +177,9 @@ a:hover { .right { float: right; } +.hidden { + display: none; +} .tool { height: auto; overflow: auto; @@ -393,3 +488,70 @@ section { width: 800px; padding: 0px 20px 0px 10px; } +/* wall item */ +.tread-wrapper { + background-color: #f6f7f8; + position: relative; + padding: 10px; + margin-bottom: 20px; +} +.wall-item-decor { + position: absolute; + left: 790px; + top: -10px; + width: 16px; +} +.wall-item-container { + display: table; + width: 780px; + margin-bottom: 10px; +} +.wall-item-container .wall-item-item, .wall-item-container .wall-item-bottom { + display: table-row; +} +.wall-item-container .wall-item-info { + display: table-cell; + vertical-align: top; + text-align: left; + width: 60px; +} +.wall-item-container .wall-item-info .wall-item-photo-wrapper { + position: relative; +} +.wall-item-container .wall-item-info .wall-item-photo { + width: 48px; + height: 48px; +} +.wall-item-container .wall-item-info .wall-item-photo-menu-button { + display: none; + position: absolute; + left: -4px; + top: 28px; +} +.wall-item-container .wall-item-info .wall-item-photo-menu { + display: none; +} +.wall-item-container .wall-item-content { + display: table-cell; + font-size: 12px; + max-width: 720px; + word-wrap: break-word; +} +.wall-item-container .wall-item-content img { + max-width: 710px; +} +.wall-item-container .wall-item-links, .wall-item-container .wall-item-actions { + display: table-cell; +} +.wall-item-container .wall-item-ago { + padding-right: 40px; +} +.wall-item-container.comment .wall-item-photo { + width: 32px; + height: 32px; + margin-left: 16px; +} +.wall-item-container.comment .wall-item-photo-menu-button { + top: 13px !important; + left: 10px !important; +} diff --git a/view/wall_item.tpl b/view/wall_item.tpl index 3db3b15075..39cb33f0fe 100644 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -1,50 +1,43 @@ -
-
-
-
+{{ if $indent }}{{ else }} +
+ $star.starred + {{ if $lock }}$lock{{ endif }} +
+{{ endif }} +
+
+
+
- $name + $name - menu -
-
    - $item_photo_menu -
-
-
-
-
- $lock -
$location
-
-
-
- $name -
$ago
+ menu + -
-
-
$title
-
-
$body
+
+
$location
-
- $vote - $plink - $edpost - $star - $drop +
+ {{ if $title }}

$title

{{ endif }} + $body
-
- -
$dislike
-
- $comment +
+ +
+ $name $ago + + {{ if $star }} + $star.do + $star.undo + {{ endif }} +
- -