pkp / customheader Goto Github PK
View Code? Open in Web Editor NEWCustom header plugin for OJS/OMP 3.x
License: GNU General Public License v3.0
Custom header plugin for OJS/OMP 3.x
License: GNU General Public License v3.0
Hi! I'm trying to add a helper button that checks when we have submissions with more than 2 evaluations, alerts how many and paints their background, but I'm getting the following error when saving: Editorial Backend Header Content must be valid XHTML.
I've tried vanilla and jquery javascript but neither works.
However, when I paste them on the developer console both work as expected.
Any idea?
thanks!
<!-- teste custom headers plugin para melhorar backend -->
<script>
// Cria um novo botão
var newButton = document.createElement('button');
newButton.innerHTML = 'Verificar Avaliações <span aria-hidden="true" class="fa fa-check-circle"></span>';
// Adiciona o botão ao cabeçalho
var headerActions = document.querySelector('.app__headerActions');
headerActions.appendChild(newButton);
// Adiciona o evento de clique ao botão
newButton.addEventListener('click', function() {
var count = 0;
document.querySelectorAll('li.listPanel__item').forEach(function(li) {
if (li.textContent.match(/[2-9]+\/[2-9]+/)) {
li.style.backgroundColor = '#99ff9d';
count++;
}
});
if (count > 0) {
alert(count + ' submissões com 2 ou mais avaliações concluídas.');
}
});
</script>
<!-- teste custom headers plugin para melhorar backend -->
<script>
$(document).ready(function() {
// Cria um novo botão
var newButton = $('<button/>', {
html: 'Verificar Avaliações <span aria-hidden="true" class="fa fa-check-circle"></span>',
click: function() {
var count = 0;
$('li.listPanel__item').each(function() {
if ($(this).text().match(/[2-9]+\/[2-9]+/)) {
$(this).css('backgroundColor', '#00FFbb');
count++;
}
});
if (count > 0) {
alert(count + ' submissões com 2 ou mais avaliações concluídas.');
}
}
});
// Adiciona o botão ao cabeçalho
$('.app__headerActions').append(newButton);
});
</script>
PHP Fatal error: Uncaught Error: Non-static method PKPApplication::getRequest() cannot be called statically in /var/www/html/plugins/generic/customHeader/CustomHeaderPlugin.inc.php:112
See forum.
I get this error with PHP 8.1 and OJS 3.3.0.11
[php:error] [pid 2434172] [client 37.103.18.12:40340] PHP Fatal error: Declaration of CustomHeaderSettingsForm::execute($request, ...$functionArgs) must be compatible with Form::execute(...$functionArgs) in /var/www/ojs/plugins/generic/customHeader/CustomHeaderSettingsForm.inc.php on line 71, referer: https://aldrovandiana.it/management/settings/website
Hi,
how to handle the tag clouds if there is no sidebar for the theme? can you help me in sending a piece of code to put anywhere to atleast use the plugin? TIA
PHP log says: PHP Fatal error: Declaration of CustomHeaderSettingsForm::execute($request, …$functionArgs) must be compatible with Form::execute(…$functionArgs)
It would make sense to add a CustomFooter option (within the same plugin), or separate plugin.
Some Javascript is best loaded late, and some Javascript might depend on code that is not yet loaded (e.g., jquery). Thus, adding custom JS very late would make sense.
After installing this plugin is only listed in the plugin gallery but does not show in the installed plugins. Where can I find the plugin settings so that I can add custom js to a journal?
OJS version I am using: OJS 3.3.0.14
Plugin version: 1.0.4.1
On OJS 3.1 I receive a
Failed Ajax request or invalid JSON returned.
error when clicking "Settings" after installation.
@asmecher Where can I see the plugin in action? any live demo? all I mean e.g. if we have standard theme, what this plugins actually adds to?
ctgraham writes:
We have the Custom Headers Plugin to allow arbitrary javascript/css/meta customization of the public interface, but no parallel for the backend editorial interface. I have a use-case requesting the ability to load a javascript widget in the editorial interface which I think makes sense, and I think the general principle is broadly applicable. I'm picturing Pitt ULS creating a maintaining an "Editorial Custom Headers Plugin" in the Plugin Gallery. Any reasons this has not be done to-date, or any reason why this wouldn't be a good idea?
natewr suggests:
I suspect a PR for the custom headers plugin might be welcome. Just add a second text field for headers that should be loaded on the editorial backend.
asmecher affirms:
Yup, that would be a no-fuss solution.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.