Skip to content
This repository was archived by the owner on May 30, 2019. It is now read-only.

Commit 670e8ef

Browse files
wooldridgelaurelnaiad
authored andcommitted
pressing Enter key in search box should submit a search, fixes #386
see: http://stackoverflow.com/a/15418063/3682288
1 parent 299b83c commit 670e8ef

File tree

20 files changed

+2434
-2059
lines changed

20 files changed

+2434
-2059
lines changed

appserver/java-spring/static/app/directives/ssSearchBar.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
ng-model="searchbarText"
3333
placeholder="Search the Stack!..."
3434
value=""
35+
ng-keyup="$event.keyCode == 13 && setQueryText()"
3536
>
3637
</div>
3738
</div>

appserver/java-spring/static/app/styles/style.css

Lines changed: 240 additions & 240 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

appserver/java-spring/static/deps/angular-bootstrap/ui-bootstrap-tpls.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,7 +2546,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
25462546
// Set the initial positioning.
25472547
tooltip.css({ top: 0, left: 0, display: 'block' });
25482548

2549-
// Now we add it to the DOM because need some info about it. But it's not
2549+
// Now we add it to the DOM because need some info about it. But it's not
25502550
// visible yet anyway.
25512551
if ( appendToBody ) {
25522552
$document.find( 'body' ).append( tooltip );
@@ -2574,7 +2574,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
25742574
$timeout.cancel( popupTimeout );
25752575
popupTimeout = null;
25762576

2577-
// And now we remove it from the DOM. However, if we have animation, we
2577+
// And now we remove it from the DOM. However, if we have animation, we
25782578
// need to wait for it to expire beforehand.
25792579
// FIXME: this is a placeholder for a port of the transitions library.
25802580
if ( scope.tt_animation ) {
@@ -3591,7 +3591,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap
35913591
//we need to propagate user's query so we can higlight matches
35923592
scope.query = undefined;
35933593

3594-
//Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later
3594+
//Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later
35953595
var timeoutPromise;
35963596

35973597
//plug into $parsers pipeline to open a typeahead on view changes initiated from DOM

appserver/java-spring/static/deps/angular-cookies/angular-cookies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.3.2
2+
* @license AngularJS v1.3.7
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/

appserver/java-spring/static/deps/angular-mocks/angular-mocks.js

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.3.2
2+
* @license AngularJS v1.3.7
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -117,7 +117,7 @@ angular.mock.$Browser = function() {
117117
self.defer.now += delay;
118118
} else {
119119
if (self.deferredFns.length) {
120-
self.defer.now = self.deferredFns[self.deferredFns.length-1].time;
120+
self.defer.now = self.deferredFns[self.deferredFns.length - 1].time;
121121
} else {
122122
throw new Error('No deferred tasks to be flushed');
123123
}
@@ -428,7 +428,7 @@ angular.mock.$LogProvider = function() {
428428
});
429429
});
430430
if (errors.length) {
431-
errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or "+
431+
errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or " +
432432
"an expected log message was not checked and removed:");
433433
errors.push('');
434434
throw new Error(errors.join('\n---------\n'));
@@ -461,17 +461,17 @@ angular.mock.$LogProvider = function() {
461461
* @returns {promise} A promise which will be notified on each iteration.
462462
*/
463463
angular.mock.$IntervalProvider = function() {
464-
this.$get = ['$rootScope', '$q',
465-
function($rootScope, $q) {
464+
this.$get = ['$browser', '$rootScope', '$q', '$$q',
465+
function($browser, $rootScope, $q, $$q) {
466466
var repeatFns = [],
467467
nextRepeatId = 0,
468468
now = 0;
469469

470470
var $interval = function(fn, delay, count, invokeApply) {
471-
var deferred = $q.defer(),
472-
promise = deferred.promise,
473-
iteration = 0,
474-
skipApply = (angular.isDefined(invokeApply) && !invokeApply);
471+
var iteration = 0,
472+
skipApply = (angular.isDefined(invokeApply) && !invokeApply),
473+
deferred = (skipApply ? $$q : $q).defer(),
474+
promise = deferred.promise;
475475

476476
count = (angular.isDefined(count)) ? count : 0;
477477
promise.then(null, null, fn);
@@ -494,7 +494,11 @@ angular.mock.$IntervalProvider = function() {
494494
}
495495
}
496496

497-
if (!skipApply) $rootScope.$apply();
497+
if (skipApply) {
498+
$browser.defer.flush();
499+
} else {
500+
$rootScope.$apply();
501+
}
498502
}
499503

500504
repeatFns.push({
@@ -581,10 +585,10 @@ function jsonStringToDate(string) {
581585
tzMin = int(match[9] + match[11]);
582586
}
583587
date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3]));
584-
date.setUTCHours(int(match[4]||0) - tzHour,
585-
int(match[5]||0) - tzMin,
586-
int(match[6]||0),
587-
int(match[7]||0));
588+
date.setUTCHours(int(match[4] || 0) - tzHour,
589+
int(match[5] || 0) - tzMin,
590+
int(match[6] || 0),
591+
int(match[7] || 0));
588592
return date;
589593
}
590594
return string;
@@ -663,7 +667,7 @@ angular.mock.TzDate = function(offset, timestamp) {
663667
}
664668

665669
var localOffset = new Date(timestamp).getTimezoneOffset();
666-
self.offsetDiff = localOffset*60*1000 - offset*1000*60*60;
670+
self.offsetDiff = localOffset * 60 * 1000 - offset * 1000 * 60 * 60;
667671
self.date = new Date(timestamp + self.offsetDiff);
668672

669673
self.getTime = function() {
@@ -815,7 +819,7 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
815819
animate.queue.push({
816820
event: method,
817821
element: arguments[0],
818-
options: arguments[arguments.length-1],
822+
options: arguments[arguments.length - 1],
819823
args: arguments
820824
});
821825
return $delegate[method].apply($delegate, arguments);
@@ -1115,7 +1119,7 @@ angular.mock.dump = function(object) {
11151119
```
11161120
*/
11171121
angular.mock.$HttpBackendProvider = function() {
1118-
this.$get = ['$rootScope', createHttpBackendMock];
1122+
this.$get = ['$rootScope', '$timeout', createHttpBackendMock];
11191123
};
11201124

11211125
/**
@@ -1132,7 +1136,7 @@ angular.mock.$HttpBackendProvider = function() {
11321136
* @param {Object=} $browser Auto-flushing enabled if specified
11331137
* @return {Object} Instance of $httpBackend mock
11341138
*/
1135-
function createHttpBackendMock($rootScope, $delegate, $browser) {
1139+
function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
11361140
var definitions = [],
11371141
expectations = [],
11381142
responses = [],
@@ -1145,7 +1149,7 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {
11451149
return function() {
11461150
return angular.isNumber(status)
11471151
? [status, data, headers, statusText]
1148-
: [200, status, data];
1152+
: [200, status, data, headers];
11491153
};
11501154
}
11511155

@@ -1162,7 +1166,9 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {
11621166
}
11631167

11641168
function wrapResponse(wrapped) {
1165-
if (!$browser && timeout && timeout.then) timeout.then(handleTimeout);
1169+
if (!$browser && timeout) {
1170+
timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);
1171+
}
11661172

11671173
return handleResponse;
11681174

@@ -1770,7 +1776,7 @@ angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
17701776
}
17711777

17721778
var length = queue.length;
1773-
for (var i=0;i<length;i++) {
1779+
for (var i = 0; i < length; i++) {
17741780
queue[i]();
17751781
}
17761782

@@ -2036,7 +2042,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
20362042
*/
20372043
angular.mock.e2e = {};
20382044
angular.mock.e2e.$httpBackendDecorator =
2039-
['$rootScope', '$delegate', '$browser', createHttpBackendMock];
2045+
['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock];
20402046

20412047

20422048
/**
@@ -2050,7 +2056,7 @@ angular.mock.e2e.$httpBackendDecorator =
20502056
*
20512057
* In addition to all the regular `Scope` methods, the following helper methods are available:
20522058
*/
2053-
angular.mock.$RootScopeDecorator = function($delegate) {
2059+
angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
20542060

20552061
var $rootScopePrototype = Object.getPrototypeOf($delegate);
20562062

@@ -2122,7 +2128,7 @@ angular.mock.$RootScopeDecorator = function($delegate) {
21222128

21232129
return count;
21242130
}
2125-
};
2131+
}];
21262132

21272133

21282134
if (window.jasmine || window.mocha) {

appserver/java-spring/static/deps/angular-sanitize/angular-sanitize.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.3.2
2+
* @license AngularJS v1.3.7
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -218,29 +218,29 @@ var validElements = angular.extend({},
218218
//Attributes that have href and hence need to be sanitized
219219
var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap,xlink:href");
220220

221-
var htmlAttrs = makeMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,'+
222-
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,'+
223-
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,'+
224-
'scope,scrolling,shape,size,span,start,summary,target,title,type,'+
221+
var htmlAttrs = makeMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +
222+
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +
223+
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +
224+
'scope,scrolling,shape,size,span,start,summary,target,title,type,' +
225225
'valign,value,vspace,width');
226226

227227
// SVG attributes (without "id" and "name" attributes)
228228
// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes
229-
var svgAttrs = makeMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,'+
230-
'attributeName,attributeType,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,'+
231-
'color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,'+
232-
'font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,'+
233-
'gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,'+
234-
'keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,'+
235-
'markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,'+
236-
'overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,'+
237-
'repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,'+
238-
'stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,'+
239-
'stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,'+
240-
'stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,'+
241-
'underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,'+
242-
'viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,'+
243-
'xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,'+
229+
var svgAttrs = makeMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +
230+
'attributeName,attributeType,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,' +
231+
'color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,' +
232+
'font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,' +
233+
'gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,' +
234+
'keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,' +
235+
'markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,' +
236+
'overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,' +
237+
'repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,' +
238+
'stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,' +
239+
'stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,' +
240+
'stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,' +
241+
'underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,' +
242+
'viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,' +
243+
'xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,' +
244244
'zoomAndPan');
245245

246246
var validAttrs = angular.extend({},
@@ -628,7 +628,7 @@ angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);
628628
*/
629629
angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
630630
var LINKY_URL_REGEXP =
631-
/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/,
631+
/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/,
632632
MAILTO_REGEXP = /^mailto:/;
633633

634634
return function(text, target) {
@@ -641,8 +641,10 @@ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
641641
while ((match = raw.match(LINKY_URL_REGEXP))) {
642642
// We can not end in these as they are sometimes found at the end of the sentence
643643
url = match[0];
644-
// if we did not match ftp/http/mailto then assume mailto
645-
if (match[2] == match[3]) url = 'mailto:' + url;
644+
// if we did not match ftp/http/www/mailto then assume mailto
645+
if (!match[2] && !match[4]) {
646+
url = (match[3] ? 'http://' : 'mailto:') + url;
647+
}
646648
i = match.index;
647649
addText(raw.substr(0, i));
648650
addLink(url, match[0].replace(MAILTO_REGEXP, ''));
@@ -661,13 +663,13 @@ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
661663
function addLink(url, text) {
662664
html.push('<a ');
663665
if (angular.isDefined(target)) {
664-
html.push('target="');
665-
html.push(target);
666-
html.push('" ');
666+
html.push('target="',
667+
target,
668+
'" ');
667669
}
668-
html.push('href="');
669-
html.push(url);
670-
html.push('">');
670+
html.push('href="',
671+
url.replace(/"/g, '&quot;'),
672+
'">');
671673
addText(text);
672674
html.push('</a>');
673675
}

appserver/java-spring/static/deps/angular-ui-router.stateHelper/statehelper.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Mark Lagendijk <[email protected]>
44
* @license MIT
55
*/
6-
angular.module('ui.router.stateHelper', ['ui.router'])
6+
angular.module('ui.router.stateHelper', [ 'ui.router' ])
77
.provider('stateHelper', function($stateProvider){
88
var self = this;
99

@@ -19,8 +19,8 @@ angular.module('ui.router.stateHelper', ['ui.router'])
1919
* @param {Array} [state.children] - An optional array of child states.
2020
* @param {Boolean} keepOriginalNames - An optional flag that prevents conversion of names to dot notation if true.
2121
*/
22-
this.setNestedState = function(state, keepOriginalNames){
23-
if (!keepOriginalNames){
22+
this.state = function(state, keepOriginalNames){
23+
if(!keepOriginalNames){
2424
fixStateName(state);
2525
}
2626
$stateProvider.state(state);
@@ -31,8 +31,12 @@ angular.module('ui.router.stateHelper', ['ui.router'])
3131
self.setNestedState(childState, keepOriginalNames);
3232
});
3333
}
34+
35+
return self;
3436
};
3537

38+
this.setNestedState = this.state;
39+
3640
self.$get = angular.noop;
3741

3842
/**
@@ -44,5 +48,4 @@ angular.module('ui.router.stateHelper', ['ui.router'])
4448
state.name = state.parent.name + '.' + state.name;
4549
}
4650
}
47-
})
48-
;
51+
});

0 commit comments

Comments
 (0)