From ec97b7f0494833e64e4730c2df8d74004df7f83c Mon Sep 17 00:00:00 2001 From: dandoyon Date: Mon, 19 Sep 2011 20:11:32 -0700 Subject: [PATCH 1/2] - add style for disqus threads in css - add loadDisqus method to be called afterPartialLoaded - add div container for disqus threads --- docs/src/templates/docs.css | 17 +++++++++++++++++ docs/src/templates/docs.js | 17 +++++++++++++++-- docs/src/templates/index.html | 5 ++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/docs/src/templates/docs.css b/docs/src/templates/docs.css index 6ba835680721..7215031d55d9 100644 --- a/docs/src/templates/docs.css +++ b/docs/src/templates/docs.css @@ -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; diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js index b31a748da037..a57e157183a7 100644 --- a/docs/src/templates/docs.js +++ b/docs/src/templates/docs.js @@ -7,7 +7,6 @@ function DocsController($location, $browser, $window, $cookies) { HAS_HASH = /#/; this.$location = $location; - self.versionNumber = angular.version.full; self.version = angular.version.full + " " + angular.version.codeName; self.subpage = false; @@ -65,9 +64,22 @@ 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.hashPath.substr(1)]); + $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() { @@ -76,6 +88,7 @@ function DocsController($location, $browser, $window, $cookies) { "body=" + escape("Hi there,\n\nI read " + $location.href + " 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! diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index d5cfaed2d290..45268b01f7b7 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -70,8 +70,11 @@

Report an Issue or Ask a Question + - +
+
+