Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F29901257
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
alaa_wmde
Jul 29 2019, 10:32 PM
2019-07-29 22:32:08 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
raw.txt
View Options
/* <nowiki>
*
* taxobox.js by [[User:FelixReimann]] with help from [[User:Ricordisamoa]]
* based on [[User:Ricordisamoa/Wikispecies.js]]
*/
$(document).ready(function(){
mw.hook( 'wikibase.entityPage.entityLoaded' ).add( function( entity ) {
// only on entities, not properties or other namespaces
if ( mw.config.get('wgNamespaceNumber') != 0 ) return ;
if ( mw.config.get('wgAction') != 'view' ) return ;
if( typeof entity.claims=='undefined' ) return;
if( Object.keys( entity.claims ).indexOf( 'P225' ) != -1 ){// 'taxon name' is present
var language = mw.user.options.get('language');
var count = 5;
if (mw.config.get('taxoboxCount')) {
count = mw.config.get('taxoboxCount');
}
var template = '<div class="wikibase-taxobox">{{Taxobox|qid=' + wgPageName + '|count=' + count + '|lang=' + language + '}}<div class="wikibase-taxobox-references" style="clear:right;"><references/></div></div>';
// https://www.wikidata.org/w/api.php?action=parse&text={{Taxobox|qid=Q36146}}&prop=text&contentmodel=wikitext&format=jsonfm
$.getJSON(mw.util.wikiScript('api'),
{
action:'parse',
format:'json',
text:template,
contentmodel:'wikitext',
prop:'text'
},
function(data){
var text=data.parse.text;
$('.wikibase-sitelinkgrouplistview').append(text['*']); // TODO insert text
});
}
} );
});
//</nowiki>
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7792555
Default Alt Text
raw.txt (1 KB)
Attached To
Mode
P8820 Fixed User:FelixReimann/taxobox.js
Attached
Detach File
Event Timeline
Log In to Comment