add google analytics and facebook scripts && improve url share method w/ fb && enforce https in prod
This commit is contained in:
@@ -3,11 +3,31 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{% block metas %}{% endblock %}
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
{% block stylesheets %}{% endblock %}
|
||||
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/>
|
||||
<script type="text/javascript">
|
||||
(function (i, s, o, g, r, a, m) {
|
||||
i['GoogleAnalyticsObject'] = r;
|
||||
i[r] = i[r] || function () {
|
||||
(i[r].q = i[r].q || []).push(arguments)
|
||||
}, i[r].l = 1 * new Date();
|
||||
a = s.createElement(o),
|
||||
m = s.getElementsByTagName(o)[0];
|
||||
a.async = 1;
|
||||
a.src = g;
|
||||
m.parentNode.insertBefore(a, m)
|
||||
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
|
||||
|
||||
ga('create', 'UA-88761060-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="fb-root"></div>
|
||||
<header>
|
||||
{% block header %}{% endblock %}
|
||||
</header>
|
||||
@@ -22,9 +42,12 @@
|
||||
<script type="text/javascript">
|
||||
window.fbAsyncInit = function () {
|
||||
FB.init({
|
||||
appId: '320599508311862',
|
||||
appId: '{{ facebook_api }}',
|
||||
xfbml: true,
|
||||
version: 'v2.8'
|
||||
cookie: true,
|
||||
status: true,
|
||||
oauth: true,
|
||||
version: '{{ facebook_api_version }}'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ framework:
|
||||
twig:
|
||||
debug: "%kernel.debug%"
|
||||
strict_variables: "%kernel.debug%"
|
||||
globals:
|
||||
facebook_api: "%facebook.api%"
|
||||
facebook_api_version: "%facebook.version%"
|
||||
|
||||
# Doctrine Configuration
|
||||
doctrine:
|
||||
|
||||
@@ -32,6 +32,10 @@ monolog:
|
||||
type: console
|
||||
channels: [!event, !doctrine]
|
||||
|
||||
parameters:
|
||||
facebook.api: 320599508311862
|
||||
facebook.version: 'v2.8'
|
||||
|
||||
# Facebook OAuth
|
||||
hwi_oauth:
|
||||
firewall_names: [secured_area]
|
||||
|
||||
@@ -23,6 +23,10 @@ monolog:
|
||||
console:
|
||||
type: console
|
||||
|
||||
parameters:
|
||||
facebook.api: 320597498312063
|
||||
facebook.version: 'v2.8'
|
||||
|
||||
# Facebook OAuth
|
||||
hwi_oauth:
|
||||
firewall_names: [secured_area]
|
||||
|
||||
@@ -4,11 +4,14 @@ fos_user:
|
||||
JotunheimrUserBundle:
|
||||
resource: "@JotunheimrUserBundle/Resources/config/routing.yml"
|
||||
prefix: /
|
||||
schemes: [https]
|
||||
|
||||
JotunheimrAdminBundle:
|
||||
resource: "@JotunheimrAdminBundle/Resources/config/routing.yml"
|
||||
prefix: /
|
||||
schemes: [https]
|
||||
|
||||
MineSeekerBundle:
|
||||
resource: "@MineSeekerBundle/Resources/config/routing.yml"
|
||||
prefix: /
|
||||
schemes: [https]
|
||||
|
||||
@@ -12,3 +12,4 @@ _errors:
|
||||
|
||||
_main:
|
||||
resource: routing.yml
|
||||
schemes: [http]
|
||||
|
||||
@@ -14,10 +14,30 @@
|
||||
{% endstylesheets %}
|
||||
{% endblock %}
|
||||
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Rajdhani:300,400,500,600,700&subset=latin-ext" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css?family=Rajdhani:300,400,500,600,700&subset=latin-ext"
|
||||
rel="stylesheet">
|
||||
<script type="text/javascript">
|
||||
(function (i, s, o, g, r, a, m) {
|
||||
i['GoogleAnalyticsObject'] = r;
|
||||
i[r] = i[r] || function () {
|
||||
(i[r].q = i[r].q || []).push(arguments)
|
||||
}, i[r].l = 1 * new Date();
|
||||
a = s.createElement(o),
|
||||
m = s.getElementsByTagName(o)[0];
|
||||
a.async = 1;
|
||||
a.src = g;
|
||||
m.parentNode.insertBefore(a, m)
|
||||
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
|
||||
|
||||
ga('create', 'UA-88761060-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="fb-root"></div>
|
||||
|
||||
{% if app.request.hasPreviousSession %}
|
||||
{% for type, messages in app.session.flashbag.all() %}
|
||||
{% for message in messages %}
|
||||
@@ -42,9 +62,12 @@
|
||||
<script type="text/javascript">
|
||||
window.fbAsyncInit = function () {
|
||||
FB.init({
|
||||
appId: '320599508311862',
|
||||
appId: '{{ facebook_api }}',
|
||||
xfbml: true,
|
||||
version: 'v2.8'
|
||||
cookie: true,
|
||||
status: true,
|
||||
oauth: true,
|
||||
version: '{{ facebook_api_version }}'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -96,51 +96,37 @@ main {
|
||||
|
||||
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window h1 {
|
||||
font-weight: bold;
|
||||
font-size: 32px;
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window h2 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window h3 {
|
||||
font-size: 16px;
|
||||
color: #386e8c;
|
||||
}
|
||||
|
||||
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy input {
|
||||
border: 0;
|
||||
height: 40px;
|
||||
width: 90%;
|
||||
width: 100%;
|
||||
padding: 0 20px;
|
||||
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
|
||||
}
|
||||
|
||||
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy button {
|
||||
border: 0;
|
||||
width: 10%;
|
||||
height: 40px;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-border-top-right-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
-webkit-border-bottom-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
}
|
||||
|
||||
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window .clippy button img {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
#mine-wrapper .game-wrapper .game-overlay .game-overlay-window a {
|
||||
background: #d8e3ea;
|
||||
display: inline-table;
|
||||
|
||||
@@ -160,6 +160,27 @@ class MineSeeker extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus
|
||||
* @see https://developers.facebook.com/docs/sharing/reference/send-dialog
|
||||
* @see https://developers.facebook.com/docs/plugins/share-button/
|
||||
*/
|
||||
clickFBShare() {
|
||||
let display = 'popup';
|
||||
|
||||
FB.getLoginStatus(function (response) {
|
||||
display = response.status === 'connected'
|
||||
? 'dialog'
|
||||
: 'popup';
|
||||
});
|
||||
|
||||
FB.ui({
|
||||
method: 'send',
|
||||
display: display,
|
||||
link: window.location.href + '/' + this.state.gameAssoc,
|
||||
});
|
||||
}
|
||||
|
||||
wInit(session, data, gridClient) {
|
||||
this.setState({session: session});
|
||||
|
||||
@@ -184,14 +205,17 @@ class MineSeeker extends React.Component {
|
||||
overlaySubTitle: this.state.gameAssoc
|
||||
?
|
||||
<div>
|
||||
<h3>Share this unique link w/ your opponent</h3>
|
||||
<div className="clippy">
|
||||
<input id="foo"
|
||||
defaultValue={window.location.href + '/' + this.state.gameAssoc}/>
|
||||
<button className="btn">
|
||||
<img src="/bundles/mineseeker/images/clippy.svg" alt="Copy to clipboard"/>
|
||||
</button>
|
||||
</div>
|
||||
{this.state.env !== 'dev' &&
|
||||
<a onClick={this.clickFBShare.bind(this)}>Share in Facebook message</a>
|
||||
}
|
||||
{this.state.env === 'dev' &&
|
||||
<a href={"/play/" + this.state.gameAssoc} target="_blank">Play w/ me!</a>
|
||||
}
|
||||
</div>
|
||||
: '',
|
||||
renderGridFields: this.state.gameAssoc
|
||||
@@ -349,7 +373,7 @@ class MineSeeker extends React.Component {
|
||||
|
||||
/** After rendering */
|
||||
componentDidMount() {
|
||||
|
||||
this.connectWithWebsocket();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<a href="{{ path('MineSeekerBundle_gamePlay') }}">Most játszom egyet!</a>
|
||||
<a href="{{ path('fos_user_registration_register') }}" class="small">Regisztrálok</a> ·
|
||||
<a href="{{ path('fos_user_security_login') }}" class="small">Belépek</a>
|
||||
<h3>version 0.16.11 (beta2) · MineSeeker© · <a href="http://www.laszlolang.com">www.laszlolang.com</a>
|
||||
<h3>version 0.18.11 (beta2) · MineSeeker© · <a href="http://www.laszlolang.com">www.laszlolang.com</a>
|
||||
</h3>
|
||||
</div>
|
||||
<img src="{{ asset('bundles/mineseeker/images/mine-logo-logo.png') }}" alt="MineSeeker Logo" border="0"/>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
{% extends '::base.html.twig' %}
|
||||
|
||||
{% block metas %}
|
||||
{#<meta property="og:url" content="http://www.your-domain.com/your-page.html" />#}
|
||||
{#<meta property="og:type" content="website" />#}
|
||||
{#<meta property="og:title" content="Your Website Title" />#}
|
||||
{#<meta property="og:description" content="Your description" />#}
|
||||
{#<meta property="og:image" content="http://www.your-domain.com/path/image.jpg" />#}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="mine-container">
|
||||
<div id="mine-wrapper"
|
||||
|
||||
Reference in New Issue
Block a user