Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ember Recaptcha POC
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['g-recaptcha'],
attributeBindings: ['siteKey:data-sitekey'],
siteKey: '6LcggAqwgTAAA234AAO5J44Z422341rdG1d4qQ234sasfasqDD-iYmVT5p5gv',
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Recaptcha</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for 'head'}}
<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/recaptcha.css">
{{content-for 'head-footer'}}
</head>
<body>
{{content-for 'body'}}
<script src="assets/vendor.js"></script>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script src="assets/recaptcha.js"></script>
{{content-for 'body-footer'}}
</body>
</html>
<h2 id="title">Welcome to Ember.js</h2>
{{google-recaptcha}}
/* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'recaptcha',
environment: environment,
baseURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
}
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
},
contentSecurityPolicy: {
'default-src': "'none'",
'script-src': "'self' https://www.gstatic.com https://www.google.com",
'font-src': "'self'",
'connect-src': "'self'",
'img-src': "'self'",
'style-src': "'self'",
'media-src': "'self'"
},
};
if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
// ENV.APP.LOG_VIEW_LOOKUPS = true;
}
if (environment === 'test') {
// Testem prefers this...
ENV.baseURL = '/';
ENV.locationType = 'none';
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = '#ember-testing';
}
if (environment === 'production') {
}
return ENV;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment