Skip to content

Commit b1d172a

Browse files
author
Null McNull
committed
seo support
1 parent 59abefd commit b1d172a

File tree

8 files changed

+23
-83
lines changed

8 files changed

+23
-83
lines changed

src/angular-block-ui/config.js

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -9,73 +9,3 @@ blkUI.constant('blockUIConfig', {
99
cssClass: 'block-ui block-ui-anim-fade'
1010
});
1111

12-
// this.templateUrl = function (url) {
13-
// _config.templateUrl = url;
14-
// };
15-
//
16-
// this.template = function (template) {
17-
// _config.template = template;
18-
// };
19-
//
20-
// this.delay = function (delay) {
21-
// _config.delay = delay;
22-
// };
23-
//
24-
// this.message = function (message) {
25-
// _config.message = message;
26-
// };
27-
//
28-
// this.autoBlock = function (enabled) {
29-
// _config.autoBlock = enabled;
30-
// };
31-
//
32-
// this.resetOnException = function (enabled) {
33-
// _config.resetOnException = enabled;
34-
// };
35-
//
36-
// this.requestFilter = function (filter) {
37-
// _config.requestFilter = filter;
38-
// };
39-
//
40-
// this.autoInjectBodyBlock = function (enabled) {
41-
// _config.autoInjectBodyBlock = enabled;
42-
// };
43-
//
44-
// function _cssClassArray(target) {
45-
// return function(classes, replace) {
46-
// if (classes !== undefined) {
47-
//
48-
// if (angular.isString(classes)) {
49-
// classes = classes.split(' ');
50-
// }
51-
//
52-
// if (replace) {
53-
// _config[target] = classes;
54-
// } else {
55-
// var i = classes.length;
56-
//
57-
// while (i--) {
58-
// _config[target].push(classes[i]);
59-
// }
60-
// }
61-
// }
62-
// }
63-
// }
64-
//
65-
// this.cssClass = _cssClassArray('cssClass');
66-
// this.cssClassMessage = _cssClassArray('cssClassMessage');
67-
//
68-
// this.$get = ['$templateCache', function ($templateCache) {
69-
//
70-
// if (_config.template) {
71-
//
72-
// // Swap the builtin template with the custom template.
73-
// // Create a unique cache key and place the template in the cache.
74-
//
75-
// _config.templateUrl = '$$block-ui-template$$';
76-
// $templateCache.put(_config.templateUrl, _config.template);
77-
// }
78-
//
79-
// return _config;
80-
// }];
81-
//});

src/app/app.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ angular.module('myApp', [
1111
], null).value('navItems', [
1212
{
1313
text: 'Home',
14-
url: '#/'
14+
url: '#!/'
1515
},
1616
{
1717
text: 'Documentation',
18-
url: '#/examples',
18+
url: '#!/examples',
1919
pattern: '/examples(/.*)?'
2020
}
2121
]).config(function ($routeProvider, examplesRoutes) {
@@ -32,15 +32,25 @@ angular.module('myApp', [
3232
redirectTo: '/'
3333
});
3434

35-
}).config(function (blockUIConfig, delayConfig) {
35+
}).config(function (blockUIConfig, delayConfig, $locationProvider) {
36+
37+
// Enable hashbangs
38+
39+
$locationProvider.hashPrefix('!');
40+
41+
if(window.location.search.indexOf('delay=false')!=-1 ||
42+
window.location.search.indexOf('_escaped_fragment_')!=-1 ||
43+
window.navigator.userAgent.indexOf('Prerender')!=-1) {
3644

37-
if(window.location.search.indexOf('delay=false')!=-1) {
3845
delayConfig.enabled = false;
46+
blockUIConfig.autoBlock = false;
47+
blockUIConfig.autoInjectBodyBlock = false;
48+
3949
} else {
4050
delayConfig.excludes.push(/.*\.md/i);
4151
delayConfig.enabled = true;
42-
delayConfig.timeout.min = 1000;
43-
delayConfig.timeout.max = 2000;
52+
delayConfig.timeout.min = 750;
53+
delayConfig.timeout.max = 1500;
4454
}
4555

4656
// blockUIConfig.template = '<pre><code>{{ state | json }}</code></pre>';

src/app/examples/examples.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ angular.module('myApp').controller('ExamplesController', function($scope, $route
5252

5353
$scope.examples.active = indexOfExample(urlToName($routeParams.example), $scope.examples);
5454
$scope.examples.getUrl = function(example) {
55-
return '#/examples/' + nameToUrl(example.name);
55+
return '#!/examples/' + nameToUrl(example.name);
5656
};
5757

5858
});

src/app/examples/examples.ng.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1>Angular BlockUI Documentation &amp; Examples</h1>
77
</li>
88
</ul>
99

10-
<div class="example-container" block-ui block-ui-pattern="/^app\/examples\/.*\.html$/">
10+
<!--<div class="example-container" block-ui block-ui-pattern="/^app\/examples\/.*\.html$/">-->
1111
<div class="spacer" ng-include="examples[examples.active].tmpl"></div>
12-
</div>
12+
<!--</div>-->
1313
</div>

src/app/main/home.ng.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1>Angular BlockUI</h1>
77
</p>
88

99
<p>
10-
<a class="btn btn-primary btn-lg" href="#/examples">Documentation »</a>
10+
<a class="btn btn-primary btn-lg" href="#!/examples">Documentation »</a>
1111
</p>
1212
</div>
1313
</div>

src/app/navbar/navbar-controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ angular.module('myApp').controller('NavbarController', function ($scope, $locati
1414

1515
if (!pattern) {
1616
pattern = navItem.url || '/';
17-
pattern = pattern.replace(/^#/, '')
17+
pattern = pattern.replace(/^#!/, '')
1818
}
1919

2020
regexp = new RegExp('^' + pattern + '$', 'i');

src/app/navbar/navbar.ng.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<span class="icon-bar"></span>
88
<span class="icon-bar"></span>
99
</button>
10-
<a class="navbar-brand" href="#">Angular BlockUI</a>
10+
<a class="navbar-brand" href="#!/">Angular BlockUI</a>
1111
</div>
1212
<div class="navbar-collapse" ng-class="{ collapsed: navItems.isCollapsed }">
1313
<ul class="navbar-nav nav">

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<meta name="description" content="">
7+
<meta name="description" content="An AngularJS module that allows you to block user interaction on AJAX requests">
88
<link rel="shortcut icon" href="app/assets/favicon.ico">
99

1010
<title><%- pkg.name %></title>

0 commit comments

Comments
 (0)