diff --git a/js/components/ascribe_media/media_player.js b/js/components/ascribe_media/media_player.js index 23e84945..1d0f01e8 100644 --- a/js/components/ascribe_media/media_player.js +++ b/js/components/ascribe_media/media_player.js @@ -56,11 +56,11 @@ let Image = React.createClass({ }, componentDidMount() { - InjectInHeadUtils.inject('https://code.jquery.com/jquery-2.1.4.min.js') + InjectInHeadUtils.inject(AppConstants.jquery.sdkUrl) .then(() => Q.all([ - InjectInHeadUtils.inject(AppConstants.baseUrl + 'static/thirdparty/shmui/shmui.css'), - InjectInHeadUtils.inject(AppConstants.baseUrl + 'static/thirdparty/shmui/jquery.shmui.js') + InjectInHeadUtils.inject(AppConstants.shmui.cssUrl), + InjectInHeadUtils.inject(AppConstants.shmui.sdkUrl) ]).then(() => { window.jQuery('.shmui-ascribe').shmui(); })); }, @@ -77,7 +77,7 @@ let Audio = React.createClass({ }, componentDidMount() { - InjectInHeadUtils.inject(AppConstants.baseUrl + 'static/thirdparty/audiojs/audiojs/audio.min.js').then(this.ready); + InjectInHeadUtils.inject(AppConstants.audiojs.sdkUrl).then(this.ready); }, ready() { @@ -132,8 +132,8 @@ let Video = React.createClass({ componentDidMount() { Q.all([ - InjectInHeadUtils.inject('//vjs.zencdn.net/4.12/video-js.css'), - InjectInHeadUtils.inject('//vjs.zencdn.net/4.12/video.js')]) + InjectInHeadUtils.inject(AppConstants.videojs.cssUrl), + InjectInHeadUtils.inject(AppConstants.videojs.sdkUrl)]) .then(() => this.setState({libraryLoaded: true})) .fail(() => this.setState({libraryLoaded: false})); }, diff --git a/js/components/ascribe_social_share/facebook_share_button.js b/js/components/ascribe_social_share/facebook_share_button.js index 1f0e7aa3..87a2aef6 100644 --- a/js/components/ascribe_social_share/facebook_share_button.js +++ b/js/components/ascribe_social_share/facebook_share_button.js @@ -43,7 +43,7 @@ let FacebookShareButton = React.createClass({ className="fb-share-button btn btn-ascribe-social" data-href={this.props.url} data-layout={this.props.type}> - + ); } }); diff --git a/js/constants/application_constants.js b/js/constants/application_constants.js index 17e85608..50ab18df 100644 --- a/js/constants/application_constants.js +++ b/js/constants/application_constants.js @@ -1,15 +1,19 @@ 'use strict'; -let constants = { - //'baseUrl': 'http://localhost:8000/api/', +//const baseUrl = 'http://localhost:8000/api/'; - //FIXME: referring to a global variable in `window` is not - // super pro. What if we render stuff on the server? - // - super-bro - Senor Developer, 14th July 2015 - //'baseUrl': window.BASE_URL, - 'apiEndpoint': window.API_ENDPOINT, - 'serverUrl': window.SERVER_URL, - 'baseUrl': window.BASE_URL, +//FIXME: referring to a global variable in `window` is not +// super pro. What if we render stuff on the server? +// - super-bro - Senor Developer, 14th July 2015 +//const baseUrl = window.BASE_URL; +const apiEndpoint = window.API_ENDPOINT; +const serverUrl = window.SERVER_URL; +const baseUrl = window.BASE_URL; + +const constants = { + apiEndpoint, + serverUrl, + baseUrl, 'aclList': ['acl_coa', 'acl_consign', 'acl_delete', 'acl_download', 'acl_edit', 'acl_create_editions', 'acl_view_editions', 'acl_loan', 'acl_share', 'acl_transfer', 'acl_unconsign', 'acl_unshare', 'acl_view', 'acl_withdraw_transfer', 'acl_wallet_submit'], @@ -70,8 +74,30 @@ let constants = { } }, + 'copyrightAssociations': ['ARS', 'DACS', 'Bildkunst', 'Pictoright', 'SODRAC', 'Copyright Agency/Viscopy', 'SAVA', + 'Bildrecht GmbH', 'SABAM', 'AUTVIS', 'CREAIMAGEN', 'SONECA', 'Copydan', 'EAU', 'Kuvasto', 'GCA', 'HUNGART', + 'IVARO', 'SIAE', 'JASPAR-SPDA', 'AKKA/LAA', 'LATGA-A', 'SOMAAP', 'ARTEGESTION', 'CARIER', 'BONO', 'APSAV', + 'SPA', 'GESTOR', 'VISaRTA', 'RAO', 'LITA', 'DALRO', 'VeGaP', 'BUS', 'ProLitteris', 'AGADU', 'AUTORARTE', 'BUBEDRA', 'BBDA', 'BCDA', 'BURIDA', 'ADAVIS', 'BSDA'], + 'searchThreshold': 500, + // in case of whitelabel customization, we store stuff here 'whitelabel': {}, + + // 3rd party integrations + 'jquery': { + 'sdkUrl': 'https://code.jquery.com/jquery-2.1.4.min.js' + }, + 'shmui': { + 'sdkUrl': baseUrl + 'static/thirdparty/shmui/jquery.shmui.js', + 'cssUrl': baseUrl + 'static/thirdparty/shmui/shmui.css' + }, + 'audiojs': { + 'sdkUrl': baseUrl + 'static/thirdparty/audiojs/audiojs/audio.min.js' + }, + 'videojs': { + 'sdkUrl': '//vjs.zencdn.net/4.12/video.js', + 'cssUrl': '//vjs.zencdn.net/4.12/video-js.css' + }, 'raven': { 'url': 'https://0955da3388c64ab29bd32c2a429f9ef4@app.getsentry.com/48351' }, @@ -81,12 +107,7 @@ let constants = { }, 'twitter': { 'sdkUrl': 'https://platform.twitter.com/widgets.js' - }, - 'copyrightAssociations': ['ARS', 'DACS', 'Bildkunst', 'Pictoright', 'SODRAC', 'Copyright Agency/Viscopy', 'SAVA', - 'Bildrecht GmbH', 'SABAM', 'AUTVIS', 'CREAIMAGEN', 'SONECA', 'Copydan', 'EAU', 'Kuvasto', 'GCA', 'HUNGART', - 'IVARO', 'SIAE', 'JASPAR-SPDA', 'AKKA/LAA', 'LATGA-A', 'SOMAAP', 'ARTEGESTION', 'CARIER', 'BONO', 'APSAV', - 'SPA', 'GESTOR', 'VISaRTA', 'RAO', 'LITA', 'DALRO', 'VeGaP', 'BUS', 'ProLitteris', 'AGADU', 'AUTORARTE', 'BUBEDRA', 'BBDA', 'BCDA', 'BURIDA', 'ADAVIS', 'BSDA'], - 'searchThreshold': 500 + } }; export default constants;