Skip to content

Commit

Permalink
Replaced feedback page with link to issue tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
levibotelho committed May 5, 2014
1 parent 47b4d78 commit e83b588
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 133 deletions.
2 changes: 0 additions & 2 deletions AngularTutorial.Web/AngularTutorial.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
<Content Include="Content\Images\Editor.png" />
<Content Include="Content\Images\ImStuck.png" />
<Content Include="Content\Images\Run.png" />
<Content Include="Content\Views\Feedback.html" />
<Content Include="Content\Views\Home.html" />
<Content Include="favicon.ico" />
<Content Include="Content\Images\LearnAngular-huge.png" />
Expand Down Expand Up @@ -485,7 +484,6 @@
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\ResourceLessonController.cs" />
<Compile Include="Entities\CacheFiller.cs" />
<Compile Include="Entities\Feedback.cs" />
<Compile Include="Entities\XmlParser.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
Expand Down
43 changes: 0 additions & 43 deletions AngularTutorial.Web/Content/Views/Feedback.html

This file was deleted.

9 changes: 0 additions & 9 deletions AngularTutorial.Web/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Linq;
using System.Web.Mvc;
using AngularTutorial.Services;
using AngularTutorial.Web.Entities;

#if !DEBUG
using System.Web.UI;
Expand Down Expand Up @@ -63,14 +62,6 @@ public JsonResult GetLesson(string id)
return Json(lesson, JsonRequestBehavior.AllowGet);
}

[HttpPost]
public void SendFeedback(string subject, string message)
{
subject = subject.Substring(0, 200);
message = message.Substring(0, 1000);
Feedback.SendMessage(subject, message);
}

static string GetSnapshotUrl(string escapedFragment)
{
return string.Format(
Expand Down
27 changes: 0 additions & 27 deletions AngularTutorial.Web/Entities/Feedback.cs

This file was deleted.

4 changes: 1 addition & 3 deletions AngularTutorial.Web/Entities/SiteMapGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ public static class SiteMapGenerator
static readonly List<string> Urls = new List<string>
{
Host,
Host + "lessons",
Host + "about",
Host + "feedback"
Host + "lessons"
};

public static void Generate()
Expand Down
5 changes: 0 additions & 5 deletions AngularTutorial.Web/Scripts/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
.when("/lessons", {
redirectTo: "/lessons/introducing-angular"
})
.when("/feedback", {
templateUrl: "/Content/Views/Feedback.html",
controller: "feedback",
title: "Feedback"
})
.otherwise({
templateUrl: "/Content/Views/Home.html",
controller: "home",
Expand Down
70 changes: 29 additions & 41 deletions AngularTutorial.Web/Scripts/Controllers.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
angular.module("controllers", ["ui.ace", "services"])
.controller("index", [
"$scope", "$routeParams", "navigationService",
function ($scope, $routeParams, navigationService) {
function($scope, $routeParams, navigationService) {
$scope.tableOfContents = null;
$scope.selectedLesson = null;
$scope.isTableOfContentsAvailable = false;

$scope.selectLesson = function (id) {
$scope.selectLesson = function(id) {
navigationService.selectLesson(id);
};

navigationService.getTableOfContents()
.success(function (data) {
.success(function(data) {
$scope.tableOfContents = data;
if ($routeParams.lessonId != null) {
$scope.selectLesson($routeParams.lessonId);
}
})
.error(function () {
.error(function() {
alert("An unexpected error has occured. Please try again.");
});

$scope.$watch(function () { return navigationService.selectedLesson; },
function (newValue, oldValue) {
$scope.$watch(function() { return navigationService.selectedLesson; },
function(newValue, oldValue) {
if (newValue != oldValue) {
$scope.selectedLesson = newValue;
}
});

$scope.$watch(function () { return navigationService.isTableOfContentsAvailable; },
function (newValue, oldValue) {
$scope.$watch(function() { return navigationService.isTableOfContentsAvailable; },
function(newValue, oldValue) {
if (newValue != oldValue) {
$scope.isTableOfContentsAvailable = newValue;
}
});
}
])
.controller("home", ["$scope", "$window", "navigationService", function ($scope, $window, navigationService) {
$window.document.title = "Home";
navigationService.isTableOfContentsAvailable = false;
}])
.controller("home", [
"$scope", "$window", "navigationService", function($scope, $window, navigationService) {
$window.document.title = "Home";
navigationService.isTableOfContentsAvailable = false;
}
])
.controller("lesson", [
"$scope", "$http", "$routeParams", "$sce", "$window", "navigationService",
function ($scope, $http, $routeParams, $sce, $window, navigationService) {
function($scope, $http, $routeParams, $sce, $window, navigationService) {
$scope.id = "";
$scope.title = "";
$scope.instructions = "";
Expand All @@ -51,19 +53,19 @@
$scope.headIncludes = "";
$scope.scriptIncludes = "";

$scope.areEditableDocuments = function () {
$scope.areEditableDocuments = function() {
return $scope.htmlDocuments.length != 0 || $scope.javaScriptDocuments.length != 0;
};

$scope.run = function () {
$scope.run = function() {
var frame = window.frames[0].document;
var document = $scope.generateDocument();
frame.open();
frame.write(document);
frame.close();
};

$scope.generateDocument = function () {
$scope.generateDocument = function() {
if ($scope.htmlDocuments.length > 1) {
throw new Error("Multiple HTML documents are not yet supported");
}
Expand All @@ -76,7 +78,7 @@
return baseDocument;
};

$scope.generateBaseHtmlDocument = function (header, body, footer) {
$scope.generateBaseHtmlDocument = function(header, body, footer) {
var document = "";
if (header != null)
document += header + "\n";
Expand All @@ -89,7 +91,7 @@
return document.trim();
};

$scope.generateScriptBlock = function () {
$scope.generateScriptBlock = function() {
var scriptBlock = "";
for (var i = 0; i < $scope.javaScriptDocuments.length; i++) {
var document = $scope.javaScriptDocuments[i];
Expand All @@ -99,7 +101,7 @@
return scriptBlock.trim();
};

$scope.insertHeadIncludes = function (document) {
$scope.insertHeadIncludes = function(document) {
if ($scope.headIncludes == "")
return document;

Expand All @@ -111,7 +113,7 @@
return document.substr(0, insertIndex) + $scope.headIncludes + document.substr(insertIndex) + "\n";
};

$scope.insertScript = function (document, scriptBlock) {
$scope.insertScript = function(document, scriptBlock) {
if (scriptBlock == null) {
return document;
}
Expand All @@ -132,7 +134,7 @@
return document.substr(0, insertIndex) + scripts + document.substr(insertIndex);
};

$scope.showSolution = function () {
$scope.showSolution = function() {
for (var i = 0; i < $scope.htmlDocuments.length; i++) {
var htmlDocument = $scope.htmlDocuments[i];
htmlDocument.html = htmlDocument.solutionHtml;
Expand All @@ -143,7 +145,7 @@
}
};

$scope.resetCode = function () {
$scope.resetCode = function() {
for (var i = 0; i < $scope.htmlDocuments.length; i++) {
var htmlDocument = $scope.htmlDocuments[i];
htmlDocument.html = htmlDocument.initialHtml;
Expand All @@ -154,7 +156,7 @@
}
};

$scope.loadLesson = function (id) {
$scope.loadLesson = function(id) {
$http.get("/Home/GetLesson", { params: { id: id } })
// data, status, headers, config
.success(function(data) {
Expand All @@ -171,7 +173,7 @@
});
};

$scope.parseHtmlDocuments = function (documents) {
$scope.parseHtmlDocuments = function(documents) {
$scope.htmlDocuments.length = 0;
if (documents == null)
return;
Expand All @@ -190,7 +192,7 @@
}
};

$scope.parseJavaScriptDocuments = function (documents) {
$scope.parseJavaScriptDocuments = function(documents) {
$scope.javaScriptDocuments.length = 0;
if (documents == null)
return;
Expand All @@ -207,13 +209,13 @@
}
};

$scope.generateDocumentId = function (name) {
$scope.generateDocumentId = function(name) {
if (name == null)
throw new Error("name cannot be null");
return name.replace(".", "");
};

$scope.parseIncludes = function (includes) {
$scope.parseIncludes = function(includes) {
return includes != null ? includes.join("\n") : "";
};

Expand All @@ -223,18 +225,4 @@
navigationService.selectLesson($routeParams.lessonId);
}
}
])
.controller("feedback", [
"$scope", "$http", "$window", "navigationService",
function ($scope, $http, $window, navigationService) {
$window.document.title = "Feedback";
$scope.feedbackStatus = -1;
navigationService.isTableOfContentsAvailable = false;
$scope.submit = function () {
$scope.feedbackStatus = -1;
$http.post("/Home/SendFeedback", { subject: $scope.subject, message: $scope.message })
.success(function () { $scope.feedbackStatus = 0; })
.error(function () { $scope.feedbackStatus = 1; });
};
}
]);
2 changes: 0 additions & 2 deletions AngularTutorial.Web/Sitemap/Sitemap.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
http://www.learn-angular.org/#!/
http://www.learn-angular.org/#!/lessons
http://www.learn-angular.org/#!/about
http://www.learn-angular.org/#!/feedback
http://www.learn-angular.org/#!/lessons/introducing-angular
http://www.learn-angular.org/#!/lessons/the-essentials
http://www.learn-angular.org/#!/lessons/a-simple-app
Expand Down
2 changes: 1 addition & 1 deletion AngularTutorial.Web/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="#!/lessons">Lessons</a></li>
<li><a href="#!/feedback">Feedback</a></li>
<li><a href="https://github.com/LeviBotelho/LearnAngular/issues">Feedback</a></li>
</ul>
</div><!-- /.container-fluid -->
</nav>
Expand Down

0 comments on commit e83b588

Please sign in to comment.