Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abbe98/human-readable-kulturarvsdata
Userscript for Wikidata to make all Kulturarvsdata URIs(P1260) link to their human readable source.
https://github.com/abbe98/human-readable-kulturarvsdata
k-samsok raa-collection soch wikidata
Last synced: 3 days ago
JSON representation
Userscript for Wikidata to make all Kulturarvsdata URIs(P1260) link to their human readable source.
- Host: GitHub
- URL: https://github.com/abbe98/human-readable-kulturarvsdata
- Owner: Abbe98
- Created: 2016-10-15T12:02:08.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-21T07:26:54.000Z (about 6 years ago)
- Last Synced: 2024-12-12T20:46:15.966Z (10 days ago)
- Topics: k-samsok, raa-collection, soch, wikidata
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Human Readable Kulturarvsdata for Wikidata
Userscript for Wikidata to make all Kulturarvsdata URIs(`P1260`) link to their human readable source.
## Usage
Paste the following into your `commons.js` file:
```js
mw.loader.using(['jquery.ui.dialog'], function() {
$(document).ready(function() {
// common functions
String.prototype.insertAt=function(index, string) {
return this.substr(0, index) + string + this.substr(index);
}if (window.mw.config.values.wbEntity) {
// replace external kulturarvsdata.se(P1260) RDF links with human readable ones
if (JSON.parse(window.mw.config.values.wbEntity).claims.P1260) {
var link = $('a[href*="kulturarvsdata.se"]');
if (link.attr('href').indexOf('/html/') == -1) {
var re = new RegExp('\/.[^/]+(|\/)$');insertIndex = re.exec(link.attr('href'))['index'];
newUrl = link.attr('href').insertAt(insertIndex, '/html')
link.attr('href', newUrl);
}
}
}
});
});
```