Content deleted Content added
. |
0.01.2 |
||
Line 1:
// This script is used in combination with the WebRef script, which is not yet uploaded for use for the English Wikipedia.
// v. 2013-04-
if (!window.webRef || !window.webRef.getRef) alert('WebRef Setup error: Please, load WebRef first!');
else webRef.webRefSetup = (function () {
Line 23:
var frameBodyStyleObj = {
margin: '0 auto',
color: '#ffffff', backgroundColor: '#000077',
Line 78 ⟶ 77:
function saveToStorage() {
var code, obj;
if (!window.localStorage || !window.JSON)
alert(idToText['noStorage']);
else {
Line 107 ⟶ 106:
function closeSetup() {
dom.byId('ref01ref').style.display = 'none';
dom.byId('
webRef.displayWebRefFrame(true);
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
Line 181:
}
var i, id, docFrag = document.createDocumentFragment();
var subDiv;
function br() {
Line 274 ⟶ 275:
id: 'ref01ref',
resizable: 'resizable',
css: {width: '100%', position: 'absolute', zIndex: '100000', top: 0, left: 0}
});
document.body.insertBefore(refFrame.frame, document.body.firstChild);
Line 289 ⟶ 290:
refFrame.body.appendChild(docFrag);
refFrame.frame.style.height = frameHeight;
subDiv = dom.newEl('div', {
id: 'ref01refDiv',
css: {height: frameHeight}
});
document.body.insertBefore(subDiv, document.body.firstChild);
function getDocHeight(b,D) {
return Math.max(
Line 314 ⟶ 322:
aux.fatalError("findContainingEls: No element with id " + id);
}
var val = aux.trimStr(refFrame.doc.getElementById(id).value
if (val) {
val = val
Line 351 ⟶ 359:
if (str && str.search(patternsToSearchFor[o]) > -1) {
if (el.parentNode) {
var n = -1; // matchedEls[o].indexOf(el.parentNode);
for (var ii = 0; ii < matchedEls[o].length; ii++) {
if (matchedEls[o][ii] == el.parentNode) {
n = ii;
break;
}
}
if (n > -1)
matchedEls[o].splice(n, 1); // remove parent if child has the string
Line 550 ⟶ 565:
return function () {
var setupFrame = dom.byId('ref01ref');
webRef.displayWebRefFrame(false);
if (setupFrame) {
dom.byId('ref00ref').style.display = 'none';▼
setupFrame.style.display = 'block';
}
else {
Line 561 ⟶ 577:
})();
if (window.webRef && webRef.webRefSetupStartOnLoad) {
webRef.webRefSetupStartOnLoad = false;
webRef.webRefSetup();
}
|