diff --git a/assets/js/kute-bs.js b/assets/js/kute-bs.js index 768b47b..bb7dd31 100644 --- a/assets/js/kute-bs.js +++ b/assets/js/kute-bs.js @@ -10,12 +10,11 @@ (function (root,factory) { if (typeof define === 'function' && define.amd) { - define(["./kute.js"], function(KUTE){ factory(KUTE); return KUTE; }); - } else if(typeof module == "object" && typeof require == "function") { - var KUTE = require("./kute.js"); - module.exports = factory(KUTE); + define(['kute.js'], factory); + } else if(typeof module == 'object' && typeof require == 'function') { + module.exports = factory(require('kute.js')); } else if ( typeof root.KUTE !== 'undefined' ) { - factory(KUTE); + factory(root.KUTE); } else { throw new Error("Box Shadow Plugin require KUTE.js."); } @@ -25,7 +24,7 @@ // filter unsupported browsers if (!('boxShadow' in document.body.style)) {return;} // add a reference to KUTE object - var g = window, K = g.KUTE, getComputedStyle = K.gCS, + var g = window, K = KUTE, getComputedStyle = K.gCS, trueColor = K.truC, prepareStart = K.prS, parseProperty = K.pp, DOM = g.dom, unit = g.Interpolate.unit, color = g.Interpolate.color, diff --git a/extend.html b/extend.html index b24ba4f..f6458af 100644 --- a/extend.html +++ b/extend.html @@ -97,12 +97,11 @@ (function (root,factory) { if (typeof define === 'function' && define.amd) { - define(["./kute.js"], function(KUTE){ factory(KUTE); return KUTE; }); - } else if(typeof module == "object" && typeof require == "function") { - var KUTE = require("./kute.js"); - module.exports = factory(KUTE); - } else if ( typeof root.KUTE !== 'undefined' ) { - factory(KUTE); + define(['kute.js'], factory); + } else if(typeof module == 'object' && typeof require == 'function') { + module.exports = factory(require('kute.js')); + } else if ( typeof root.KUTE !== 'undefined' ) { + factory(root.KUTE); } else { throw new Error("pluginName require KUTE.js."); } @@ -175,7 +174,7 @@ K.Tween.prototype.onUpdate = function(){
So let's add support for boxShadow! It should be a medium difficulty guide most developers can follow and the purpose of this guide is to showcase how easy it actually is to extend KUTE.js. So grab the above template and let's break it down to pieces:
// add a reference to global and KUTE object
-var g = window, K = g.KUTE,
+var g = window, K = KUTE,
// add a reference to KUTE utilities
prepareStart = K.prS, DOM = g.dom, parseProperty = K.pp, trueColor = K.truC,
color = g.Interpolate.color, unit = g.Interpolate.unit, getComputedStyle = K.gCS;