Skip to content

Commit aa4da6d

Browse files
authored
Merge pull request #255 from Active-CSS/2.10.0
2.10.0
2 parents a9625b3 + ed984b9 commit aa4da6d

File tree

88 files changed

+25371
-519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+25371
-519
lines changed

Gruntfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
module.exports = function(grunt) {
77
grunt.initConfig({
88
// Custom variables.
9-
realVersion: '2.9.1',
10-
fileVersion: '2-9-1',
9+
realVersion: '2.10.0',
10+
fileVersion: '2-10-0',
1111

1212
pkg: grunt.file.readJSON('package.json'),
1313

README.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Boldly go where no CSS author has gone before...
99

1010
Here's a taster:
11-
1211
```
1312
#clickMe:click {
1413
body {
@@ -17,6 +16,22 @@ Here's a taster:
1716
}
1817
```
1918

19+
Example of a component (because you love components):
20+
```
21+
button:click {
22+
render-after-end: "<hello-world></hello-world>";
23+
}
24+
25+
@component hello-world private {
26+
html {
27+
<p>Hello world</p>
28+
}
29+
p:click {
30+
alert: "Why are you clicking me, you crazy!";
31+
}
32+
}
33+
```
34+
2035
Ultra-fast. No pre-processing. No virtual DOM. Runs in real-time in the browser.<br>
2136
All DOM events are supported, plus CSS commands up to level 4 (if browser supported).<br>
2237
Works on chromium browsers (Chrome, Edge, Opera, etc.) and Firefox. (ES6+)
@@ -30,10 +45,10 @@ The Active CSS installation instructions are [on the website](https://activecss.
3045
If you are looking for the core script to download, check out the [dist](https://github.com/Active-CSS/active-css/tree/master/dist) folder and then find the version(s) you need.
3146

3247
The production (live) version will look like this:<br>
33-
activecss-2-9-1.min.js
48+
activecss-2-10-0.min.js
3449

3550
The development (offline) version will look like this:<br>
36-
activecss-dev-2-9-1.min.js
51+
activecss-dev-2-10-0.min.js
3752

3853
There are also npm versions - links on the website.
3954

core-test/startup/compiled/core-test-config.acss

+44-24
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ create-element-tag:connectedCallback {
583583
}
584584

585585
#checkCreateElementDiv:draw {
586-
func: checkCreateElement {createElementConnectCallbackVar} {createElementDisconnectedCallbackVar} {createElementAttributeChangeVar} after 1s;
586+
func: checkCreateElement pars({createElementConnectCallbackVar}, {createElementDisconnectedCallbackVar}, {createElementAttributeChangeVar}) after 1s;
587587
}
588588

589589
#checkCreateElement:test {
@@ -836,12 +836,12 @@ create-element-tag:connectedCallback {
836836
func: checkFuncFalse false;
837837
/*
838838
Still to set up:
839-
func: checkFuncArr [1, 2, "cheesey wotsit"];
840-
func: checkFuncObj {dave: "hi"};
841-
func: checkFuncWinVar window.globIt;
842-
func: checkFuncACSSVar {myACSSVariable};
843-
func: checkFuncExpr {= 7 + 10 =};
844-
func: checkFuncCombined [1, 2, "cheesey wotsit"] {dave: "hi"} window.globIt {myACSSVariable} {= new Date =};*/
839+
func: checkFuncArr pars([1, 2, "cheesey wotsit"]);
840+
func: checkFuncObj pars({dave: "hi"});
841+
func: checkFuncWinVar pars(window.globIt);
842+
func: checkFuncACSSVar pars({myACSSVariable});
843+
func: checkFuncExpr pars({= 7 + 10 =});
844+
func: checkFuncCombined pars([1, 2, "cheesey wotsit"], {dave: "hi"}, window.globIt, {myACSSVariable}, {= new Date =});*/
845845

846846
func: checkFuncFinal;
847847
}
@@ -987,8 +987,6 @@ create-element-tag:connectedCallback {
987987
}
988988
a:draw {
989989
trigger-real: click;
990-
}
991-
a:afterTriggerReal {
992990
func: checkPreventDefault; /* If prevent-default works at all then passing the test in the function will be enough. */
993991
}
994992
html {
@@ -1009,8 +1007,6 @@ create-element-tag:connectedCallback {
10091007
}
10101008
a:draw {
10111009
trigger-real: click;
1012-
}
1013-
a:afterTriggerReal {
10141010
func: checkPreventDefaultShadow; /* If prevent-default works at all then passing the test in the function will be enough. */
10151011
}
10161012
html {
@@ -1198,7 +1194,7 @@ create-element-tag:connectedCallback {
11981194
&:componentOpen {
11991195
#renderHTMLExample {
12001196
render: "<span id=\"checkRenderTestDiv\"><strong>render</strong></span>";
1201-
func: checkRender;
1197+
func: checkRender after 100ms;
12021198
}
12031199
#renderEscapePTag {
12041200
render-after-end: "<span id=\"checkRenderAttrSubHack\">{@data-hackA}</span>" after stack;
@@ -1445,7 +1441,7 @@ create-element-tag:connectedCallback {
14451441
}
14461442
#checkStopEventPropagationDiv:draw {
14471443
trigger-real: click;
1448-
func: checkStopEventPropagation {checkStopEventPropagationVar} {checkStopEventPropagationAdditionalVar} after 1s;
1444+
func: checkStopEventPropagation pars({checkStopEventPropagationVar}, {checkStopEventPropagationAdditionalVar}) after 1s;
14491445
}
14501446
#checkStopEventPropagationDiv:click {
14511447
var: checkStopEventPropagationVar 1;
@@ -1536,7 +1532,7 @@ create-element-tag:connectedCallback {
15361532
}
15371533
#checkStopPropagationDiv:draw {
15381534
trigger-real: click;
1539-
func: checkStopPropagation {checkStopPropagationVar} {checkStopPropagationAdditionalVar} after 1s;
1535+
func: checkStopPropagation pars({checkStopPropagationVar}, {checkStopPropagationAdditionalVar}) after 1s;
15401536
}
15411537
#checkStopPropagationDiv:click {
15421538
var: checkStopPropagationVar 1;
@@ -1684,16 +1680,16 @@ create-element-tag:connectedCallback {
16841680
varTestArray['array'] [],
16851681
varTestArray['array']['subAssign'] {},
16861682
varTestArray['array']['subAssign'].dave true,
1687-
varTestArrayAssign varTestArray['array']['subAssign'].dave
1683+
varTestArrayAssignProp {varTestArray['array']['subAssign'].dave}
16881684
;
1689-
func: checkVar "{varTestString}"
1690-
{varTestBooleanTrue}
1691-
{varTestBooleanFalse}
1692-
{varTestBooleanDigitPositive}
1693-
{varTestBooleanDigitNegative}
1694-
{varTestEvaluatedNumber}
1695-
"{window.varTestWinVar}"
1696-
{varTestArrayAssign}
1685+
func: checkVar pars({varTestString},
1686+
{varTestBooleanTrue},
1687+
{varTestBooleanFalse},
1688+
{varTestBooleanDigitPositive},
1689+
{varTestBooleanDigitNegative},
1690+
{varTestEvaluatedNumber},
1691+
{window.varTestWinVar},
1692+
{varTestArrayAssignProp})
16971693
;
16981694
}
16991695
html {
@@ -1809,6 +1805,30 @@ create-element-tag:connectedCallback {
18091805
#continueAfterElementRemovalDivElDoesNotExist {
18101806
var: continueAfterElementVar "This shouldn't run at all";
18111807
}
1812-
func: continueAfterElementRemovalFinal "{continueAfterElementVar}";
1808+
func: continueAfterElementRemovalFinal {continueAfterElementVar};
1809+
}
1810+
1811+
1812+
#content:draw {
1813+
render-before-end: "<div id=\"quoteCheckOnSetAttributeAndSetProperty\" data-desc=\"Core - check setting attributes and properties with double quotes\" class=\"coreTest\">{|quoteCheckOnSetAttributeAndSetPropertyHTML}</div>";
18131814
}
18141815

1816+
@component quoteCheckOnSetAttributeAndSetPropertyHTML {
1817+
&:componentOpen {
1818+
#quoteCheckOnSetAttributeAndSetPropertyButton {
1819+
trigger-real: click;
1820+
}
1821+
}
1822+
html {
1823+
<button id="quoteCheckOnSetAttributeAndSetPropertyButton" data-quoted='was "Test Stuff".''>test</button>
1824+
<div id="quoteCheckOnSetAttributeAndSetPropertyTarget"></div>
1825+
}
1826+
}
1827+
1828+
#quoteCheckOnSetAttributeAndSetPropertyButton:click {
1829+
#quoteCheckOnSetAttributeAndSetPropertyTarget {
1830+
set-attribute: data-quoted-target "{@data-quoted}";
1831+
set-property: value "{@data-quoted}";
1832+
func: quoteCheckOnSetAttributeAndSetPropertyFinal pars("{@data-quoted-target}", "{@@value}");
1833+
}
1834+
}

core-test/startup/compiled/core-test-js.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -2218,7 +2218,7 @@ function checkVar(o, pars) {
22182218
_shouldBe(checkVarEl, 'varTestEvaluatedNumber', pars[5], 8);
22192219
_shouldBe(checkVarEl, 'window.varTestWinVar as a parameter', pars[6], 'hello');
22202220
_shouldBe(checkVarEl, 'window.varTestWinVar as a variable', window.varTestWinVar, 'hello');
2221-
_shouldBe(checkVarEl, 'varTestArrayAssign', pars[7], true);
2221+
_shouldBe(checkVarEl, 'varTestArrayAssignProp', pars[7], true);
22222222

22232223
// The test will not pass if any of the above comparisons fail. The success flag added below will be ignored by the test system.
22242224
_addSuccessClass(checkVarEl);
@@ -2317,3 +2317,19 @@ function continueAfterElementRemovalFinal(o, pars) {
23172317
}
23182318
}
23192319
}
2320+
2321+
function quoteCheckOnSetAttributeAndSetPropertyFinal(o, pars) {
2322+
let quoteCheckOnSetAttributeAndSetPropertyEl = _initTest('quoteCheckOnSetAttributeAndSetProperty');
2323+
if (!quoteCheckOnSetAttributeAndSetProperty) return;
2324+
2325+
let el = _getObj('#quoteCheckOnSetAttributeAndSetPropertyTarget');
2326+
if (!el) {
2327+
_fail(quoteCheckOnSetAttributeAndSetPropertyEl, '#quoteCheckOnSetAttributeAndSetPropertyTarget is not present for attribute/property check.');
2328+
}
2329+
2330+
_shouldBe(quoteCheckOnSetAttributeAndSetPropertyEl, 'attribute', pars[0], 'was "Test Stuff".');
2331+
_shouldBe(quoteCheckOnSetAttributeAndSetPropertyEl, 'property', pars[1], 'was "Test Stuff".');
2332+
2333+
// The test will not pass if any of the above comparisons fail. The success flag added below will be ignored by the test system.
2334+
_addSuccessClass(quoteCheckOnSetAttributeAndSetPropertyEl);
2335+
}

core-test/tests/commands/built-in/create-element/checkCreateElement.acss

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ create-element-tag:connectedCallback {
4141
}
4242

4343
#checkCreateElementDiv:draw {
44-
func: checkCreateElement {createElementConnectCallbackVar} {createElementDisconnectedCallbackVar} {createElementAttributeChangeVar} after 1s;
44+
func: checkCreateElement pars({createElementConnectCallbackVar}, {createElementDisconnectedCallbackVar}, {createElementAttributeChangeVar}) after 1s;
4545
}
4646

4747
#checkCreateElement:test {

core-test/tests/commands/built-in/func/checkFunc.acss

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
func: checkFuncFalse false;
1212
/*
1313
Still to set up:
14-
func: checkFuncArr [1, 2, "cheesey wotsit"];
15-
func: checkFuncObj {dave: "hi"};
16-
func: checkFuncWinVar window.globIt;
17-
func: checkFuncACSSVar {myACSSVariable};
18-
func: checkFuncExpr {= 7 + 10 =};
19-
func: checkFuncCombined [1, 2, "cheesey wotsit"] {dave: "hi"} window.globIt {myACSSVariable} {= new Date =};*/
14+
func: checkFuncArr pars([1, 2, "cheesey wotsit"]);
15+
func: checkFuncObj pars({dave: "hi"});
16+
func: checkFuncWinVar pars(window.globIt);
17+
func: checkFuncACSSVar pars({myACSSVariable});
18+
func: checkFuncExpr pars({= 7 + 10 =});
19+
func: checkFuncCombined pars([1, 2, "cheesey wotsit"], {dave: "hi"}, window.globIt, {myACSSVariable}, {= new Date =});*/
2020

2121
func: checkFuncFinal;
2222
}

core-test/tests/commands/built-in/prevent-default/checkPreventDefault.acss

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
}
99
a:draw {
1010
trigger-real: click;
11-
}
12-
a:afterTriggerReal {
1311
func: checkPreventDefault; /* If prevent-default works at all then passing the test in the function will be enough. */
1412
}
1513
html {

core-test/tests/commands/built-in/prevent-default/checkPreventDefaultShadow.acss

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
}
99
a:draw {
1010
trigger-real: click;
11-
}
12-
a:afterTriggerReal {
1311
func: checkPreventDefaultShadow; /* If prevent-default works at all then passing the test in the function will be enough. */
1412
}
1513
html {

core-test/tests/commands/built-in/render/checkRender.acss

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
&:componentOpen {
1111
#renderHTMLExample {
1212
render: "<span id=\"checkRenderTestDiv\"><strong>render</strong></span>";
13-
func: checkRender;
13+
func: checkRender after 100ms;
1414
}
1515
#renderEscapePTag {
1616
render-after-end: "<span id=\"checkRenderAttrSubHack\">{@data-hackA}</span>" after stack;

core-test/tests/commands/built-in/stop-event-propagation/checkStopEventPropagation.acss

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99
#checkStopEventPropagationDiv:draw {
1010
trigger-real: click;
11-
func: checkStopEventPropagation {checkStopEventPropagationVar} {checkStopEventPropagationAdditionalVar} after 1s;
11+
func: checkStopEventPropagation pars({checkStopEventPropagationVar}, {checkStopEventPropagationAdditionalVar}) after 1s;
1212
}
1313
#checkStopEventPropagationDiv:click {
1414
var: checkStopEventPropagationVar 1;

core-test/tests/commands/built-in/stop-propagation/checkStopPropagation.acss

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99
#checkStopPropagationDiv:draw {
1010
trigger-real: click;
11-
func: checkStopPropagation {checkStopPropagationVar} {checkStopPropagationAdditionalVar} after 1s;
11+
func: checkStopPropagation pars({checkStopPropagationVar}, {checkStopPropagationAdditionalVar}) after 1s;
1212
}
1313
#checkStopPropagationDiv:click {
1414
var: checkStopPropagationVar 1;

core-test/tests/commands/built-in/var/checkVar.acss

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
varTestArray['array'] [],
1818
varTestArray['array']['subAssign'] {},
1919
varTestArray['array']['subAssign'].dave true,
20-
varTestArrayAssign varTestArray['array']['subAssign'].dave
20+
varTestArrayAssignProp {varTestArray['array']['subAssign'].dave}
2121
;
22-
func: checkVar "{varTestString}"
23-
{varTestBooleanTrue}
24-
{varTestBooleanFalse}
25-
{varTestBooleanDigitPositive}
26-
{varTestBooleanDigitNegative}
27-
{varTestEvaluatedNumber}
28-
"{window.varTestWinVar}"
29-
{varTestArrayAssign}
22+
func: checkVar pars({varTestString},
23+
{varTestBooleanTrue},
24+
{varTestBooleanFalse},
25+
{varTestBooleanDigitPositive},
26+
{varTestBooleanDigitNegative},
27+
{varTestEvaluatedNumber},
28+
{window.varTestWinVar},
29+
{varTestArrayAssignProp})
3030
;
3131
}
3232
html {

core-test/tests/commands/built-in/var/checkVar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function checkVar(o, pars) {
1010
_shouldBe(checkVarEl, 'varTestEvaluatedNumber', pars[5], 8);
1111
_shouldBe(checkVarEl, 'window.varTestWinVar as a parameter', pars[6], 'hello');
1212
_shouldBe(checkVarEl, 'window.varTestWinVar as a variable', window.varTestWinVar, 'hello');
13-
_shouldBe(checkVarEl, 'varTestArrayAssign', pars[7], true);
13+
_shouldBe(checkVarEl, 'varTestArrayAssignProp', pars[7], true);
1414

1515
// The test will not pass if any of the above comparisons fail. The success flag added below will be ignored by the test system.
1616
_addSuccessClass(checkVarEl);

core-test/tests/core/continue-after-element-removal/continueAfterElementRemoval.acss

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
#continueAfterElementRemovalDivElDoesNotExist {
1818
var: continueAfterElementVar "This shouldn't run at all";
1919
}
20-
func: continueAfterElementRemovalFinal "{continueAfterElementVar}";
20+
func: continueAfterElementRemovalFinal {continueAfterElementVar};
2121
}
2222

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#content:draw {
2+
render-before-end: "<div id=\"quoteCheckOnSetAttributeAndSetProperty\" data-desc=\"Core - check setting attributes and properties with double quotes\" class=\"coreTest\">{|quoteCheckOnSetAttributeAndSetPropertyHTML}</div>";
3+
}
4+
5+
@component quoteCheckOnSetAttributeAndSetPropertyHTML {
6+
&:componentOpen {
7+
#quoteCheckOnSetAttributeAndSetPropertyButton {
8+
trigger-real: click;
9+
}
10+
}
11+
html {
12+
<button id="quoteCheckOnSetAttributeAndSetPropertyButton" data-quoted='was "Test Stuff".''>test</button>
13+
<div id="quoteCheckOnSetAttributeAndSetPropertyTarget"></div>
14+
}
15+
}
16+
17+
#quoteCheckOnSetAttributeAndSetPropertyButton:click {
18+
#quoteCheckOnSetAttributeAndSetPropertyTarget {
19+
set-attribute: data-quoted-target "{@data-quoted}";
20+
set-property: value "{@data-quoted}";
21+
func: quoteCheckOnSetAttributeAndSetPropertyFinal pars("{@data-quoted-target}", "{@@value}");
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function quoteCheckOnSetAttributeAndSetPropertyFinal(o, pars) {
2+
let quoteCheckOnSetAttributeAndSetPropertyEl = _initTest('quoteCheckOnSetAttributeAndSetProperty');
3+
if (!quoteCheckOnSetAttributeAndSetProperty) return;
4+
5+
let el = _getObj('#quoteCheckOnSetAttributeAndSetPropertyTarget');
6+
if (!el) {
7+
_fail(quoteCheckOnSetAttributeAndSetPropertyEl, '#quoteCheckOnSetAttributeAndSetPropertyTarget is not present for attribute/property check.');
8+
}
9+
10+
_shouldBe(quoteCheckOnSetAttributeAndSetPropertyEl, 'attribute', pars[0], 'was "Test Stuff".');
11+
_shouldBe(quoteCheckOnSetAttributeAndSetPropertyEl, 'property', pars[1], 'was "Test Stuff".');
12+
13+
// The test will not pass if any of the above comparisons fail. The success flag added below will be ignored by the test system.
14+
_addSuccessClass(quoteCheckOnSetAttributeAndSetPropertyEl);
15+
}

dist/v-2-10-0/activecss-2-10-0.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)