Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
diaspora
Commits
7be7acdf
Commit
7be7acdf
authored
May 03, 2012
by
danielgrippi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add chartbeat option for great success (and metrics)
parent
3b994f45
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
0 deletions
+44
-0
app/helpers/analytics_helper.rb
app/helpers/analytics_helper.rb
+33
-0
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+4
-0
app/views/layouts/post.html.haml
app/views/layouts/post.html.haml
+4
-0
config/application.yml.example
config/application.yml.example
+3
-0
No files found.
app/helpers/analytics_helper.rb
View file @
7be7acdf
...
...
@@ -25,9 +25,42 @@ module AnalyticsHelper
end
end
def
chartbeat_head_block
return
unless
chartbeat_configured?
javascript_tag
(
"var _sf_startpt=(new Date()).getTime()"
)
end
def
include_chartbeat
return
unless
chartbeat_configured?
javascript_tag
do
<<-
JS
var _sf_async_config = { uid:
#{
AppConfig
[
:charbeat_uid
]
}
, domain: '
#{
AppConfig
[
:pod_url
]
}
' };
(function() {
function loadChartbeat() {
window._sf_endpt = (new Date()).getTime();
var e = document.createElement('script');
e.setAttribute('language', 'javascript');
e.setAttribute('type', 'text/javascript');
e.setAttribute('src',
(("https:" == document.location.protocol) ? "https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/" : "http://static.chartbeat.com/") +
"js/chartbeat.js");
document.body.appendChild(e);
};
var oldonload = window.onload;
window.onload = (typeof window.onload != 'function') ?
loadChartbeat : function() { oldonload(); loadChartbeat(); };
})();
JS
end
end
private
def
google_configured?
AppConfig
[
:google_a_site
].
present?
&&
AppConfig
[
:google_a_site
].
present?
end
def
chartbeat_configured?
AppConfig
[
:chartbeat_uid
].
present?
end
end
\ No newline at end of file
app/views/layouts/application.html.haml
View file @
7be7acdf
...
...
@@ -19,6 +19,8 @@
%title
=
page_title
yield
(
:page_title
)
=
chartbeat_head_block
=
include_base_css_framework
=
stylesheet_link_tag
'login'
,
'application'
,
'default'
...
...
@@ -73,3 +75,5 @@
%li
=
link_to
t
(
'.whats_new'
),
'https://github.com/diaspora/diaspora/wiki/Changelog'
%li
=
link_to
(
t
(
'layouts.application.toggle'
),
toggle_mobile_path
)
if
is_mobile_device?
=
image_tag
'branding/powered_by_diaspora.png'
,
:height
=>
"11px"
,
:width
=>
"145px"
=
include_chartbeat
app/views/layouts/post.html.haml
View file @
7be7acdf
...
...
@@ -20,6 +20,8 @@
%link
{
:rel
=>
'apple-touch-icon'
,
:href
=>
'/apple-touch-icon.png'
}
=
og_site_name
=
chartbeat_head_block
%title
=
page_title
yield
(
:page_title
)
...
...
@@ -58,3 +60,5 @@
=
flash_messages
#container
=
javascript_tag
"window.preLoadContent = '
#{
escape_javascript
(
yield
)
}
'"
=
include_chartbeat
config/application.yml.example
View file @
7be7acdf
...
...
@@ -82,6 +82,9 @@ defaults: &defaults
# the site url in raw format (e.g. pikwik.examplehost.com)
piwik_url:
## Chartbeat tracking
chartbeat_uid:
######################################################
# General Pod Settings
######################################################
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment