Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelkaron committed Sep 2, 2016
0 parents commit 247f9b4
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# JS
node_modules/
bower_components/
17 changes: 17 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "mu-jquery-widget",
"authors": [
"Mikael Karon <mikael@karon.se>"
],
"description": "A jQuery widget",
"main": "jquery.widget.js",
"license": "MIT",
"homepage": "",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
38 changes: 38 additions & 0 deletions jquery.widget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(function(root, factory) {
if (typeof define === "function" && define.amd) {
define(["jquery"], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory(require("jquery"));
} else {
root["mu-jquery-widget/jquery.widget"] = factory(root.jQuery);
}
}(this, function($) {
var re = /,+/;
var space = " ";

return $.fn.widget = function(ops, ns, data) {
function namespace(type) {
return type + "." + ns;
}

return this.each(function(i, element) {
var $element = $(this);

$.each(ops || false, function(j, op) {
switch (op.method) {
case "on":
$element.on($.map(op.type.split(re), namespace).join(space), data, op.value);
break;

case "attr":
$element.attr(op.type, op.value);
break;

case "prop":
$element.prop(op.type, op.value);
break;
}
});
});
}
}));
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "mu-jquery-widget",
"version": "1.0.0",
"description": "A jQuery widget",
"main": "jquery.widget.js",
"scripts": {
"release": "standard-version"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mu-lib/mu-jquery-widget.git"
},
"author": "Mikael Karon <mikael@karon.se>",
"license": "MIT",
"bugs": {
"url": "https://github.com/mu-lib/mu-jquery-widget/issues"
},
"homepage": "https://github.com/mu-lib/mu-jquery-widget#readme",
"devDependencies": {
"standard-version": "^2.4.0"
}
}

0 comments on commit 247f9b4

Please sign in to comment.