This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'dist' folder for installations with bower
- Loading branch information
1 parent
ff5215b
commit ba8da4c
Showing
5 changed files
with
238 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/** | ||
* jquery.jcreate.js v1.3.0 | ||
* Marco Montalbano © 2011-2022 - https://marcomontalbano.com | ||
* ---------------------------------------------------------- | ||
*/ | ||
(function($, domManip, append, prepend, before, after, html, replaceWith) { | ||
var _createList = [], _utility = {}; | ||
_utility.camelize = function(str) { | ||
return str.toLowerCase().replace(/[-_\.]+(.)/g, function(match, group) { | ||
return group.toUpperCase(); | ||
}); | ||
}; | ||
_utility.firstLetterToLowerCase = function(str) { | ||
return str.charAt(0).toLowerCase() + str.slice(1); | ||
}; | ||
_utility.firstLetterToUpperCase = function(str) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
}; | ||
_utility.filterDataByKey = function(data, key) { | ||
var _data = {}, regexp = new RegExp("^" + key + "([A-Za-z0-9]+)$"), matches; | ||
if (typeof data !== "object") { | ||
return data; | ||
} | ||
for (var data_key in data) { | ||
if (Object.hasOwnProperty.call(data, data_key)) { | ||
matches = data_key.match(regexp); | ||
if (matches) { | ||
_data[_utility.firstLetterToLowerCase(matches[1])] = data[data_key]; | ||
} | ||
} | ||
} | ||
return _data; | ||
}; | ||
var _create = function(_createItem) { | ||
var $elements = _createItem.is_document ? $(_createItem.handleObj.selector) : _createItem.$delegateTarget.find(_createItem.handleObj.selector); | ||
$elements.each(function() { | ||
var $this = $(this), data_key = "$.event.special.create", data_sep = ",", data = $this.data(data_key) ? $this.data(data_key).split(data_sep) : []; | ||
if ($.inArray(_createItem.id, data) === -1) { | ||
data.push(_createItem.id); | ||
$this.data(data_key, data.join(data_sep)); | ||
_createItem.handleObj.handler.apply(this, [ new $.Event("create", { | ||
currentTarget: this, | ||
$currentTarget: $this, | ||
delegateTarget: _createItem.delegateTarget, | ||
$delegateTarget: _createItem.$delegateTarget, | ||
data: _createItem.handleObj.data, | ||
options: function(key) { | ||
return _utility.filterDataByKey($this.data(), _utility.camelize(key)); | ||
} | ||
}) ]); | ||
} | ||
}); | ||
}; | ||
var _domManip = function() { | ||
if (_createList.length >= 1) { | ||
var _createItem = null; | ||
for (var key in _createList) { | ||
if (_createList.hasOwnProperty(key)) { | ||
_createItem = _createList[key]; | ||
_create(_createItem); | ||
} | ||
} | ||
} | ||
return this; | ||
}; | ||
$.event.special.create = { | ||
add: function(handleObj) { | ||
var $this = $(this); | ||
var _createItem = { | ||
id: _createList.length.toString(), | ||
delegateTarget: this, | ||
$delegateTarget: $this, | ||
is_document: $this.is(document), | ||
handleObj: handleObj | ||
}; | ||
_createList.push(_createItem); | ||
_create(_createItem); | ||
}, | ||
remove: function(handleObj) { | ||
for (var _createList_key in _createList) { | ||
if (_createList.hasOwnProperty(_createList_key) && $(this).is(_createList[_createList_key].$delegateTarget) && _createList[_createList_key].handleObj.selector === handleObj.selector) { | ||
delete _createList[_createList_key]; | ||
break; | ||
} | ||
} | ||
}, | ||
utility: _utility, | ||
version: "1.3.0" | ||
}; | ||
$.fn.append = function() { | ||
return _domManip.apply(append.apply(this, arguments), arguments); | ||
}; | ||
$.fn.before = function() { | ||
return _domManip.apply(before.apply(this, arguments), arguments); | ||
}; | ||
$.fn.after = function() { | ||
return _domManip.apply(after.apply(this, arguments), arguments); | ||
}; | ||
$.fn.html = function() { | ||
return _domManip.apply(html.apply(this, arguments), arguments); | ||
}; | ||
$.fn.replaceWith = function() { | ||
return _domManip.apply(replaceWith.apply(this, arguments), arguments); | ||
}; | ||
})(jQuery, jQuery.fn.domManip, jQuery.fn.append, jQuery.fn.prepend, jQuery.fn.before, jQuery.fn.after, jQuery.fn.html, jQuery.fn.replaceWith); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
(function (root, factory) { | ||
if (root === undefined && window !== undefined) root = window; | ||
if (typeof define === 'function' && define.amd) { | ||
// AMD. Register as an anonymous module unless amdModuleId is set | ||
define(["jquery"], function (a0) { | ||
return (factory(a0)); | ||
}); | ||
} else if (typeof module === 'object' && module.exports) { | ||
// Node. Does not work with strict CommonJS, but | ||
// only CommonJS-like environments that support module.exports, | ||
// like Node. | ||
module.exports = factory(require("jquery")); | ||
} else { | ||
factory(root["jquery"]); | ||
} | ||
}(this, function (jquery) { | ||
|
||
/** | ||
* jquery.jcreate.js v1.3.0 | ||
* Marco Montalbano © 2011-2022 - https://marcomontalbano.com | ||
* ---------------------------------------------------------- | ||
*/ | ||
(function($, domManip, append, prepend, before, after, html, replaceWith) { | ||
var _createList = [], _utility = {}; | ||
_utility.camelize = function(str) { | ||
return str.toLowerCase().replace(/[-_\.]+(.)/g, function(match, group) { | ||
return group.toUpperCase(); | ||
}); | ||
}; | ||
_utility.firstLetterToLowerCase = function(str) { | ||
return str.charAt(0).toLowerCase() + str.slice(1); | ||
}; | ||
_utility.firstLetterToUpperCase = function(str) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
}; | ||
_utility.filterDataByKey = function(data, key) { | ||
var _data = {}, regexp = new RegExp("^" + key + "([A-Za-z0-9]+)$"), matches; | ||
if (typeof data !== "object") { | ||
return data; | ||
} | ||
for (var data_key in data) { | ||
if (Object.hasOwnProperty.call(data, data_key)) { | ||
matches = data_key.match(regexp); | ||
if (matches) { | ||
_data[_utility.firstLetterToLowerCase(matches[1])] = data[data_key]; | ||
} | ||
} | ||
} | ||
return _data; | ||
}; | ||
var _create = function(_createItem) { | ||
var $elements = _createItem.is_document ? $(_createItem.handleObj.selector) : _createItem.$delegateTarget.find(_createItem.handleObj.selector); | ||
$elements.each(function() { | ||
var $this = $(this), data_key = "$.event.special.create", data_sep = ",", data = $this.data(data_key) ? $this.data(data_key).split(data_sep) : []; | ||
if ($.inArray(_createItem.id, data) === -1) { | ||
data.push(_createItem.id); | ||
$this.data(data_key, data.join(data_sep)); | ||
_createItem.handleObj.handler.apply(this, [ new $.Event("create", { | ||
currentTarget: this, | ||
$currentTarget: $this, | ||
delegateTarget: _createItem.delegateTarget, | ||
$delegateTarget: _createItem.$delegateTarget, | ||
data: _createItem.handleObj.data, | ||
options: function(key) { | ||
return _utility.filterDataByKey($this.data(), _utility.camelize(key)); | ||
} | ||
}) ]); | ||
} | ||
}); | ||
}; | ||
var _domManip = function() { | ||
if (_createList.length >= 1) { | ||
var _createItem = null; | ||
for (var key in _createList) { | ||
if (_createList.hasOwnProperty(key)) { | ||
_createItem = _createList[key]; | ||
_create(_createItem); | ||
} | ||
} | ||
} | ||
return this; | ||
}; | ||
$.event.special.create = { | ||
add: function(handleObj) { | ||
var $this = $(this); | ||
var _createItem = { | ||
id: _createList.length.toString(), | ||
delegateTarget: this, | ||
$delegateTarget: $this, | ||
is_document: $this.is(document), | ||
handleObj: handleObj | ||
}; | ||
_createList.push(_createItem); | ||
_create(_createItem); | ||
}, | ||
remove: function(handleObj) { | ||
for (var _createList_key in _createList) { | ||
if (_createList.hasOwnProperty(_createList_key) && $(this).is(_createList[_createList_key].$delegateTarget) && _createList[_createList_key].handleObj.selector === handleObj.selector) { | ||
delete _createList[_createList_key]; | ||
break; | ||
} | ||
} | ||
}, | ||
utility: _utility, | ||
version: "1.3.0" | ||
}; | ||
$.fn.append = function() { | ||
return _domManip.apply(append.apply(this, arguments), arguments); | ||
}; | ||
$.fn.before = function() { | ||
return _domManip.apply(before.apply(this, arguments), arguments); | ||
}; | ||
$.fn.after = function() { | ||
return _domManip.apply(after.apply(this, arguments), arguments); | ||
}; | ||
$.fn.html = function() { | ||
return _domManip.apply(html.apply(this, arguments), arguments); | ||
}; | ||
$.fn.replaceWith = function() { | ||
return _domManip.apply(replaceWith.apply(this, arguments), arguments); | ||
}; | ||
})(jQuery, jQuery.fn.domManip, jQuery.fn.append, jQuery.fn.prepend, jQuery.fn.before, jQuery.fn.after, jQuery.fn.html, jQuery.fn.replaceWith); | ||
|
||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters