Merge pull request #1952 from CachetHQ/disable-external-dependencies

Option to disable external dependencies
This commit is contained in:
James Brooks
2016-07-11 10:12:27 +01:00
committed by GitHub
8 changed files with 41 additions and 13 deletions

View File

@@ -42,8 +42,9 @@ class AppComposer
$view->withAppHeader(Config::get('setting.header'));
$view->withAppFooter(Config::get('setting.footer'));
$view->withAppName(Config::get('setting.app_name'));
$view->withShowSupport($support = Config::get('setting.show_support'));
$view->withShowSupport(Config::get('setting.show_support'));
$view->withAutomaticLocalization(Config::get('setting.automatic_localization'));
$view->withEnableExternalDependencies(Config::get('setting.enable_external_dependencies'));
$view->withSiteTitle(Config::get('setting.app_name'));
$view->withFontSubset(Config::get('langs.'.Config::get('app.locale').'.subset', 'latin'));
}

View File

@@ -56,4 +56,15 @@ return [
'show_support' => true,
/*
|--------------------------------------------------------------------------
| Enable External Dependencies
|--------------------------------------------------------------------------
|
| Whether to disable third-party dependencies.
|
*/
'enable_external_dependencies' => true,
];

View File

@@ -101,15 +101,16 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Site Name',
'site-url' => 'Site URL',
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'About this page',
'days-of-incidents' => 'How many days of incidents to show?',
'banner' => 'Banner Image',
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
'subscribers' => 'Allow people to signup to email notifications?',
'automatic_localization' => 'Automatically localise your status page to your visitor\'s language?',
'site-name' => 'Site Name',
'site-url' => 'Site URL',
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'About this page',
'days-of-incidents' => 'How many days of incidents to show?',
'banner' => 'Banner Image',
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
'subscribers' => 'Allow people to signup to email notifications?',
'automatic_localization' => 'Automatically localise your status page to your visitor\'s language?',
'enable_external_dependencies' => 'Enable Third Party Dependencies (Google Fonts, Trackers, etc...)',
],
'analytics' => [
'analytics_google' => 'Google Analytics code',

View File

@@ -20,7 +20,9 @@
<title>{{ $page_title or $site_title }}</title>
@if($enable_external_dependencies)
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $font_subset }}" rel="stylesheet" type="text/css">
@endif
<link rel="stylesheet" href="{{ elixir('dist/css/all.css') }}">
@yield('css')

View File

@@ -84,6 +84,17 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="checkbox">
<label>
<input type="hidden" value="0" name="enable_external_dependencies">
<input type="checkbox" value="1" name="enable_external_dependencies" {{ $enable_external_dependencies ? 'checked' : null }}>
{{ trans('forms.settings.app-setup.enable_external_dependencies') }}
</label>
</div>
</div>
</div>
</fieldset>
<div class="row">

View File

@@ -46,7 +46,9 @@
<title>{{ $site_title }}</title>
@if($enable_external_dependencies)
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset={{ $font_subset }}" rel="stylesheet" type="text/css">
@endif
<link rel="stylesheet" href="{{ elixir('dist/css/all.css') }}">
@include('partials.stylesheet')

View File

@@ -1,3 +1,4 @@
@if($enable_external_dependencies)
@if($app_analytics)
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -14,12 +15,10 @@
arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0];
d.src='https://d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode.
insertBefore(d,q)}(window,document,'script','_gs');
_gs('{{ $app_analytics_go_squared }}');
</script>
@endif
@if($app_analytics_piwik_url)
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
@@ -34,3 +33,4 @@
</script>
<noscript><p><img src="https://{{ $app_analytics_piwik_url }}/piwik.php?idsite={{ $app_analytics_piwik_site_id }}" style="border:0;" alt="" /></p></noscript>
@endif
@endif

View File

@@ -1,4 +1,4 @@
@if($app_locale === 'en-UD')
@if($app_locale === 'en-UD' && $enable_external_dependencies)
<script type="text/javascript">
var _jipt = [];
_jipt.push(['project', 'cachet']);