OK

Code License managed by NGOAN, submitted on 2016/08/04.

Please enable Javascript to view page properly.

Summary


Quick Summary


  • Can

  • Cannot

  • Must

Fulltext


Full License Text

function toggleHelpBox() {

var helpBoxOuter = document.getElementById('details');

helpBoxOuter.classList.toggle('hidden');

var detailsButton = document.getElementById('details-button');

if (helpBoxOuter.classList.contains('hidden'))

detailsButton.innerText = detailsButton.detailsText;

else

detailsButton.innerText = detailsButton.hideDetailsText;

if (mobileNav) {

document.getElementById('main-content').classList.toggle('hidden');

var runnerContainer = document.querySelector('.runner-container');

if (runnerContainer) {

runnerContainer.classList.toggle('hidden');

}

}

}

function diagnoseErrors() {

if (window.errorPageController)

errorPageController.diagnoseErrorsButtonClick();

}

if (window.top.location != window.location)

document.documentElement.setAttribute('subframe', '');

function updateForDnsProbe(strings) {

var context = new JsEvalContext(strings);

jstProcess(context, document.getElementById('t'));

}

function updateIconClass(classList, newClass) {

var oldClass;

if (classList.hasOwnProperty('last_icon_class')) {

oldClass = classList['last_icon_class'];

if (oldClass == newClass)

return;

}

classList.add(newClass);

if (oldClass !== undefined)

classList.remove(oldClass);

classList['last_icon_class'] = newClass;

if (newClass == 'icon-offline') {

document.body.classList.add('offline');

new Runner('.interstitial-wrapper');

} else {

document.body.classList.add('neterror');

}

}

function search(baseSearchUrl) {

var searchTextNode = document.getElementById('search-box');

document.location = baseSearchUrl + searchTextNode.value;

return false;

}

function trackClick(trackingId) {

if (trackingId >= 0 && errorPageController)

errorPageController.trackClick(trackingId);

}

function linkClicked(jstdata) {

trackClick(jstdata.trackingId);

}

function reloadButtonClick(url) {

if (window.errorPageController) {

errorPageController.reloadButtonClick();

} else {

location = url;

}

}

function showSavedCopyButtonClick() {

if (window.errorPageController) {

errorPageController.showSavedCopyButtonClick();

}

}

function showOfflinePagesButtonClick() {

if (window.errorPageController) {

errorPageController.showOfflinePagesButtonClick();

}

}

function detailsButtonClick() {

if (window.errorPageController)

errorPageController.detailsButtonClick();

}

/**

* Replace the reload button with the Google cached copy suggestion.

*/

function setUpCachedButton(buttonStrings) {

var reloadButton = document.getElementById('reload-button');

reloadButton.textContent = buttonStrings.msg;

var url = buttonStrings.cacheUrl;

var trackingId = buttonStrings.trackingId;

reloadButton.onclick = function(e) {

e.preventDefault();

trackClick(trackingId);

if (window.errorPageController) {

errorPageController.trackCachedCopyButtonClick();

}

location = url;

};

reloadButton.style.display = '';

document.getElementById('control-buttons').hidden = false;

}

var primaryControlOnLeft = true;

function onDocumentLoad() {

var controlButtonDiv = document.getElementById('control-buttons');

var reloadButton = document.getElementById('reload-button');

var detailsButton = document.getElementById('details-button');

var showSavedCopyButton = document.getElementById('show-saved-copy-button');

var showOfflinePagesButton =

document.getElementById('show-offline-pages-button');

var reloadButtonVisible = loadTimeData.valueExists('reloadButton') &&

loadTimeData.getValue('reloadButton').msg;

var showSavedCopyButtonVisible =

loadTimeData.valueExists('showSavedCopyButton') &&

loadTimeData.getValue('showSavedCopyButton').msg;

var showOfflinePagesButtonVisible =

loadTimeData.valueExists('showOfflinePagesButton') &&

loadTimeData.getValue('showOfflinePagesButton').msg;

var primaryButton, secondaryButton;

if (showSavedCopyButton.primary) {

primaryButton = showSavedCopyButton;

secondaryButton = reloadButton;

} else {

primaryButton = reloadButton;

secondaryButton = showSavedCopyButton;

}

if (primaryControlOnLeft) {

buttons.classList.add('suggested-left');

controlButtonDiv.insertBefore(secondaryButton, primaryButton);

} else {

buttons.classList.add('suggested-right');

controlButtonDiv.insertBefore(primaryButton, secondaryButton);

}

if (loadTimeData.valueExists('cacheButton')) {

setUpCachedButton(loadTimeData.getValue('cacheButton'));

}

if (reloadButton.style.display == 'none' &&

showSavedCopyButton.style.display == 'none' &&

showOfflinePagesButton.style.display == 'none') {

detailsButton.classList.add('singular');

}

if (reloadButtonVisible || showSavedCopyButtonVisible ||

showOfflinePagesButtonVisible) {

controlButtonDiv.hidden = false;

if ((reloadButtonVisible || showOfflinePagesButtonVisible) &&

showSavedCopyButtonVisible) {

secondaryButton.classList.add('secondary-button');

}

}

}

document.addEventListener('DOMContentLoaded', onDocumentLoad);

Changesets


Track OK inside your code

Use to manage open source licenses, from the creators of

Free to try • 60 second integration Learn More...