feature(feedback): add feedback API call to the site

This commit is contained in:
Naomi Black 2015-12-09 12:51:39 -08:00
parent fad02f7405
commit ee5da936da
5 changed files with 13 additions and 22 deletions

View File

@ -35,7 +35,8 @@ meta(itemprop="image" content="https://angular.io/resources/images/logos/standar
link(rel="icon" type="image/x-icon" href="/resources/images/icons/favicon.ico")
link(rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/0.8.3/angular-material.min.css")
link(href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,400italic,700' rel='stylesheet' type='text/css')
link(href="https://fonts.googleapis.com/css?family=Roboto:400,300,500,400italic,700" rel='stylesheet' type='text/css')
link(href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet")
link(rel="stylesheet" href="/resources/css/vendor/icomoon/style.css")
link(rel="stylesheet" href="/resources/css/vendor/animate.css")
link(rel="stylesheet" href="/resources/css/main.css")

View File

@ -9,3 +9,4 @@ md-toolbar(class="main-nav background-regal l-pinned-top l-layer-5")
li.l-left <a class="main-nav-button" href="/docs/ts/latest/" md-button>Docs</a>
li.l-left <a class="main-nav-button" href="/about/" md-button>About</a>
li.l-left <a class="main-nav-button" href="/contribute.html" md-button>Contribute</a>
li.l-right <md-button ng-click="appCtrl.openFeedback()" class="md-icon-button top-nav-icon" aria-label="Submit feedback on this page"><span class="material-icons" style="line-height:1.5">feedback</span></md-button>

View File

@ -48,15 +48,3 @@ if current.path[0] == "docs"
<!-- Google Feedback -->
script(src="//www.gstatic.com/feedback/api.js" type="text/javascript")
script.
var btn = document.getElementById("feedback-btn");
var submitFeedback = function() {
var dropdown = document.getElementById("feedback-dropdown");
var configuration = {
'productId': '410509',
'authuser': '1',
'bucket': dropdown.options[dropdown.selectedIndex].value
}
userfeedback.api.startFeedback(configuration);
}
btn.addEventListener("click", submitFeedback);

View File

@ -1,8 +0,0 @@
div(flex)
p.
What's your question about?
select#feedback-dropdown(name="Angular Version")
option(value="angular2") Angular 2
option(value="angularJS") AngularJS
button#feedback-btn.
Submit

View File

@ -55,6 +55,15 @@ angularIO.controller('AppCtrl', ['$mdDialog', '$timeout', '$http', '$sce', funct
else vm.apiType = type;
};
vm.openFeedback = function() {
var configuration = {
'productId': '410509',
'authuser': '1',
'bucket': 'angulario'
};
userfeedback.api.startFeedback(configuration);
};
vm.apiSections = [
{ name: 'angular2/core', title: 'angular2/core' },
{ name: 'angular2/common', title: 'angular2/common' },