forked from friendica/friendica-addons
viewsrc: show message source in a fancybox via ajax
This commit is contained in:
parent
c92861618b
commit
5adb4ef803
1 changed files with 12 additions and 0 deletions
|
@ -11,13 +11,25 @@
|
|||
|
||||
function viewsrc_install() {
|
||||
register_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
|
||||
register_hook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end');
|
||||
}
|
||||
|
||||
|
||||
function viewsrc_uninstall() {
|
||||
unregister_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
|
||||
unregister_hook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end');
|
||||
|
||||
}
|
||||
|
||||
function viewsrc_page_end(&$a, &$o){
|
||||
$a->page['htmlhead'] .= <<< EOS
|
||||
<script>
|
||||
$(function(){
|
||||
$('a[href*="/viewsrc/"]').fancybox();
|
||||
});
|
||||
</script>
|
||||
EOS;
|
||||
}
|
||||
|
||||
function viewsrc_item_photo_menu(&$a,&$b) {
|
||||
if(! local_user())
|
||||
|
|
Loading…
Reference in a new issue