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
* Bugfix for attachments downloading with hash instead of file name (#41).
* Bugfix for item positions (#37).
* noty errors are ignored now.
* Favicons added.
* API Error now returns exception message in JSON data.
* Markdown support in comments
* Cursor on default input field
* Show app version

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
taskBoardControllers.controller('ItemViewBoardCtrl',
['$scope', 'BoardService',
function ($scope, BoardService) {
['$scope', '$window', 'BoardService',
function ($scope, $window, BoardService) {
$scope.viewItem = {};
$scope.toggle = {
sidebar: false
@ -15,6 +15,14 @@ function ($scope, BoardService) {
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.
var convertDates = function(timestampArray) {
if (undefined === timestampArray) {

View File

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

View File

@ -2,6 +2,7 @@ taskBoardControllers.controller('UserFormSettingsCtrl',
['$scope', 'UserService',
function ($scope, UserService) {
$scope.userFormData = {
setFocus: false,
userId: 0,
isAdd: true,
username: '',
@ -23,6 +24,7 @@ function ($scope, UserService) {
},
reset: function() {
$('.popover-dismiss').popover();
this.setFocus = true;
this.userId = 0;
this.isAdd = true;
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>
<input class="form-control" type="text" placeholder="Item Title"
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 class="form-group">
<h5>Description

View File

@ -87,7 +87,7 @@
data-ng-repeat="comment in viewItem.ownComment | orderBy:'timestamp':comments.sorting"
data-ng-class-even="'alternate'">
<p class="comment">
{{ comment.text }}
<span data-ng-bind-html="markedComment(comment.text)"></span>
<a class="fa fa-trash-o pull-right"
data-ng-if="currentUser.userId == comment.user_id || currentUser.isAdmin == 1"
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><a id="nav-logout" href="#/" data-ng-click="logout()">Logout {{ display.username }}</a></li>
</ul>
<h2>TaskBoard<small>{{ display.smallText }}</small></h2>
<h2>TaskBoard<small>{{ display.smallText }}</small><span class="version"> ({{ version }})</span></h2>
</div>

View File

@ -10,6 +10,7 @@
</label>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</fieldset>
<p class="small text-center version">{{ version }}</p>
</form>
</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 }">
<h5>Board Name</h5>
<input class="form-control" type="text" placeholder="Board Name"
data-focus="boardFormData.setFocus"
data-ng-model="boardFormData.name" data-ng-disabled="boardFormData.isSaving">
</div>
<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">
<div class="form-group" data-ng-class="{ 'has-error': userFormData.usernameError }">
<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 class="form-group" data-ng-class="{ 'has-error': userFormData.passError }">
<h5><span data-ng-if="!userFormData.isAdd">Change </span>Password</h5>