fixes #96
This commit is contained in:
parent
dc189e1662
commit
3a7f8ab84d
|
@ -208,6 +208,7 @@ class QvitterPlugin extends Plugin {
|
|||
if ($this->hijack_ui === true) {
|
||||
$m->connect('', array('action' => 'qvitter'));
|
||||
$m->connect('main/all', array('action' => 'qvitter'));
|
||||
$m->connect('main/public', array('action' => 'qvitter'));
|
||||
$m->connect('search/notice', array('action' => 'qvitter'));
|
||||
|
||||
// if the user wants the twitter style home stream with hidden replies to non-friends
|
||||
|
|
|
@ -301,7 +301,18 @@ class QvitterAction extends ApiAction
|
|||
?>
|
||||
<input id="upload-image-input" class="upload-image-input" type="file" name="upload-image-input" accept="image/*">
|
||||
<div class="topbar">
|
||||
<a href="<?php print $instanceurl; ?>"><div id="logo"></div></a>
|
||||
<a href="<?php
|
||||
|
||||
// if we're logged in, the logo links to the home stream
|
||||
// if logged out it links to the site's public stream
|
||||
if($logged_in_user) {
|
||||
print $instanceurl.$logged_in_user_nickname.'/all';
|
||||
}
|
||||
else {
|
||||
print $instanceurl.'main/public';
|
||||
}
|
||||
|
||||
?>"><div id="logo"></div></a>
|
||||
<a id="settingslink">
|
||||
<div class="dropdown-toggle">
|
||||
<div class="nav-session"></div>
|
||||
|
@ -457,7 +468,7 @@ class QvitterAction extends ApiAction
|
|||
<a class="stream-selection mentions" data-stream-header="" data-stream-name="statuses/mentions.json"><i class="chev-right"></i></a>
|
||||
<a class="stream-selection my-timeline" data-stream-header="@statuses/user_timeline.json" data-stream-name="statuses/user_timeline.json"><i class="chev-right"></i></a>
|
||||
<a class="stream-selection favorites" data-stream-header="" data-stream-name="favorites.json"><i class="chev-right"></i></a>
|
||||
<a href="<?php print $instanceurl ?>" class="stream-selection public-timeline" data-stream-header="" data-stream-name="statuses/public_timeline.json"><i class="chev-right"></i></a>
|
||||
<a href="<?php print $instanceurl ?>main/public" class="stream-selection public-timeline" data-stream-header="" data-stream-name="statuses/public_timeline.json"><i class="chev-right"></i></a>
|
||||
<a href="<?php print $instanceurl ?>main/all" class="stream-selection public-and-external-timeline" data-stream-header="" data-stream-name="statuses/public_and_external_timeline.json"><i class="chev-right"></i></a>
|
||||
</div>
|
||||
<div class="menu-container" id="history-container"></div>
|
||||
|
|
|
@ -770,7 +770,7 @@ function convertStreamToPath(stream) {
|
|||
return screenName + '/all';
|
||||
}
|
||||
else if(stream == 'statuses/public_timeline.json') {
|
||||
return '';
|
||||
return 'main/public';
|
||||
}
|
||||
else if(stream == 'statuses/public_and_external_timeline.json') {
|
||||
return 'main/all';
|
||||
|
@ -834,6 +834,11 @@ function getStreamFromUrl() {
|
|||
streamToSet = 'statuses/public_and_external_timeline.json';
|
||||
}
|
||||
|
||||
// main/public, i.e. site's public timeline, new gnu social style
|
||||
else if (loc == '/main/public') {
|
||||
streamToSet = 'statuses/public_timeline.json';
|
||||
}
|
||||
|
||||
// {domain}/{screen_name} or {domain}/{screen_name}/
|
||||
else if ((/^[a-zA-Z0-9]+$/.test(loc.substring(0, loc.length - 1).replace('/','')))) {
|
||||
var userToStream = loc.replace('/','').replace('/','');
|
||||
|
|
|
@ -987,6 +987,11 @@ $('body').on('click','a', function(e) {
|
|||
e.preventDefault();
|
||||
setNewCurrentStream('statuses/public_timeline.json',function(){},true);
|
||||
}
|
||||
// site root new gnu social style
|
||||
else if($(this).attr('href').replace('http://','').replace('https://','').replace(window.siteRootDomain,'') == '/main/public') {
|
||||
e.preventDefault();
|
||||
setNewCurrentStream('statuses/public_timeline.json',function(){},true);
|
||||
}
|
||||
// whole network feed
|
||||
else if($(this).attr('href').replace('http://','').replace('https://','').replace(window.siteRootDomain,'') == '/main/all') {
|
||||
e.preventDefault();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
/* · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
|
||||
/* · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
|
||||
· ·
|
||||
· ·
|
||||
· Q V I T T E R ·
|
||||
|
@ -14,7 +14,7 @@
|
|||
· o> \\\\_\ ·
|
||||
· \\) \____) ·
|
||||
· ·
|
||||
· ·
|
||||
· ·
|
||||
· ·
|
||||
· Qvitter is free software: you can redistribute it and / or modify it ·
|
||||
· under the terms of the GNU Affero General Public License as published by ·
|
||||
|
@ -30,30 +30,30 @@
|
|||
· along with Qvitter. If not, see <http://www.gnu.org/licenses/>. ·
|
||||
· ·
|
||||
· Contact h@nnesmannerhe.im if you have any questions. ·
|
||||
· ·
|
||||
· ·
|
||||
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
|
||||
|
||||
|
||||
/* ·
|
||||
·
|
||||
/* ·
|
||||
·
|
||||
· Qvitter link in default GNU Social UI, toggle setting in api and reload page when finished
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
|
||||
if(qvitterEnabled) {
|
||||
$('#site_nav_global_primary').find('.nav').first().prepend('<li id="toggleqvitter"><a href="' + qvitterAllLink + '">' + toggleText + '</a></li>');
|
||||
$('#site_nav_global_primary').find('.nav').first().prepend('<li id="toggleqvitter" title="' + toggleText + '"><a href="' + qvitterAllLink + '">' + toggleText + '</a></li>');
|
||||
}
|
||||
else {
|
||||
$('#site_nav_global_primary').find('.nav').first().prepend('<li id="toggleqvitter"><a href="' + location.href + '">' + toggleText + '</a></li>');
|
||||
$('#site_nav_global_primary').find('.nav').first().prepend('<li id="toggleqvitter" title="' + toggleText + '"><a href="' + location.href + '">' + toggleText + '</a></li>');
|
||||
|
||||
$('#toggleqvitter > a').click(function(e){
|
||||
e.preventDefault();
|
||||
e.preventDefault();
|
||||
$.get(toggleQvitterAPIURL,function(data){
|
||||
if(data.success === true) {
|
||||
window.location.href = qvitterAllLink;
|
||||
window.location.href = qvitterAllLink;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user