From d9225e65dfe26226965829d689442b352fbb253c Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Thu, 2 Feb 2017 15:30:40 +0100 Subject: [PATCH] move phraseapp js into own file --- public/js/phraseapp.js | 8 ++++++++ resources/themes/pterodactyl/layouts/auth.blade.php | 13 +------------ .../themes/pterodactyl/layouts/master.blade.php | 13 +------------ 3 files changed, 10 insertions(+), 24 deletions(-) create mode 100644 public/js/phraseapp.js diff --git a/public/js/phraseapp.js b/public/js/phraseapp.js new file mode 100644 index 000000000..a11a22655 --- /dev/null +++ b/public/js/phraseapp.js @@ -0,0 +1,8 @@ +window.PHRASEAPP_CONFIG = { + projectId: '94f8b39450cd749ae9c3cc0ab8cdb61d' +}; +(function() { + var phraseapp = document.createElement('script'); phraseapp.type = 'text/javascript'; phraseapp.async = true; + phraseapp.src = ['https://', 'phraseapp.com/assets/in-context-editor/2.0/app.js?', new Date().getTime()].join(''); + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(phraseapp, s); +})(); diff --git a/resources/themes/pterodactyl/layouts/auth.blade.php b/resources/themes/pterodactyl/layouts/auth.blade.php index 2163c9cc5..a6fbf86f5 100644 --- a/resources/themes/pterodactyl/layouts/auth.blade.php +++ b/resources/themes/pterodactyl/layouts/auth.blade.php @@ -50,17 +50,6 @@ {!! Theme::js('js/vendor/jquery/jquery.min.js') !!} {!! Theme::js('vendor/bootstrap/bootstrap.min.js') !!} - @if(config('app.phrase_in_context')) - - @endif + @if(config('app.phrase_in_context')) {!! Theme::js('js/phraseapp.js') !!} @endif diff --git a/resources/themes/pterodactyl/layouts/master.blade.php b/resources/themes/pterodactyl/layouts/master.blade.php index 250eb894d..57c7383e0 100644 --- a/resources/themes/pterodactyl/layouts/master.blade.php +++ b/resources/themes/pterodactyl/layouts/master.blade.php @@ -282,18 +282,7 @@ {!! Theme::js('js/vendor/socketio/socket.io.min.js') !!} {!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js') !!} - @if(config('app.phrase_in_context')) - - @endif + @if(config('app.phrase_in_context')) {!! Theme::js('js/phraseapp.js') !!} @endif @show