How to use the ember-get-config.FB_APP_ID function in ember-get-config

To help you get started, we’ve selected a few ember-get-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CenterForOpenScience / ember-osf-preprints / app / controllers / content.js View on Github external
facebookHref: Ember.computed('model', function() {
        const queryParams = {
            app_id: config.FB_APP_ID,
            display: 'popup',
            href: window.location.href,
            redirect_uri: window.location.href
        };

        return `https://www.facebook.com/dialog/share?${queryStringify(queryParams)}`;
    }),
    // https://developer.linkedin.com/docs/share-on-linkedin
github CenterForOpenScience / ember-osf-preprints / app / routes / content.js View on Github external
return preprint.get('node').then(node => {
            this.set('node', node);

            if (this.get('editMode')) {
                let userPermissions = this.get('node.currentUserPermissions') || [];
                if (userPermissions.indexOf(permissions.ADMIN) === -1) {
                    this.replaceWith('forbidden'); // Non-admin trying to access edit form.
                }
            }

            const {origin} = window.location;
            const image = this.get('theme.logoSharing');
            const imageUrl = `${origin.replace(/^https/, 'http')}${image.path}`;

            const ogp = [
                ['fb:app_id', config.FB_APP_ID],
                ['og:title', node.get('title')],
                ['og:image', imageUrl],
                ['og:image:secure_url', `${origin}${image.path}`], // We should always be on https in staging/prod
                ['og:image:width', image.width.toString()],
                ['og:image:height', image.height.toString()],
                ['og:image:type', image.type],
                ['og:url', window.location.href],
                ['og:description', node.get('description')],
                ['og:site_name', this.get('theme.provider.name')],
                ['og:type', 'article'],
                ['article:published_time', preprint.get('datePublished').toISOString()],
            ];

            const modified = preprint.get('dateModified') || preprint.get('dateCreated');

            if (modified)
github CenterForOpenScience / ember-osf-web / app / services / meta-tags.ts View on Github external
getMetaTags(this: MetaTags, metaTagsOverrides: MetaTagsData): MetaTagsDefs {
        // Default values.
        const metaTagsData: MetaTagsData = {
            type: 'article',
            description: this.get('i18n').t('general.hosted_on_the_osf'),
            url: pathJoin(config.OSF.url, this.get('router').get('currentURL')),
            language: this.get('i18n').get('locale'),
            image: pathJoin(config.OSF.url, 'static/img/preprints_assets/osf/sharing.png'),
            imageType: 'image/png',
            imageWidth: 1200,
            imageHeight: 630,
            imageAlt: this.get('i18n').t('home.brand'),
            siteName: this.get('i18n').t('home.brand'),
            institution: this.get('i18n').t('general.cos'),
            fbAppId: config.FB_APP_ID,
            twitterSite: config.social.twitter.viaHandle,
            twitterCreator: config.social.twitter.viaHandle,
            ...metaTagsOverrides,
        };

        // Include URL, DOI, and any additional identifiers.
        const identifiers = toArray(metaTagsData.url)
            .concat(toArray(metaTagsData.doi))
            .concat(toArray(metaTagsData.identifier));

        return {
            // Citation
            citation_title: metaTagsData.title,
            citation_doi: metaTagsData.doi,
            citation_publisher: metaTagsData.siteName,
            citation_author_institution: metaTagsData.institution,
github CenterForOpenScience / ember-osf-preprints / app / routes / content / index.js View on Github external
const description = node.get('description');
                const doi = preprint.get('doi');
                const image = this.get('theme.logoSharing');
                const imageUrl = `${origin.replace(/^https/, 'http')}${image.path}`;
                const dateCreated = new Date(preprint.get('dateCreated') || null);
                const dateModified = new Date(preprint.get('dateModified') || dateCreated);
                if (!preprint.get('datePublished'))
                    preprint.set('datePublished', dateCreated);
                const providerName = provider.get('name');
                const canonicalUrl = preprint.get('links.html');

                // NOTE: Ordering of meta tags matters for scrapers (Facebook, LinkedIn, Google, etc)

                // Open Graph Protocol
                const openGraph = [
                    ['fb:app_id', config.FB_APP_ID],
                    ['og:title', title],
                    ['og:image', imageUrl],
                    ['og:image:secure_url', `${origin}${image.path}`], // We should always be on https in staging/prod
                    ['og:image:width', image.width.toString()],
                    ['og:image:height', image.height.toString()],
                    ['og:image:type', image.type],
                    ['og:url', canonicalUrl],
                    ['og:description', description],
                    ['og:site_name', providerName],
                    ['og:type', 'article'],
                    ['article:published_time', dateCreated.toISOString()],
                    ['article:modified_time', dateModified.toISOString()]
                ];

                // Highwire Press
                const highwirePress = [
github CenterForOpenScience / ember-osf-web / lib / registries / addon / components / sharing-icons / component.ts View on Github external
import Component from '@ember/component';
import config from 'ember-get-config';

import { layout } from 'ember-osf-web/decorators/component';
import param from 'ember-osf-web/utils/param';
import template from './template';

@layout(template)
export default class SharingIcons extends Component {
    // optional arguments
    title!: string;
    hyperlink!: string;
    description?: string;
    resultId?: string;
    parentId?: string;
    facebookAppId?: string = config.FB_APP_ID || '';

    @computed('hyperlink', 'title')
    get twitterHref(this: SharingIcons): string {
        const queryParams = {
            url: this.hyperlink,
            text: this.title,
            via: config.social.twitter.viaHandle,
        };
        return `https://twitter.com/intent/tweet?${param(queryParams)}`;
    }

    @computed('hyperlink', 'facebookAppId')
    get facebookHref(this: SharingIcons): string | null {
        if (!this.facebookAppId) {
            return null;
        }
github CenterForOpenScience / ember-osf-preprints / app / controllers / content / index.js View on Github external
facebookAppId: computed('model', function() {
        return this.get('model.provider.facebookAppId') ? this.get('model.provider.facebookAppId') : config.FB_APP_ID;
    }),
    supplementalMaterialDisplayLink: computed('node.links.html', function() {