share,retweet,relay,forward, whatever

This commit is contained in:
Friendika 2011-03-16 19:36:59 -07:00
parent e2ea341094
commit 3f432a7b82
17 changed files with 80 additions and 3 deletions

View file

@ -2,7 +2,7 @@
set_time_limit(0);
define ( 'FRIENDIKA_VERSION', '2.1.919' );
define ( 'FRIENDIKA_VERSION', '2.1.920' );
define ( 'DFRN_PROTOCOL_VERSION', '2.1' );
define ( 'DB_UPDATE_VERSION', 1043 );

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 365 B

BIN
images/share.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

View file

@ -155,6 +155,7 @@ function display_content(&$a) {
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => t("I don't like this \x28toggle\x29"),
'$share' => t('Share'),
'$wait' => t('Please wait')
));
}

View file

@ -364,6 +364,7 @@ function network_content(&$a, $update = 0) {
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => t("I don't like this \x28toggle\x29"),
'$share' => t('Share'),
'$wait' => t('Please wait')
));
}

View file

@ -1073,7 +1073,7 @@ function photos_content(&$a) {
$tpl = load_view_file('view/photo_item.tpl');
$return_url = $a->cmd;
$like_tpl = load_view_file('view/like.tpl');
$like_tpl = load_view_file('view/lik_noshare.tpl');
$likebuttons = '';
@ -1082,6 +1082,7 @@ function photos_content(&$a) {
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => t("I don't like this \x28toggle\x29"),
'$share' => t('Share'),
'$wait' => t('Please wait')
));
}

View file

@ -311,6 +311,7 @@ function profile_content(&$a, $update = 0) {
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => t("I don't like this \x28toggle\x29"),
'$share' => t('Share'),
'$wait' => t('Please wait')
));
}

View file

@ -87,7 +87,7 @@ function profile_photo_post(&$a) {
);
// Update global directory in background
$url = $_SESSION['my_url'];
$url = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
if($url && strlen(get_config('system','directory_submit_url')))
proc_run('php',"include/directory.php","$url");
}

23
mod/share.php Normal file
View file

@ -0,0 +1,23 @@
<?php
require_once('bbcode.php');
function share_init(&$a) {
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if((! $post_id) || (! local_user()))
killme();
$r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
intval($post_id)
);
if(! count($r) || $r[0]['private'])
killme();
$o = '';
$o .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
$o .= prepare_body($r[0]);
echo $o . '<br />';
killme();
}

View file

@ -111,6 +111,16 @@ tinyMCE.init({
}
}
function jotShare(id) {
$('#like-rotator-' + id).show();
$.get('share/' + id, function(data) {
tinyMCE.execCommand('mceInsertRawHTML',false,data);
$('#like-rotator-' + id).hide();
$(window).scrollTop(0);
});
}
function linkdropper(event) {
var linkFound = event.dataTransfer.types.contains("text/uri-list");

View file

@ -111,6 +111,14 @@ tinyMCE.init({
}
}
function jotShare(id) {
$('#like-rotator-' + id).show();
$.get('share/' + id, function(data) {
tinyMCE.execCommand('mceInsertRawHTML',false,data);
$('#like-rotator-' + id).hide();
$(window).scrollTop(0);
});
}
function linkdropper(event) {
var linkFound = event.dataTransfer.types.contains("text/uri-list");

View file

@ -110,6 +110,15 @@ tinyMCE.init({
}
}
function jotShare(id) {
$('#like-rotator-' + id).show();
$.get('share/' + id, function(data) {
tinyMCE.execCommand('mceInsertRawHTML',false,data);
$('#like-rotator-' + id).hide();
$(window).scrollTop(0);
});
}
function linkdropper(event) {
var linkFound = event.dataTransfer.types.contains("text/uri-list");

View file

@ -111,6 +111,15 @@ tinyMCE.init({
}
}
function jotShare(id) {
$('#like-rotator-' + id).show();
$.get('share/' + id, function(data) {
tinyMCE.execCommand('mceInsertRawHTML',false,data);
$('#like-rotator-' + id).hide();
$(window).scrollTop(0);
});
}
function linkdropper(event) {
var linkFound = event.dataTransfer.types.contains("text/uri-list");

View file

@ -1,5 +1,6 @@
<div class="wall-item-like-buttons" id="wall-item-like-buttons-$id">
<img src="images/like.gif" alt="$likethis" title="$likethis" onclick="dolike($id,'like');" />
<img src="images/dislike.gif" alt="$nolike" title="$nolike" onclick="dolike($id,'dislike');" />
<img src="images/share.gif" alt="$share" title="$share" class="wall-item-share-buttons" onclick="jotShare($id);" />
<img id="like-rotator-$id" class="like-rotator" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
</div>

5
view/like_noshare.tpl Normal file
View file

@ -0,0 +1,5 @@
<div class="wall-item-like-buttons" id="wall-item-like-buttons-$id">
<img src="images/like.gif" alt="$likethis" title="$likethis" onclick="dolike($id,'like');" />
<img src="images/dislike.gif" alt="$nolike" title="$nolike" onclick="dolike($id,'dislike');" />
<img id="like-rotator-$id" class="like-rotator" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
</div>

View file

@ -921,6 +921,10 @@ input#dfrn-url {
cursor: pointer;
}
.wall-item-share-buttons {
margin-left: 5px;
}
.wall-item-links-wrapper {
float: left;
}

View file

@ -993,6 +993,10 @@ input#dfrn-url {
border-right: 2px solid #fff;
}
.wall-item-share-buttons {
margin-left: 5px;
}
.wall-item-links-wrapper {
float: left;
}