Merge pull request #242 from safiyu/test

autofocus added to the app.
This commit is contained in:
Nayan Ambali 2013-11-06 09:46:43 -08:00
commit cc60d096a4
39 changed files with 72 additions and 62 deletions

View File

@ -27,7 +27,7 @@
</div>
<br/><br/>
<div class="pull-right">
<input type="text" data-ng-model="loginCredentials.username" placeholder="{{ 'label.username' | translate }}" class="input-small" required>
<input ng-autofocus="true" type="text" data-ng-model="loginCredentials.username" placeholder="{{ 'label.username' | translate }}" class="input-small" required>
<input type="password" data-ng-model="loginCredentials.password" placeholder="{{ 'label.password' | translate }}" class="input-small" required>
<button class="btn btn-success" type="submit" data-ng-click="login()">{{ 'label.signin' | translate }}</button>
</div>
@ -166,7 +166,7 @@
</div>
</div>
<div ng-class="{blockui:blockUI==true}">
<div class="container fullscreen">
<div class="container whitebg fullscreen">
<div class="row-fluid whitebg">
<div class="span12 pull-right whitebg">
<div class="whitebg" ng-view></div>

View File

@ -76,6 +76,9 @@
scope.group = '';
scope.center = '';
scope.client = '';
scope.centers='';
scope.clients= '';
scope.groups='';
scope.groupsOrCenters = '';
scope.isCollapsed = true;
scope.officerCollapsed = false;
@ -110,6 +113,8 @@
scope.centerCollapsed = false;
scope.clientCollapsed = true;
scope.groupCollapsed = true;
scope.clients= '';
scope.groups='';
if(scope.office=='' && scope.group=='' && scope.center=='' && scope.client==''){
resourceFactory.employeeResource.get({staffId: staffId} , function(data) {
scope.staff = data;
@ -129,6 +134,7 @@
scope.filterText = '';
scope.groupName = '';
scope.clientName = '';
scope.clients= '';
scope.centerName = centerName;
scope.isCollapsed = true;
scope.officerCollapsed = true;

View File

@ -1,25 +0,0 @@
<div class="row-fluid" ng-controller="ClientController">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name/acct#/staff/office">
<table class="table">{{clients}}
<thead>
<tr class="graybg">
<th>{{'table.heading.version' | translate}}</th>
<th>{{'table.heading.runstarttime' | translate}}</th>
<th>{{'table.heading.status' | translate}}</th>
<th>{{'table.heading.runtype' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="history in jobhistory.currentPageItems | filter:filterText">
<td>{{history.version}}</td>
<td>{{history.jobRunStartTime}}</td>
<td>{{history.status}}</td>
<td>{{history.triggerType}}</td>
</tr>
</tbody>
</table>
<ul class="pager">
<li class="previous"><a ng-click="jobhistory.previous()" href="" ng-disabled="!jobhistory.hasPrevious()">&larr; Prev</a></li>
<li class="next" ><a ng-click="jobhistory.next()" href="" ng-disabled="!jobhistory.hasNext()">Next &rarr;</a></li>
</ul>
</div>

View File

@ -0,0 +1,23 @@
(function(module) {
mifosX.directives = _.extend(module, {
AutofocusDirective: function($timeout,$parse) {
return {
link: function(scope, element, attrs) {
var focus = $parse(attrs.ngAutofocus);
scope.$watch(focus, function(value) {
if(value === true) {
$timeout(function() {
element[0].focus();
});
}
});
}
};
}
});
}(mifosX.directives || {}));
mifosX.ng.application.directive("ngAutofocus", ['$timeout','$parse',mifosX.directives.AutofocusDirective]).run(function($log) {
$log.info("AutofocusDirective initialized");
});

View File

@ -18,7 +18,7 @@
'require-less': '../bower_components/require-less/less',
'd3': '../bower_components/d3/d3',
'nvd3': '../bower_components/nvd3/nv.d3',
'nvd3ChartDirectives':'../scripts/directives/angularjs-nvd3-directives',
'nvd3ChartDirectives':'../scripts/modules/angularjs-nvd3-directives',
'styles': '../styles',
'test': '../../test/functional',
'notificationWidget':'../scripts/modules/notificationWidget',

View File

@ -167,7 +167,8 @@ define(['underscore', 'mifosX'], function() {
'OnBlurDirective',
'LateValidateDirective',
'TreeviewDirective',
'CkEditorDirective'
'CkEditorDirective',
'AutofocusDirective'
]
};

View File

@ -1,3 +1,11 @@
/* Copyright (c) 2012-2013 Coding Smackdown TV, http://codingsmackdown.tv
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
'use strict';
// Declare module which depends on filters, and services

View File

@ -796,11 +796,8 @@ nav:hover
transition: all .30s ease-in-out;
}
.blockui{
background-color:white !important;
opacity: .8 !important;
pointer-events: none !important;
cursor: default !important;
z-index: -100 !important;
}
nav:hover:after

View File

@ -15,7 +15,7 @@
<div class="control-group">
<label class="control-label" for="name">{{'label.accountname' | translate}}<span class="required">*</span></label>
<div class="controls">
<input type="text" name="name" id="name" ng-model="formData.name" required late-Validate/>
<input type="text" ng-autofocus="true" name="name" id="name" ng-model="formData.name" required late-Validate/>
<span ng-show="createglaccountingform.name.$invalid">
<small class="error" ng-show="createglaccountingform.name.$error.req">
Required Field

View File

@ -13,7 +13,7 @@
<div class="control-group">
<label class="control-label" for="name">{{ 'label.accounting.rule.name' | translate }}<span class="required">*</span></label>
<div class="controls">
<input type="text" id="name" name="name" ng-model="formData.name" required late-Validate/>
<input type="text" ng-autofocus="true" id="name" name="name" ng-model="formData.name" required late-Validate/>
<span ng-show="editaccountruleform.name.$invalid">
<small class="error">
Required Field

View File

@ -17,7 +17,7 @@
<div class="control-group">
<label class="control-label" for="name">{{'label.accountname' | translate}}<span class="required">*</span></label>
<div class="controls">
<input type="text" id="name" name="name" ng-model="formData.name" required late-Validate/>
<input ng-autofocus="true" type="text" id="name" name="name" ng-model="formData.name" required late-Validate/>
<span ng-show="editglaccountingform.name.$invalid">
<small class="error">
Required Field

View File

@ -16,7 +16,7 @@
<br/><!-- The span is displaying the first line of the hiding div, making the first line of div as blank solved my problem -->
<div>
<label>Account Name</label>
<input ng-model="formData.glAccount" type="text" placeholder="Account Name" typeahead="glAccount as glAccount.name for glAccount in glAccounts | filter:$viewValue | limitTo:8" />
<input ng-autofocus="true" ng-model="formData.glAccount" type="text" placeholder="Account Name" typeahead="glAccount as glAccount.name for glAccount in glAccounts | filter:$viewValue | limitTo:8" />
<div class="control-group">
<label class="control-label" for="officeId">{{ 'label.office' | translate }}</label>
<div class="controls">

View File

@ -12,7 +12,7 @@
</div>
<div>
<label for="username">Username</label>
<input name="username" type="text" data-ng-model="userFormData.username" placeholder="username"/>
<input ng-autofocus="true" name="username" type="text" data-ng-model="userFormData.username" placeholder="username"/>
</div>
<div>
<label for="firstname">First name</label>

View File

@ -7,7 +7,7 @@
</div>
</div>
<div class="row-fluid" ng-controller="CenterController">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="{{'label.filterbynameheadoffice' | translate}}">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="{{'label.filterbynameheadoffice' | translate}}">
<table class="table">
<thead>
<tr class="graybg">

View File

@ -11,7 +11,7 @@
<div class="control-group">
<label class="control-label" for="name">{{'label.form.name' | translate}}<span class="required">*</span></label>
<div class="controls">
<input type="text" id="name" name="name" ng-model="formData.name" required late-Validate/>
<input ng-autofocus="true" type="text" id="name" name="name" ng-model="formData.name" required late-Validate/>
<span ng-show="createcenterform.name.$invalid">
<small class="error" ng-show="createcenterform.name.$error.req">
Required Field

View File

@ -13,7 +13,7 @@
<div class="control-group">
<label class="control-label" for="name">{{'label.name' | translate}}<span class="required">*</span></label>
<div class="controls">
<input type="text" id="name" name="name" placeholder="{{edit.name}}" ng-model="formData.name" required late-Validate/>
<input ng-autofocus="true" type="text" id="name" name="name" placeholder="{{edit.name}}" ng-model="formData.name" required late-Validate/>
<span ng-show="editcenterform.name.$invalid">
<small class="error">
Required Field

View File

@ -12,7 +12,7 @@
<div class="control-group">
<label class="control-label" for="name">{{'label.name' | translate}}<span class="required">*</span></label>
<div class="controls">
<input type="text" name="name" ng-model="formData.name" required late-Validate/>
<input ng-autofocus="true" type="text" name="name" ng-model="formData.name" required late-Validate/>
<span ng-show="clientdocument.name.$invalid">
<small class="error" ng-show="clientdocument.name.$error.req">
Required Field

View File

@ -13,7 +13,7 @@
<div class="control-group">
<label class="control-label" for="name">{{'label.name' | translate}}<span class="required">*</span></label>
<div class="controls">
<input type="text" name="name" ng-model="formData.name" required late-Validate/>
<input ng-autofocus="true" type="text" name="name" ng-model="formData.name" required late-Validate/>
<span ng-show="clientidentifierform.name.$invalid">
<small class="error" ng-show="clientidentifierform.name.$error.req">
Required Field

View File

@ -7,7 +7,7 @@
</div>
</div>
<div class="row-fluid" ng-controller="ClientController">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name/acct#/staff/office">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name/acct#/staff/office">
<table class="table">
<thead>
<tr class="graybg">

View File

@ -6,7 +6,7 @@
<div class="control-group">
<label class="control-label" for="name">{{'label.name' | translate}}<span class="required">*</span></label>
<div class="controls">
<input type="text" id="name" name="name" placeholder="{{editGroup.name}}" ng-model="formData.name" required late-Validate/>
<input ng-autofocus="true" type="text" id="name" name="name" placeholder="{{editGroup.name}}" ng-model="formData.name" required late-Validate/>
<span ng-show="editgroupform.name.$invalid">
<small class="error">
Required Field

View File

@ -7,7 +7,7 @@
</div>
</div>
<div class="row-fluid" ng-controller="GroupController">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="{{'label.filterbynameheadoffice' | translate}}">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="{{'label.filterbynameheadoffice' | translate}}">
<table class="table">
<thead>
<tr class="graybg">

View File

@ -12,7 +12,7 @@
<div class="control-group">
<label class="control-label" for="amount">{{ 'label.transaction.amount' | translate }}<span class="required">*</span></label>
<div class="controls">
<input type="text" name="amount" ng-model="formData.amount" required late-Validate/>
<input ng-autofocus="true" type="text" name="amount" ng-model="formData.amount" required late-Validate/>
<span ng-show="loanchargeform.amount.$invalid">
<small class="error">
Required Field

View File

@ -14,7 +14,7 @@
<div class="control-group">
<label class="control-label">{{ 'label.holiday.name' | translate }}<span class="required">*</span></label>
<div class="controls">
<input type="text" name="name" ng-model="formData.name" required late-Validate/>
<input ng-autofocus="true" type="text" name="name" ng-model="formData.name" required late-Validate/>
<span ng-show="addholidayform.name.$invalid">
<small class="error" ng-show="addholidayform.name.$error.req">
Required Field

View File

@ -14,7 +14,7 @@
<div class="control-group">
<label class="control-label">{{ 'label.officename' | translate }}<span class="required">*</span></label>
<div class="controls">
<input type="text" name="name" ng-model="formData.name" required late-Validate/>
<input ng-autofocus="true" type="text" name="name" ng-model="formData.name" required late-Validate/>
<span ng-show="createofficeform.name.$invalid">
<small class="error" ng-show="createofficeform.name.$error.req">
Required Field

View File

@ -13,7 +13,7 @@
<div class="control-group">
<label class="control-label" for="name">{{ 'label.officename' | translate }}<span class="required">*</span></label>
<div class="controls">
<input type="text" name="name" ng-model="formData.name" required late-Validate/>
<input ng-autofocus="true" type="text" name="name" ng-model="formData.name" required late-Validate/>
<span ng-show="editofficeform.name.$invalid">
<small class="error">
Required Field

View File

@ -8,7 +8,7 @@
</div>
</div>
<div class="row-fluid" ng-controller="EmployeeController">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name">
<table class="table">
<thead>
<tr class="graybg">

View File

@ -7,7 +7,7 @@
<h3>Manage Funds</h3>
<div class="row alert-block span" ng-controller="ManageFundsController">
<div>
<input class="form-control input-xxlarge"
<input ng-autofocus="true" class="form-control input-xxlarge"
ng-model="newfund"
placeholder="New Fund"
type="text"

View File

@ -12,7 +12,7 @@
<a href="#/createoffice" class="btn btn-primary"><i class="icon-plus icon-white"></i> Create Office</a>
</div>
<div ng-hide="isTreeView">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name/externalId">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name/externalId">
<table class="table">
<thead>
<tr class="graybg">

View File

@ -17,7 +17,7 @@
<tr>
<td width="40%">
<label class="control-label">{{ 'label.productname' | translate }}&nbsp;</label>
<input type="text" ng-model="formData.name">
<input ng-autofocus="true" type="text" ng-model="formData.name">
</td>
<td width="40%">
</td>

View File

@ -13,7 +13,7 @@
<div class="control-group">
<label class="control-label" for="name">{{'label.name' | translate}}</label>
<div class="controls">
<input type="text" id="name" ng-model="formData.name">
<input ng-autofocus="true" type="text" id="name" ng-model="formData.name">
</div>
</div>
<div class="control-group">

View File

@ -19,7 +19,7 @@
<tr>
<td width="40%">
<label class="control-label">{{ 'label.productname' | translate }}&nbsp;</label>
<input type="text" ng-model="formData.name">
<input ng-autofocus="true" type="text" ng-model="formData.name">
</td>
<td width="40%">
</td>

View File

@ -19,7 +19,7 @@
<tr>
<td width="40%">
<label class="control-label">{{ 'label.productname' | translate }}&nbsp;</label>
<input type="text" ng-model="formData.name">
<input ng-autofocus="true" type="text" ng-model="formData.name">
</td>
<td width="40%">
</td>

View File

@ -9,7 +9,7 @@
</div>
<div class="row-fluid" ng-controller="LoanProductController">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name/fundname">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name/fundname">
<table class="table">
<thead>
<tr class="graybg">

View File

@ -9,7 +9,7 @@
</div>
<div class="row-fluid" ng-controller="SavingProductController">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name">
<table class="table">
<thead>
<tr class="graybg">

View File

@ -6,7 +6,7 @@
<div class="control-group" ng-repeat="columnHeader in columnHeaders">
<label class="control-label" for="colName">{{ columnHeader.columnName }}<span class="required">*</span></label>
<div class="controls">
<input type="text" ng-hide="columnHeader.columnDisplayType == 'CODELOOKUP'" ng-model="formData[columnHeader.columnName]">
<input ng-autofocus="true" type="text" ng-hide="columnHeader.columnDisplayType == 'CODELOOKUP'" ng-model="formData[columnHeader.columnName]">
<select ng-show="columnHeader.columnDisplayType == 'CODELOOKUP'" ng-model="formData[columnHeader.columnName]" ng-options="columnValue.id as columnValue.value for columnValue in columnHeader.columnValues" value="{{columnValue.id}}"></select>
</div>
</div>

View File

@ -9,7 +9,7 @@
</div>
<div class="row-fluid" ng-controller="ReportsController">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name">
<table class="table">
<thead>
<tr class="graybg">

View File

@ -4,7 +4,7 @@
<li><a href="#/jobs">{{'label.manageschedulerjobs' | translate}}</a> <span class="divider">/</span></li>
<li class="active">{{'label.schedularjobhistory' | translate}}</li>
</ul>
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="{{'label.filterbyversion' | translate}}">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="{{'label.filterbyversion' | translate}}">
<table class="table">
<thead>
<tr class="graybg">

View File

@ -7,7 +7,7 @@
</div>
</div>
<div class="row-fluid" ng-controller="TemplateController">
<input ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name">
<input ng-autofocus="true" ng-model="filterText" type="text" class="span marginbottom0px" placeholder="Filter by name">
<table class="table">
<thead>
<tr class="graybg">