This commit is contained in:
Mario Vavti 2016-12-10 15:08:54 +01:00
commit dc64556902
9 changed files with 6146 additions and 5787 deletions

View File

@ -80,6 +80,7 @@ class Help extends \Zotlabs\Web\Controller {
return replace_macros(get_markup_template('help.tpl'), array(
'$title' => t('$Projectname Documentation'),
'$tocHeading' => t('Contents'),
'$content' => $content
));
}

View File

@ -137,15 +137,21 @@ class Router {
killme();
}
logger("Module {$module} not found.", LOGGER_DEBUG, LOG_WARNING);
if((x($_SERVER, 'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && \App::$config['system']['dreamhost_error_hack']) {
logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']);
if((x($_SERVER, 'QUERY_STRING'))
&& ($_SERVER['QUERY_STRING'] === 'q=internal_error.html')
&& \App::$config['system']['dreamhost_error_hack']) {
logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI'],LOGGER_DEBUG);
goaway(z_root() . $_SERVER['REQUEST_URI']);
}
logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG);
header($_SERVER['SERVER_PROTOCOL'] . ' 404 ' . t('Not Found'));
if(get_config('system','log_404',true)) {
logger("Module {$module} not found.", LOGGER_DEBUG, LOG_WARNING);
logger('index.php: page not found: ' . $_SERVER['REQUEST_URI']
. ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: '
. $_SERVER['QUERY_STRING'], LOGGER_DEBUG);
}
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
$tpl = get_markup_template('404.tpl');
\App::$page['content'] = replace_macros($tpl, array(
'$message' => t('Page not found.')

View File

@ -1,11 +1,11 @@
[h1]Hubzilla Project[/h1]
[h1]Project Overview[/h1]
$Projectname is a decentralized communication network, which aims to provide communication that is censorship-resistant, privacy-respecting, and thus free from the oppressive claws of contemporary corporate communication giants. These giants function primarily as spy networks for paying clients of all sorts and types, in addition to monopolizing and centralizing the Internet; a feature that was not part of the original and revolutionary goals that produced the World Wide Web.
$Projectname is a decentralized community server providing communications, identity, and access control services which work together seamlessly across domains and connected websites. It allows anybody to publicly or [b]privately[/b] publish a range of web/media/personal content. The cross-domain privacy implementation is unique and somewhat revolutionary, as identity and access rights are negotiated by servers invisibly in the background.
$Projectname is free and open source. It is designed to scale from a $35 Raspberry Pi, to top of the line AMD and Intel Xeon-powered multi-core enterprise servers. It can be used to support communication between a few individuals, or scale to many thousands and more.
$Projectname aims to be skill and resource agnostic. It is easy to use by everyday computer users, as well as by systems administrators and developers.
$Projectname aims to be skill and resource agnostic. It is easy to use by everyday people, as well as by systems administrators and developers.
How you use it depends on how you want to use it.

View File

@ -14,13 +14,121 @@ Export channel data
channel/stream
================================================================================
Fetch conversation items
Fetch channel conversation items
network/stream
================================================================================
Fetch network conversation items
files
================================================================================
List file storage
List file storage (attach DB)
GET /api/z/1.0/files
Options:
- hash
return only entries matching hash (exactly)
- filename
return only entries matching filename (substring)
- filetype
return only entries matching filetype/mimetype (substring)
- start
start at record (default 0)
- records
number of records to return or 0 for unlimited
Example:
curl -u mychannel:mypassword https://xyz.macgirvin.com/api/z/1.0/files -d filetype=multipart/mixed
Returns:
{
"success": true,
"results": [
{
"id": "1",
"aid": "1",
"uid": "2",
"hash": "44ee8b2a1a7f36dea07b93b7747a2383a1bc0fdd08339e8928bfcbe45f65d939",
"filename": "Profile Photos",
"filetype": "multipart/mixed",
"filesize": "0",
"revision": "0",
"folder": "",
"os_storage": "1",
"is_dir": "1",
"is_photo": "0",
"flags": "0",
"created": "2016-01-02 21:51:17",
"edited": "2016-01-02 21:51:17",
"allow_cid": "",
"allow_gid": "",
"deny_cid": "",
"deny_gid": ""
},
{
"id": "12",
"aid": "1",
"uid": "2",
"hash": "71883f1fc64af33889229cbc79c5a056deeec5fc277d765f182f19073e1b2998",
"filename": "Cover Photos",
"filetype": "multipart/mixed",
"filesize": "0",
"revision": "0",
"folder": "",
"os_storage": "1",
"is_dir": "1",
"is_photo": "0",
"flags": "0",
"created": "2016-01-15 00:24:33",
"edited": "2016-01-15 00:24:33",
"allow_cid": "",
"allow_gid": "",
"deny_cid": "",
"deny_gid": ""
},
{
"id": "16",
"aid": "1",
"uid": "2",
"hash": "f48f7ec3278499d1dd86b72c3207beaaf4717b07df5cc9b373f14d7aad2e1bcd",
"filename": "2016-01",
"filetype": "multipart/mixed",
"filesize": "0",
"revision": "0",
"folder": "",
"os_storage": "1",
"is_dir": "1",
"is_photo": "0",
"flags": "0",
"created": "2016-01-22 03:24:55",
"edited": "2016-01-22 03:26:57",
"allow_cid": "",
"allow_gid": "",
"deny_cid": "",
"deny_gid": ""
}
]
}
filemeta
================================================================================
@ -30,7 +138,69 @@ Export file metadata for any uploaded file
filedata
================================================================================
Export file contents for any uploaded file
Provides the ability to download a file from cloud storage in chunks
GET /api/z/1.0/filedata
Required:
- file_id
attach.hash of desired file ('begins with' match)
Optional:
- start
starting byte of returned data in file (counting from 0)
- length
length (prior to base64 encoding) of chunk to download
Returns:
attach (DB) structure with base64 encoded 'content' comprised of the desired chunk
Example:
https://xyz.macgirvin.com/api/z/1.0/filedata?f=&file_id=9f5217770fd&start=0&length=48
Returns:
{
"attach": {
"id": "107",
"aid": "1",
"uid": "2",
"hash": "9f5217770fd55d563bd77f84d534d8e119a187514bbd391714626cd9c0e60207",
"creator": "pgcJx1IQjuPkx8aI9qheJlBMZzJz-oTPjHy3h5pWlOVOriBO_cSiUhhqwhuZ74TYJ8_ECO3pPiRMWC0q8YPCQg",
"filename": "pcxtopbm.c",
"filetype": "application/octet-stream",
"filesize": "3934",
"revision": "0",
"folder": "",
"flags": "0",
"is_dir": "0",
"is_photo": "0",
"os_storage": "1",
"os_path": "",
"display_path": "",
"content": "LyogcGN4dG9wYm0uYyAtIGNvbnZlcnQgUEMgcGFpbnRicnVzaCAoLnBjeCkgZmls",
"created": "2016-07-24 23:13:01",
"edited": "2016-07-24 23:13:01",
"allow_cid": "",
"allow_gid": "",
"deny_cid": "",
"deny_gid": "",
"start": 0,
"length": 48
}
}
file/export
@ -42,7 +212,70 @@ file
albums
================================================================================
List photo albums
Description: list photo albums
GET /api/z/1.0/albums
Output:
text - textual name
total - number of photos in this album
url - web URL
urlencode - textual name, urlencoded
bin2hex - textual name using bin2hex (which is used in the web URL link)
Example:
{
"success": true,
"albums": [
{
"text": "/",
"total": "2",
"url": "https://xyz.macgirvin.com/photos/hubzilla/album/",
"urlencode": "",
"bin2hex": ""
},
{
"text": "2016-01",
"total": "6",
"url": "https://xyz.macgirvin.com/photos/hubzilla/album/323031362d3031",
"urlencode": "2016-01",
"bin2hex": "323031362d3031"
},
{
"text": "2016-02",
"total": "7",
"url": "https://xyz.macgirvin.com/photos/hubzilla/album/323031362d3032",
"urlencode": "2016-02",
"bin2hex": "323031362d3032"
},
{
"text": "Cover Photos",
"total": "5",
"url": "https://xyz.macgirvin.com/photos/hubzilla/album/436f7665722050686f746f73",
"urlencode": "Cover+Photos",
"bin2hex": "436f7665722050686f746f73"
},
{
"text": "Profile Photos",
"total": "26",
"url": "https://xyz.macgirvin.com/photos/hubzilla/album/50726f66696c652050686f746f73",
"urlencode": "Profile+Photos",
"bin2hex": "50726f66696c652050686f746f73"
}
]
}
photos

View File

@ -420,11 +420,11 @@
tocUl.toc({content: "#doco-content", headings: "h1"});
tocUl.addClass('toc-content');
if( $(window).height() > 499) {
tocUl.sticky({topSpacing:$('nav').outerHeight(true), zIndex: 1000});
}
tocUl.sticky({topSpacing:$('nav').outerHeight(true), zIndex: 1000});
}
}
});
});
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1788,6 +1788,7 @@ nav .badge.mail-update:hover {
#expand-aside,
#expand-tabs,
#doco-return-to-top-btn,
#context-help-btn {
color: $nav_active_icon_colour;
padding: 7px 10px;

View File

@ -3,9 +3,11 @@
<h2>{{$title}}</h2>
</div>
<div class="section-content-wrapper" id="doco-content">
<h1>Contents</h1>
<ul id="doco-top-toc"></ul>
<hr>
<h1 class="fakelink" id="doco-top-toc-heading"><span onclick="docoTocToggle(); return false;">
<i class="fakelink fa fa-caret-right" id="doco-toc-toggle"></i>
{{$tocHeading}}
</span></h1>
<ul id="doco-top-toc" style="margin-bottom: 1.5em; display: none;"></ul>
{{$content}}
</div>
</div>
@ -16,7 +18,25 @@
$(document).ready(function () {
$('#doco-top-toc').toc({content: "#doco-content", headings: "h1,h2,h3,h4"});
$('.navbar-header').append('<button id="doco-return-to-top-btn">'); //.find('button');
var goTopBtn = $('#doco-return-to-top-btn');
goTopBtn.append('<i>').find('i').addClass('fa fa-arrow-circle-up');
//goTopBtn.attr('id', 'doco-return-to-top-btn');
goTopBtn.attr('type', 'button');
goTopBtn.attr('data-toggle', 'offcanvas');
goTopBtn.addClass('navbar-toggle');
goTopBtn.click(function() { $(window).scrollTop(0); });
});
function docoTocToggle() {
if($('#doco-top-toc').is(':visible')) {
$('#doco-toc-toggle').removeClass('fa-caret-down').addClass('fa-caret-right');
} else {
$('#doco-toc-toggle').removeClass('fa-caret-right').addClass('fa-caret-down');
}
$('#doco-top-toc').toggle();
return false;
}
</script>
</script>