//todo write angular scripts for developer page.


var developerKingdomModule = angular.module('app', []).
	controller("forumCtrl", function forumCtrl($scope, $window){
		
		$scope.forum = {
			threads: [{subject: "blah blah blah", posts: [{user: "user1", time:  (new Date()).toLocaleString(), message: "hi how u doing"}, {user: "user2", time:  (new Date()).toLocaleString(), message: "lol wassup"}]},
				{subject: "how to add your own functions", posts: [{user: "user1", time: (new Date()).toLocaleString(), message: "asdfasdf"}, {user: "user2", time:  (new Date()).toLocaleString(), message: "j jajajajajajh"}]}]
		};
		
		$scope.currentThread = {};
		$scope.currentThreadOn = false;
		
		$scope.setThread = function(thread){
			$scope.currentThread = thread;
			$scope.currentThreadOn = true;
		}
		
		$scope.backToForum = function(){
			$scope.currentThreadOn = false;
		}
		
		$scope.addPost = function(thread){
			if($scope.currentUser == "" || $scope.currentUser == null){
				$scope.currentUser = "Guest";
			}
			$scope.currentThread.posts.push({user: $scope.currentUser, message: $scope.newPost, time: (new Date()).toLocaleString()});
			
			$scope.newPost = "";
		}
		
		$scope.currentUser = "";
		$scope.newPost = "";
	});

@@ -1166,32 +1166,346 @@
 st = %22%22;%0A%09%09%7D%0A%09%09%0A
+%09%09$scope.addThread = function()%7B%0A%09%09%09if($scope.currentUser == %22%22 %7C%7C $scope.currentUser == null)%7B%0A%09%09%09%09$scope.currentUser = %22Guest%22;%0A%09%09%09%7D%0A%09%09%09$scope.forum.threads.push(%7B%0A%09%09%09%09subject: $scope.newSubject,%0A%09%09%09%09posts: %5B%7Buser: $scope.currentUser, message: $scope.newPost, time: (new Date()).toLocaleString()%7D%5D%0A%09%09%09%7D);%0A%09%09%7D%0A%09%09%0A
 %09%09$scope.current
@@ -1538,13 +1538,39 @@
 t = %22%22;%0A
+%09%09$scope.newSubject = %22%22;%0A
 %09%7D);%0A

Update forum.js