Skip to content

Commit bd3ed43

Browse files
committed
Merge master into release branch
2 parents 24a2f2d + 42fdfff commit bd3ed43

File tree

22 files changed

+971
-647
lines changed

22 files changed

+971
-647
lines changed

_sass/_mixins.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
@if $media == small {
33
@media only screen and (max-width: $break-small) { @content; }
44
}
5+
@else if $media == small-medium {
6+
@media only screen and (max-width: $break-large -1) { @content; }
7+
}
58
@else if $media == medium {
69
@media only screen and (min-width: $break-small + 1) and (max-width: $break-large - 1) { @content; }
710
}
11+
@else if $media == medium-large {
12+
@media only screen and (min-width: $break-small + 1) { @content; }
13+
}
814
@else if $media == large {
915
@media only screen and (min-width: $break-large) { @content; }
1016
}

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "patternslib",
3-
"version": "2.0.11",
3+
"version": "2.0.12",
44
"main": "bundle.js",
55
"devDependencies": {
66
"jasmine": "https://github.com/jcbrand/jasmine.git#1_3_x"

changes.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 2.0.12 - Oct. 9, 2015
4+
5+
- New argument for the inject pattern: `loading-class`.
6+
Specifies a class to appear on the injection target while the injected content is still loading.
7+
Previously this was hardcoded to `injecting`, this is still set to the default value.
8+
- New arguments for the inject pattern: `confirm` and `confirm-message`.
9+
Allows you to specify whether a confirmation message should be shown before
10+
injecting, as well as the text of that message.
11+
- New argument for tooltip pattern: `mark-inactive`.
12+
A boolean value, used to specify whether the class 'inactive' should be added
13+
to the tooltip trigger. Previously this behavior was hardcoded, now it's
14+
optional with a default of `true`.
15+
- Fix: tooltips with `closing` set to `sticky` or `auto` couldn't be closed on mobile.
16+
- Parser fix. Remove duplicate configurations.
17+
- Bugfix: TypeError: Cannot read property 'msie' of undefined.
18+
319
## 2.0.11 - Sept. 30, 2015
420

521
- Bugfix. Specifying combined pattern properties (with &&) not working on IE10.

docs/developer/create-a-pattern.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# How to create a new pattern
22

3-
This section provides a quick tutorial on how to create a new Patternslib pattern.
3+
This document provides a quick tutorial on how to create a new Patternslib pattern.
44
Patterns are implemented as javascript objects that are registered with the Patternslib library.
55

6-
We create a new pattern called pat-colorchanger, which will change
7-
the text-color of an element after waiting for 3 seconds.
6+
## Creating a colorchanger pattern
87

9-
## Creating the pattern directory
8+
In this tutorial we will create a new pattern called pat-colorchanger.
9+
This pattern changes the text-color of an element after waiting for 3 seconds.
10+
11+
### Creating the pattern directory
1012

1113
To start off, lets create a new directory in which we'll put our pattern's
1214
files, and then lets navigate into it.
@@ -16,6 +18,17 @@ mkdir pat-colorchanger
1618
cd pat-colorchanger
1719
```
1820

21+
### Using the Yeoman generator
22+
23+
Instead of manually typing out the code shown in this tutorial, you can simply
24+
use the [Yeoman Patternslib generator](https://www.npmjs.com/package/generator-patternslib) to generate the appropriate skeleton for you.
25+
26+
To do so, simply run the following commands in side the `pat-colorchanger`
27+
directory you created in the previous section.
28+
29+
sudo npm install -g generator-patternslib
30+
yo patternslib pat-colorchanger
31+
1932
In our example we're creating for demonstration purposes the pattern
2033
pat-colorchanger, but you'll of course choose a more appropriate
2134
name for your own pattern.
@@ -26,11 +39,10 @@ Each pattern should have a certain layout. Look for example at [pat-pickadate](h
2639
There is one subdirectory, called *src*, inside the *pat-pickadate* repository.
2740
It contains the pattern's actual Javascript source file(s).
2841

29-
Let's create this directory now::
30-
31-
mkdir src
42+
The Yeoman generator will create the correct layout and all the necessary
43+
files.
3244

33-
And let's also create the files required::
45+
However, if you're doing this manually instead of using Yeoman, then create this directory as well as the files required:
3446

3547
touch README.md index.html src/pat-colorchanger.js
3648

@@ -39,7 +51,7 @@ And let's also create the files required::
3951

4052
Patterns are configured via a declarative HTML syntax.
4153

42-
A particular pattern is usually invoked by specifying its name as an HTML class on a DOM object.
54+
Usually a particular pattern is invoked by specifying its name as an HTML class on a DOM object.
4355
The invoked pattern then acts upon that specifc DOM element. In our example case, the pattern
4456
changes the text color after 3 seconds. This color change is applied to the DOM
4557
element on which the pattern is declared.
@@ -51,11 +63,9 @@ So in our case, that's `data-pat-colorchanger`.
5163

5264
For example:
5365

54-
```
55-
<p class="pat-colorchanger" data-pat-colorchanger="color: blue" style="color: red">
56-
This text will turn from red into blue after 3 seconds.
57-
</p>
58-
```
66+
<p class="pat-colorchanger" data-pat-colorchanger="color: blue" style="color: red">
67+
This text will turn from red into blue after 3 seconds.
68+
</p>
5969

6070
HTML markup as shown above, which illustrates how your pattern functions, should be put
6171
inside the `index.html` file. This file can then be used by designers and integrators
@@ -144,8 +154,7 @@ Put this code into `./src/pat-colorchanger.js`
144154
}));
145155
```
146156

147-
This pattern can be loaded directly in your browser after a standard Patterns
148-
bundle has been loaded.
157+
This pattern can be loaded directly in your browser after a standard Patterns bundle has been loaded.
149158

150159
```
151160
<html>

docs/developer/parser.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# The argument parser's API
22

3-
Many patterns can be configured to change their behaviour. This is done
3+
Patterns can usually be configured to change their behaviour. This is done
44
by passing arguments to the parser in data-pat-\* attributes or by using
55
an internal javascript API. All processing of arguments is done by the
66
argument parser. Using the parser is easy:
77

88
```
99
var parser = new ArgumentParser("tooltip");
10-
parser.add_argument("delay", 150);
11-
parser.add_argument("loop", false);
12-
parser.add_argument("next-label", "Next");
10+
parser.addArgument("delay", 150);
11+
parser.addArgument("loop", false);
12+
parser.addArgument("next-label", "Next");
1313
1414
$("[data-pat-tooltip]").each(function() {
1515
var options = parser.parse($(this));
@@ -41,7 +41,7 @@ they are:
4141
right attribute to parse for elements.
4242

4343

44-
- **ArgumentParser.add_argument(name[, default[, choices[, multiple]]])**
44+
- **ArgumentParser.addArgument(name[, default[, choices[, multiple]]])**
4545

4646
Parameters:
4747
- **name** *(String)*: argument name
@@ -61,7 +61,7 @@ they are:
6161
The default value can also be a function taking a jQuery wrapped element
6262
and the parameter name as arguments and which returns a default value.
6363

64-
parser.add_argument("delay", function($el, name) {
64+
parser.addArgument("delay", function($el, name) {
6565
return 500;
6666
});
6767

@@ -80,10 +80,10 @@ they are:
8080
options will be returned as a sub-object. For example a parser with
8181
these arguments:
8282

83-
parser.add_argument("selector", ".pattern");
84-
parser.add_argument("control-arrows", false);
85-
parser.add_argument("control-links", true);
86-
parser.add_argument("control-index", false);
83+
parser.addArgument("selector", ".pattern");
84+
parser.addArgument("control-arrows", false);
85+
parser.addArgument("control-links", true);
86+
parser.addArgument("control-index", false);
8787

8888
will return an object like this:
8989

package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "patternslib",
3-
"version": "2.0.11",
3+
"version": "2.0.12",
44
"title": "Markup patterns to drive behaviour.",
55
"description": "Patterns is a JavaScript library that enables designers to build rich interactive prototypes without the need for writing any Javascript. All events are triggered by classes and other attributes in the HTML, without abusing the HTML as a programming language. Accessibility, SEO and well structured HTML are core values of Patterns.",
66
"author": {
@@ -12,34 +12,33 @@
1212
"URL": "LICENSE.txt"
1313
}
1414
],
15-
"dependencies": {
16-
"http-server": "^0.7.5"
17-
},
1815
"devDependencies": {
1916
"bower": "latest",
2017
"generator-patternslib": "0.2.1",
18+
"http-server": "^0.7.5",
2119
"jshint": "~0.9.1",
2220
"pegjs": "0.7.0",
2321
"phantom-jasmine": "0.1.8",
24-
"phantomjs": "^1.9.12",
22+
"phantomjs": "^1.9.18",
2523
"requirejs": "",
2624
"yo": "^1.4.8"
2725
},
2826
"homepage": "https://gitub.com/Patternslib/Patterns",
2927
"docs": "http://patternslib.com/",
3028
"maintainers": [
31-
{
32-
"name": "Wichert Akkerman",
33-
"email": "wichert@wiggy.net",
34-
"url": "http://www.wiggy.net"
35-
},
3629
{
3730
"name": "Cornelis Kolbach",
3831
"url": "http://cornae.com"
3932
},
4033
{
41-
"name": "Florian Friesdorf",
42-
"email": "flo@chaoflow.net"
34+
"name": "JC Brand",
35+
"email": "jc@opkode.com",
36+
"url": "https://www.opkode.com"
37+
},
38+
{
39+
"name": "Syslab.com GmbH",
40+
"email": "info@syslab.com",
41+
"url": "http://www.syslab.com"
4342
}
4443
]
4544
}

0 commit comments

Comments
 (0)