Thanks to visit codestin.com
Credit goes to github.com

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

Commit 4f3a039

Browse files
committed
Merge branch 'eavichay-master'
2 parents 94b2c9e + dee6ab4 commit 4f3a039

File tree

10 files changed

+542
-6
lines changed

10 files changed

+542
-6
lines changed

angular-v2.4.9-keyed/src/app.ngsummary.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

angular-v2.4.9-non-keyed/src/app.ngsummary.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

index.html

Lines changed: 197 additions & 1 deletion
Large diffs are not rendered by default.

slim-js-v2.8.20/.babelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": ["es2015"],
3+
"plugins": [
4+
"transform-decorators-legacy",
5+
"transform-decorators",
6+
"transform-custom-element-classes",
7+
"transform-es2015-classes"]
8+
}

slim-js-v2.8.20/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Slim.js</title>
6+
<script src="./node_modules/slim-js/src/Slim.js"></script>
7+
<script src="./main-app.js"></script>
8+
<link href="/css/currentStyle.css" rel="stylesheet" />
9+
</head>
10+
<body>
11+
<main-app></main-app>
12+
</body>
13+
</html>

slim-js-v2.8.20/main-app.js

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
var startTime;
2+
var lastMeasure;
3+
var startMeasure = function(name) {
4+
startTime = performance.now();
5+
lastMeasure = name;
6+
}
7+
var stopMeasure = function() {
8+
var last = lastMeasure;
9+
if (lastMeasure) {
10+
window.setTimeout(function () {
11+
lastMeasure = null;
12+
var stop = performance.now();
13+
var duration = 0;
14+
console.log(last+" took "+(stop-startTime));
15+
}, 0);
16+
}
17+
}
18+
19+
function _random(max) {
20+
return Math.round(Math.random()*1000)%max;
21+
}
22+
23+
class Store {
24+
constructor() {
25+
this.data = [];
26+
this.backup = null;
27+
this.selected = null;
28+
this.id = 1;
29+
}
30+
buildData(count = 1000) {
31+
var adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"];
32+
var colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"];
33+
var nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"];
34+
var data = [];
35+
for (var i = 0; i < count; i++)
36+
data.push({id: this.id++, label: adjectives[_random(adjectives.length)] + " " + colours[_random(colours.length)] + " " + nouns[_random(nouns.length)] });
37+
return data;
38+
}
39+
updateData(mod = 10) {
40+
for (let i=0;i<this.data.length;i+=10) {
41+
this.data[i].label += ' !!!';
42+
// this.data[i] = Object.assign({}, this.data[i], {label: this.data[i].label +' !!!'});
43+
}
44+
}
45+
delete(id) {
46+
const idx = this.data.findIndex(d => d.id==id);
47+
this.data = this.data.filter((e,i) => i!=idx);
48+
return this;
49+
}
50+
run() {
51+
this.data = this.buildData();
52+
this.selected = null;
53+
}
54+
add() {
55+
this.data = this.data.concat(this.buildData(1000));
56+
this.selected = null;
57+
}
58+
update() {
59+
this.updateData();
60+
this.selected = null;
61+
}
62+
select(id) {
63+
this.selected = id;
64+
}
65+
hideAll() {
66+
this.backup = this.data;
67+
this.data = [];
68+
this.selected = null;
69+
}
70+
showAll() {
71+
this.data = this.backup;
72+
this.backup = null;
73+
this.selected = null;
74+
}
75+
runLots() {
76+
this.data = this.buildData(10000);
77+
this.selected = null;
78+
}
79+
clear() {
80+
this.data = [];
81+
this.selected = null;
82+
}
83+
swapRows() {
84+
if(this.data.length > 10) {
85+
var a = this.data[4];
86+
this.data[4] = this.data[9];
87+
this.data[9] = a;
88+
}
89+
}
90+
}
91+
92+
Slim.tag('main-app',
93+
94+
`
95+
<div id='main'>
96+
<div class="container">
97+
<div class="jumbotron">
98+
<div class="row">
99+
<div class="col-md-6">
100+
<h1>Slim.js</h1>
101+
</div>
102+
<div class="col-md-6">
103+
<div class="row">
104+
<div class="col-sm-6 smallpad">
105+
<button click="create1k" type='button' class='btn btn-primary btn-block' id='run'>Create 1,000 rows</button>
106+
</div>
107+
<div class="col-sm-6 smallpad">
108+
<button click="create10k" type='button' class='btn btn-primary btn-block' id='runlots'>Create 10,000 rows</button>
109+
</div>
110+
<div class="col-sm-6 smallpad">
111+
<button click="append1k" type='button' class='btn btn-primary btn-block' id='add'>Append 1,000 rows</button>
112+
</div>
113+
<div class="col-sm-6 smallpad">
114+
<button click="update10" type='button' class='btn btn-primary btn-block' id='update'>Update every 10th row</button>
115+
</div>
116+
<div class="col-sm-6 smallpad">
117+
<button click="testClear" type='button' class='btn btn-primary btn-block' id='clear'>Clear</button>
118+
</div>
119+
<div class="col-sm-6 smallpad">
120+
<button click="swap" type='button' class='btn btn-primary btn-block' id='swaprows'>Swap Rows</button>
121+
</div>
122+
</div>
123+
</div>
124+
</div>
125+
</div>
126+
<table class="table table-hover table-striped test-data">
127+
<tbody id="tbody">
128+
<tr slim-repeat="items" slim-repeat-adjacent="true" class="[[isSelected(data)]]">
129+
<td class="col-md-1" bind>[[data.id]]</td>
130+
<td class="col-md-4">
131+
<a click="doSelect" bind>[[data.label]]</a>
132+
</td>
133+
<td class="col-md-1">
134+
<a>
135+
<span click="deleteOne" class="glyphicon glyphicon-remove" aria-hidden="true"></span>
136+
</a>
137+
</td>
138+
<td class="col-md-6">
139+
</td>
140+
</tr>
141+
</tbody>
142+
</table>
143+
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
144+
</div>
145+
</div>
146+
`,
147+
148+
class extends Slim {
149+
onBeforeCreated() {
150+
this.items = [];
151+
this.store = new Store();
152+
}
153+
154+
doSelect(e) {
155+
startMeasure('select');
156+
this.store.select(e.target.data.id);
157+
this.items = this.store.data;
158+
stopMeasure();
159+
}
160+
161+
isSelected(data) {
162+
if (!data) return '';
163+
return this.store.selected === data.id ? 'danger' : '';
164+
}
165+
166+
deleteOne(e) {
167+
startMeasure('delete');
168+
this.store.delete(e.target.data.id);
169+
this.items = this.store.data;
170+
stopMeasure();
171+
}
172+
173+
update10() {
174+
startMeasure('update');
175+
this.store.update();
176+
this.items = this.store.data;
177+
stopMeasure();
178+
}
179+
180+
testClear() {
181+
startMeasure('clear');
182+
this.store.clear();
183+
this.items = this.store.data;
184+
stopMeasure();
185+
}
186+
187+
append1k() {
188+
startMeasure('add');
189+
this.store.add();
190+
this.items = this.store.data;
191+
stopMeasure();
192+
}
193+
194+
swap() {
195+
startMeasure('swap');
196+
this.store.swapRows();
197+
this.items = this.store.data;
198+
stopMeasure();
199+
}
200+
201+
create10k() {
202+
this.store.clear();
203+
this.store.runLots();
204+
startMeasure('runLots');
205+
this.items = this.store.data;
206+
stopMeasure();
207+
}
208+
209+
create1k() {
210+
this.store.clear();
211+
this.store.run();
212+
startMeasure('run');
213+
this.items = this.store.data;
214+
stopMeasure();
215+
}
216+
});

slim-js-v2.8.20/package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "slim-js-v2.8.17",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"build-prod": "exit 0",
8+
"abuild-prod": "NODE_ENV=production webpack -p --progress --display-chunks --profile --config webpack.prod.config.js",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"keywords": [],
12+
"author": "",
13+
"license": "ISC",
14+
"devDependencies": {
15+
"webpack": "^1.12.12",
16+
"uglify-js-harmony": "^2.6.2",
17+
"script-loader": "^0.7.0",
18+
"html-webpack-plugin": "^2.7.2",
19+
"html-webpack-template": "^3.0.2",
20+
"babel": "^6.23.0",
21+
"babel-core": "^6.4.5",
22+
"babel-eslint": "^7.2.3",
23+
"babel-loader": "^6.2.1",
24+
"babel-plugin-transform-custom-element-classes": "^0.1.0",
25+
"babel-plugin-transform-decorators": "^6.24.1",
26+
"babel-plugin-transform-decorators-legacy": "^1.3.4",
27+
"babel-polyfill": "^6.23.0",
28+
"babel-preset-env": "^1.4.0",
29+
"babel-preset-es2015": "^6.3.13"
30+
},
31+
"dependencies": {
32+
"slim-js": "^2.8.20"
33+
}
34+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
//webpack and its dependencies
2+
var webpack = require('webpack');
3+
var HtmlWebpackPlugin = require('html-webpack-plugin');
4+
//package.json to pull in the project title
5+
6+
module.exports = {
7+
devtool: 'source-map',
8+
debug: true,
9+
entry: [
10+
'./main-app.js'
11+
],
12+
module: {
13+
preLoaders: [
14+
{
15+
test: /\.json$/,
16+
exclude: /node_modules/,
17+
loader: 'json'
18+
}
19+
],
20+
loaders:[
21+
{
22+
test: /\.html$/,
23+
loader: 'raw-loader'
24+
},
25+
{
26+
test: /\.png$/,
27+
exclude: /node_modules/,
28+
loader: 'url-loader'
29+
},
30+
{
31+
test: /\.scss$/,
32+
exclude: /node_modules/,
33+
loaders: ["style", "css?sourceMap&modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]", "sass?sourceMap"]
34+
},
35+
{
36+
test: /\.js$/,
37+
loader: 'babel'
38+
},
39+
{
40+
test: /\.tff$/,
41+
exclude: /node_modules/,
42+
loader: 'url-loader?limit=100000'
43+
}
44+
]
45+
},
46+
resolve: {
47+
extensions: ['', '.js']
48+
},
49+
output: {
50+
path: __dirname + '/dist',
51+
publicPath: '/',
52+
filename: 'bundle.js'
53+
},
54+
devServer: {
55+
contentBase: './dist',
56+
port: 8000,
57+
noInfo: true,
58+
open: true,
59+
hot: false
60+
},
61+
plugins: [
62+
new webpack.HotModuleReplacementPlugin(),
63+
new HtmlWebpackPlugin({
64+
template: './index.html'
65+
// appMountId: 'app'
66+
})
67+
]
68+
};

webdriver-ts/src/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export let frameworks = [
6565
f("plastiq-v1.33.0", false),
6666
f("polymer-v1.7.0", true, {uri: "polymer-v1.7.0", useShadowRoot: true}),
6767
f("preact-v7.1.0", false),
68-
f("svelte-v1.0.1", true),
6968
f("ractive-v0.8.9-keyed", false),
7069
f("ractive-v0.8.9-non-keyed", true),
7170
f("ractive-edge", true),
@@ -77,9 +76,11 @@ export let frameworks = [
7776
f("riot-v3.0.7", true),
7877
f("rx-domh-v0.0.2-rxjs-v5.3.0", false),
7978
f("simulacra-v2.0.4", true),
79+
f("slim-js-v2.8.20", true),
8080
f("stem-v0.2.60", true),
8181
f("surplus-v0.4.0-keyed", false, { uri: "surplus-v0.4.0?keyed" }),
8282
f("surplus-v0.4.0-nonkeyed", true, { uri: "surplus-v0.4.0" }),
83+
f("svelte-v1.0.1", true),
8384
f("tsers-v1.0.0", true),
8485
f("vanillajs-non-keyed", true),
8586
f("vanillajs-keyed", false),

webdriver-ts/table.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)