fix github icon after recent refactor

pull/553/head
Gordon Williams 2020-08-21 17:03:52 +01:00
parent 25cf1b9338
commit cd465c12bd
1 changed files with 4 additions and 7 deletions

View File

@ -256,7 +256,7 @@ function refreshLibrary() {
let readme = `<a class="c-hand" onclick="showReadme('${app.id}')">Read more...</a>`;
let favourite = favourites.find(e => e == app.id);
let url = `${APP_SOURCECODE_URL}/${app.id}`;
let githubURL = `${APP_SOURCECODE_URL}/${app.id}`;
let appurl = window.location.origin + window.location.pathname + "#" + encodeURIComponent(app.id);
return `<div class="tile column col-6 col-sm-12 col-xs-12">
@ -266,7 +266,7 @@ function refreshLibrary() {
<div class="tile-content">
<p class="tile-title text-bold"><a name="${appurl}"></a>${escapeHtml(app.name)} ${versionInfo}</p>
<p class="tile-subtitle">${getAppDescription(app)}${app.readme?`<br/>${readme}`:""}</p>
<a href="${url}" target="_blank" class="link-github"><img src="core/img/github-icon-sml.png" alt="See the code on GitHub"/></a>
<a href="${githubURL}" target="_blank" class="link-github"><img src="core/img/github-icon-sml.png" alt="See the code on GitHub"/></a>
</div>
<div class="tile-action">
<button class="btn btn-link btn-action btn-lg ${!app.custom?"text-error":"d-hide"}" appid="${app.id}" title="Favorite"><i class="icon"></i>${favourite?"&#x2665;":"&#x2661;"}</button>
@ -499,10 +499,7 @@ function refreshMyApps() {
panelbody.innerHTML = appsInstalled.map(appInstalled => {
let app = appNameToApp(appInstalled.id);
let version = getVersionInfo(app, appInstalled);
let username = "espruino";
let githubMatch = window.location.href.match(/\/(\w+)\.github\.io/);
if(githubMatch) username = githubMatch[1];
let url = `https://github.com/${username}/BangleApps/tree/master/apps/${app.id}`;
let githubURL = `${APP_SOURCECODE_URL}/${app.id}`;
return `<div class="tile column col-6 col-sm-12 col-xs-12">
<div class="tile-icon">
<figure class="avatar"><img src="apps/${app.icon?`${app.id}/${app.icon}`:"unknown.png"}" alt="${escapeHtml(app.name)}"></figure>
@ -510,7 +507,7 @@ function refreshMyApps() {
<div class="tile-content">
<p class="tile-title text-bold">${escapeHtml(app.name)} <small>(${version.text})</small></p>
<p class="tile-subtitle">${getAppDescription(app)}</p>
<a href="${url}" target="_blank" class="link-github"><img src="img/github-icon-sml.png" alt="See the code on GitHub"/></a>
<a href="${githubURL}" target="_blank" class="link-github"><img src="core/img/github-icon-sml.png" alt="See the code on GitHub"/></a>
</div>
<div class="tile-action">
<button class="btn btn-link btn-action btn-lg ${(appInstalled&&app.interface)?"":"d-hide"}" appid="${app.id}" title="Download data from app"><i class="icon icon-download"></i></button>