Skip to content

Commit d9225e6

Browse files
committed
move phraseapp js into own file
1 parent 8fc30fb commit d9225e6

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

public/js/phraseapp.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
window.PHRASEAPP_CONFIG = {
2+
projectId: '94f8b39450cd749ae9c3cc0ab8cdb61d'
3+
};
4+
(function() {
5+
var phraseapp = document.createElement('script'); phraseapp.type = 'text/javascript'; phraseapp.async = true;
6+
phraseapp.src = ['https://', 'phraseapp.com/assets/in-context-editor/2.0/app.js?', new Date().getTime()].join('');
7+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(phraseapp, s);
8+
})();

resources/themes/pterodactyl/layouts/auth.blade.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@
5050
{!! Theme::js('js/vendor/jquery/jquery.min.js') !!}
5151
{!! Theme::js('vendor/bootstrap/bootstrap.min.js') !!}
5252

53-
@if(config('app.phrase_in_context'))
54-
<script>
55-
window.PHRASEAPP_CONFIG = {
56-
projectId: '94f8b39450cd749ae9c3cc0ab8cdb61d'
57-
};
58-
(function() {
59-
var phraseapp = document.createElement('script'); phraseapp.type = 'text/javascript'; phraseapp.async = true;
60-
phraseapp.src = ['https://', 'phraseapp.com/assets/in-context-editor/2.0/app.js?', new Date().getTime()].join('');
61-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(phraseapp, s);
62-
})();
63-
</script>
64-
@endif
53+
@if(config('app.phrase_in_context')) {!! Theme::js('js/phraseapp.js') !!} @endif
6554
</body>
6655
</html>

resources/themes/pterodactyl/layouts/master.blade.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,7 @@ class="active"
282282
{!! Theme::js('js/vendor/socketio/socket.io.min.js') !!}
283283
{!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js') !!}
284284

285-
@if(config('app.phrase_in_context'))
286-
<script>
287-
window.PHRASEAPP_CONFIG = {
288-
projectId: '94f8b39450cd749ae9c3cc0ab8cdb61d'
289-
};
290-
(function() {
291-
var phraseapp = document.createElement('script'); phraseapp.type = 'text/javascript'; phraseapp.async = true;
292-
phraseapp.src = ['https://', 'phraseapp.com/assets/in-context-editor/2.0/app.js?', new Date().getTime()].join('');
293-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(phraseapp, s);
294-
})();
295-
</script>
296-
@endif
285+
@if(config('app.phrase_in_context')) {!! Theme::js('js/phraseapp.js') !!} @endif
297286
@show
298287
</body>
299288
</html>

0 commit comments

Comments
 (0)