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
/* global grecaptcha */ | |
/* global $ */ | |
/* global window */ | |
import Ember from 'ember'; | |
/** | |
* Component to handle Render and Forward Result of the reCaptcha Challenge | |
*/ | |
export default Ember.Component.extend({ | |
/** |
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
Source: http://stackoverflow.com/questions/1495407/maintain-the-aspect-ratio-of-a-div-with-css | |
aspect ratio | padding-bottom value | |
--------------|---------------------- | |
16:9 | 56.25% | |
4:3 | 75% | |
3:2 | 66.66% | |
8:5 | 62.5% | |
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
/** | |
* Useful common operations wrttien in vanilla JS. Found, borrowed, created and modified from various sources on the internet. | |
*/ | |
/** | |
* Helper to test if an element has a given class | |
* @param {*} el Element to test | |
* @param {*} className Class to test | |
*/ | |
function hasClass(el, className) { |
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
/** | |
* YouTube API helper for instantiating multiple videos on a page | |
* https://developers.google.com/youtube/iframe_api_reference | |
*/ | |
/** | |
* Helper to queue a youtube video to be instantiated with the YouTube API | |
* @param {*} videoId The YouTube Video ID | |
* @param {*} elementId The Element ID to instantiate as a YouTube player | |
* @param {*} callback The callback to be called once the player object is available |
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
/** | |
* Middleware to add the following helpers to the req object | |
* 1. wantsJSON | |
* 2. getAllParams | |
* @param req - The Express Request Object for the current request | |
* @param res - The Express Response Object for the current request | |
* @param next | |
*/ | |
function enhanceReq(req, res, next) { |
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
require('../../vendor/js/fetch'); | |
/** | |
* The defaultOptions properties used in fetching API | |
* @typedef {Object} defaultOptions | |
* @property {string} method - Indicates the http request method | |
* @property {string} url - request Url | |
* @property {Object|null} body - holds the http request body information to be used in post or put request | |
*/ | |
const fetchConfig = { |
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
const lassoLoader = require('lasso-loader'); | |
/* globals gapi, _sdk */ | |
/** | |
* Performs a one time OAuth 2.0 authorization. | |
* Depending on the parameters used, this will open a popup to the Google sign-in flow | |
* or try to load the requested response silently, without user interaction. | |
*/ | |
function authenticate() { | |
return new Promise(function (resolve, reject) { |
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
const lassoLoader = require('lasso-loader'); | |
/* globals FB, _sdk */ | |
/** | |
* Performs a one time OAuth 2.0 authorization. | |
* Depending on the parameters used, this will open a popup to the Google sign-in flow | |
* or try to load the requested response silently, without user interaction. | |
*/ | |
function authenticate() { | |
return new Promise(function (resolve, reject) { |
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
/** | |
* Helper to inject the YouTube iFrame API script and initialise a YouTube video | |
* @param container {DOMElement | string} A Dom element or a string which is the id of the element to make a youtube video | |
* @param [playerOptions={}] {Object} An object as defined by the [YT iFrame API](https://developers.google.com/youtube/player_parameters) | |
*/ | |
export default function inject(container, playerOptions={}) { | |
// Extract Player vars if available | |
const playerVars = {...(playerOptions.playerVars || {})}; | |
delete playerOptions.playerVars; |
OlderNewer