+ title="View {{ include.component_name }} component code example"
+ data-target="#{{ include.component_name }}_component-code"
+ aria-controls="{{ include.component_name }}_component-code">
{{ include.component_name }} Component
@@ -41,7 +41,8 @@
+ target="{{ site.repo_target }}"
+ onclick="handleSourceCodeView('{{ include.component_name }}');">
{% include svg/popout.svg %}
View {{ include.component_name }} component code in a new window
@@ -51,9 +52,9 @@
{% if include.component_two_name %}
+ title="View {{ include.component_two_name }} component code example"
+ data-target="#{{ include.component_two_name }}_component-code"
+ aria-controls="{{ include.component_two_name }}_component-code">
@@ -17,10 +25,16 @@
@@ -28,8 +42,24 @@
diff --git a/docs/_includes/site_navbar.html b/docs/_includes/site_navbar.html
index 1ea8f78f9..525be6b5f 100644
--- a/docs/_includes/site_navbar.html
+++ b/docs/_includes/site_navbar.html
@@ -23,13 +23,19 @@
Demos
- API Docs
+
+ API Docs
+
diff --git a/docs/_layouts/home.html b/docs/_layouts/home.html
index d9ae38b4c..8d5aba015 100644
--- a/docs/_layouts/home.html
+++ b/docs/_layouts/home.html
@@ -12,7 +12,9 @@
Demos
-
+
API Docs
@@ -31,9 +33,11 @@
The best of both worlds.
The {{ site.pkg_name }} platform delivers the declarative awesomeness of
- React
+ React
and all the creature comforts of
- Dart
+ Dart
in a single package!
@@ -54,7 +58,12 @@
The best of both worlds.
Make components;
not boilerplate.
The {{ site.pkg_name }} platform makes use of a powerful Pub transformer
- to wire up a factory and React component class,
+ to wire up a factory and
+
+ React component class
+ ,
along with props and optional state classes, so you can focus on building UI that your consumers
— and customers — will love.
diff --git a/docs/assets/js/docs.js b/docs/assets/js/docs.js
index 9dc8f24f3..fdc4e819b 100644
--- a/docs/assets/js/docs.js
+++ b/docs/assets/js/docs.js
@@ -1,3 +1,57 @@
+var gaSourceCodeViewPath = '/over_react/demos/source/';
+
+function gaLinkHandler(action, label, isAffiliated, page) {
+ // For one reason or another, analytics was not loaded onto the page
+ if (!ga) return;
+
+ isAffiliated = isAffiliated || false;
+
+ var evCategory = 'External Link';
+
+ if (isAffiliated) {
+ evCategory += ': Affiliated';
+ } else {
+ evCategory += ': 3rd Party';
+ }
+
+ // Track as an event
+ ga('send', 'event', evCategory, action, label);
+
+ // Track as pageview if the "external" location is directly
+ // related to our library (e.g. click to go to gh repo, click to go to dartdocs, etc.)
+ if (isAffiliated) {
+ page = page || label;
+ ga('send', 'pageview', page);
+ }
+}
+
+// These link clicks take the user to a 3rd party location, unaffiliated with over_react.
+function handleExternalClick(action, label) {
+ gaLinkHandler(action, label, false);
+}
+
+// These link clicks take the user to a different domain, but one that
+// we wish we could track with ga as part of the github.io site...
+function handleAffiliatedClick(action, label, page) {
+ gaLinkHandler(action, label, true, page);
+}
+
+function handleSourceCodeView(componentName) {
+ handleAffiliatedClick('View Source Code', componentName, gaSourceCodeViewPath + componentName);
+}
+
+function handleBsExternalClick() {
+ try {
+ var linkText = arguments.callee.caller.arguments[0].target.innerText;
+
+ handleExternalClick("Click: Hero", linkText);
+ } catch (err) {
+ handleExternalClick("Click: Hero", "Bootstrap component");
+ }
+}
+
+///////////////////////////////////////////
+
var contentPlaceholders = $('.content-placeholder__bg');
var waitFn;