Created addPop() for Realtime plugin and added param to include iconurl
This commit is contained in:
parent
bdbc2cb8de
commit
4d4bb089a5
|
@ -99,11 +99,13 @@ class RealtimePlugin extends Plugin
|
||||||
$user_id = 0;
|
$user_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$iconurl = $base.'plugins/Realtime/icon_external.gif';
|
||||||
|
|
||||||
$action->elementStart('script', array('type' => 'text/javascript'));
|
$action->elementStart('script', array('type' => 'text/javascript'));
|
||||||
|
|
||||||
$script = ' $(document).ready(function() { '.
|
$script = ' $(document).ready(function() { '.
|
||||||
$this->_updateInitialize($timeline, $user_id).
|
$this->_updateInitialize($timeline, $user_id).
|
||||||
' RealtimeUpdate.addPopup("'.$url.'", "'.$title.'"); '.
|
' RealtimeUpdate.addPopup("'.$url.'", "'.$title.'", "'. $iconurl .'");'
|
||||||
'}); ';
|
'}); ';
|
||||||
|
|
||||||
$action->raw($script);
|
$action->raw($script);
|
||||||
|
|
|
@ -111,9 +111,30 @@ RealtimeUpdate = {
|
||||||
return dl;
|
return dl;
|
||||||
},
|
},
|
||||||
|
|
||||||
addPopup: function(url, title)
|
addPopup: function(url, title, iconurl)
|
||||||
{
|
{
|
||||||
// FIXME: need to add the realtime popup button here
|
$('#site_nav_local_views .current a').append('<button id="realtime_timeline" title="Real-time pop window">↗</button>');
|
||||||
|
|
||||||
|
$('#realtime_timeline').css({
|
||||||
|
'margin':'2px 0 0 11px',
|
||||||
|
'background':'transparent url('+ iconurl + ') no-repeat 45% 45%',
|
||||||
|
'text-indent':'-9999px',
|
||||||
|
'width':'16px',
|
||||||
|
'height':'16px',
|
||||||
|
'padding':'0',
|
||||||
|
'display':'block',
|
||||||
|
'float':'right',
|
||||||
|
'border':'none',
|
||||||
|
'cursor':'pointer'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#realtime_timeline').click(function() {
|
||||||
|
window.open(url,
|
||||||
|
title,
|
||||||
|
'toolbar=no,resizable=yes,scrollbars=yes,status=yes');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user