Last active
September 9, 2020 14:39
-
-
Save notsobad/fe14110fb4f65dd9c44f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CloudFlare: Challenge Page | |
// =========================== | |
// @author: CloudFlare WWW Team | |
// @date: 2013-05-28 | |
// CloudFlare Challenge Page Setup | |
// -------------------------------- | |
(function( $, window, undefined ) { | |
var challenge_message_length = 100; | |
// Event tracking | |
function trackEvent( category, action ){ | |
try { _gaq.push(['_trackEvent', category, action ]); } catch(e) {} | |
} | |
// Once the DOM is ready | |
$(function(){ | |
var challengeTextarea = $('#challenge-message'), | |
challengeForm = $('#challenge-form'), | |
captchaInput = $('#recaptcha_response_field'); | |
// ID click event delegation | |
$('body').on('click', 'a', function( evt ){ | |
switch( evt.currentTarget.id ){ | |
case 'recaptcha_reload': | |
Recaptcha.reload(); | |
evt.preventDefault(); | |
break; | |
case 'recaptcha_show_image': | |
Recaptcha.switch_type('image'); | |
evt.preventDefault(); | |
break; | |
case 'recaptcha_show_audio': | |
Recaptcha.switch_type('audio'); | |
evt.preventDefault(); | |
break; | |
case 'recaptcha_whatsthis': | |
Recaptcha.showhelp(); | |
evt.preventDefault(); | |
break; | |
case 'ip_address': | |
trackEvent('Challenge聽Page', 'External Click: IP Address'); | |
break; | |
case 'support_link': | |
trackEvent('Challenge聽Page', 'Click: CloudFlare Support'); | |
break; | |
case 'cloudflare_link': | |
trackEvent('Challenge聽Page', 'Click: CloudFlare WWW'); | |
break; | |
} | |
}); | |
// Provide some user feedback on characters left | |
challengeTextarea.on('keyup', function(evt){ | |
var value = evt.target.value; | |
$('#challenge-message-character-count') | |
.text( challenge_message_length - value.length ) | |
[ value.length > challenge_message_length * 0.75 ? 'addClass' : 'removeClass']( 'text-error' ); | |
}); | |
// Ensure we're valid before submitting | |
challengeForm.on('submit', function( evt ){ | |
var msg = challengeTextarea.val(), | |
captchaResponse = captchaInput.val(); | |
// Safety net in case the user modified the maxlength attribute | |
if( (!msg || msg.length <= challenge_message_length) && captchaResponse.length ){ | |
trackEvent('Challenge Page', 'Captcha Submit'); | |
}else{ | |
if( !captchaResponse.length ){ | |
alertContainer.text('Please enter the captcha text above.').prependTo( challengeForm.find('.form-content') ); | |
} | |
evt.preventDefault(); | |
return false; | |
} | |
}); | |
}); | |
})( window.$, window ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CloudFlare: Common | |
// =================== | |
// @author: CloudFlare WWW Team | |
// @date: 2013-08-06 | |
// We use Polyglot for translations | |
// --------------------------------- | |
// Polyglot.js (c) 2012 Airbnb, Inc. | |
// | |
// polyglot.js may be freely distributed under the terms of the BSD | |
// license. For all licensing information, details, and documention: | |
// http://airbnb.github.com/polyglot.js | |
!function(e){"use strict";function t(e){e=e||{},this.phrases=e.phrases||{},this.currentLocale=e.locale||"en"}function n(e){return"shared.pluralize."+e}function o(e){var t,n,r,i={};for(t in e)if(e.hasOwnProperty(t)){n=e[t];for(r in n)i[n[r]]=t}return i}function u(e){var t=/^\s+|\s+$/g;return e.replace(t,"")}function a(e,t,n){var i,s,o;return n!=null&&e?(s=e.split(r),o=s[l(t,n)]||s[0],i=u(o)):i=e,i}function f(e){var t=o(s);return t[e]||t.en}function l(e,t){return i[f(e)](t)}function c(e,t){for(var n in t)n!=="_"&&t.hasOwnProperty(n)&&(e=e.replace(new RegExp("%\\{"+n+"\\}","g"),t[n]));return e}function h(t){e.console&&e.console.warn&&e.console.warn("WARNING: "+t)}function p(e){var t={};for(var n in e)t[n]=e[n];return t}t.VERSION="0.2.0",t.prototype.locale=function(e){return e&&(this.currentLocale=e),this.currentLocale},t.prototype.extend=function(e){for(var t in e)e.hasOwnProperty(t)&&(this.phrases[t]=e[t])},t.prototype.clear=function(){this.phrases={}},t.prototype.replace=function(e){this.clear(),this.extend(e)},t.prototype.t=function(e,t){var n;t=t||{};var r=this.phrases[e]||t._||"";return r===""?(h('Missing translation for key: "'+e+'"'),n=e):(t=p(t),t.smart_count!=null&&t.smart_count.length!=null&&(t.smart_count=t.smart_count.length),n=a(r,this.currentLocale,t.smart_count),n=c(n,t)),n},t.prototype.pluralize=function(e,t){t!=null&&t.length!=null&&(t=t.length);var r=n(e);return this.t(r,{smart_count:t})};var r="||||",i={chinese:function(e){return 0},german:function(e){return e!==1?1:0},french:function(e){return e>1?1:0},russian:function(e){return e%10===1&&e%100!==11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},czech:function(e){return e===1?0:e>=2&&e<=4?1:2},polish:function(e){return e===1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},icelandic:function(e){return e%10!==1||e%100===11?1:0}},s={chinese:["id","ja","ko","ms","th","tr","zh"],german:["da","de","en","es","fi","el","he","hu","it","nl","no","pt","sv"],french:["fr","tl"],russian:["hr","ru"],czech:["cs"],polish:["pl"],icelandic:["is"]};typeof module!="undefined"&&module.exports?module.exports=t:e.Polyglot=t}(this); | |
(function($, Polyglot, window, navigator, undefined){ | |
var polyglot = new Polyglot(); | |
// Process tranlations | |
function translate( json ){ | |
if( !json ){ return false; } | |
polyglot.extend( json ); | |
$.each( polyglot.phrases, function( key, val ){ $('[data-translate='+key+']').html( val ); }); | |
} | |
// Piece links back together if they were split apart | |
function unobfuscateLinks(){ | |
$('a[data-orig-ref]').each(function(){ | |
var $el = $(this), | |
proto = $el.data('orig-proto') || '', | |
url = $el.data('orig-ref') || ''; | |
url = (proto.length ? proto+'://' : '') + url; | |
$el.attr('href', url ); | |
}); | |
} | |
$('html') | |
// Let everything know that JS is ready/enabled | |
.toggleClass('no-js js') | |
// Hide all HTML content until the DOM is ready (used to prevent translation text from flashing) | |
.css({ 'visibility' : 'hidden', 'opacity': 0 }); | |
// Once the DOM is ready | |
$(function(){ | |
var alertContainer = $('<label/>',{'class':'alert alert-error'}), | |
languageSelect = $('#lang-selector'); | |
// Process translations if it exists | |
if( window._cf_translation ){ | |
// Setup the translation object, run through all translations, and show the body again | |
polyglot.locale = window._cf_translation.locale; | |
translate( window._cf_translation.blobs ); | |
languageSelect.val( polyglot.locale ); | |
} | |
// Translate obfuscated links back to clickable links. | |
unobfuscateLinks(); | |
// Show the page to the user | |
$('html').css({ 'opacity': 1, 'visibility' : 'visible' }); | |
// Go grab the requested language | |
languageSelect.on('change', function( evt ){ | |
var lang = evt.target.value; | |
if( lang ){ | |
$.getJSON('/cdn-cgi/scripts/lang/waf/'+lang+'.json', function( data ){ | |
polyglot.locale = lang; | |
translate( data ); | |
}); | |
} | |
}); | |
// If cookies aren't enabled, let the visitor know | |
if( !navigator.cookieEnabled ){ | |
$('#cookie-alert').show(); | |
} | |
}); | |
})( window.$, window.Polyglot, window, navigator ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]--> | |
<head> | |
<title>Attention Required! | CloudFlare</title> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" /> | |
<meta name="robots" content="noindex, nofollow" /> | |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" /> | |
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" /> | |
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]--> | |
<style type="text/css">body{margin:0;padding:0}</style> | |
<!--[if lt IE 9]><script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><![endif]--> | |
<!--[if gte IE 9]><!--><script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script><!--<![endif]--> | |
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script> | |
<script type="text/javascript" src="/cdn-cgi/scripts/cf.challenge.js"></script> | |
</head> | |
<body> | |
<div id="cf-wrapper"> | |
<div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div> | |
<div id="cf-error-details" class="cf-error-details-wrapper"> | |
<div class="cf-wrapper cf-header cf-error-overview"> | |
<h1 data-translate="challenge_headline">One more step</h1> | |
<h2 class="cf-subheadline"><span data-translate="complete_sec_check">Please complete the security check to access</span> fas.org</h2> | |
</div><!-- /.header --> | |
<div class="cf-section cf-highlight cf-captcha-container"> | |
<div class="cf-wrapper"> | |
<div class="cf-columns two"> | |
<div class="cf-column"> | |
<div class="cf-highlight-inverse cf-form-stacked"> | |
<form class="challenge-form" id="challenge-form" action="/cdn-cgi/l/chk_captcha" method="get"> | |
<fieldset class="cf-captcha-info"> | |
<div id="recaptcha_widget" style="display:none"> | |
<div class="cf-captcha-actions"> | |
<a href="#" class="cf-btn cf-btn-primary cf-icon-refresh" id="recaptcha_reload"><span data-translate="refresh">Refresh</span></a> | |
<a href="#" class="cf-btn cf-btn-primary cf-icon-announce recaptcha_only_if_audio" id="recaptcha_show_image"><span data-translate="show_image">Show Image</span></a> | |
<a href="#" class="cf-btn cf-btn-primary cf-icon-announce recaptcha_only_if_image" id="recaptcha_show_audio"><span data-translate="announce">Announce</span></a> | |
<a href="#" class="cf-btn cf-btn-primary cf-icon-question" id="recaptcha_whatsthis" title="This field helps us determine that you are human, and not an automated program trying to compromise the security system."><span data-translate="info">Info</span></a> | |
</div> | |
<div id="recaptcha_image" class="cf-captcha-image"></div><!-- /#recaptcha_image --> | |
</div> | |
</fieldset> | |
<fieldset class="form-content"> | |
<label for="captcha-text" data-translate="enter_text_above" class="js-only">Enter above text</label> | |
<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" class="js-only" /> | |
<noscript class="cf-captcha-info"> | |
<iframe src="//www.google.com/recaptcha/api/noscript?k=6LeT6gcAAAAAAAZ_yDmTMqPH57dJQZdQcu6VFqog" height="300" width="500" frameborder="0"></iframe> | |
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"> | |
<label for="manual_recaptcha_challenge_field">Enter confirmation code after solving challenge above</label> | |
<textarea id="manual_recaptcha_challenge_field" name="recaptcha_challenge_field" rows="3" cols="40"></textarea> | |
</noscript> | |
<label for="challenge-message"><span data-translate="msg_site_owner">Leave a message for the site owner?</span> <small>(<span id="challenge-message-character-count">100</span> <span data-translate="characters_left">characters left</span>)</small></label> | |
<textarea id="challenge-message" name="message" rows="3" maxlength="100"></textarea> | |
<input type="hidden" id="id" name="id" value="17a38cbf86180719" /> | |
</fieldset> | |
<fieldset class="cf-form-actions"> | |
<button type="submit" class="cf-btn cf-btn-accept"><span data-translate="submit">Submit</span></button> | |
</fieldset> | |
</form> | |
</div> | |
</div> | |
<div class="cf-column"> | |
<div class="cf-screenshot-container"> | |
<span class="cf-no-screenshot"></span> | |
</div> | |
</div> | |
</div><!-- /.columns --> | |
</div> | |
</div><!-- /.captcha-container --> | |
<div class="cf-section cf-wrapper"> | |
<div class="cf-columns two"> | |
<div class="cf-column"> | |
<h2 data-translate="why_captcha_headline">Why do I have to complete a CAPTCHA?</h2> | |
<p data-translate="why_captcha_detail">Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.</p> | |
</div> | |
<div class="cf-column"> | |
<h2 data-translate="resolve_captcha_headline">What can I do to prevent this in the future?</h2> | |
<p data-translate="resolve_captcha_antivirus">If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.</p> | |
<p data-translate="resolve_captcha_network">If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.</p> | |
</div> | |
</div> | |
</div><!-- /.section --> | |
<div class="cf-error-footer cf-wrapper"> | |
<p> | |
<span class="cf-footer-item">CloudFlare Ray ID: <strong>17a38cbf86180719</strong></span> | |
<span class="cf-footer-separator">•</span> | |
<span class="cf-footer-item"><span data-translate="your_ip">Your IP</span>: 112.193.145.139</span> | |
<span class="cf-footer-separator">•</span> | |
<span class="cf-footer-item"><span data-translate="performance_security_by">Performance & security by</span> <a data-orig-proto="https" data-orig-ref="www.cloudflare.com/5xx-error-landing" id="cloudflare_link" target="_blank">CloudFlare</a></span> | |
</p> | |
</div><!-- /.error-footer --> | |
</div><!-- /#cf-error-details --> | |
</div><!-- /#cf-wrapper --> | |
<script type="text/javascript">var RecaptchaOptions = { theme: 'custom', custom_theme_widget: 'recaptcha_widget' };</script> | |
<script src="//www.google.com/recaptcha/api/challenge?k=6LeT6gcAAAAAAAZ_yDmTMqPH57dJQZdQcu6VFqog"></script> | |
<script type="text/javascript"> | |
window._cf_translation = {}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment