Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

created a build directory and relocated smoosh config file there; rel…

…ocated the ender lib to the main directory
  • Loading branch information...
commit c750a2b6396bf2b482254a26aad17e6b3048dc3f 1 parent c1ddd13
Stuart Malin authored
2  Lintfile.js
View
@@ -1,3 +1,3 @@
require('smoosh')
- .config('./config/smoosh.json')
+ .config('./build/smoosh.json')
.run(); // runs jshint on full build
2  Makefile.js
View
@@ -1,5 +1,5 @@
require('smoosh')
- .config('./config/smoosh.json')
+ .config('./build/smoosh.json')
.clean() // removes dist directory
.run() // runs jshint on full build
.build() // builds both uncompressed and compressed files
5 build/package.json
View
@@ -0,0 +1,5 @@
+{
+ "ender": "../src/ender.js",
+ "main": "../src/doml.js",
+ "name": "doml",
+}
0  config/smoosh.json → build/smoosh.json
View
File renamed without changes
18 test/ender.js → ender.js
View
@@ -98,6 +98,12 @@
var module = { exports: {} }, exports = module.exports;
+ /*!
+ * Doml - a DOM constructor
+ * copyright Stuart Malin 2011
+ * https://github.com/zhami/doml
+ * MIT License
+ */
!function (context) {
var contextDoc, createNode, doml, Doml, Domil_orig, env, getGlobal, isArray, isNode, procArgs, procTag;
@@ -325,12 +331,12 @@
});
$.ender({
- doml: function () {
- this.forEach(function (el) {
- var element = d.create.apply(d, arguments);
- el.appendChild(element);
- })
- }
+ doml: function () {
+ var element = d.create.apply(d, arguments);
+ this.forEach(function (el) {
+ el.appendChild(d.create.call(d, element));
+ })
+ }
}, true);
$.id = function (id) {
2  test/ender.min.js → ender.min.js
View
@@ -9,4 +9,4 @@
* =======================================================
*/
-!function(a){function g(a,b){return f(a,b)}function f(a,b,c){g._select&&(typeof a=="string"||a.nodeName||a.length&&"item"in a||a==window)?(c=g._select(a,b),c.selector=a):c=isFinite(a.length)?a:[a];return e(c,f)}function e(a,b){for(var c in b)c!="noConflict"&&c!="_VERSION"&&(a[c]=b[c]);return a}function d(a,c){return b[a]=c}function c(a){var c=b[a]||window[a];if(!c)throw new Error("Requested module has not been defined.");return c}var b={};a.provide=d,a.require=c,e(g,{_VERSION:"0.2.5",ender:function(a,b){e(b?f:g,a)},fn:a.$&&a.$.fn||{}}),e(f,{forEach:function(a,b,c){for(c=0,l=this.length;c<l;++c)c in this&&a.call(b||this[c],this[c],c,this);return this},$:g});var h=a.$;g.noConflict=function(){a.$=h;return this},typeof module!="undefined"&&module.exports&&(module.exports=g),a.ender=a.$=a.ender||g}(this),!function(){var a={exports:{}},b=a.exports;!function(b){var c,d,e,f,g,h,i,j,k,l,m;getEnv=function(){var c,d;c={global:undefined,isAMD:!1,isBrowser:!1,isModule:!1,isEnder:!1,hasRequire:!1},c.global=d=function(){return this}(),c.isAMD=Boolean(typeof define!="undefined"&&define.AMD),c.isBrowser=Boolean(typeof d.window!="undefined"),c.isEnder=Boolean(typeof b.ender!="undefined"),c.isModule=Boolean(typeof a!="undefined"&&a.exports),c.hasRequire=Boolean(typeof require=="function");return c},j=function(a){return Boolean(a&&Object.prototype.toString.apply(a)==="[object Array]")},k=function(a){return a&&a.nodeName&&a.nodeType==1},d=function(){var a,b,c,d,e;e=function(a,b,c){switch(b){case"checked":case"selected":a[b]=Boolean(c);break;case"className":case"class":a.className=c;break;default:a.setAttribute(b,c)}},a=this.document.createElement(this.tagName),d=this.attrs;for(c in d)d.hasOwnProperty(c)&&e(a,c,d[c]);d=!/^input$/.test(this.tagName.toLowerCase()),d&&(d=this.content)&&(a.innerHTML=d);return a},getText=function(a){var b},procArg=function(a){var b,c,d,e;e=j(a)?"array":typeof a;switch(e){case"string":this.content+=a;break;case"array":c=a.length,d=this.elems;for(b=0;b<c;b+=1)d.push(a[b]);break;case"object":d=this.attrs;for(c in a)a.hasOwnProperty(c)&&(d[c]=a[c]);break;case"function":e=a.call(this),e&&procArg.call(this,e)}},l=function(a){var b,c,d,e;c=Array.prototype.slice.call(a,0),e=c.length;if(e!==0&&typeof c[0]=="string"){this.tagName=c[0];for(d=1;d<e;d+=1)b=c[d],procArg.call(this,b)}},f=function(a){!a&&h.isBrowser&&(a=h.global.window.document),this.document=a,this.clear()},f.prototype={clear:function(){this.tagName=undefined,this.content="",this.attrs={},this.elems=[]},create:function(){var a,b;this.clear();if(arguments.length===1&&k(a=arguments[0]))return a.cloneNode(!0);l.call(this,arguments);if(!this.document||!this.tagName)return null;b=d.call(this);return b},setDocument:function(a){this.document=a},verbose:!1},h=getEnv(),b.window&&(c=window.document),g=b.Doml;if(h.isEnder)a.exports=new f;else if(h.isBrowser)f.noConflict=function(){b.Doml=g;return f},b.Doml=f;else if(h.isModule)a.exports=f,f.noConflict=function(){};else throw new Error("Doml: can not determine the environment!")}(this),provide("doml",a.exports),!function(a){var b=require("doml");a.ender({doml:function(){return a([b.create.apply(b,arguments)])}}),a.ender({doml:function(){this.forEach(function(a){var c=b.create.apply(b,arguments);a.appendChild(c)})}},!0),a.id=function(b){return a([document.getElementById(b)])}}(ender||$)}()
+!function(a){function g(a,b){return f(a,b)}function f(a,b,c){g._select&&(typeof a=="string"||a.nodeName||a.length&&"item"in a||a==window)?(c=g._select(a,b),c.selector=a):c=isFinite(a.length)?a:[a];return e(c,f)}function e(a,b){for(var c in b)c!="noConflict"&&c!="_VERSION"&&(a[c]=b[c]);return a}function d(a,c){return b[a]=c}function c(a){var c=b[a]||window[a];if(!c)throw new Error("Requested module has not been defined.");return c}var b={};a.provide=d,a.require=c,e(g,{_VERSION:"0.2.5",ender:function(a,b){e(b?f:g,a)},fn:a.$&&a.$.fn||{}}),e(f,{forEach:function(a,b,c){for(c=0,l=this.length;c<l;++c)c in this&&a.call(b||this[c],this[c],c,this);return this},$:g});var h=a.$;g.noConflict=function(){a.$=h;return this},typeof module!="undefined"&&module.exports&&(module.exports=g),a.ender=a.$=a.ender||g}(this),!function(){var a={exports:{}},b=a.exports;!function(b){var c,d,e,f,g,h,i,j,k,l,m;getEnv=function(){var c,d;c={global:undefined,isAMD:!1,isBrowser:!1,isModule:!1,isEnder:!1,hasRequire:!1},c.global=d=function(){return this}(),c.isAMD=Boolean(typeof define!="undefined"&&define.AMD),c.isBrowser=Boolean(typeof d.window!="undefined"),c.isEnder=Boolean(typeof b.ender!="undefined"),c.isModule=Boolean(typeof a!="undefined"&&a.exports),c.hasRequire=Boolean(typeof require=="function");return c},j=function(a){return Boolean(a&&Object.prototype.toString.apply(a)==="[object Array]")},k=function(a){return a&&a.nodeName&&a.nodeType==1},d=function(){var a,b,c,d,e;e=function(a,b,c){switch(b){case"checked":case"selected":a[b]=Boolean(c);break;case"className":case"class":a.className=c;break;default:a.setAttribute(b,c)}},a=this.document.createElement(this.tagName),d=this.attrs;for(c in d)d.hasOwnProperty(c)&&e(a,c,d[c]);d=!/^input$/.test(this.tagName.toLowerCase()),d&&(d=this.content)&&(a.innerHTML=d);return a},getText=function(a){var b},procArg=function(a){var b,c,d,e;e=j(a)?"array":typeof a;switch(e){case"string":this.content+=a;break;case"array":c=a.length,d=this.elems;for(b=0;b<c;b+=1)d.push(a[b]);break;case"object":d=this.attrs;for(c in a)a.hasOwnProperty(c)&&(d[c]=a[c]);break;case"function":e=a.call(this),e&&procArg.call(this,e)}},l=function(a){var b,c,d,e;c=Array.prototype.slice.call(a,0),e=c.length;if(e!==0&&typeof c[0]=="string"){this.tagName=c[0];for(d=1;d<e;d+=1)b=c[d],procArg.call(this,b)}},f=function(a){!a&&h.isBrowser&&(a=h.global.window.document),this.document=a,this.clear()},f.prototype={clear:function(){this.tagName=undefined,this.content="",this.attrs={},this.elems=[]},create:function(){var a,b;this.clear();if(arguments.length===1&&k(a=arguments[0]))return a.cloneNode(!0);l.call(this,arguments);if(!this.document||!this.tagName)return null;b=d.call(this);return b},setDocument:function(a){this.document=a},verbose:!1},h=getEnv(),b.window&&(c=window.document),g=b.Doml;if(h.isEnder)a.exports=new f;else if(h.isBrowser)f.noConflict=function(){b.Doml=g;return f},b.Doml=f;else if(h.isModule)a.exports=f,f.noConflict=function(){};else throw new Error("Doml: can not determine the environment!")}(this),provide("doml",a.exports),!function(a){var b=require("doml");a.ender({doml:function(){return a([b.create.apply(b,arguments)])}}),a.ender({doml:function(){var a=b.create.apply(b,arguments);this.forEach(function(c){c.appendChild(b.create.call(b,a))})}},!0),a.id=function(b){return a([document.getElementById(b)])}}(ender||$)}()
2  test/test-with-ender.html
View
@@ -5,7 +5,7 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../node_modules/sink-test/src/sink.css" type="text/css">
<script src="../node_modules/sink-test/src/sink.js"></script>
- <script src="./ender.js"></script>
+ <script src="../ender.js"></script>
<script src="./ender-tests.js"></script>
</head>
<body>
Please sign in to comment.
Something went wrong with that request. Please try again.