possibility for other plugins to add streams and translations to qvitter
This commit is contained in:
parent
5c00ecc52c
commit
76f579b84a
|
@ -212,7 +212,11 @@ class QvitterPlugin extends Plugin {
|
||||||
|
|
||||||
|
|
||||||
if ($this->hijack_ui === true) {
|
if ($this->hijack_ui === true) {
|
||||||
$m->connect('', array('action' => 'qvitter'));
|
|
||||||
|
// other plugins might want to reroute to qvitter
|
||||||
|
Event::handle('QvitterHijackUI', array($m));
|
||||||
|
|
||||||
|
$m->connect('', array('action' => 'qvitter'));
|
||||||
$m->connect('main/all', array('action' => 'qvitter'));
|
$m->connect('main/all', array('action' => 'qvitter'));
|
||||||
$m->connect('main/public', array('action' => 'qvitter'));
|
$m->connect('main/public', array('action' => 'qvitter'));
|
||||||
$m->connect('search/notice', array('action' => 'qvitter'));
|
$m->connect('search/notice', array('action' => 'qvitter'));
|
||||||
|
|
|
@ -494,7 +494,7 @@ class QvitterAction extends ApiAction
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-container"><?php
|
<div id="main-menu" class="menu-container"><?php
|
||||||
|
|
||||||
if($logged_in_user) {
|
if($logged_in_user) {
|
||||||
?><a href="<?php print $instanceurl.$logged_in_user->nickname ?>/all" class="stream-selection friends-timeline"><i class="chev-right"></i></a>
|
?><a href="<?php print $instanceurl.$logged_in_user->nickname ?>/all" class="stream-selection friends-timeline"><i class="chev-right"></i></a>
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
· ·
|
· ·
|
||||||
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
|
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
|
||||||
|
|
||||||
|
// plugins can add translatons to this object
|
||||||
|
window.pluginTranslations = [];
|
||||||
|
|
||||||
// object to keep old states of streams in, to speed up stream change
|
// object to keep old states of streams in, to speed up stream change
|
||||||
window.oldStreams = new Object();
|
window.oldStreams = new Object();
|
||||||
|
|
||||||
|
@ -723,6 +726,19 @@ $(window).load(function() {
|
||||||
function proceedToSetLanguageAndLogin(data){
|
function proceedToSetLanguageAndLogin(data){
|
||||||
window.sL = data;
|
window.sL = data;
|
||||||
|
|
||||||
|
// plugins might have added translations
|
||||||
|
$.each(window.pluginTranslations,function(k,pluginTranslation) {
|
||||||
|
if(typeof pluginTranslation[window.selectedLanguage] != 'undefined') {
|
||||||
|
$.extend(window.sL,pluginTranslation[window.selectedLanguage]);
|
||||||
|
}
|
||||||
|
else if(typeof pluginTranslation['en'] != 'undefined') {
|
||||||
|
$.extend(window.sL,pluginTranslation['en']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// plugins might want to wait and do stuff until after language is set
|
||||||
|
$(document).trigger('qvitterAfterLanguageIsSet');
|
||||||
|
|
||||||
// if this is a RTL-language, add rtl class to body
|
// if this is a RTL-language, add rtl class to body
|
||||||
if(window.sL.directionality == 'rtl') {
|
if(window.sL.directionality == 'rtl') {
|
||||||
$('body').addClass('rtl');
|
$('body').addClass('rtl');
|
||||||
|
|
|
@ -37,6 +37,16 @@
|
||||||
· ·
|
· ·
|
||||||
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
|
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
|
||||||
|
|
||||||
|
/* ·
|
||||||
|
·
|
||||||
|
· Other plugins can add streams to Qvitter, by pushing streamObjects to
|
||||||
|
· this array. See the structure in pathToStreamRouter()
|
||||||
|
·
|
||||||
|
· · · · · · · · · */
|
||||||
|
|
||||||
|
window.pluginStreamObjects = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ·
|
/* ·
|
||||||
·
|
·
|
||||||
|
@ -347,6 +357,18 @@ function pathToStreamRouter(path) {
|
||||||
streamObject.stream = 'statusnet/groups/list.json?count=10&screen_name=' + streamObject.nickname + '&withuserarray=1';
|
streamObject.stream = 'statusnet/groups/list.json?count=10&screen_name=' + streamObject.nickname + '&withuserarray=1';
|
||||||
return streamObject;
|
return streamObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// other plugins can add streams to Qvitter
|
||||||
|
if(window.pluginStreamObjects.length > 0) {
|
||||||
|
$.each(window.pluginStreamObjects,function(k,pluginStreamObject) {
|
||||||
|
if(typeof pluginStreamObject.pathRegExp != 'undefined' && pluginStreamObject.pathRegExp.test(path)){
|
||||||
|
$.extend(streamObject,pluginStreamObject);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return streamObject;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user