partial support (unfinished) for ajax loading cards with liveupdate; page still functions even though this isn't finished
This commit is contained in:
parent
66b032823b
commit
4450170790
@ -19,8 +19,7 @@ class Cards extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get($update = 0, $load = false) {
|
||||||
function get() {
|
|
||||||
|
|
||||||
if(observer_prohibited(true)) {
|
if(observer_prohibited(true)) {
|
||||||
return login();
|
return login();
|
||||||
@ -173,7 +172,7 @@ class Cards extends \Zotlabs\Web\Controller {
|
|||||||
$items = [];
|
$items = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$mode = 'channel';
|
$mode = 'cards';
|
||||||
|
|
||||||
$content = conversation($items,$mode,false,'traditional');
|
$content = conversation($items,$mode,false,'traditional');
|
||||||
|
|
||||||
|
39
Zotlabs/Module/Update_cards.php
Normal file
39
Zotlabs/Module/Update_cards.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module: update_profile
|
||||||
|
* Purpose: AJAX synchronisation of profile page
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
class Update_cards extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
|
||||||
|
$profile_uid = intval($_GET['p']);
|
||||||
|
$load = (((argc() > 1) && (argv(1) == 'load')) ? 1 : 0);
|
||||||
|
|
||||||
|
header("Content-type: text/html");
|
||||||
|
echo "<!DOCTYPE html><html><body><section></section></body></html>\r\n";
|
||||||
|
|
||||||
|
killme();
|
||||||
|
|
||||||
|
|
||||||
|
$mod = new Cards();
|
||||||
|
|
||||||
|
$text = $mod->get($profile_uid,$load);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reportedly some versions of MSIE don't handle tabs in XMLHttpRequest documents very well
|
||||||
|
*/
|
||||||
|
|
||||||
|
echo str_replace("\t",' ',$text);
|
||||||
|
echo (($_GET['msie'] == 1) ? '</div>' : '</section>');
|
||||||
|
echo "</body></html>\r\n";
|
||||||
|
killme();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -517,6 +517,15 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elseif ($mode === 'cards') {
|
||||||
|
$profile_owner = App::$profile['profile_uid'];
|
||||||
|
$page_writeable = ($profile_owner == local_channel());
|
||||||
|
$live_update_div = '<div id="live-cards"></div>' . "\r\n"
|
||||||
|
. "<script> var profile_uid = " . App::$profile['profile_uid']
|
||||||
|
. "; var netargs = '?f='; var profile_page = " . App::$pager['page'] . "; </script>\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
elseif ($mode === 'display') {
|
elseif ($mode === 'display') {
|
||||||
$profile_owner = local_channel();
|
$profile_owner = local_channel();
|
||||||
$page_writeable = false;
|
$page_writeable = false;
|
||||||
|
@ -380,6 +380,7 @@ function NavUpdate() {
|
|||||||
if($('#live-pubstream').length) { src = 'pubstream'; liveUpdate(); }
|
if($('#live-pubstream').length) { src = 'pubstream'; liveUpdate(); }
|
||||||
if($('#live-display').length) { src = 'display'; liveUpdate(); }
|
if($('#live-display').length) { src = 'display'; liveUpdate(); }
|
||||||
if($('#live-search').length) { src = 'search'; liveUpdate(); }
|
if($('#live-search').length) { src = 'search'; liveUpdate(); }
|
||||||
|
if($('#live-cards').length) { src = 'cards'; liveUpdate(); }
|
||||||
|
|
||||||
if($('#live-photos').length) {
|
if($('#live-photos').length) {
|
||||||
if(liking) {
|
if(liking) {
|
||||||
|
Reference in New Issue
Block a user