Page MenuHomePhabricator

bookmarkletcode.js

Authored By
bzimport
Nov 21 2014, 11:36 PM
Size
1 KB
Referenced Files
None
Subscribers
None

bookmarkletcode.js

javascript: (function () {
if (!(document.getElementById('wbBlockParentUI'))) {
if (location.href.match(/^(http):\/\/[A-Za-z]+.(wikipedia.org)/) == null || wgNamespaceNumber != 0) {
alert('Please select a valid article from wikipedia and invoke WikiBhasha (Beta).');
return;
}
this.baseUrl = 'http://www.wikibhasha.org/';
this.targetLanguageCode = 'en';
this.wikiSourceLanguage = typeof wgUserLanguage !== 'undefined' ? wgUserLanguage : 'en';
wbBookMarkletLinkDiv = document.createElement('div');
wbBookMarkletLinkDiv.id = 'wbLoadDiv';
this.wbIsInvokedFromBookmarklet = 'true';
wbBookMarkletLinkDiv.innerHTML = '<div style="background-color:Black;color:#FFFFFF;position:absolute;text-align:center;font-size:13px;font-weight:bold;left:0px;top:0px;padding:10px 0;z-index:1000;width:100%;border-bottom:3px solid gray;">Loading...</div>';
document.body.appendChild(wbBookMarkletLinkDiv);
function addScript(srcUrl) {
wbBookMarkletScripts = document.createElement('script');
wbBookMarkletScripts.setAttribute('src', 'http://www.wikibhasha.org/' + srcUrl);
document.body.appendChild(wbBookMarkletScripts);
}
addScript('js/main.js');
}
})()

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7456
Default Alt Text
bookmarkletcode.js (1 KB)

Event Timeline