Merge pull request #66 from kiswa/dev

Merge dev into master
This commit is contained in:
Matt 2014-10-27 21:25:12 -04:00
commit 8ea769202d
15 changed files with 48 additions and 12 deletions

10
VERSION
View File

@ -1,10 +1,8 @@
v0.2.4 v0.2.5
Changelog Changelog
* Bugfix for attachments downloading with hash instead of file name (#41). * Markdown support in comments
* Bugfix for item positions (#37). * Cursor on default input field
* noty errors are ignored now. * Show app version
* Favicons added.
* API Error now returns exception message in JSON data.

View File

@ -157,6 +157,10 @@ a:hover.fa {
#board-nav :last-child.form-control { #board-nav :last-child.form-control {
margin-right: 0; margin-right: 0;
} }
.version {
margin-top: 5px;
font-size: small !important;
}
/* #SiteNav*/ /* #SiteNav*/
.nav { .nav {
margin-top: -.7em; margin-top: -.7em;

View File

@ -78,5 +78,6 @@
<script src="js/directives/clickToEdit.js"></script> <script src="js/directives/clickToEdit.js"></script>
<script src="js/directives/onLoadCallback.js"></script> <script src="js/directives/onLoadCallback.js"></script>
<script src="js/directives/fileUpload.js"></script> <script src="js/directives/fileUpload.js"></script>
<script src="js/directives/focus.js"></script>
</body> </body>
</html> </html>

View File

@ -53,6 +53,8 @@ function($routeProvider, $httpProvider) {
// Custom handlers for route authentication and rejection of invalid board id // Custom handlers for route authentication and rejection of invalid board id
taskBoard.run(['$rootScope', '$location', '$window', 'AuthenticationService', taskBoard.run(['$rootScope', '$location', '$window', 'AuthenticationService',
function($rootScope, $location, $window, AuthenticationService) { function($rootScope, $location, $window, AuthenticationService) {
$rootScope.version = 'v0.2.5';
$rootScope.$on('$routeChangeStart', function(event, nextRoute, currentRoute) { $rootScope.$on('$routeChangeStart', function(event, nextRoute, currentRoute) {
// Redirect to default path if authentication is required but not present. // Redirect to default path if authentication is required but not present.
if (nextRoute !== null && nextRoute.authRequired !== null && if (nextRoute !== null && nextRoute.authRequired !== null &&

View File

@ -4,6 +4,7 @@ function ($scope, BoardService) {
var defaultColor = '#ffffe0'; var defaultColor = '#ffffe0';
$scope.itemFormData = { $scope.itemFormData = {
setFocus: false,
isSaving: false, isSaving: false,
isAdd: true, isAdd: true,
itemId: 0, itemId: 0,
@ -19,6 +20,7 @@ function ($scope, BoardService) {
pointsError: false, pointsError: false,
reset: function(laneId) { reset: function(laneId) {
$('.popover-dismiss').popover({html:true}); $('.popover-dismiss').popover({html:true});
this.setFocus = true;
this.isSaving = false; this.isSaving = false;
this.isAdd = true; this.isAdd = true;
this.itemId = 0; this.itemId = 0;

View File

@ -1,6 +1,6 @@
taskBoardControllers.controller('ItemViewBoardCtrl', taskBoardControllers.controller('ItemViewBoardCtrl',
['$scope', 'BoardService', ['$scope', '$window', 'BoardService',
function ($scope, BoardService) { function ($scope, $window, BoardService) {
$scope.viewItem = {}; $scope.viewItem = {};
$scope.toggle = { $scope.toggle = {
sidebar: false sidebar: false
@ -15,6 +15,14 @@ function ($scope, BoardService) {
sorting: 0 sorting: 0
}; };
$scope.markedComment = function(text) {
if (text) {
return $window.marked(text);
} else {
return "<p>No text</p>";
}
};
// Takes an array of timestamps and converts them to display dates. // Takes an array of timestamps and converts them to display dates.
var convertDates = function(timestampArray) { var convertDates = function(timestampArray) {
if (undefined === timestampArray) { if (undefined === timestampArray) {

View File

@ -2,6 +2,7 @@ taskBoardControllers.controller('BoardFormSettingsCtrl',
['$scope', 'BoardService', ['$scope', 'BoardService',
function ($scope, BoardService) { function ($scope, BoardService) {
$scope.boardFormData = { $scope.boardFormData = {
setFocus: false,
boardId: 0, boardId: 0,
isAdd: true, isAdd: true,
name: '', name: '',
@ -139,6 +140,7 @@ function ($scope, BoardService) {
$scope.alerts.showAlert({ 'type': 'error', 'text': message }); $scope.alerts.showAlert({ 'type': 'error', 'text': message });
}, },
reset: function() { reset: function() {
this.setFocus = true;
this.boardId = 0; this.boardId = 0;
this.isAdd = true; this.isAdd = true;
this.name = ''; this.name = '';

View File

@ -2,6 +2,7 @@ taskBoardControllers.controller('UserFormSettingsCtrl',
['$scope', 'UserService', ['$scope', 'UserService',
function ($scope, UserService) { function ($scope, UserService) {
$scope.userFormData = { $scope.userFormData = {
setFocus: false,
userId: 0, userId: 0,
isAdd: true, isAdd: true,
username: '', username: '',
@ -23,6 +24,7 @@ function ($scope, UserService) {
}, },
reset: function() { reset: function() {
$('.popover-dismiss').popover(); $('.popover-dismiss').popover();
this.setFocus = true;
this.userId = 0; this.userId = 0;
this.isAdd = true; this.isAdd = true;
this.username = ''; this.username = '';

14
js/directives/focus.js Normal file
View File

@ -0,0 +1,14 @@
taskBoardDirectives.directive('focus', ['$timeout', function($timeout) {
return {
link: function(scope, elem, attrs) {
scope.$watch(attrs.focus, function(val) {
if (angular.isDefined(val) && val) {
$timeout(function() {
elem[0].focus();
scope.$eval(attrs.focus + ' = false');
}, 500);
}
}, true);
}
};
}]);

View File

@ -14,7 +14,8 @@
<h5>Title</h5> <h5>Title</h5>
<input class="form-control" type="text" placeholder="Item Title" <input class="form-control" type="text" placeholder="Item Title"
data-ng-model="itemFormData.title" data-ng-disabled="itemFormData.isSaving" data-ng-model="itemFormData.title" data-ng-disabled="itemFormData.isSaving"
data-ng-class="{ 'has-error': itemFormData.titleError }"> data-ng-class="{ 'has-error': itemFormData.titleError }"
data-focus="itemFormData.setFocus">
</div> </div>
<div class="form-group"> <div class="form-group">
<h5>Description <h5>Description

View File

@ -87,7 +87,7 @@
data-ng-repeat="comment in viewItem.ownComment | orderBy:'timestamp':comments.sorting" data-ng-repeat="comment in viewItem.ownComment | orderBy:'timestamp':comments.sorting"
data-ng-class-even="'alternate'"> data-ng-class-even="'alternate'">
<p class="comment"> <p class="comment">
{{ comment.text }} <span data-ng-bind-html="markedComment(comment.text)"></span>
<a class="fa fa-trash-o pull-right" <a class="fa fa-trash-o pull-right"
data-ng-if="currentUser.userId == comment.user_id || currentUser.isAdmin == 1" data-ng-if="currentUser.userId == comment.user_id || currentUser.isAdmin == 1"
data-ng-click="deleteComment(comment.id)"></a> data-ng-click="deleteComment(comment.id)"></a>

View File

@ -4,5 +4,5 @@
<li data-ng-class="{ active: page.settings }"><a id="nav-settings" href="#/settings">Settings</a></li> <li data-ng-class="{ active: page.settings }"><a id="nav-settings" href="#/settings">Settings</a></li>
<li><a id="nav-logout" href="#/" data-ng-click="logout()">Logout {{ display.username }}</a></li> <li><a id="nav-logout" href="#/" data-ng-click="logout()">Logout {{ display.username }}</a></li>
</ul> </ul>
<h2>TaskBoard<small>{{ display.smallText }}</small></h2> <h2>TaskBoard<small>{{ display.smallText }}</small><span class="version"> ({{ version }})</span></h2>
</div> </div>

View File

@ -10,6 +10,7 @@
</label> </label>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button> <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</fieldset> </fieldset>
<p class="small text-center version">{{ version }}</p>
</form> </form>
</div> </div>
<div data-on-load-callback="clear"></div> <div data-on-load-callback="clear"></div>

View File

@ -13,6 +13,7 @@
<div class="form-group" data-ng-class="{ 'has-error': boardFormData.nameError }"> <div class="form-group" data-ng-class="{ 'has-error': boardFormData.nameError }">
<h5>Board Name</h5> <h5>Board Name</h5>
<input class="form-control" type="text" placeholder="Board Name" <input class="form-control" type="text" placeholder="Board Name"
data-focus="boardFormData.setFocus"
data-ng-model="boardFormData.name" data-ng-disabled="boardFormData.isSaving"> data-ng-model="boardFormData.name" data-ng-disabled="boardFormData.isSaving">
</div> </div>
<div class="form-group half-width" data-ng-class="{ 'has-error': boardFormData.lanesError }"> <div class="form-group half-width" data-ng-class="{ 'has-error': boardFormData.lanesError }">

View File

@ -14,7 +14,7 @@
<fieldset data-ng-disabled="userFormData.isSaving"> <fieldset data-ng-disabled="userFormData.isSaving">
<div class="form-group" data-ng-class="{ 'has-error': userFormData.usernameError }"> <div class="form-group" data-ng-class="{ 'has-error': userFormData.usernameError }">
<h5><span data-ng-if="!userFormData.isAdd">Change </span>Username</h5> <h5><span data-ng-if="!userFormData.isAdd">Change </span>Username</h5>
<input class="form-control" type="text" placeholder="Username" data-ng-model="userFormData.username"> <input class="form-control" type="text" placeholder="Username" data-ng-model="userFormData.username" data-focus="userFormData.setFocus">
</div> </div>
<div class="form-group" data-ng-class="{ 'has-error': userFormData.passError }"> <div class="form-group" data-ng-class="{ 'has-error': userFormData.passError }">
<h5><span data-ng-if="!userFormData.isAdd">Change </span>Password</h5> <h5><span data-ng-if="!userFormData.isAdd">Change </span>Password</h5>