Skip to content

Commit

Permalink
cosmetic corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
ldittmar81 committed Apr 15, 2019
1 parent 1960864 commit 61f1463
Show file tree
Hide file tree
Showing 24 changed files with 120 additions and 122 deletions.
2 changes: 1 addition & 1 deletion admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "Wenn Links fehlen oder falsch sind, senden Sie uns bitte eine E-Mail an",
"Important information!": "Wichtige Informationen!",
"Installing adapter %s...": "Adapter %s wird installiert...",
"Issues & bugs": "Probleme und Fehler",
"Issues & bugs": "Meine Adapter",
"Issues assigned to me": "Zugewiesene Issues",
"Italian": "Italienisch",
"Known errors closed at startup": "Bekannte Fehler beim Start geschlossen",
Expand Down
2 changes: 1 addition & 1 deletion admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "If links are missing or wrong, please send us an e-mail to",
"Important information!": "Important information!",
"Installing adapter %s...": "Installing adapter %s...",
"Issues & bugs": "Issues & bugs",
"Issues & bugs": "My adapters",
"Issues assigned to me": "Assigned Issues",
"Italian": "Italian",
"Known errors closed at startup": "Known errors closed at startup",
Expand Down
2 changes: 1 addition & 1 deletion admin/i18n/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "Si faltan enlaces o están equivocados, envíenos un correo electrónico a",
"Important information!": "¡Información importante!",
"Installing adapter %s...": "Se está instalando el adaptador %s ...",
"Issues & bugs": "Problemas y bugs",
"Issues & bugs": "Mis adaptadores",
"Issues assigned to me": "Problemas asignados",
"Italian": "italiano",
"Known errors closed at startup": "Errores conocidos cerrado en el inicio",
Expand Down
2 changes: 1 addition & 1 deletion admin/i18n/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "Si des liens manquent ou sont incorrects, veuillez nous envoyer un courrier électronique à",
"Important information!": "Une information important!",
"Installing adapter %s...": "L'adaptateur %s sera installé...",
"Issues & bugs": "Problèmes et bugs",
"Issues & bugs": "Mes adaptateurs",
"Issues assigned to me": "Problèmes assignés",
"Italian": "italien",
"Known errors closed at startup": "Les erreurs connues fermé au démarrage",
Expand Down
2 changes: 1 addition & 1 deletion admin/i18n/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "Se i link mancano o sono errati, inviaci una e-mail a",
"Important information!": "Informazioni importanti!",
"Installing adapter %s...": "Installazione dell'adattatore %s ...",
"Issues & bugs": "Problemi e bug",
"Issues & bugs": "I miei adattatori",
"Issues assigned to me": "Problemi assegnati",
"Italian": "italiano",
"Known errors closed at startup": "Errori noti chiuso all'avvio",
Expand Down
2 changes: 1 addition & 1 deletion admin/i18n/nl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "Als links ontbreken of verkeerd zijn, stuur ons dan een e-mail naar",
"Important information!": "Belangrijke informatie!",
"Installing adapter %s...": "Adapter %s wordt geïnstalleerd...",
"Issues & bugs": "Problemen & bugs",
"Issues & bugs": "Mijn adapters",
"Issues assigned to me": "Toegewezen problemen",
"Italian": "Italiaans",
"Known errors closed at startup": "Bekende fouten gesloten bij het opstarten",
Expand Down
2 changes: 1 addition & 1 deletion admin/i18n/pl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "Jeśli brakuje linków lub są one nieprawidłowe, wyślij nam e-mail na adres",
"Important information!": "Ważna informacja!",
"Installing adapter %s...": "Instalowanie adaptera %s ...",
"Issues & bugs": "Problemy i błędy",
"Issues & bugs": "Moje adaptery",
"Issues assigned to me": "Przypisane problemy",
"Italian": "Włoski",
"Known errors closed at startup": "Znane błędy zamyka po uruchomieniu",
Expand Down
2 changes: 1 addition & 1 deletion admin/i18n/pt/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "Se os links estão faltando ou errado, por favor envie-nos um e-mail para",
"Important information!": "Informação importante!",
"Installing adapter %s...": "O adaptador %s está sendo instalado...",
"Issues & bugs": "Problemas e bugs",
"Issues & bugs": "Meus adaptadores",
"Issues assigned to me": "Questões Atribuídas",
"Italian": "italiano",
"Known errors closed at startup": "Erros conhecidos fechado na inicialização",
Expand Down
2 changes: 1 addition & 1 deletion admin/i18n/ru/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "Если ссылки отсутствуют или неправильны, пожалуйста, отправьте нам письмо по электронной почте",
"Important information!": "Важная информация!",
"Installing adapter %s...": "Установка адаптера %s ...",
"Issues & bugs": "Проблемы и ошибки",
"Issues & bugs": "Мои адаптеры",
"Issues assigned to me": "Назначенные проблемы",
"Italian": "итальянский",
"Known errors closed at startup": "Известные ошибки закрывается при запуске",
Expand Down
2 changes: 1 addition & 1 deletion admin/i18n/zh-cn/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"If links are missing or wrong, please send us an e-mail to": "如果链接丢失或错误,请发送电子邮件至",
"Important information!": "重要信息!",
"Installing adapter %s...": "安装适配器%s ...",
"Issues & bugs": "问题和错误",
"Issues & bugs": "我的适配器",
"Issues assigned to me": "分配的问题",
"Italian": "意大利",
"Known errors closed at startup": "已知的误差在启动封闭",
Expand Down
196 changes: 98 additions & 98 deletions admin/lib/js/adapterIssues.js
Original file line number Diff line number Diff line change
@@ -1,99 +1,99 @@
/* global systemLang, dateOptions, adapterConfig, stargazers */

function showIssues() {

async function getIssues() {
const adapters = window.top.gMain.tabs.adapters.curInstalled;
if (adapters && typeof adapters === "object") {
$('#adapterIssueList').empty();
$('#adapterIssueListLoader').remove();
await asyncForEach(Object.keys(adapters), async function (key) {
if (key !== "hosts") {
const adapter = adapters[key];
const $item = $('#forumEntryTemplate').children().clone(true, true);
$item.find('.label-success').remove();

const full_name = adapter.readme.substring(adapter.readme.indexOf(".com/") + 5, adapter.readme.indexOf("/blob/"));

const fullNameId = full_name.replace("/", "ISSUE-ISSUE").replace(".", "ISSUE-PUNKT-ISSUE").toUpperCase();

$item.find('.title').attr('id', 'adapterTitleIssueList' + fullNameId);
$item.find('.titleLink').text(adapter.title).attr('href', "https://github.com/" + full_name + "/issues").attr('title', full_name);
$item.find('.collapse-link').attr("data-adapter", fullNameId).addClass("loadAdapterIssues");

let button = "<div class='text-center'>";
button += "<button type='button' data-adapter='" + adapter.title + ": " + adapter.version + "' data-href='https://api.github.com/repos/" + full_name + "/issues' class='btn btn-primary create-issue-adapter-button" + (adapterConfig.github_token ? "" : " disabled") + "'>";
button += "<i class='fa fa-plus fa-lg'></i> ";
button += _("add new request");
button += "</button>";
button += "</div>";

const ul = $('<ul/>').attr("id", "issue_" + fullNameId).addClass("list-unstyled timeline").attr('style', "margin-bottom: 3px;");
$item.find('.y_title').addClass('spoiler-content').css('padding-left', '20px');
$item.find('.y_content').addClass('spoiler-content').css('display', 'none').css('background-color', 'cornsilk').empty().append($(button)).append(ul).append($(button));

$('#adapterIssueList').append($item);
}
});
if (sessionStorage.getItem('ioBroker.info.stargazers')) {
stargazers = JSON.parse(sessionStorage.getItem('ioBroker.info.stargazers'));
addStarsToAdapterIssues();
}
}
if (adapterConfig.adapter_issue_closed) {
$('#knownIssuesBlock').find('.x_title a.collapse-link').click();
}
}

getIssues();
}

function addStarsToAdapterIssues() {
const adapters = window.top.gMain.tabs.adapters.curInstalled;
if (adapters && typeof adapters === "object") {
Object.keys(adapters).forEach(function (key) {
if (key !== "hosts") {
const adapter = adapters[key];
const full_name = adapter.readme.substring(adapter.readme.indexOf(".com/") + 5, adapter.readme.indexOf("/blob/"));
const fullNameId = full_name.replace("/", "ISSUE-ISSUE").replace(".", "ISSUE-PUNKT-ISSUE").toUpperCase();
const stars = stargazers[fullNameId];
if (stars && $('#starsCounter' + fullNameId).length === 0) {
const button = "<div class='pull-right'><button type='button' title='" + (stars.starred ? _("Thanks for the adapter!") : _("I want to thank the developer...")) + "' data-fullname='" + full_name + "' id='reactionBI" + fullNameId + "' class='adaptersInstalledReaction btn btn-" + (stars.starred ? "success" : "default") + "'><i class='fa fa-thumbs-up fa-lg'></i></button></div>";
const starCounter = "<span class='badge" + (stars.starred ? ' badge-success' : '') + "' id='starsCounter" + fullNameId + "'>" + stars.count + "</span>";
$('#adapterTitleIssueList' + fullNameId).prepend($(starCounter));
const $content = $('#adapterTitleIssueList' + fullNameId).parent().parent().find(".y_content");
$content.prepend($(button));
$($content.find('.create-issue-adapter-button')[0]).css('margin-left', '44px');
if (stars.starred) {
$('#adapterTitleIssueList' + fullNameId).parent().css("background-color", "#dff0d8");
}
} else if (stars) {
if (stars.starred) {
$('#reactionBI' + fullNameId).addClass('btn-success').removeClass('btn-default');
$('#starsCounter' + fullNameId).addClass('badge-success');
$('#adapterTitleIssueList' + fullNameId).parent().css("background-color", "#dff0d8");
} else {
$('#reactionBI' + fullNameId).removeClass('btn-success').addClass('btn-default');
$('#starsCounter' + fullNameId).removeClass('badge-success');
$('#adapterTitleIssueList' + fullNameId).parent().css("background-color", "");
}
$('#starsCounter' + fullNameId).text(stars.count);
}
}
});
}
}

async function getAndWriteIssuesFor(id) {
const full_name = id.replace("ISSUE-ISSUE", "/").replace("ISSUE-PUNKT-ISSUE", ".").split("/");
let allIssues;
$("<div class='loader3 loader-small' id='loader_" + id + "'></div>").insertBefore("#issue_" + id);
if (adapterConfig.github_token) {
allIssues = await getAllIssues(full_name[0], full_name[1]);
await writeAllIssuesV4(allIssues, "issue_" + id);
} else {
allIssues = await getAllIssuesFromAdapter(full_name);
await writeAllIssues(allIssues, "issue_" + id);
}
$("#loader_" + id).remove();
/* global systemLang, dateOptions, adapterConfig, stargazers */

function showIssues() {

async function getIssues() {
const adapters = window.top.gMain.tabs.adapters.curInstalled;
if (adapters && typeof adapters === "object") {
$('#adapterIssueList').empty();
$('#adapterIssueListLoader').remove();
await asyncForEach(Object.keys(adapters), async function (key) {
if (key !== "hosts") {
const adapter = adapters[key];
const $item = $('#forumEntryTemplate').children().clone(true, true);
$item.find('.label-success').remove();

const full_name = adapter.readme.substring(adapter.readme.indexOf(".com/") + 5, adapter.readme.indexOf("/blob/"));

const fullNameId = full_name.replace("/", "ISSUE-ISSUE").replace(".", "ISSUE-PUNKT-ISSUE").toUpperCase();

$item.find('.title').attr('id', 'adapterTitleIssueList' + fullNameId);
$item.find('.titleLink').text(adapter.title).attr('href', "https://github.com/" + full_name + "/issues").attr('title', full_name);
$item.find('.collapse-link').attr("data-adapter", fullNameId).addClass("loadAdapterIssues");

let button = "<div class='text-center'>";
button += "<button type='button' data-adapter='" + adapter.title + ": " + adapter.version + "' data-href='https://api.github.com/repos/" + full_name + "/issues' class='btn btn-primary create-issue-adapter-button" + (adapterConfig.github_token ? "" : " disabled") + "'>";
button += "<i class='fa fa-plus fa-lg'></i> ";
button += _("add new request");
button += "</button>";
button += "</div>";

const ul = $('<ul/>').attr("id", "issue_" + fullNameId).addClass("list-unstyled timeline").attr('style', "margin-bottom: 3px;");
$item.find('.y_title').addClass('spoiler-content').css('padding-left', '20px');
$item.find('.y_content').addClass('spoiler-content').css('display', 'none').css('background-color', 'cornsilk').empty().append($(button)).append(ul).append($(button));

$('#adapterIssueList').append($item);
}
});
if (sessionStorage.getItem('ioBroker.info.stargazers')) {
stargazers = JSON.parse(sessionStorage.getItem('ioBroker.info.stargazers'));
addStarsToAdapterIssues();
}
}
if (adapterConfig.adapter_issue_closed) {
$('#knownIssuesBlock').find('.x_title a.collapse-link').click();
}
}

getIssues();
}

function addStarsToAdapterIssues() {
const adapters = window.top.gMain.tabs.adapters.curInstalled;
if (adapters && typeof adapters === "object") {
Object.keys(adapters).forEach(function (key) {
if (key !== "hosts") {
const adapter = adapters[key];
const full_name = adapter.readme.substring(adapter.readme.indexOf(".com/") + 5, adapter.readme.indexOf("/blob/"));
const fullNameId = full_name.replace("/", "ISSUE-ISSUE").replace(".", "ISSUE-PUNKT-ISSUE").toUpperCase();
const stars = stargazers[fullNameId];
if (stars && $('#starsCounter' + fullNameId).length === 0) {
const button = "<div class='pull-right'><button type='button' title='" + (stars.starred ? _("Thanks for the adapter!") : _("I want to thank the developer...")) + "' data-fullname='" + full_name + "' id='reactionBI" + fullNameId + "' class='adaptersInstalledReaction btn btn-" + (stars.starred ? "success" : "default") + "'><i class='fa fa-thumbs-up fa-lg'></i></button></div>";
const starCounter = "<span title='" + _("Total votes") + "' class='badge" + (stars.starred ? ' badge-success' : '') + "' id='starsCounter" + fullNameId + "'>" + stars.count + "</span>";
$('#adapterTitleIssueList' + fullNameId).prepend($(starCounter));
const $content = $('#adapterTitleIssueList' + fullNameId).parent().parent().find(".y_content");
$content.prepend($(button));
$($content.find('.create-issue-adapter-button')[0]).css('margin-left', '44px');
if (stars.starred) {
$('#adapterTitleIssueList' + fullNameId).parent().css("background-color", "#dff0d8");
}
} else if (stars) {
if (stars.starred) {
$('#reactionBI' + fullNameId).addClass('btn-success').removeClass('btn-default');
$('#starsCounter' + fullNameId).addClass('badge-success');
$('#adapterTitleIssueList' + fullNameId).parent().css("background-color", "#dff0d8");
} else {
$('#reactionBI' + fullNameId).removeClass('btn-success').addClass('btn-default');
$('#starsCounter' + fullNameId).removeClass('badge-success');
$('#adapterTitleIssueList' + fullNameId).parent().css("background-color", "");
}
$('#starsCounter' + fullNameId).text(stars.count);
}
}
});
}
}

async function getAndWriteIssuesFor(id) {
const full_name = id.replace("ISSUE-ISSUE", "/").replace("ISSUE-PUNKT-ISSUE", ".").split("/");
let allIssues;
$("<div class='loader3 loader-small' id='loader_" + id + "'></div>").insertBefore("#issue_" + id);
if (adapterConfig.github_token) {
allIssues = await getAllIssues(full_name[0], full_name[1]);
await writeAllIssuesV4(allIssues, "issue_" + id);
} else {
allIssues = await getAllIssuesFromAdapter(full_name);
await writeAllIssues(allIssues, "issue_" + id);
}
$("#loader_" + id).remove();
}
2 changes: 1 addition & 1 deletion admin/lib/js/adapterRequests.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function writeAllIssuesV4(allIssues, id) {
$item.find('.label-success').remove();
const createdAt = new Date(issue.createdAt);
if (id === "adapterRequestList") {
$item.find('.title').prepend($("<span class='badge" + (issue.reactions.viewerHasReacted ? " badge-success" : "") + "' id='reactionARBadge" + issue.number + "'>" + issue.reactions.totalCount + "</span>"));
$item.find('.title').prepend($("<span title='" + _("Total votes") + "' class='badge" + (issue.reactions.viewerHasReacted ? " badge-success" : "") + "' id='reactionARBadge" + issue.number + "'>" + issue.reactions.totalCount + "</span>"));
const votes = "<strong class='text-primary'>" + _("Total votes") + ": <span id='reactionARNumber" + issue.number + "'>" + issue.reactions.totalCount + "</span></strong>";
const thumb = "<div class='pull-right marginHoch'><button type='button' title='" + (issue.reactions.viewerHasReacted ? _("I voted!") : _("Vote for this adapter request!")) + "' id='reactionAR" + issue.number + "' class='adapterRequestReaction btn btn-" + (issue.reactions.viewerHasReacted ? 'success' : 'default') + "'><i class='fa fa-thumbs-up fa-lg'></i></button></div>";
$item.find('.y_content').append($(thumb)).append($(votes));
Expand Down
2 changes: 0 additions & 2 deletions admin/lib/js/githubData.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,6 @@ query {
totalCount
}
viewerHasStarred
shortDescriptionHTML
diskUsage
}
}
cursor
Expand Down
Loading

0 comments on commit 61f1463

Please sign in to comment.