Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

doc(disqus): Add integration to disqus discussion thread service #564

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/src/templates/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,23 @@ li {
height: 1em;
}

#disqus_thread {
float: right;
margin-top: 1em;
margin-right: 3em;
width: 57em;
padding: 0.5em 1em 1em 1em;
background: #fff;
overflow: hidden;

-moz-box-shadow: 4px 4px 6px #48577D;
-webkit-box-shadow: 4px 4px 6px #48577D;
box-shadow: 4px 4px 6px #48577D;

-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
}

#content {
background-color: #fff;
Expand Down
16 changes: 15 additions & 1 deletion docs/src/templates/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function DocsController($location, $browser, $window, $cookies) {
DOCS_PATH = /^\/(api)|(guide)|(cookbook)|(misc)|(tutorial)/;

this.$location = $location;

self.versionNumber = angular.version.full;
self.version = angular.version.full + " " + angular.version.codeName;
self.subpage = false;
Expand Down Expand Up @@ -66,9 +65,23 @@ function DocsController($location, $browser, $window, $cookies) {
};

this.afterPartialLoaded = function() {
var currentPageId = $location.hashPath.substr(1);
SyntaxHighlighter.highlight();
$window.scrollTo(0,0);
$window._gaq.push(['_trackPageview', $location.path()]);
$window._gaq.push(['_trackPageview', currentPageId]);
this.loadDisqus(currentPageId);
};

this.loadDisqus = function(currentPageId) {
var disqus_shortname = 'angularjs'; // required: replace example with your forum shortname
var disqus_identifier = currentPageId;
/* * * Per Disqus: DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://angularjs.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
};

this.getFeedbackUrl = function() {
Expand All @@ -77,6 +90,7 @@ function DocsController($location, $browser, $window, $cookies) {
"body=" + escape("Hi there,\n\nI read " + $location.absUrl() + " and wanted to ask ....");
};


/** stores a cookie that is used by apache to decide which manifest ot send */
this.enableOffline = function() {
//The cookie will be good for one year!
Expand Down
5 changes: 4 additions & 1 deletion docs/src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@
<h2 ng:bind="partialTitle"></h2>
<a id="feedback" ng:href="{{getFeedbackUrl()}}">Report an Issue or Ask a Question</a>
<ng:include id="content" src="getCurrentPartial()" onload="afterPartialLoaded()"></ng:include>

</div>

<div id="disqus_thread" ng:cloak>
</div>

<div id="footer" ng:cloak>
<a id="version"
ng:href="https://github.com/angular/angular.js/blob/master/CHANGELOG.md#{{versionNumber}}"
Expand Down