feat: 支持编辑线路图署名并固定 CC BY 4.0
This commit is contained in:
+22
-2
@@ -184,6 +184,26 @@
|
||||
<script src="/custom-dialog.js?v=11"></script>
|
||||
<script src="/public-status.js?v=14"></script>
|
||||
<script>
|
||||
const createRouteMapCredit = (credit, license) => {
|
||||
const wrap = document.createElement('div');
|
||||
wrap.className = 'jr-asset-credit';
|
||||
|
||||
const creditText = document.createElement('span');
|
||||
creditText.textContent = `线路图署名:${credit || '未填写'}`;
|
||||
wrap.appendChild(creditText);
|
||||
|
||||
wrap.appendChild(document.createTextNode(' 许可协议:'));
|
||||
|
||||
const licenseLink = document.createElement('a');
|
||||
licenseLink.href = 'https://creativecommons.org/licenses/by/4.0/';
|
||||
licenseLink.target = '_blank';
|
||||
licenseLink.rel = 'noopener noreferrer';
|
||||
licenseLink.textContent = license || 'CC BY 4.0';
|
||||
wrap.appendChild(licenseLink);
|
||||
|
||||
return wrap;
|
||||
};
|
||||
|
||||
const loadPublicAssets = async () => {
|
||||
const fareMapBox = document.getElementById('fareMapBox');
|
||||
const routeMapBox = document.getElementById('routeMapBox');
|
||||
@@ -207,8 +227,9 @@
|
||||
const img = document.createElement('img');
|
||||
img.alt = '线路图';
|
||||
img.src = `/assets/${encodeURIComponent(m.routeMap)}?v=${encodeURIComponent(mv)}`;
|
||||
routeMapBox.innerHTML = '<div class="jr-asset-frame"></div><div class="jr-asset-credit">线路图署名:CC-BY 4.0</div>';
|
||||
routeMapBox.innerHTML = '<div class="jr-asset-frame"></div>';
|
||||
routeMapBox.firstElementChild.appendChild(img);
|
||||
routeMapBox.appendChild(createRouteMapCredit(m.routeMapCredit, m.routeMapLicense));
|
||||
} else {
|
||||
routeMapBox.innerHTML = '<div class="text-muted">暂无线路图</div>';
|
||||
}
|
||||
@@ -245,4 +266,3 @@
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user