Skip to content

Commit 5d6b04f

Browse files
committed
gh-pages v2.0.7-e8f8606
1 parent e4fa93e commit 5d6b04f

11 files changed

+694
-66
lines changed

customizer.html

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<!doctype html>
2+
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
3+
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
4+
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
5+
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
6+
<head>
7+
<meta charset="utf-8">
8+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
9+
<link rel="stylesheet" href="/docs/css/bootstrap.min.css" />
10+
<link rel="stylesheet" href="/docs/css/bootstrap-flatly.css" />
11+
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" />
12+
<link rel="stylesheet" href="/css/site.css" />
13+
</head>
14+
<body>
15+
<header class="header">
16+
<div class="navbar navbar-fixed-top">
17+
<div class="navbar-inner">
18+
<div class="container">
19+
<a href="/" class="brand">UI Grid</a>
20+
<ul class="nav">
21+
<li class="dropdown">
22+
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
23+
Learn
24+
<b class="caret"></b>
25+
</a>
26+
<ul class="dropdown-menu">
27+
<li>
28+
<a href="/docs/#/api">Docs</a>
29+
</li>
30+
<li>
31+
<a href="/docs/#/tutorial">Tutorial</a>
32+
</li>
33+
</ul>
34+
</li>
35+
</ul>
36+
<p class="navbar-text pull-right">
37+
<iframe class="nav-ghbtn" src="http://ghbtns.com/github-btn.html?user=angular-ui&repo=ng-grid&type=watch&count=true"
38+
allowtransparency="true" frameborder="0" scrolling="0" width="120" height="20"></iframe>
39+
<iframe class="nav-ghbtn" src="http://ghbtns.com/github-btn.html?user=angular-ui&repo=ng-grid&type=fork&count=true"
40+
allowtransparency="true" frameborder="0" scrolling="0" width="120" height="20"></iframe>
41+
</p>
42+
</div>
43+
</div>
44+
</div>
45+
</header>
46+
47+
<div ng-cloak class="container" ng-app="customizer" ng-controller='Main'>
48+
<br>
49+
<br>
50+
51+
<div class="row">
52+
<form>
53+
<div class="span4" ng-repeat="v in variables track by $index">
54+
<label for="{{ v.name }}" class="muted">{{ v.name }}</label> <input name="{{ v.name }}" type="text" ng-model="v.value" ng-change="updateCSS()">
55+
</div>
56+
</form>
57+
</div>
58+
59+
<div class="text-error">{{ cssErr }}</div>
60+
61+
<br>
62+
<div class="grid" ui-grid="gridOptions"></div>
63+
64+
<style ui-grid-style>
65+
.grid {
66+
width: 400px;
67+
height: 300px;
68+
}
69+
70+
{{ css }}
71+
</style>
72+
</div>
73+
74+
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/1.6.0/less.min.js"></script>
75+
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
76+
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
77+
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.js"></script>
78+
<!-- <link rel="stylesheet" href="/release/ui-grid.css" /> -->
79+
<script src="/release/ui-grid.js"></script>
80+
<script src="/js/customizer.js"></script>
81+
</body>
82+
</html>

docs/js/docs-setup.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ NG_DOCS={
5151
"id": "ui.grid.edit.directive:uiGridCell",
5252
"shortName": "uiGridCell",
5353
"type": "directive",
54-
"keywords": "actions and angular api back be been begin binds blur by cancel cancelled capabilities cell columndef dblclick default dependent directive div do edit editablecelldirective editing element emit end ended enter esc etc event events f2 fire grid gridcell has if in-line initial input invoke is it key keydown model needed of on original provide recognizes replaced respond scrolling selection set should specific stacks standards start steps that the to top ui ui-grid-text-editor uigridcell uigrideditconstants using value when will with"
54+
"keywords": "actions and angular api back be been begin binds blur by cancel cancelled capabilities cell columndef dblclick default dependent directive div do edit editablecelldirective editing element emit end ended enter esc etc event events f2 fire grid grid_scroll gridcell has if in-line initial input invoke is it key keydown model needed of on original provide recognizes replaced respond selection set should specific stacks standards start steps that the to top ui ui-grid-text-editor uigridcell uigridconstants uigrideditconstants using value when will with"
5555
},
5656
{
5757
"section": "api",
@@ -60,6 +60,20 @@ NG_DOCS={
6060
"type": "directive",
6161
"keywords": "$scope adds angular api app bob ceo columndefs controller data developer directive div ea edit editing enablecelledit features frank function grid html index js lowly mainctrl module name ng-controller the title to true ui ui-grid ui-grid-edit var"
6262
},
63+
{
64+
"section": "api",
65+
"id": "ui.grid.edit.directive:uiGridTextEditor",
66+
"shortName": "uiGridTextEditor",
67+
"type": "directive",
68+
"keywords": "and api as be blur can cancel component develop directive div edit editing editor editors end enter esc events fields for grid input keydown other template text that to ui used"
69+
},
70+
{
71+
"section": "api",
72+
"id": "ui.grid.edit.service:uiGridEditService",
73+
"shortName": "uiGridEditService",
74+
"type": "service",
75+
"keywords": "adds any api column columnbuilder edit editcolumnbuilder editing features for function grid load needed promise properties resolved service services templates that to ui when will"
76+
},
6377
{
6478
"section": "api",
6579
"id": "ui.grid.service:gridClassFactory",

docs/partials/api/ui.grid.edit.directive.uiGridCell.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h1><code ng:non-bindable="">uiGridCell</code>
3232
- Standards should be Esc keydown</p>
3333

3434
<p>Grid Events that end editing:
35-
- scrolling</p></div>
35+
- uiGridConstants.events.GRID_SCROLL</p></div>
3636
<h2 id="Usage">Usage</h2>
3737
<div class="usage">as attribute<pre class="prettyprint linenums">&lt;div ui-grid-cell&gt;
3838
...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<h1><code ng:non-bindable="">uiGridTextEditor</code>
2+
<span class="hint">(directive in module <code ng:non-bindable="">ui.grid.edit</code>
3+
)</span>
4+
</h1>
5+
<div><h2 id="Description">Description</h2>
6+
<div class="description"><p>input editor component for text fields. Can be used as a template to develop other editors</p>
7+
8+
<p>Events that end editing:
9+
blur and enter keydown</p>
10+
11+
<p>Events that cancel editing:
12+
- Esc keydown</p></div>
13+
<h2 id="Usage">Usage</h2>
14+
<div class="usage">as attribute<pre class="prettyprint linenums">&lt;div ui-grid-text-editor&gt;
15+
...
16+
&lt;/div&gt;</pre>
17+
</div>
18+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<h1><code ng:non-bindable="">uiGridEditService</code>
2+
<span class="hint">(service in module <code ng:non-bindable="">ui.grid.edit</code>
3+
)</span>
4+
</h1>
5+
<div><h2 id="Description">Description</h2>
6+
<div class="description"><p>Services for editing features</p></div>
7+
<div class="member method"><h2 id="Methods">Methods</h2>
8+
<ul class="methods"><li><h3 id="editColumnBuilder">editColumnBuilder()</h3>
9+
<div class="editcolumnbuilder"><p>columnBuilder function that adds edit properties to grid column</p><h4 id="Returns">Returns</h4>
10+
<div class="returns"><code ng:non-bindable="">{promise}</code>
11+
<p>promise that will load any needed templates when resolved</p></div>
12+
</div>
13+
</li>
14+
</ul>
15+
</div>
16+
</div>

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ <h2>Angular UI Grid</h2>
6161

6262
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
6363

64-
<a class="btn btn-danger btn-large" href="https://github.com/angular-ui/ui-grid.info/tree/gh-pages/release" title="Download 2.0.7-c97db35">
64+
<a class="btn btn-danger btn-large" href="https://github.com/angular-ui/ui-grid.info/tree/gh-pages/release" title="Download 2.0.7-e8f8606">
6565
<i class="fa fa-download fa-fw"></i>
66-
Download <small>( / 2.0.7-c97db35 )</small>
66+
Download <small>( / 2.0.7-e8f8606 )</small>
6767
</a>
6868

6969
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

js/customizer.js

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
(function() {
2+
3+
var app = angular.module('customizer', ['ui.grid', 'ui.grid.style']);
4+
5+
app.run(function($log, $rootScope, $http) {
6+
});
7+
8+
app.controller('Main', function($log, $http, $scope, less) {
9+
$scope.gridOptions = {};
10+
$http.get('/data/100.json')
11+
.success(function(data) {
12+
$scope.gridOptions.data = data;
13+
});
14+
15+
$http.get('/less/ui-grid.less')
16+
.success(function (data) {
17+
$scope.source = data;
18+
$scope.variables = less.parseVariables(data);
19+
});
20+
21+
$scope.$watch('source', function(n, o) {
22+
if (n) {
23+
$scope.updateCSS();
24+
}
25+
});
26+
27+
$scope.updateCSS = function() {
28+
var src = less.replaceVariables($scope.source, $scope.variables);
29+
less.process(src)
30+
.then(
31+
function(css) {
32+
$scope.css = css;
33+
$scope.cssErr = null;
34+
},
35+
function(err) {
36+
$log.debug('wha!');
37+
$scope.cssErr = err;
38+
}
39+
);
40+
};
41+
});
42+
43+
app.service('less', function($log, $q) {
44+
45+
46+
var variableBlockRe = /\/\*-- VARIABLES.+?--\*\/([\s\S]+?)\/\*-- END VARIABLES.+?--\*\//m;
47+
var variableRe = /(\@\w+)\: (.+?);/g;
48+
49+
return {
50+
parseVariables: function (src) {
51+
var groups = src.match(variableBlockRe);
52+
var variableText = groups[1];
53+
54+
var variables = []
55+
56+
var match;
57+
while (match = variableRe.exec(variableText)) {
58+
variables.push({ name: match[1], value: match[2] });
59+
}
60+
61+
return variables;
62+
},
63+
64+
replaceVariables: function(src, vars) {
65+
angular.forEach(vars, function (variable) {
66+
var re = new RegExp('(' + variable.name + ')\: (.+?);', 'g');
67+
src = src.replace(re, '$1: ' + variable.value + ';');
68+
});
69+
70+
return src;
71+
},
72+
73+
process: function (src, compress) {
74+
var comp;
75+
if (compress) {
76+
comp = true;
77+
}
78+
79+
var parser = new less.Parser();
80+
81+
var p = $q.defer();
82+
try {
83+
parser.parse(src, function(err, tree) {
84+
if (err) {
85+
p.reject(err.message);
86+
}
87+
else {
88+
$log.debug('tree', tree);
89+
var css = tree.toCSS({ compress: comp });
90+
p.resolve(css);
91+
}
92+
});
93+
}
94+
catch (e) {
95+
p.resolve(e);
96+
}
97+
98+
return p.promise;
99+
}
100+
};
101+
});
102+
103+
})();

0 commit comments

Comments
 (0)