Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit ac32e00

Browse files
Rohit Mulangearschmitz
Rohit Mulange
authored andcommitted
Performance: Add topcoat framework to test suite
Closes gh-45
1 parent d084595 commit ac32e00

File tree

3 files changed

+118
-2
lines changed

3 files changed

+118
-2
lines changed
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
module.exports = {
2+
css: [
3+
"//cdnjs.cloudflare.com/ajax/libs/topcoat/0.8.0/css/topcoat-mobile-dark.css",
4+
"//cdnjs.cloudflare.com/ajax/libs/topcoat-icons/0.2.0/font/icomatic.css"
5+
],
6+
button: {
7+
generator: function( options ) {
8+
var button = "<button class='",
9+
buttonText = options.type ? "" : " Button",
10+
buttonClass = "topcoat" + options.type + "-button" + options.size,
11+
icon = "",
12+
iconClass = "topcoat-icon";
13+
14+
// Add icon only if it is a icon-button or there is an icon set
15+
if ( options.icon || options.type ) {
16+
17+
// Icon butons donot support cta type
18+
if ( !options.type || options.state !== "--cta" ) {
19+
buttonClass += options.state;
20+
}
21+
22+
// If it is an icon button, add size to class
23+
if ( options.type ) {
24+
iconClass += options.size;
25+
}
26+
icon = "<span class='" + iconClass + " icomatic'>" + options.icon +
27+
"</span>";
28+
}
29+
30+
return button + buttonClass + "'>" + icon + buttonText + "</button>";
31+
},
32+
variations: {
33+
type: [
34+
"",
35+
"-icon"
36+
],
37+
size: [
38+
"",
39+
"--large"
40+
],
41+
state: [
42+
"",
43+
"--cta",
44+
"--quiet"
45+
46+
],
47+
icon: [
48+
"",
49+
"location",
50+
"home",
51+
"alert"
52+
]
53+
54+
}
55+
}
56+
};

performance/frameworks/topcoat.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
module.exports = {
2+
css: [
3+
"//cdnjs.cloudflare.com/ajax/libs/topcoat/0.8.0/css/topcoat-desktop-dark.css",
4+
"//cdnjs.cloudflare.com/ajax/libs/topcoat-icons/0.2.0/font/icomatic.css"
5+
],
6+
button: {
7+
generator: function( options ) {
8+
var button = "<button class='",
9+
buttonText = options.type ? "" : " Button",
10+
buttonClass = "topcoat" + options.type + "-button" + options.size,
11+
icon = "",
12+
iconClass = "topcoat-icon";
13+
14+
// Add icon only if it is a icon-button or there is an icon set
15+
if ( options.icon || options.type ) {
16+
17+
// Icon butons donot support cta type
18+
if ( !options.type || options.state !== "--cta" ) {
19+
buttonClass += options.state;
20+
}
21+
22+
// If it is an icon button, add size to class
23+
if ( options.type ) {
24+
iconClass += options.size;
25+
}
26+
icon = "<span class='" + iconClass + " icomatic'>" + options.icon +
27+
"</span>";
28+
}
29+
30+
return button + buttonClass + "'>" + icon + buttonText + "</button>";
31+
},
32+
variations: {
33+
type: [
34+
"",
35+
"-icon"
36+
],
37+
size: [
38+
"",
39+
"--large"
40+
],
41+
state: [
42+
"",
43+
"--cta",
44+
"--quiet"
45+
46+
],
47+
icon: [
48+
"",
49+
"location",
50+
"home",
51+
"alert"
52+
]
53+
54+
}
55+
}
56+
};

tasks/options/perfjankie.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ module.exports = {
2828
"http://localhost:4200/framework/jquery-ui-1-12/component/button/count/1000/" +
2929
"jquery-ui-1-12:button",
3030
"http://localhost:4200/framework/bootstrap/component/button/count/1000/" +
31-
"bootstrap:button"
31+
"bootstrap:button",
32+
"http://localhost:4200/framework/topcoat/component/button/count/1000/" +
33+
"topcoat:button",
34+
"http://localhost:4200/framework/topcoat-mobile/component/button/count/1000/" +
35+
"topcoat-mobile:button"
3236
]
3337
}
3438
}
35-
}
39+
}

0 commit comments

Comments
 (0)