Skip to content

Commit

Permalink
Garante que todos os termos separados serão avaliados como instituiçã…
Browse files Browse the repository at this point in the history
…o e adiciona a capacidade de buscar por diferentes separadores.
  • Loading branch information
gitnnolabs committed Jan 3, 2023
1 parent d5626a4 commit ff95029
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions opac/webapp/templates/article/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@
{% endif %}

<script>

function splitMulti(str, tokens){
var tempChar = tokens[0];
for(var i = 1; i < tokens.length; i++){
str = str.split(tokens[i]).join(tempChar);
}
str = str.split(tempChar);
return str;
}

var scimago_verify = false;

$('#ModalTutors').on('shown.bs.modal', function () {
Expand All @@ -113,10 +123,10 @@
$(this).find('div').not(".clearfix").each(function () {
self = $(this);

items = self.text().split(',');
items = splitMulti(self.text(), ['–', ',', '.', ':'])

// just the first and the second item.
items.splice(0, 2).forEach(function (item) {
items.forEach(function (item) {

if (!appended) {
$.ajax({
Expand Down

0 comments on commit ff95029

Please sign in to comment.