Skip to content

Commit b6c3d55

Browse files
committed
first commit
0 parents  commit b6c3d55

9 files changed

+6435
-0
lines changed

assets/css/bootstrap.css

+6,103
Large diffs are not rendered by default.

assets/css/mainStyle.css

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
header {
2+
position: fixed;
3+
top: 0;
4+
right: 0;
5+
left: 0;
6+
height: 120px;
7+
text-align: center;
8+
background-color: #269;
9+
background-image:
10+
linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 4px),
11+
linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 4px),
12+
linear-gradient(rgba(255, 255, 255, .3) 1px, transparent 1px),
13+
linear-gradient(90deg, rgba(255, 255, 255, .3) 1px, transparent 1px);
14+
background-size: 40px 40px, 40px 40px, 10px 10px, 10px 10px;
15+
background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px;
16+
box-shadow: 0px 3px 8px 2px rgba(80, 80, 80, 1);
17+
}
18+
19+
.banner {
20+
padding: 10px;
21+
color: #ffffff;
22+
text-shadow: 0px 3px 30px #fafaff;
23+
}
24+
25+
.main{
26+
margin-top: 130px;
27+
}

assets/css/prism.css

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/**
2+
* prism.js default theme for JavaScript, CSS and HTML
3+
* Based on dabblet (http://dabblet.com)
4+
* @author Lea Verou
5+
*/
6+
7+
code[class*="language-"],
8+
pre[class*="language-"] {
9+
color: black;
10+
text-shadow: 0 1px white;
11+
font-family: Consolas, Monaco, 'Andale Mono', monospace;
12+
direction: ltr;
13+
text-align: left;
14+
white-space: pre;
15+
word-spacing: normal;
16+
17+
-moz-tab-size: 4;
18+
-o-tab-size: 4;
19+
tab-size: 4;
20+
21+
-webkit-hyphens: none;
22+
-moz-hyphens: none;
23+
-ms-hyphens: none;
24+
hyphens: none;
25+
}
26+
27+
@media print {
28+
code[class*="language-"],
29+
pre[class*="language-"] {
30+
text-shadow: none;
31+
}
32+
}
33+
34+
/* Code blocks */
35+
pre[class*="language-"] {
36+
padding: 1em;
37+
margin: .5em 0;
38+
overflow: auto;
39+
}
40+
41+
:not(pre) > code[class*="language-"],
42+
pre[class*="language-"] {
43+
background: #f5f2f0;
44+
}
45+
46+
/* Inline code */
47+
:not(pre) > code[class*="language-"] {
48+
padding: .1em;
49+
border-radius: .3em;
50+
}
51+
52+
.token.comment,
53+
.token.prolog,
54+
.token.doctype,
55+
.token.cdata {
56+
color: slategray;
57+
}
58+
59+
.token.punctuation {
60+
color: #999;
61+
}
62+
63+
.namespace {
64+
opacity: .7;
65+
}
66+
67+
.token.property,
68+
.token.tag,
69+
.token.boolean,
70+
.token.number {
71+
color: #905;
72+
}
73+
74+
.token.selector,
75+
.token.attr-name,
76+
.token.string {
77+
color: #690;
78+
}
79+
80+
.token.operator,
81+
.token.entity,
82+
.token.url,
83+
.language-css .token.string,
84+
.style .token.string {
85+
color: #a67f59;
86+
background: hsla(0,0%,100%,.5);
87+
}
88+
89+
.token.atrule,
90+
.token.attr-value,
91+
.token.keyword {
92+
color: #07a;
93+
}
94+
95+
96+
.token.regex,
97+
.token.important {
98+
color: #e90;
99+
}
100+
101+
.token.important {
102+
font-weight: bold;
103+
}
104+
105+
.token.entity {
106+
cursor: help;
107+
}

assets/js/app.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* User: laurentrenard
3+
* Date: 5/14/13
4+
* Time: 10:55 PM
5+
**/
6+
var app=angular.module('app',['ui.bootstrap.tabs']);

assets/js/controllers.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* User: laurentrenard
3+
* Date: 5/14/13
4+
* Time: 10:55 PM
5+
**/
6+
app.controller('mainCtrl',['$scope', function (scope) {
7+
scope.greeting='hello Laurent';
8+
}]);

assets/js/prism.js

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.tabs"]);
2+
angular.module("ui.bootstrap.tpls", ["template/tabs/pane.html","template/tabs/tabs.html"]);
3+
angular.module('ui.bootstrap.tabs', [])
4+
.controller('TabsController', ['$scope', '$element', function($scope, $element) {
5+
var panes = $scope.panes = [];
6+
7+
this.select = $scope.select = function selectPane(pane) {
8+
angular.forEach(panes, function(pane) {
9+
pane.selected = false;
10+
});
11+
pane.selected = true;
12+
};
13+
14+
this.addPane = function addPane(pane) {
15+
if (!panes.length) {
16+
$scope.select(pane);
17+
}
18+
panes.push(pane);
19+
};
20+
21+
this.removePane = function removePane(pane) {
22+
var index = panes.indexOf(pane);
23+
panes.splice(index, 1);
24+
//Select a new pane if removed pane was selected
25+
if (pane.selected && panes.length > 0) {
26+
$scope.select(panes[index < panes.length ? index : index-1]);
27+
}
28+
};
29+
}])
30+
.directive('tabs', function() {
31+
return {
32+
restrict: 'EA',
33+
transclude: true,
34+
scope: {},
35+
controller: 'TabsController',
36+
templateUrl: 'template/tabs/tabs.html',
37+
replace: true
38+
};
39+
})
40+
.directive('pane', ['$parse', function($parse) {
41+
return {
42+
require: '^tabs',
43+
restrict: 'EA',
44+
transclude: true,
45+
scope:{
46+
heading:'@'
47+
},
48+
link: function(scope, element, attrs, tabsCtrl) {
49+
var getSelected, setSelected;
50+
scope.selected = false;
51+
if (attrs.active) {
52+
getSelected = $parse(attrs.active);
53+
setSelected = getSelected.assign;
54+
scope.$watch(
55+
function watchSelected() {return getSelected(scope.$parent);},
56+
function updateSelected(value) {scope.selected = value;}
57+
);
58+
scope.selected = getSelected ? getSelected(scope.$parent) : false;
59+
}
60+
scope.$watch('selected', function(selected) {
61+
if(selected) {
62+
tabsCtrl.select(scope);
63+
}
64+
if(setSelected) {
65+
setSelected(scope.$parent, selected);
66+
}
67+
});
68+
69+
tabsCtrl.addPane(scope);
70+
scope.$on('$destroy', function() {
71+
tabsCtrl.removePane(scope);
72+
});
73+
},
74+
templateUrl: 'template/tabs/pane.html',
75+
replace: true
76+
};
77+
}]);
78+
79+
angular.module("template/tabs/pane.html", []).run(["$templateCache", function($templateCache){
80+
$templateCache.put("template/tabs/pane.html",
81+
"<div class=\"tab-pane\" ng-class=\"{active: selected}\" ng-show=\"selected\" ng-transclude></div>" +
82+
"");
83+
}]);
84+
85+
angular.module("template/tabs/tabs.html", []).run(["$templateCache", function($templateCache){
86+
$templateCache.put("template/tabs/tabs.html",
87+
"<div class=\"tabbable\">" +
88+
" <ul class=\"nav nav-tabs\">" +
89+
" <li ng-repeat=\"pane in panes\" ng-class=\"{active:pane.selected}\">" +
90+
" <a ng-click=\"select(pane)\">{{pane.heading}}</a>" +
91+
" </li>" +
92+
" </ul>" +
93+
" <div class=\"tab-content\" ng-transclude></div>" +
94+
"</div>" +
95+
"");
96+
}]);

index.html

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<!DOCTYPE html>
2+
<html ng-app="app">
3+
<head>
4+
<title>Smart Table</title>
5+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
6+
<script src="./assets/js/app.js"></script>
7+
<script src="./assets/js/controllers.js"></script>
8+
<script src="./assets/js/ui-bootstrap-custom-tpls-0.4.0-SNAPSHOT.js"></script>
9+
<link rel="stylesheet" href="assets/css/bootstrap.css"/>
10+
<link rel="stylesheet" href="assets/css/prism.css"/>
11+
<link rel="stylesheet" href="assets/css/mainStyle.css"/>
12+
</head>
13+
<body ng-controller="mainCtrl">
14+
<header>
15+
<h1 class="banner">Smart Table</h1>
16+
<a class="btn" href="#">Code on github</a>
17+
</header>
18+
<div class="main">
19+
<p class="text-error">
20+
{{greeting}}
21+
</p>
22+
23+
<tabs>
24+
<pane heading="JavaScript">
25+
<pre>
26+
<code class="language-javascript">
27+
'use strict';
28+
// Declare app level module which depends on filters, and services
29+
var app = angular.module('myApp', ['SmartTable.Table']).
30+
config(['$routeProvider', function ($routeProvider) {
31+
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: 'dummy'});
32+
//$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: MyCtrl2});
33+
$routeProvider.otherwise({redirectTo: '/view1'});
34+
}]).controller('dummy', ['$scope', function (scope) {
35+
36+
scope.rowCollection = [
37+
{firstName: 'Laurent', lastName: 'Renard', birthDate: new Date('1987-05-21'), balance: 102, email: 'laurent34azerty@gmail.com'},
38+
{firstName: 'Blandine', lastName: 'Faivre', birthDate: new Date('1987-04-25'), balance: -2323.22, email: 'laurent34azerty@gmail.com'},
39+
{firstName: 'Francoise', lastName: 'Frere', birthDate: new Date('1955-08-27'), balance: 42343, email: 'laurent34azerty@gmail.com'}
40+
];
41+
42+
scope.columnCollection = [
43+
{label: 'FirsName', map: 'firstName', sortPredicate: function (dataRow) {
44+
return dataRow.firstName.length;
45+
}},
46+
{label: 'LastName', map: 'lastName', isSortable: false},
47+
{label: 'birth date', map: 'birthDate', formatFunction: 'date', type: 'date', isEditable: true},
48+
{label: 'balance', map: 'balance', isEditable: true, type: 'number', formatFunction: 'currency', formatParameter: '$'},
49+
{label: 'email', map: 'email', isEditable: true, type: 'email'}
50+
];
51+
scope.tableTitle = 'youpi';
52+
53+
scope.myObject = {number: 1, type: 'number'};
54+
scope.myModel = 'salut';
55+
}]);
56+
</code>
57+
</pre>
58+
59+
</pane>
60+
</tabs>
61+
</div>
62+
<script src="./assets/js/prism.js"></script>
63+
</body>
64+
</html>

package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "smart-table",
3+
"version": "0.0.1",
4+
"description": "documentation site for Smart-Table",
5+
"main": "index.html",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": "",
10+
"author": "Laurent Renard",
11+
"license": "MIT",
12+
"devDependencies": {
13+
"grunt": "~0.4.1"
14+
}
15+
}

0 commit comments

Comments
 (0)