add hooks for other plugins to tap into qvitter
This commit is contained in:
parent
d34fac4a7f
commit
5ebe154879
|
@ -303,6 +303,12 @@ class QvitterAction extends ApiAction
|
|||
}
|
||||
|
||||
</style>
|
||||
<?php
|
||||
|
||||
// event for other plugins to use to add head elements to qvitter
|
||||
Event::handle('QvitterEndShowHeadElements', array($this));
|
||||
|
||||
?>
|
||||
</head>
|
||||
<body style="background-color:<?php print QvitterPlugin::settings("defaultbackgroundcolor"); ?>">
|
||||
<input id="upload-image-input" class="upload-image-input" type="file" name="upload-image-input" accept="image/*">
|
||||
|
@ -493,6 +499,9 @@ class QvitterAction extends ApiAction
|
|||
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/qvitter.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/qvitter.js')); ?>"></script>
|
||||
<?php
|
||||
|
||||
// event for other plugins to add scripts to qvitter
|
||||
Event::handle('QvitterEndShowScripts', array($this));
|
||||
|
||||
// we might have custom javascript in the config file that we want to add
|
||||
if(QvitterPlugin::settings('js')) {
|
||||
print '<script type="text/javascript">'.QvitterPlugin::settings('js').'</script>';
|
||||
|
|
|
@ -1029,6 +1029,17 @@ function expand_queet(q,doScrolling) {
|
|||
q.children('.queet').find('.expanded-content').prepend('<div class="media"><iframe width="420" height="315" src="//www.youtube.com/embed/' + youtubeId + '" frameborder="0" allowfullscreen></iframe></div>');
|
||||
}
|
||||
}
|
||||
else {
|
||||
// other plugins, e.g. gotabulo, can check for other attachment file formats to expand
|
||||
window.currentlyExpanding = {
|
||||
"attachment_title":attachment_title,
|
||||
"attachment_mimetype":attachment_mimetype,
|
||||
"attachment_title_extension":attachment_title_extension,
|
||||
"streamItem":q,
|
||||
"thisAttachmentLink":$(this)
|
||||
};
|
||||
$(document).trigger('qvitterExpandOtherAttachments');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1860,10 +1860,10 @@ $('body').on('mousedown','.syntax-two',function () {
|
|||
});
|
||||
$('body').on('blur','.queet-box-syntax',function (e) {
|
||||
|
||||
// don't collapse if upload-image-button has been clicked
|
||||
var uploadImageButton = $(this).siblings('.queet-toolbar').find('button.upload-image');
|
||||
if(uploadImageButton.hasClass('clicked')) {
|
||||
uploadImageButton.removeClass('clicked');
|
||||
// don't collapse if a toolbar button has been clicked
|
||||
var clickedToolbarButtons = $(this).siblings('.queet-toolbar').find('button.clicked');
|
||||
if(clickedToolbarButtons.length>0) {
|
||||
clickedToolbarButtons.removeClass('clicked');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user