Skip to content

Commit 2c852d8

Browse files
committed
Error handling of missing layouts added
1 parent ecf836e commit 2c852d8

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ Create your own keymap to display the keybinings of your software with jQuery.
1515

1616
####[Live preview](http://andr3as.github.io/jQuery-Keymap)
1717

18-
![Example](http://andrano.de/Plugins/img/keymap.jpg "Example")
18+
![Example](http://andrano.de/Plugins/img/keymap.jpg "Example")
19+
20+
##Contribute
21+
You want to contribute a new layout or some fixes create a pull request or send an email to [andranode[at]gmail.com](mailto://andranode@gmail.com)

keymap.jquery.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "keymap",
33
"title": "jQuery Keymap",
4-
"description": "jQuery plugin for displaying shortcuts.",
4+
"description": "Create with jQuery a keymap to display keybindings.",
55
"keywords": [
66
"ui",
77
"animation"
88
],
9-
"version": "1.0.3",
9+
"version": "1.0.4",
1010
"author": {
1111
"name": "Andr3as",
1212
"email": "andranode@gmail.com",

keymap.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ var scripts = document.getElementsByTagName('script'),
221221
//Save selector and style
222222
keyMap.selector = this.selector;
223223
keyMap.css = opt.css;
224+
})
225+
.fail(function(e){
226+
$(_this).html('<p class="keymap-error">Failed to load layout! Check <a href="https://github.com/Andr3as/jQuery-Keymap/wiki/Troubleshooting">error #1</a> for more details.</p>');
224227
});
225228
return this;
226229
};
@@ -271,8 +274,8 @@ var scripts = document.getElementsByTagName('script'),
271274
return false;
272275
}
273276

274-
selector = selector || keyMap.selector;
275-
css = css || {};
277+
selector = selector || keyMap.selector;
278+
css = css || {};
276279

277280
if (typeof(css.class) == 'undefined') {
278281
setClass = false;

keymap.min.js

Lines changed: 1 addition & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)