Skip to content

Commit

Permalink
Use AMD declaration API
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Sorin committed Sep 6, 2014
1 parent edd04a8 commit 7379c51
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .gitignore
@@ -0,0 +1,22 @@
.DS_Store
.DS_Store?
.*DS_Store*

lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results

npm-debug.log
node_modules
bower_components

.idea
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "sklad",
"version": "0.2.0",
"version": "0.2.1",
"homepage": "https://github.com/1999/sklad",
"author": "Dmitry Sorin <info@staypositive.ru>",
"main": "sklad.js",
Expand Down
26 changes: 26 additions & 0 deletions package.json
@@ -0,0 +1,26 @@
{
"name": "sklad",
"version": "1.0.0",
"description": "IndexedDB abstraction layer",
"directories": {
"doc": "docs"
},
"repository": {
"type": "git",
"url": "https://github.com/1999/sklad.git"
},
"keywords": [
"indexeddb",
"html5",
"database"
],
"author": "Dmitry Sorin <info@staypositive.ru>",
"license": "MIT",
"bugs": {
"url": "https://github.com/1999/sklad/issues"
},
"homepage": "https://github.com/1999/sklad",
"dependencies": {
"bower": "~1.3.9"
}
}
18 changes: 13 additions & 5 deletions sklad.js
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2013 Dmitry Sorin <info@staypositive.ru>
* Copyright (c) 2013-2014 Dmitry Sorin <info@staypositive.ru>
* https://github.com/1999/sklad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -23,8 +23,16 @@
* @author Dmitry Sorin <info@staypositive.ru>
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
(function () {
"use strict";
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else {
// Browser globals
root.sklad = factory();
}
}(this, function () {
'use strict';

if (!window.indexedDB)
window.indexedDB = window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
Expand Down Expand Up @@ -648,5 +656,5 @@
});
};

window.sklad = skladAPI;
})();
return skladAPI;
}));

0 comments on commit 7379c51

Please sign in to comment.