From 9271f907e9a557b8dd36f743ea6e01b38ccc78cf Mon Sep 17 00:00:00 2001 From: Kirill Cherkashin Date: Sat, 19 Apr 2014 13:23:58 -0400 Subject: [PATCH 1/6] Increase the height of code boxes, make textarea vertically resizable --- style.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/style.scss b/style.scss index 84aa6bf..127d4e5 100644 --- a/style.scss +++ b/style.scss @@ -17,13 +17,17 @@ section { input, textarea, pre { $width: $section-width - $input-margin * 2; background-color: #ffffff; - resize: none; + resize: vertical; margin: $input-margin/2 $input-margin; padding: $input-padding; width: $width; &.properties { width: $width - $input-padding * 2; } border: 0; } + textarea, pre { + height: 400px; + box-sizing: border-box; + } } .editorconfig { float: left; } From 12191386e9579128715bda714f8d62f2c5cb4ea7 Mon Sep 17 00:00:00 2001 From: Kirill Cherkashin Date: Sat, 19 Apr 2014 17:25:32 -0400 Subject: [PATCH 2/6] Commit built style.css --- _build/style.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_build/style.css b/_build/style.css index ac8fb9c..feacea5 100644 --- a/_build/style.css +++ b/_build/style.css @@ -9,13 +9,16 @@ section { padding: 10px 0 0 0; } section input, section textarea, section pre { background-color: #ffffff; - resize: none; + resize: vertical; margin: 10px 20px; padding: 5px; width: 320px; border: 0; } section input.properties, section textarea.properties, section pre.properties { width: 310px; } + section textarea, section pre { + height: 400px; + box-sizing: border-box; } .editorconfig { float: left; } From 4b1a2583a51ad911faca8c225cf28cfc05c3cdd4 Mon Sep 17 00:00:00 2001 From: Kirill Cherkashin Date: Sat, 19 Apr 2014 17:28:10 -0400 Subject: [PATCH 3/6] Commit built style.min.css --- _build/style.min.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_build/style.min.css b/_build/style.min.css index bd4ef28..aa982ac 100644 --- a/_build/style.min.css +++ b/_build/style.min.css @@ -1 +1 @@ -.content{width:800px;margin:0 auto}section{background-color:#60B9CE;width:360px;margin:20px;padding:10px 0 0}section input,section textarea,section pre{background-color:#fff;resize:none;margin:10px 20px;padding:5px;width:320px;border:0}section input.properties,section textarea.properties,section pre.properties{width:310px}.editorconfig{float:left}.output{float:right} +.content{width:800px;margin:0 auto}section{background-color:#60B9CE;width:360px;margin:20px;padding:10px 0 0}section input,section textarea,section pre{background-color:#fff;resize:vertical;margin:10px 20px;padding:5px;width:320px;border:0}section input.properties,section textarea.properties,section pre.properties{width:310px}section textarea,section pre{height:400px;box-sizing:border-box}.editorconfig{float:left}.output{float:right} \ No newline at end of file From a7b4f14b68e6edca30425f2b21c4fca776f2bf0d Mon Sep 17 00:00:00 2001 From: Kirill Cherkashin Date: Sun, 20 Apr 2014 11:44:14 -0400 Subject: [PATCH 4/6] Add forEach to NodeList/HTMLCollection prototype in vquery. --- _build/app.min.js | 2 +- _build/main.browser.js | 1851 +++++++++++++++++++++------------------- vquery.js | 4 +- 3 files changed, 956 insertions(+), 901 deletions(-) diff --git a/_build/app.min.js b/_build/app.min.js index 7ee6d13..2a6ef7f 100644 --- a/_build/app.min.js +++ b/_build/app.min.js @@ -1 +1 @@ -!function(){var a=function(a){return function(b,c){return c||(c=document),c[a].call(c,b)}};NodeList.prototype.forEach=Array.prototype.forEach,Element.prototype.on=Element.prototype.addEventListener;var b=a("querySelectorAll");b.byTag=a("getElementsByTagName"),b.byClass=a("getElementsByClassName"),b.get=a("querySelector"),b.getByClass=function(a){return b.byClass(a)[0]},b.getByTag=function(a){return b.byTag(a)[0]},b.getById=a("getElementById"),window.vQuery=b}(),function(a,b,c){function d(c,f){if(!b[c]){if(!a[c]){var g="function"==typeof require&&require;if(!f&&g)return g(c,!0);if(e)return e(c,!0);throw new Error("Cannot find module '"+c+"'")}var h=b[c]={exports:{}};a[c][0](function(b){var e=a[c][1][b];return d(e?e:b)},h,h.exports)}return b[c].exports}for(var e="function"==typeof require&&require,f=0;fc&&(c=a.clientHeight)}),b.byTag("section").forEach(function(a){a.style.height=c})};b.byTag("textarea").forEach(function(a){var b=function(){e(a)};a.on("input",b),b()}),b("input, textarea").forEach(function(a){var e=function(){var a=c();b(".output [name=filename]").forEach(function(c){var e="",f=d.parseFromFiles(c.value,a);for(var g in f)e+=g+" = "+f[g]+"\n";b.get(".output pre").innerText=e})};a.on("input",e),e()})}(vQuery)},{"./node_modules/editorconfig/editorconfig.js":2}],3:[function(){},{}],4:[function(a,b){var c=b.exports={};c.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};if(b){var c=[];return window.addEventListener("message",function(a){if(a.source===window&&"process-tick"===a.data&&(a.stopPropagation(),c.length>0)){var b=c.shift();b()}},!0),function(a){c.push(a),window.postMessage("process-tick","*")}}return function(a){setTimeout(a,0)}}(),c.title="browser",c.browser=!0,c.env={},c.argv=[],c.binding=function(){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(){throw new Error("process.chdir is not supported")}},{}],5:[function(a,b,c){!function(a){function b(a,b){for(var c=[],d=0;d=0;d--){var e=a[d];"."==e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}var e=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;c.resolve=function(){for(var c="",e=!1,f=arguments.length;f>=-1&&!e;f--){var g=f>=0?arguments[f]:a.cwd();"string"==typeof g&&g&&(c=g+"/"+c,e="/"===g.charAt(0))}return c=d(b(c.split("/"),function(a){return!!a}),!e).join("/"),(e?"/":"")+c||"."},c.normalize=function(a){var c="/"===a.charAt(0),e="/"===a.slice(-1);return a=d(b(a.split("/"),function(a){return!!a}),!c).join("/"),a||c||(a="."),a&&e&&(a+="/"),(c?"/":"")+a},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(b(a,function(a){return a&&"string"==typeof a}).join("/"))},c.dirname=function(a){var b=e.exec(a)[1]||"",c=!1;return b?1===b.length||c&&b.length<=3&&":"===b.charAt(1)?b:b.substring(0,b.length-1):"."},c.basename=function(a,b){var c=e.exec(a)[2]||"";return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){return e.exec(a)[3]||""},c.relative=function(a,b){function d(a){for(var b=0;b=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;g>i;i++)if(e[i]!==f[i]){h=i;break}for(var j=[],i=h;i1?this.components[1]:0,this.build=c>2?this.components[2]:0,this.revision=c>3?this.components[3]:0,"string"==typeof a){var d=a.split("-");2===d.length&&(this.configuration=d[1])}}c.prototype={toString:function(){var a=this.components.join(".");return"undefined"!=typeof this.configuration&&(a+="-"+this.configuration),a},gte:function(a){return this.majore&&"!"===a.charAt(e);e++)b=!b,d++;d&&(this.pattern=a.substr(d)),this.negate=b}}function m(a,b){function c(){p.push(t),t=""}if(b=b||this.options,a="undefined"==typeof a?this.pattern:a,"undefined"==typeof a)throw new Error("undefined pattern");if(b.nobrace||!a.match(/\{.*\}/))return[a];var d=!1;if("{"!==a.charAt(0)){for(var e=null,f=0,g=a.length;g>f;f++){var h=a.charAt(f);if("\\"===h)d=!d;else if("{"===h&&!d){e=a.substr(0,f);break}}if(null===e)return[a];var i=m(a.substr(f),b);return i.map(function(a){return e+a})}var j=a.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(j){for(var k=m(a.substr(j[0].length),b),l=+j[1],n=+j[2],o=l>n?-1:1,p=[],f=l;f!=n+o;f+=o)for(var q=0,r=k.length;r>q;q++)p.push(f+k[q]);return p}var f=1,s=1,p=[],t="",d=!1;a:for(f=1,g=a.length;g>f;f++){var h=a.charAt(f);if(d)d=!1,t+="\\"+h;else switch(h){case"\\":d=!0;continue;case"{":s++,t+="{";continue;case"}":if(s--,0===s){c(),f++;break a}t+=h;continue;case",":1===s?c():t+=h;continue;default:t+=h;continue}}if(0!==s)return m("\\"+a,b);var k=m(a.substr(f),b),u=1===p.length;p=p.map(function(a){return m(a,b)}),p=p.reduce(function(a,b){return a.concat(b)}),u&&(p=p.map(function(a){return"{"+a+"}"}));for(var v=[],f=0,g=p.length;g>f;f++)for(var q=0,r=k.length;r>q;q++)v.push(p[f]+k[q]);return v}function n(a,b){function c(){if(f){switch(f){case"*":h+=y,i=!0;break;case"?":h+=x,i=!0;break;default:h+="\\"+f}f=!1}}var d=this.options;if(!d.noglobstar&&"**"===a)return u;if(""===a)return"";for(var e,f,g,h="",i=!!d.nocase,j=!1,k=[],l=!1,m=-1,n=-1,o="."===a.charAt(0)?"":d.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",p=0,r=a.length;r>p&&(g=a.charAt(p));p++)if(d.debug&&console.error("%s %s %s %j",a,p,h,g),j&&B[g])h+="\\"+g,j=!1;else switch(g){case"/":return!1;case"\\":c(),j=!0;continue;case"?":case"*":case"+":case"@":case"!":if(d.debug&&console.error("%s %s %s %j <-- stateChar",a,p,h,g),l){"!"===g&&p===n+1&&(g="^"),h+=g;continue}c(),f=g,d.noext&&c();continue;case"(":if(l){h+="(";continue}if(!f){h+="\\(";continue}e=f,k.push({type:e,start:p-1,reStart:h.length}),h+="!"===f?"(?:(?!":"(?:",f=!1;continue;case")":if(l||!k.length){h+="\\)";continue}switch(i=!0,h+=")",e=k.pop().type){case"!":h+="[^/]*?)";break;case"?":case"+":case"*":h+=e;case"@":}continue;case"|":if(l||!k.length||j){h+="\\|",j=!1;continue}h+="|";continue;case"[":if(c(),l){h+="\\"+g;continue}l=!0,n=p,m=h.length,h+=g;continue;case"]":if(p===n+1||!l){h+="\\"+g,j=!1;continue}i=!0,l=!1,h+=g;continue;default:c(),j?j=!1:!B[g]||"^"===g&&l||(h+="\\"),h+=g}if(l){var s=a.substr(n+1),t=this.parse(s,D);h=h.substr(0,m)+"\\["+t[0],i=i||t[1]}for(var v;v=k.pop();){var w=h.slice(v.reStart+3);w=w.replace(/((?:\\{2})*)(\\?)\|/g,function(a,b,c){return c||(c="\\"),b+b+c+"|"});var z="*"===v.type?y:"?"===v.type?x:"\\"+v.type;i=!0,h=h.slice(0,v.reStart)+z+"\\("+w}c(),j&&(h+="\\\\");var A=!1;switch(h.charAt(0)){case".":case"[":case"(":A=!0}if(""!==h&&i&&(h="(?=.)"+h),A&&(h=o+h),b===D)return[h,i];if(!i)return q(a);var C=d.nocase?"i":"",E=new RegExp("^"+h+"$",C);return E._glob=a,E._src=h,E}function o(){if(this.regexp||this.regexp===!1)return this.regexp;var a=this.set;if(!a.length)return this.regexp=!1;var b=this.options,c=b.noglobstar?y:b.dot?z:A,d=b.nocase?"i":"",e=a.map(function(a){return a.map(function(a){return a===u?c:"string"==typeof a?r(a):a._src}).join("\\/")}).join("|");e="^(?:"+e+")$",this.negate&&(e="^(?!"+e+").*$");try{return this.regexp=new RegExp(e,d)}catch(f){return this.regexp=!1}}function p(a,b){if(this.comment)return!1;if(this.empty)return""===a;if("/"===a&&b)return!0;var c=this.options;"win32"===d&&(a=a.split("\\").join("/")),a=a.split(C),c.debug&&console.error(this.pattern,"split",a);for(var e=this.set,f=0,g=e.length;g>f;f++){var h=e[f],i=this.matchOne(a,h,b);if(i)return c.flipNegate?!0:!this.negate}return c.flipNegate?!1:this.negate}function q(a){return a.replace(/\\(.)/g,"$1")}function r(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}c?c.exports=i:b.minimatch=i,a||(a=function(a){switch(a){case"sigmund":return function(a){return JSON.stringify(a)};case"path":return{basename:function(a){a=a.split(/[\/\\]/);var b=a.pop();return b||(b=a.pop()),b}};case"lru-cache":return function(){var a={},b=0;this.set=function(c,d){b++,b>=100&&(a={}),a[c]=d},this.get=function(b){return a[b]}}}}),i.Minimatch=j;var s=a("lru-cache"),t=i.cache=new s({max:100}),u=i.GLOBSTAR=j.GLOBSTAR={},v=a("sigmund"),w=a("path"),x="[^/]",y=x+"*?",z="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",A="(?:(?!(?:\\/|^)\\.).)*?",B=e("().*{}+?[]^$\\!"),C=/\/+/;i.monkeyPatch=f,i.filter=g,i.defaults=function(a){if(!a||!Object.keys(a).length)return i;var b=i,c=function(c,d,e){return b.minimatch(c,d,h(a,e))};return c.Minimatch=function(c,d){return new b.Minimatch(c,h(a,d))},c},j.defaults=function(a){return a&&Object.keys(a).length?i.defaults(a).Minimatch:j},j.prototype.make=k,j.prototype.parseNegate=l,i.braceExpand=function(a,b){return new j(a,b).braceExpand()},j.prototype.braceExpand=m,j.prototype.parse=n;var D={};i.makeRe=function(a,b){return new j(a,b||{}).makeRe()},j.prototype.makeRe=o,i.match=function(a,b,c){var d=new j(b,c);return a=a.filter(function(a){return d.match(a)}),c.nonull&&!a.length&&a.push(b),a},j.prototype.match=p,j.prototype.matchOne=function(a,b,c){var d=this.options;d.debug&&console.error("matchOne",{"this":this,file:a,pattern:b}),d.matchBase&&1===b.length&&(a=w.basename(a.join("/")).split("/")),d.debug&&console.error("matchOne",a.length,b.length);for(var e=0,f=0,g=a.length,h=b.length;g>e&&h>f;e++,f++){d.debug&&console.error("matchOne loop");var i=b[f],j=a[e];if(d.debug&&console.error(b,i,j),i===!1)return!1;if(i===u){d.debug&&console.error("GLOBSTAR",[b,i,j]);var k=e,l=f+1;if(l===h){for(d.debug&&console.error("** at the end");g>e;e++)if("."===a[e]||".."===a[e]||!d.dot&&"."===a[e].charAt(0))return!1;return!0}a:for(;g>k;){var m=a[k];if(d.debug&&console.error("\nglobstar while",a,k,b,l,m),this.matchOne(a.slice(k),b.slice(l),c))return d.debug&&console.error("globstar found match!",k,g,m),!0;if("."===m||".."===m||!d.dot&&"."===m.charAt(0)){d.debug&&console.error("dot detected!",a,k,b,l);break a}d.debug&&console.error("globstar swallow a segment, and continue"),k++}return c&&k===g?!0:!1}var n;if("string"==typeof i?(n=d.nocase?j.toLowerCase()===i.toLowerCase():j===i,d.debug&&console.error("string match",i,j,n)):(n=j.match(i),d.debug&&console.error("pattern match",i,j,n)),!n)return!1}if(e===g&&f===h)return!0;if(e===g)return c;if(f===h){var o=e===g-1&&""===a[e];return o}throw new Error("wtf?")}}("function"==typeof a?a:null,this,"object"==typeof b?b:null,"object"==typeof c?c.platform:"win32")}(a("__browserify_process"))},{path:5,"lru-cache":10,sigmund:11,__browserify_process:4}],10:[function(a,b){!function(){!function(){function a(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function c(){return 1}function d(b){function f(){if(!(g>=n))for(var a in l){if(g>=n)break;var b=l[a];j&&j(b.key,b.value),n-=b.length,delete k[b.key],delete l[a]}}if(!(this instanceof d))return new d(b);var g;"number"==typeof b&&(g=b,b={max:g}),g=b.max,b||(b={});var h=b.length||c;"function"!=typeof h&&(h=c),(!g||"number"!=typeof g||0>=g)&&(g=1/0);var i=b.maxAge||null,j=b.dispose,k=Object.create(null),l=Object.create(null),m=0,n=0,o=0;Object.defineProperty(this,"max",{set:function(a){(!a||"number"!=typeof a||0>=a)&&(a=1/0),g=a,n>g&&f()},get:function(){return g},enumerable:!0}),Object.defineProperty(this,"lengthCalculator",{set:function(a){if("function"!=typeof a){h=c,n=o;for(var b in k)k[b].length=1}else{h=a,n=0;for(var b in k)k[b].length=h(k[b].value),n+=k[b].length}n>g&&f()},get:function(){return h},enumerable:!0}),Object.defineProperty(this,"length",{get:function(){return n},enumerable:!0}),Object.defineProperty(this,"itemCount",{get:function(){return o},enumerable:!0}),this.reset=function(){if(j)for(var a in k)j(a,k[a].value);k={},l={},m=0,n=0,o=0},this.dump=function(){return k},this.set=function(b,c){if(a(k,b))return j&&j(b,k[b].value),i&&(k[b].now=Date.now()),k[b].value=c,this.get(b),!0;var d=h(c),p=i?Date.now():0,q=new e(b,c,m++,d,p);return q.length>g?(j&&j(b,c),!1):(n+=q.length,l[q.lu]=k[b]=q,o++,n>g&&f(),!0)},this.get=function(b){if(a(k,b)){var c=k[b];return i&&Date.now()-c.now>i?(this.del(b),void 0):(delete l[c.lu],c.lu=m++,l[c.lu]=c,c.value)}},this.del=function(b){if(a(k,b)){var c=k[b];j&&j(b,c.value),delete k[b],delete l[c.lu],n-=c.length,o--}}}function e(a,b,c,d,e){this.key=a,this.value=b,this.lu=c,this.length=d,this.now=e}"object"==typeof b&&b.exports?b.exports=d:this.LRUCache=d}()}()},{}],11:[function(a,b){function c(a,b){function c(a,g){return g>b||"function"==typeof a||"undefined"==typeof a?void 0:"object"!=typeof a||!a||a instanceof f?(e+=a,void 0):(-1===d.indexOf(a)&&g!==b&&(d.push(a),e+="{",Object.keys(a).forEach(function(b){if("_"!==b.charAt(0)){var d=typeof a[b];"function"!==d&&"undefined"!==d&&(e+=b,c(a[b],g+1))}})),void 0)}b=b||10;var d=[],e="",f=RegExp;return c(a,0),e}b.exports=c},{}]},{},[1]); \ No newline at end of file +!function(){NodeList.prototype.forEach=Array.prototype.forEach,HTMLCollection.prototype.forEach=Array.prototype.forEach;var a=function(a){return function(b,c){return c||(c=document),c[a].call(c,b)}};NodeList.prototype.forEach=Array.prototype.forEach,Element.prototype.on=Element.prototype.addEventListener;var b=a("querySelectorAll");b.byTag=a("getElementsByTagName"),b.byClass=a("getElementsByClassName"),b.get=a("querySelector"),b.getByClass=function(a){return b.byClass(a)[0]},b.getByTag=function(a){return b.byTag(a)[0]},b.getById=a("getElementById"),window.vQuery=b}(),function(a,b,c){function d(c,f){if(!b[c]){if(!a[c]){var g="function"==typeof require&&require;if(!f&&g)return g(c,!0);if(e)return e(c,!0);throw new Error("Cannot find module '"+c+"'")}var h=b[c]={exports:{}};a[c][0].call(h.exports,function(b){var e=a[c][1][b];return d(e?e:b)},h,h.exports)}return b[c].exports}for(var e="function"==typeof require&&require,f=0;fc&&(c=a.clientHeight)}),b.byTag("section").forEach(function(a){a.style.height=c})};b.byTag("textarea").forEach(function(a){var b=function(){e(a)};a.on("input",b),b()}),b("input, textarea").forEach(function(a){var e=function(){var a=c();b(".output [name=filename]").forEach(function(c){var e="",f=d.parseFromFiles(c.value,a);for(var g in f)e+=g+" = "+f[g]+"\n";b.get(".output pre").innerText=e})};a.on("input",e),e()})}(vQuery)},{"./node_modules/editorconfig/editorconfig.js":2}],3:[function(){},{}],4:[function(a,b){var c=b.exports={};c.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};if(b){var c=[];return window.addEventListener("message",function(a){var b=a.source;if((b===window||null===b)&&"process-tick"===a.data&&(a.stopPropagation(),c.length>0)){var d=c.shift();d()}},!0),function(a){c.push(a),window.postMessage("process-tick","*")}}return function(a){setTimeout(a,0)}}(),c.title="browser",c.browser=!0,c.env={},c.argv=[],c.binding=function(){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(){throw new Error("process.chdir is not supported")}},{}],5:[function(a,b,c){!function(a){function b(a,b){for(var c=[],d=0;d=0;d--){var e=a[d];"."==e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}var e=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;c.resolve=function(){for(var c="",e=!1,f=arguments.length;f>=-1&&!e;f--){var g=f>=0?arguments[f]:a.cwd();"string"==typeof g&&g&&(c=g+"/"+c,e="/"===g.charAt(0))}return c=d(b(c.split("/"),function(a){return!!a}),!e).join("/"),(e?"/":"")+c||"."},c.normalize=function(a){var c="/"===a.charAt(0),e="/"===a.slice(-1);return a=d(b(a.split("/"),function(a){return!!a}),!c).join("/"),a||c||(a="."),a&&e&&(a+="/"),(c?"/":"")+a},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(b(a,function(a){return a&&"string"==typeof a}).join("/"))},c.dirname=function(a){var b=e.exec(a)[1]||"",c=!1;return b?1===b.length||c&&b.length<=3&&":"===b.charAt(1)?b:b.substring(0,b.length-1):"."},c.basename=function(a,b){var c=e.exec(a)[2]||"";return b&&c.substr(-1*b.length)===b&&(c=c.substr(0,c.length-b.length)),c},c.extname=function(a){return e.exec(a)[3]||""},c.relative=function(a,b){function d(a){for(var b=0;b=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;g>i;i++)if(e[i]!==f[i]){h=i;break}for(var j=[],i=h;i var editorconfig = require('./editorconfig');\n undefined\n > editorconfig.parse('/home/zoidberg/humans/anatomy.md');\n { charset: 'utf-8',\n insert_final_newline: 'true',\n end_of_line: 'lf',\n tab_width: '8',\n trim_trailing_whitespace: 'sometimes' }\n\n\nUsage as a command line tool:\n\n```\n$ ./bin/editorconfig\n\n Usage: editorconfig [OPTIONS] FILEPATH1 [FILEPATH2 FILEPATH3 ...]\n\n EditorConfig Node.js Core Version 0.11.4-development\n\n FILEPATH can be a hyphen (-) if you want path(s) to be read from stdin.\n\n Options:\n\n -h, --help output usage information\n -V, --version output the version number\n -f Specify conf filename other than \".editorconfig\"\n -b Specify version (used by devs to test compatibility)\n```\n\nExample:\n\n $ ./bin/editorconfig /home/zoidberg/humans/anatomy.md\n charset=utf-8\n insert_final_newline=true\n end_of_line=lf\n tab_width=8\n trim_trailing_whitespace=sometimes\n\n\n## Development\n\nTo install dependencies for this package run this in the package directory:\n\n $ npm install\n\nNext, run:\n\n $ npm link\n\nThe global editorconfig will now point to the files in your development\nrepository instead of a globally-installed version from npm. You can now use\neditorconfig directly to test your changes.\n\nIf you ever update from the central repository and there are errors, it might\nbe because you are missing some dependencies. If that happens, just run npm\nlink again to get the latest dependencies.\n\nTo test the command line interface:\n\n $ editorconfig \n\n\n# Testing\n\n[CMake][] must be installed to run the tests.\n\nTo run the tests:\n\n $ npm test\n\nTo run the tests with increased verbosity (for debugging test failures):\n\n $ npm run-script test-verbose\n\n[EditorConfig C Core]: https://github.com/editorconfig/editorconfig-core\n[EditorConfig Python Core]: https://github.com/editorconfig/editorconfig-core-py\n[node]: http://nodejs.org/\n[cmake]: http://www.cmake.org\n",readmeFilename:"README.md",_id:"editorconfig@0.11.4",_from:"editorconfig@~0.11.2"}}()},{}],8:[function(a,b){function c(a){var b={},c=null,d=[[c,b]],f=a.split(/\r\n|\r|\n/);return f.forEach(function(a){var f;e.comment.test(a)||(e.param.test(a)?(f=a.match(e.param),b[f[1]]=f[2]):e.section.test(a)&&(f=a.match(e.section),c=f[1],b={},d.push([c,b])))}),d}var d=a("fs"),e={section:/^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,param:/^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,comment:/^\s*[#;].*$/};b.exports.parse=function(a,b){b&&d.readFile(a,"utf8",function(a,d){a?b(a):b(null,c(d))})},b.exports.parseSync=function(a){return c(d.readFileSync(a,"utf8"))},b.exports.parseString=c},{fs:3}],9:[function(a,b){function c(a){var b=arguments;this.components="string"==typeof a?a.split(".").map(function(a){return parseInt(a,10)}):Object.keys(arguments).map(function(a){return b[a]});var c=this.components.length;if(this.major=c?this.components[0]:0,this.minor=c>1?this.components[1]:0,this.build=c>2?this.components[2]:0,this.revision=c>3?this.components[3]:0,"string"==typeof a){var d=a.split("-");2===d.length&&(this.configuration=d[1])}}c.prototype={toString:function(){var a=this.components.join(".");return"undefined"!=typeof this.configuration&&(a+="-"+this.configuration),a},gte:function(a){return this.majore&&"!"===a.charAt(e);e++)b=!b,d++;d&&(this.pattern=a.substr(d)),this.negate=b}}function m(a,b){function c(){p.push(t),t=""}if(b=b||this.options,a="undefined"==typeof a?this.pattern:a,"undefined"==typeof a)throw new Error("undefined pattern");if(b.nobrace||!a.match(/\{.*\}/))return[a];var d=!1;if("{"!==a.charAt(0)){for(var e=null,f=0,g=a.length;g>f;f++){var h=a.charAt(f);if("\\"===h)d=!d;else if("{"===h&&!d){e=a.substr(0,f);break}}if(null===e)return[a];var i=m(a.substr(f),b);return i.map(function(a){return e+a})}var j=a.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(j){for(var k=m(a.substr(j[0].length),b),l=+j[1],n=+j[2],o=l>n?-1:1,p=[],f=l;f!=n+o;f+=o)for(var q=0,r=k.length;r>q;q++)p.push(f+k[q]);return p}var f=1,s=1,p=[],t="",d=!1;a:for(f=1,g=a.length;g>f;f++){var h=a.charAt(f);if(d)d=!1,t+="\\"+h;else switch(h){case"\\":d=!0;continue;case"{":s++,t+="{";continue;case"}":if(s--,0===s){c(),f++;break a}t+=h;continue;case",":1===s?c():t+=h;continue;default:t+=h;continue}}if(0!==s)return m("\\"+a,b);var k=m(a.substr(f),b),u=1===p.length;p=p.map(function(a){return m(a,b)}),p=p.reduce(function(a,b){return a.concat(b)}),u&&(p=p.map(function(a){return"{"+a+"}"}));for(var v=[],f=0,g=p.length;g>f;f++)for(var q=0,r=k.length;r>q;q++)v.push(p[f]+k[q]);return v}function n(a,b){function c(){if(f){switch(f){case"*":h+=y,i=!0;break;case"?":h+=x,i=!0;break;default:h+="\\"+f}f=!1}}var d=this.options;if(!d.noglobstar&&"**"===a)return u;if(""===a)return"";for(var e,f,g,h="",i=!!d.nocase,j=!1,k=[],l=!1,m=-1,n=-1,o="."===a.charAt(0)?"":d.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",p=0,r=a.length;r>p&&(g=a.charAt(p));p++)if(d.debug&&console.error("%s %s %s %j",a,p,h,g),j&&B[g])h+="\\"+g,j=!1;else switch(g){case"/":return!1;case"\\":c(),j=!0;continue;case"?":case"*":case"+":case"@":case"!":if(d.debug&&console.error("%s %s %s %j <-- stateChar",a,p,h,g),l){"!"===g&&p===n+1&&(g="^"),h+=g;continue}c(),f=g,d.noext&&c();continue;case"(":if(l){h+="(";continue}if(!f){h+="\\(";continue}e=f,k.push({type:e,start:p-1,reStart:h.length}),h+="!"===f?"(?:(?!":"(?:",f=!1;continue;case")":if(l||!k.length){h+="\\)";continue}switch(i=!0,h+=")",e=k.pop().type){case"!":h+="[^/]*?)";break;case"?":case"+":case"*":h+=e;case"@":}continue;case"|":if(l||!k.length||j){h+="\\|",j=!1;continue}h+="|";continue;case"[":if(c(),l){h+="\\"+g;continue}l=!0,n=p,m=h.length,h+=g;continue;case"]":if(p===n+1||!l){h+="\\"+g,j=!1;continue}i=!0,l=!1,h+=g;continue;default:c(),j?j=!1:!B[g]||"^"===g&&l||(h+="\\"),h+=g}if(l){var s=a.substr(n+1),t=this.parse(s,D);h=h.substr(0,m)+"\\["+t[0],i=i||t[1]}for(var v;v=k.pop();){var w=h.slice(v.reStart+3);w=w.replace(/((?:\\{2})*)(\\?)\|/g,function(a,b,c){return c||(c="\\"),b+b+c+"|"});var z="*"===v.type?y:"?"===v.type?x:"\\"+v.type;i=!0,h=h.slice(0,v.reStart)+z+"\\("+w}c(),j&&(h+="\\\\");var A=!1;switch(h.charAt(0)){case".":case"[":case"(":A=!0}if(""!==h&&i&&(h="(?=.)"+h),A&&(h=o+h),b===D)return[h,i];if(!i)return q(a);var C=d.nocase?"i":"",E=new RegExp("^"+h+"$",C);return E._glob=a,E._src=h,E}function o(){if(this.regexp||this.regexp===!1)return this.regexp;var a=this.set;if(!a.length)return this.regexp=!1;var b=this.options,c=b.noglobstar?y:b.dot?z:A,d=b.nocase?"i":"",e=a.map(function(a){return a.map(function(a){return a===u?c:"string"==typeof a?r(a):a._src}).join("\\/")}).join("|");e="^(?:"+e+")$",this.negate&&(e="^(?!"+e+").*$");try{return this.regexp=new RegExp(e,d)}catch(f){return this.regexp=!1}}function p(a,b){if(this.comment)return!1;if(this.empty)return""===a;if("/"===a&&b)return!0;var c=this.options;"win32"===d&&(a=a.split("\\").join("/")),a=a.split(C),c.debug&&console.error(this.pattern,"split",a);for(var e=this.set,f=0,g=e.length;g>f;f++){var h=e[f],i=this.matchOne(a,h,b);if(i)return c.flipNegate?!0:!this.negate}return c.flipNegate?!1:this.negate}function q(a){return a.replace(/\\(.)/g,"$1")}function r(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}c?c.exports=i:b.minimatch=i,a||(a=function(a){switch(a){case"sigmund":return function(a){return JSON.stringify(a)};case"path":return{basename:function(a){a=a.split(/[\/\\]/);var b=a.pop();return b||(b=a.pop()),b}};case"lru-cache":return function(){var a={},b=0;this.set=function(c,d){b++,b>=100&&(a={}),a[c]=d},this.get=function(b){return a[b]}}}}),i.Minimatch=j;var s=a("lru-cache"),t=i.cache=new s({max:100}),u=i.GLOBSTAR=j.GLOBSTAR={},v=a("sigmund"),w=a("path"),x="[^/]",y=x+"*?",z="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",A="(?:(?!(?:\\/|^)\\.).)*?",B=e("().*{}+?[]^$\\!"),C=/\/+/;i.monkeyPatch=f,i.filter=g,i.defaults=function(a){if(!a||!Object.keys(a).length)return i;var b=i,c=function(c,d,e){return b.minimatch(c,d,h(a,e))};return c.Minimatch=function(c,d){return new b.Minimatch(c,h(a,d))},c},j.defaults=function(a){return a&&Object.keys(a).length?i.defaults(a).Minimatch:j},j.prototype.make=k,j.prototype.parseNegate=l,i.braceExpand=function(a,b){return new j(a,b).braceExpand()},j.prototype.braceExpand=m,j.prototype.parse=n;var D={};i.makeRe=function(a,b){return new j(a,b||{}).makeRe()},j.prototype.makeRe=o,i.match=function(a,b,c){var d=new j(b,c);return a=a.filter(function(a){return d.match(a)}),c.nonull&&!a.length&&a.push(b),a},j.prototype.match=p,j.prototype.matchOne=function(a,b,c){var d=this.options;d.debug&&console.error("matchOne",{"this":this,file:a,pattern:b}),d.matchBase&&1===b.length&&(a=w.basename(a.join("/")).split("/")),d.debug&&console.error("matchOne",a.length,b.length);for(var e=0,f=0,g=a.length,h=b.length;g>e&&h>f;e++,f++){d.debug&&console.error("matchOne loop");var i=b[f],j=a[e];if(d.debug&&console.error(b,i,j),i===!1)return!1;if(i===u){d.debug&&console.error("GLOBSTAR",[b,i,j]);var k=e,l=f+1;if(l===h){for(d.debug&&console.error("** at the end");g>e;e++)if("."===a[e]||".."===a[e]||!d.dot&&"."===a[e].charAt(0))return!1;return!0}a:for(;g>k;){var m=a[k];if(d.debug&&console.error("\nglobstar while",a,k,b,l,m),this.matchOne(a.slice(k),b.slice(l),c))return d.debug&&console.error("globstar found match!",k,g,m),!0;if("."===m||".."===m||!d.dot&&"."===m.charAt(0)){d.debug&&console.error("dot detected!",a,k,b,l);break a}d.debug&&console.error("globstar swallow a segment, and continue"),k++}return c&&k===g?!0:!1}var n;if("string"==typeof i?(n=d.nocase?j.toLowerCase()===i.toLowerCase():j===i,d.debug&&console.error("string match",i,j,n)):(n=j.match(i),d.debug&&console.error("pattern match",i,j,n)),!n)return!1}if(e===g&&f===h)return!0;if(e===g)return c;if(f===h){var o=e===g-1&&""===a[e];return o}throw new Error("wtf?")}}("function"==typeof a?a:null,this,"object"==typeof b?b:null,"object"==typeof c?c.platform:"win32")}(a("__browserify_process"))},{path:5,"lru-cache":10,sigmund:11,__browserify_process:4}],10:[function(a,b){!function(){!function(){function a(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function c(){return 1}function d(b){function f(){if(!(g>=n))for(var a in l){if(g>=n)break;var b=l[a];j&&j(b.key,b.value),n-=b.length,delete k[b.key],delete l[a]}}if(!(this instanceof d))return new d(b);var g;"number"==typeof b&&(g=b,b={max:g}),g=b.max,b||(b={});var h=b.length||c;"function"!=typeof h&&(h=c),(!g||"number"!=typeof g||0>=g)&&(g=1/0);var i=b.maxAge||null,j=b.dispose,k=Object.create(null),l=Object.create(null),m=0,n=0,o=0;Object.defineProperty(this,"max",{set:function(a){(!a||"number"!=typeof a||0>=a)&&(a=1/0),g=a,n>g&&f()},get:function(){return g},enumerable:!0}),Object.defineProperty(this,"lengthCalculator",{set:function(a){if("function"!=typeof a){h=c,n=o;for(var b in k)k[b].length=1}else{h=a,n=0;for(var b in k)k[b].length=h(k[b].value),n+=k[b].length}n>g&&f()},get:function(){return h},enumerable:!0}),Object.defineProperty(this,"length",{get:function(){return n},enumerable:!0}),Object.defineProperty(this,"itemCount",{get:function(){return o},enumerable:!0}),this.reset=function(){if(j)for(var a in k)j(a,k[a].value);k={},l={},m=0,n=0,o=0},this.dump=function(){return k},this.set=function(b,c){if(a(k,b))return j&&j(b,k[b].value),i&&(k[b].now=Date.now()),k[b].value=c,this.get(b),!0;var d=h(c),p=i?Date.now():0,q=new e(b,c,m++,d,p);return q.length>g?(j&&j(b,c),!1):(n+=q.length,l[q.lu]=k[b]=q,o++,n>g&&f(),!0)},this.get=function(b){if(a(k,b)){var c=k[b];return i&&Date.now()-c.now>i?void this.del(b):(delete l[c.lu],c.lu=m++,l[c.lu]=c,c.value)}},this.del=function(b){if(a(k,b)){var c=k[b];j&&j(b,c.value),delete k[b],delete l[c.lu],n-=c.length,o--}}}function e(a,b,c,d,e){this.key=a,this.value=b,this.lu=c,this.length=d,this.now=e}"object"==typeof b&&b.exports?b.exports=d:this.LRUCache=d}()}()},{}],11:[function(a,b){function c(a,b){function c(a,g){return g>b||"function"==typeof a||"undefined"==typeof a?void 0:"object"!=typeof a||!a||a instanceof f?void(e+=a):void(-1===d.indexOf(a)&&g!==b&&(d.push(a),e+="{",Object.keys(a).forEach(function(b){if("_"!==b.charAt(0)){var d=typeof a[b];"function"!==d&&"undefined"!==d&&(e+=b,c(a[b],g+1))}})))}b=b||10;var d=[],e="",f=RegExp;return c(a,0),e}b.exports=c},{}]},{},[1]); \ No newline at end of file diff --git a/_build/main.browser.js b/_build/main.browser.js index 5491bb2..647b8cd 100644 --- a/_build/main.browser.js +++ b/_build/main.browser.js @@ -1,4 +1,4 @@ -;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0](function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s 0) { var fn = queue.shift(); @@ -292,11 +293,11 @@ var path = require('path'); var minimatch = require('./lib/fnmatch'); var iniparser = require('./lib/ini'); var Version = require('./lib/version'); -var package = require('./package.json'); +var pkg = require('./package.json'); var knownProps = ['end_of_line', 'indent_style', 'indent_size', - 'insert_final_newline', 'trim_trailing_whitespace', 'charset']; + 'insert_final_newline', 'trim_trailing_whitespace', 'charset']; function fnmatch(filepath, glob) { @@ -330,12 +331,12 @@ function processMatches(matches, version) { // Set tab_width to indent_size if indent_size is specified and // tab_width is unspecified if ("indent_size" in matches && !("tab_width" in matches) && - matches.indent_size !== "tab") + matches.indent_size !== "tab") matches.tab_width = matches.indent_size; // Set indent_size to tab_width if indent_size is "tab" if("indent_size" in matches && "tab_width" in matches && - matches.indent_size === "tab") + matches.indent_size === "tab") matches.indent_size = matches.tab_width; return matches; @@ -343,17 +344,8 @@ function processMatches(matches, version) { function processOptions(options) { - if (typeof options === "undefined") { - options = {}; - } - switch (typeof options.version) { - case "undefined": - options.version = new Version(package.version); - break; - case "string": - options.version = new Version(options.version); - break; - } + options = options || {}; + options.version = new Version(options.version || pkg.version); return options; } @@ -401,7 +393,7 @@ function getConfigsForFiles(files) { for (var i = 0; i < files.length; i++) { files[i].contents = iniparser.parseString(files[i].contents); configs.push(files[i]); - if ((files[i].contents[0][1].root || "").toLowerCase() == "true") break; + if (/^true$/i.test(files[i].contents[0][1].root)) break; } return configs; } @@ -422,22 +414,83 @@ function readConfigFiles(filepaths) { module.exports.parseFromFiles = function(filepath, files, options) { + filepath = path.resolve(filepath); options = processOptions(options); return parseFromFiles(filepath, getConfigsForFiles(files), options); }; module.exports.parse = function(filepath, options) { + filepath = path.resolve(filepath); options = processOptions(options); var filepaths = getConfigFileNames(path.dirname(filepath), options.config); var files = readConfigFiles(filepaths); return parseFromFiles(filepath, getConfigsForFiles(files), options); }; -},{"fs":3,"path":5,"./package.json":6,"./lib/fnmatch":7,"./lib/ini":8,"./lib/version":9}],6:[function(require,module,exports){ -module.exports={ +},{"fs":3,"path":5,"./lib/fnmatch":6,"./package.json":7,"./lib/ini":8,"./lib/version":9}],7:[function(require,module,exports){ +(function(){module.exports={ + "name": "editorconfig", + "version": "0.11.4", + "description": "EditorConfig File Locator and Interpreter for Node.js", + "keywords": [ + "editorconfig", + "core" + ], + "main": "editorconfig.js", + "contributors": [ + { + "name": "Hong Xu", + "url": "topbug.net" + }, + { + "name": "Jed Hunsaker", + "email": "jed.hunsaker[at]gmail.com" + }, + { + "name": "Trey Hunner", + "url": "http://treyhunner.com" + } + ], + "directories": { + "bin": "./bin", + "lib": "./lib" + }, + "scripts": { + "pretest": "cmake .", + "test": "ctest .", + "test-verbose": "ctest -VV --output-on-failure .", + "codepaint": "codepaint xform -e **/**.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/editorconfig/editorconfig-core-js.git" + }, + "bugs": { + "url": "https://github.com/editorconfig/editorconfig-core-js/issues" + }, + "author": { + "name": "EditorConfig Team" + }, + "license": { + "type": "MIT", + "url": "http://editorconfig.mit-license.org/2012" + }, + "dependencies": { + "commander": "~1.1.1", + "lru-cache": "~2.0.0", + "sigmund": "~1.0.0" + }, + "bin": { + "editorconfig": "bin/editorconfig" + }, + "readme": "# EditorConfig JavaScript Core\n\n[![Build Status](https://travis-ci.org/editorconfig/editorconfig-core-js.png?branch=master)](https://travis-ci.org/editorconfig/editorconfig-core-js)\n\nThe EditorConfig JavaScript core will provide the same functionality as the\n[EditorConfig C Core][] and [EditorConfig Python Core][].\n\n\n## Installation\n\nYou need [node][] to use this package.\n\nTo install this package (system-wide):\n\n $ npm install editorconfig\n\nTo install the package system-wide:\n\n $ npm install -g editorconfig\n\n\n## Usage\n\nUsage as a Node library:\n\n $ node\n > var editorconfig = require('./editorconfig');\n undefined\n > editorconfig.parse('/home/zoidberg/humans/anatomy.md');\n { charset: 'utf-8',\n insert_final_newline: 'true',\n end_of_line: 'lf',\n tab_width: '8',\n trim_trailing_whitespace: 'sometimes' }\n\n\nUsage as a command line tool:\n\n```\n$ ./bin/editorconfig\n\n Usage: editorconfig [OPTIONS] FILEPATH1 [FILEPATH2 FILEPATH3 ...]\n\n EditorConfig Node.js Core Version 0.11.4-development\n\n FILEPATH can be a hyphen (-) if you want path(s) to be read from stdin.\n\n Options:\n\n -h, --help output usage information\n -V, --version output the version number\n -f Specify conf filename other than \".editorconfig\"\n -b Specify version (used by devs to test compatibility)\n```\n\nExample:\n\n $ ./bin/editorconfig /home/zoidberg/humans/anatomy.md\n charset=utf-8\n insert_final_newline=true\n end_of_line=lf\n tab_width=8\n trim_trailing_whitespace=sometimes\n\n\n## Development\n\nTo install dependencies for this package run this in the package directory:\n\n $ npm install\n\nNext, run:\n\n $ npm link\n\nThe global editorconfig will now point to the files in your development\nrepository instead of a globally-installed version from npm. You can now use\neditorconfig directly to test your changes.\n\nIf you ever update from the central repository and there are errors, it might\nbe because you are missing some dependencies. If that happens, just run npm\nlink again to get the latest dependencies.\n\nTo test the command line interface:\n\n $ editorconfig \n\n\n# Testing\n\n[CMake][] must be installed to run the tests.\n\nTo run the tests:\n\n $ npm test\n\nTo run the tests with increased verbosity (for debugging test failures):\n\n $ npm run-script test-verbose\n\n[EditorConfig C Core]: https://github.com/editorconfig/editorconfig-core\n[EditorConfig Python Core]: https://github.com/editorconfig/editorconfig-core-py\n[node]: http://nodejs.org/\n[cmake]: http://www.cmake.org\n", + "readmeFilename": "README.md", + "_id": "editorconfig@0.11.4", + "_from": "editorconfig@~0.11.2" } +})() },{}],8:[function(require,module,exports){ // Based on iniparser by shockie @@ -555,261 +608,261 @@ Version.prototype = { module.exports = Version; -},{}],7:[function(require,module,exports){ +},{}],6:[function(require,module,exports){ (function(process){// Based on minimatch.js by isaacs ;(function (require, exports, module, platform) { -if (module) module.exports = minimatch -else exports.minimatch = minimatch + if (module) module.exports = minimatch + else exports.minimatch = minimatch -if (!require) { - require = function (id) { - switch (id) { - case "sigmund": return function sigmund (obj) { - return JSON.stringify(obj) - } - case "path": return { basename: function (f) { - f = f.split(/[\/\\]/) - var e = f.pop() - if (!e) e = f.pop() - return e - }} - case "lru-cache": return function LRUCache () { - // not quite an LRU, but still space-limited. - var cache = {} - var cnt = 0 - this.set = function (k, v) { - cnt ++ - if (cnt >= 100) cache = {} - cache[k] = v - } - this.get = function (k) { return cache[k] } + if (!require) { + require = function (id) { + switch (id) { + case "sigmund": return function sigmund (obj) { + return JSON.stringify(obj) + } + case "path": return { basename: function (f) { + f = f.split(/[\/\\]/) + var e = f.pop() + if (!e) e = f.pop() + return e + }} + case "lru-cache": return function LRUCache () { + // not quite an LRU, but still space-limited. + var cache = {} + var cnt = 0 + this.set = function (k, v) { + cnt ++ + if (cnt >= 100) cache = {} + cache[k] = v + } + this.get = function (k) { return cache[k] } + } } } } -} -minimatch.Minimatch = Minimatch + minimatch.Minimatch = Minimatch -var LRU = require("lru-cache") - , cache = minimatch.cache = new LRU({max: 100}) - , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} - , sigmund = require("sigmund") + var LRU = require("lru-cache") + , cache = minimatch.cache = new LRU({max: 100}) + , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} + , sigmund = require("sigmund") -var path = require("path") - // any single thing other than / - // don't need to escape / when using new RegExp() - , qmark = "[^/]" + var path = require("path") + // any single thing other than / + // don't need to escape / when using new RegExp() + , qmark = "[^/]" - // * => any number of characters - , star = qmark + "*?" + // * => any number of characters + , star = qmark + "*?" - // ** when dots are allowed. Anything goes, except .. and . - // not (^ or / followed by one or two dots followed by $ or /), - // followed by anything, any number of times. - , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" + // ** when dots are allowed. Anything goes, except .. and . + // not (^ or / followed by one or two dots followed by $ or /), + // followed by anything, any number of times. + , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" - // not a ^ or / followed by a dot, - // followed by anything, any number of times. - , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" + // not a ^ or / followed by a dot, + // followed by anything, any number of times. + , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" - // characters that need to be escaped in RegExp. - , reSpecials = charSet("().*{}+?[]^$\\!") + // characters that need to be escaped in RegExp. + , reSpecials = charSet("().*{}+?[]^$\\!") // "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split("").reduce(function (set, c) { - set[c] = true - return set - }, {}) -} + function charSet (s) { + return s.split("").reduce(function (set, c) { + set[c] = true + return set + }, {}) + } // normalizes slashes. -var slashSplit = /\/+/ - -minimatch.monkeyPatch = monkeyPatch -function monkeyPatch () { - var desc = Object.getOwnPropertyDescriptor(String.prototype, "match") - var orig = desc.value - desc.value = function (p) { - if (p instanceof Minimatch) return p.match(this) - return orig.call(this, p) + var slashSplit = /\/+/ + + minimatch.monkeyPatch = monkeyPatch + function monkeyPatch () { + var desc = Object.getOwnPropertyDescriptor(String.prototype, "match") + var orig = desc.value + desc.value = function (p) { + if (p instanceof Minimatch) return p.match(this) + return orig.call(this, p) + } + Object.defineProperty(String.prototype, desc) } - Object.defineProperty(String.prototype, desc) -} -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) + minimatch.filter = filter + function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) + function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t } - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } + minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch - return m -} + var orig = minimatch -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } -function minimatch (p, pattern, options) { - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") + return m } - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { - return false + Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch } - // "" only matches "" - if (pattern.trim() === "") return p === "" - return new Minimatch(pattern, options).match(p) -} + function minimatch (p, pattern, options) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options, cache) - } + if (!options) options = {} - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") - } + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + return false + } - if (!options) options = {} + // "" only matches "" + if (pattern.trim() === "") return p === "" - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - pattern = pattern.split("\\").join("/") + return new Minimatch(pattern, options).match(p) } - // lru storage. - // these things aren't particularly big, but walking down the string - // and turning it into a regexp can get pretty costly. - var cacheKey = pattern + "\n" + sigmund(options) - var cached = minimatch.cache.get(cacheKey) - if (cached) return cached - minimatch.cache.set(cacheKey, this) - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} + function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options, cache) + } -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } - var pattern = this.pattern - var options = this.options + if (!options) options = {} - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + pattern = pattern.split("\\").join("/") + } - // step 1: figure out negation, etc. - this.parseNegate() + // lru storage. + // these things aren't particularly big, but walking down the string + // and turning it into a regexp can get pretty costly. + var cacheKey = pattern + "\n" + sigmund(options) + var cached = minimatch.cache.get(cacheKey) + if (cached) return cached + minimatch.cache.set(cacheKey, this) + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() + } + + Minimatch.prototype.make = make + function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } - // step 2: expand braces - var set = this.globSet = this.braceExpand() + // step 1: figure out negation, etc. + this.parseNegate() - if (options.debug) console.error(this.pattern, set) + // step 2: expand braces + var set = this.globSet = this.braceExpand() - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) + if (options.debug) console.error(this.pattern, set) - if (options.debug) console.error(this.pattern, set) + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) + if (options.debug) console.error(this.pattern, set) - if (options.debug) console.error(this.pattern, set) + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) + if (options.debug) console.error(this.pattern, set) - if (options.debug) console.error(this.pattern, set) + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return -1 === s.indexOf(false) + }) - this.set = set -} + if (options.debug) console.error(this.pattern, set) -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - , negate = false - , options = this.options - , negateOffset = 0 + this.set = set + } + + Minimatch.prototype.parseNegate = parseNegate + function parseNegate () { + var pattern = this.pattern + , negate = false + , options = this.options + , negateOffset = 0 - if (options.nonegate) return + if (options.nonegate) return - for ( var i = 0, l = pattern.length + for ( var i = 0, l = pattern.length ; i < l && pattern.charAt(i) === "!" ; i ++) { - negate = !negate - negateOffset ++ - } + negate = !negate + negateOffset ++ + } - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate + } // Brace expansion: // a{b,c}d -> abd acd @@ -821,203 +874,203 @@ function parseNegate () { // Invalid sets are not expanded. // a{2..}b -> a{2..}b // a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return new Minimatch(pattern, options).braceExpand() -} + minimatch.braceExpand = function (pattern, options) { + return new Minimatch(pattern, options).braceExpand() + } -Minimatch.prototype.braceExpand = braceExpand -function braceExpand (pattern, options) { - options = options || this.options - pattern = typeof pattern === "undefined" - ? this.pattern : pattern + Minimatch.prototype.braceExpand = braceExpand + function braceExpand (pattern, options) { + options = options || this.options + pattern = typeof pattern === "undefined" + ? this.pattern : pattern - if (typeof pattern === "undefined") { - throw new Error("undefined pattern") - } + if (typeof pattern === "undefined") { + throw new Error("undefined pattern") + } - if (options.nobrace || + if (options.nobrace || !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } + // shortcut. no need to expand. + return [pattern] + } - var escaping = false - - // examples and comments refer to this crazy pattern: - // a{b,c{d,e},{f,g}h}x{y,z} - // expected: - // abxy - // abxz - // acdxy - // acdxz - // acexy - // acexz - // afhxy - // afhxz - // aghxy - // aghxz - - // everything before the first \{ is just a prefix. - // So, we pluck that off, and work with the rest, - // and then prepend it to everything we find. - if (pattern.charAt(0) !== "{") { - // console.error(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error(i, c) - if (c === "\\") { - escaping = !escaping - } else if (c === "{" && !escaping) { - prefix = pattern.substr(0, i) - break + var escaping = false + + // examples and comments refer to this crazy pattern: + // a{b,c{d,e},{f,g}h}x{y,z} + // expected: + // abxy + // abxz + // acdxy + // acdxz + // acexy + // acexz + // afhxy + // afhxz + // aghxy + // aghxz + + // everything before the first \{ is just a prefix. + // So, we pluck that off, and work with the rest, + // and then prepend it to everything we find. + if (pattern.charAt(0) !== "{") { + // console.error(pattern) + var prefix = null + for (var i = 0, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + // console.error(i, c) + if (c === "\\") { + escaping = !escaping + } else if (c === "{" && !escaping) { + prefix = pattern.substr(0, i) + break + } } - } - // actually no sets, all { were escaped. - if (prefix === null) { - // console.error("no sets") - return [pattern] + // actually no sets, all { were escaped. + if (prefix === null) { + // console.error("no sets") + return [pattern] + } + + var tail = braceExpand(pattern.substr(i), options) + return tail.map(function (t) { + return prefix + t + }) } - var tail = braceExpand(pattern.substr(i), options) - return tail.map(function (t) { - return prefix + t - }) - } + // now we have something like: + // {b,c{d,e},{f,g}h}x{y,z} + // walk through the set, expanding each part, until + // the set ends. then, we'll expand the suffix. + // If the set only has a single member, then'll put the {} back + + // first, handle numeric sets, since they're easier + var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) + if (numset) { + // console.error("numset", numset[1], numset[2]) + var suf = braceExpand(pattern.substr(numset[0].length), options) + , start = +numset[1] + , end = +numset[2] + , inc = start > end ? -1 : 1 + , set = [] + for (var i = start; i != (end + inc); i += inc) { + // append all the suffixes + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + set.push(i + suf[ii]) + } + } + return set + } - // now we have something like: - // {b,c{d,e},{f,g}h}x{y,z} - // walk through the set, expanding each part, until - // the set ends. then, we'll expand the suffix. - // If the set only has a single member, then'll put the {} back - - // first, handle numeric sets, since they're easier - var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) - if (numset) { - // console.error("numset", numset[1], numset[2]) - var suf = braceExpand(pattern.substr(numset[0].length), options) - , start = +numset[1] - , end = +numset[2] - , inc = start > end ? -1 : 1 + // ok, walk through the set + // We hope, somewhat optimistically, that there + // will be a } at the end. + // If the closing brace isn't found, then the pattern is + // interpreted as braceExpand("\\" + pattern) so that + // the leading \{ will be interpreted literally. + var i = 1 // skip the \{ + , depth = 1 , set = [] - for (var i = start; i != (end + inc); i += inc) { - // append all the suffixes - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - set.push(i + suf[ii]) - } + , member = "" + , sawEnd = false + , escaping = false + + function addMember () { + set.push(member) + member = "" } - return set - } - // ok, walk through the set - // We hope, somewhat optimistically, that there - // will be a } at the end. - // If the closing brace isn't found, then the pattern is - // interpreted as braceExpand("\\" + pattern) so that - // the leading \{ will be interpreted literally. - var i = 1 // skip the \{ - , depth = 1 - , set = [] - , member = "" - , sawEnd = false - , escaping = false - - function addMember () { - set.push(member) - member = "" - } + // console.error("Entering for") + FOR: for (i = 1, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + // console.error("", i, c) - // console.error("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error("", i, c) + if (escaping) { + escaping = false + member += "\\" + c + } else { + switch (c) { + case "\\": + escaping = true + continue + + case "{": + depth ++ + member += "{" + continue + + case "}": + depth -- + // if this closes the actual set, then we're done + if (depth === 0) { + addMember() + // pluck off the close-brace + i ++ + break FOR + } else { + member += c + continue + } + + case ",": + if (depth === 1) { + addMember() + } else { + member += c + } + continue + + default: + member += c + continue + } // switch + } // else + } // for + + // now we've either finished the set, and the suffix is + // pattern.substr(i), or we have *not* closed the set, + // and need to escape the leading brace + if (depth !== 0) { + // console.error("didn't close", pattern) + return braceExpand("\\" + pattern, options) + } - if (escaping) { - escaping = false - member += "\\" + c - } else { - switch (c) { - case "\\": - escaping = true - continue - - case "{": - depth ++ - member += "{" - continue - - case "}": - depth -- - // if this closes the actual set, then we're done - if (depth === 0) { - addMember() - // pluck off the close-brace - i ++ - break FOR - } else { - member += c - continue - } + // x{y,z} -> ["xy", "xz"] + // console.error("set", set) + // console.error("suffix", pattern.substr(i)) + var suf = braceExpand(pattern.substr(i), options) + // ["b", "c{d,e}","{f,g}h"] -> + // [["b"], ["cd", "ce"], ["fh", "gh"]] + var addBraces = set.length === 1 + // console.error("set pre-expanded", set) + set = set.map(function (p) { + return braceExpand(p, options) + }) + // console.error("set expanded", set) - case ",": - if (depth === 1) { - addMember() - } else { - member += c - } - continue - - default: - member += c - continue - } // switch - } // else - } // for - - // now we've either finished the set, and the suffix is - // pattern.substr(i), or we have *not* closed the set, - // and need to escape the leading brace - if (depth !== 0) { - // console.error("didn't close", pattern) - return braceExpand("\\" + pattern, options) - } - // x{y,z} -> ["xy", "xz"] - // console.error("set", set) - // console.error("suffix", pattern.substr(i)) - var suf = braceExpand(pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - // console.error("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand(p, options) - }) - // console.error("set expanded", set) - - - // [["b"], ["cd", "ce"], ["fh", "gh"]] -> - // ["b", "cd", "ce", "fh", "gh"] - set = set.reduce(function (l, r) { - return l.concat(r) - }) - - if (addBraces) { - set = set.map(function (s) { - return "{" + s + "}" + // [["b"], ["cd", "ce"], ["fh", "gh"]] -> + // ["b", "cd", "ce", "fh", "gh"] + set = set.reduce(function (l, r) { + return l.concat(r) }) - } - // now attach the suffixes. - var ret = [] - for (var i = 0, l = set.length; i < l; i ++) { - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - ret.push(set[i] + suf[ii]) + if (addBraces) { + set = set.map(function (s) { + return "{" + s + "}" + }) + } + + // now attach the suffixes. + var ret = [] + for (var i = 0, l = set.length; i < l; i ++) { + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + ret.push(set[i] + suf[ii]) + } } + return ret } - return ret -} // parse a component of the expanded set. // At this point, no pattern may contain "/" in it @@ -1030,612 +1083,612 @@ function braceExpand (pattern, options) { // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === "**") return GLOBSTAR - if (pattern === "") return "" - - var re = "" - , hasMagic = !!options.nocase - , escaping = false - // ? => one single character - , patternListStack = [] - , plType - , stateChar - , inClass = false - , reClassStart = -1 - , classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - , patternStart = pattern.charAt(0) === "." ? "" // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" - : "(?!\\.)" - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case "*": - re += star - hasMagic = true - break - case "?": - re += qmark - hasMagic = true - break - default: - re += "\\"+stateChar - break + Minimatch.prototype.parse = parse + var SUBPARSE = {} + function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === "**") return GLOBSTAR + if (pattern === "") return "" + + var re = "" + , hasMagic = !!options.nocase + , escaping = false + // ? => one single character + , patternListStack = [] + , plType + , stateChar + , inClass = false + , reClassStart = -1 + , classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + , patternStart = pattern.charAt(0) === "." ? "" // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" + : "(?!\\.)" + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case "*": + re += star + hasMagic = true + break + case "?": + re += qmark + hasMagic = true + break + default: + re += "\\"+stateChar + break + } + stateChar = false } - stateChar = false } - } - for ( var i = 0, len = pattern.length, c + for ( var i = 0, len = pattern.length, c ; (i < len) && (c = pattern.charAt(i)) ; i ++ ) { - if (options.debug) { - console.error("%s\t%s %s %j", pattern, i, re, c) - } - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += "\\" + c - escaping = false - continue - } - - SWITCH: switch (c) { - case "/": - // completely not allowed, even escaped. - // Should already be path-split by now. - return false + if (options.debug) { + console.error("%s\t%s %s %j", pattern, i, re, c) + } - case "\\": - clearStateChar() - escaping = true + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += "\\" + c + escaping = false continue + } - // the various stateChar values - // for the "extglob" stuff. - case "?": - case "*": - case "+": - case "@": - case "!": - if (options.debug) { - console.error("%s\t%s %s %j <-- stateChar", pattern, i, re, c) - } + SWITCH: switch (c) { + case "/": + // completely not allowed, even escaped. + // Should already be path-split by now. + return false - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - if (c === "!" && i === classStart + 1) c = "^" - re += c - continue - } + case "\\": + clearStateChar() + escaping = true + continue - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + if (options.debug) { + console.error("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + } - case "(": - if (inClass) { - re += "(" - continue - } + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + if (c === "!" && i === classStart + 1) c = "^" + re += c + continue + } - if (!stateChar) { - re += "\\(" - continue - } + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue - plType = stateChar - patternListStack.push({ type: plType - , start: i - 1 - , reStart: re.length }) - // negation is (?:(?!js)[^/]*) - re += stateChar === "!" ? "(?:(?!" : "(?:" - stateChar = false - continue + case "(": + if (inClass) { + re += "(" + continue + } - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } + if (!stateChar) { + re += "\\(" + continue + } - hasMagic = true - re += ")" - plType = patternListStack.pop().type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case "!": - re += "[^/]*?)" - break - case "?": - case "+": - case "*": re += plType - case "@": break // the default anyway - } - continue + plType = stateChar + patternListStack.push({ type: plType + , start: i - 1 + , reStart: re.length }) + // negation is (?:(?!js)[^/]*) + re += stateChar === "!" ? "(?:(?!" : "(?:" + stateChar = false + continue - case "|": - if (inClass || !patternListStack.length || escaping) { - re += "\\|" - escaping = false - continue - } + case ")": + if (inClass || !patternListStack.length) { + re += "\\)" + continue + } - re += "|" - continue + hasMagic = true + re += ")" + plType = patternListStack.pop().type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case "!": + re += "[^/]*?)" + break + case "?": + case "+": + case "*": re += plType + case "@": break // the default anyway + } + continue - // these are mostly the same in regexp and glob - case "[": - // swallow any state-tracking char before the [ - clearStateChar() + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|" + escaping = false + continue + } - if (inClass) { - re += "\\" + c - continue - } + re += "|" + continue - inClass = true - classStart = i - reClassStart = re.length - re += c - continue + // these are mostly the same in regexp and glob + case "[": + // swallow any state-tracking char before the [ + clearStateChar() - case "]": - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += "\\" + c - escaping = false - continue - } + if (inClass) { + re += "\\" + c + continue + } - // finish up the class. - hasMagic = true - inClass = false - re += c - continue + inClass = true + classStart = i + reClassStart = re.length + re += c + continue - default: - // swallow any state char that wasn't consumed - clearStateChar() + case "]": + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += "\\" + c + escaping = false + continue + } - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === "^" && inClass)) { - re += "\\" - } + // finish up the class. + hasMagic = true + inClass = false + re += c + continue - re += c + default: + // swallow any state char that wasn't consumed + clearStateChar() - } // switch - } // for + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === "^" && inClass)) { + re += "\\" + } + re += c - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - var cs = pattern.substr(classStart + 1) - , sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + "\\[" + sp[0] - hasMagic = hasMagic || sp[1] - } + } // switch + } // for - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - var pl - while (pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = "\\" - } - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + "|" - }) + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + var cs = pattern.substr(classStart + 1) + , sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + "\\[" + sp[0] + hasMagic = hasMagic || sp[1] + } - // console.error("tail=%j\n %s", tail, tail) - var t = pl.type === "*" ? star + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + var pl + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = "\\" + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + "|" + }) + + // console.error("tail=%j\n %s", tail, tail) + var t = pl.type === "*" ? star : pl.type === "?" ? qmark - : "\\" + pl.type + : "\\" + pl.type - hasMagic = true - re = re.slice(0, pl.reStart) - + t + "\\(" - + tail - } + hasMagic = true + re = re.slice(0, pl.reStart) + + t + "\\(" + + tail + } - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += "\\\\" - } + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += "\\\\" + } - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case ".": - case "[": - case "(": addPatternStart = true - } + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case ".": + case "[": + case "(": addPatternStart = true + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== "" && hasMagic) re = "(?=.)" + re + + if (addPatternStart) re = patternStart + re + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [ re, hasMagic ] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== "" && hasMagic) re = "(?=.)" + re + var flags = options.nocase ? "i" : "" + , regExp = new RegExp("^" + re + "$", flags) - if (addPatternStart) re = patternStart + re + regExp._glob = pattern + regExp._src = re - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [ re, hasMagic ] + return regExp } - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) + minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() } - var flags = options.nocase ? "i" : "" - , regExp = new RegExp("^" + re + "$", flags) + Minimatch.prototype.makeRe = makeRe + function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp - regExp._glob = pattern - regExp._src = re + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set - return regExp -} + if (!set.length) return this.regexp = false + var options = this.options -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + , flags = options.nocase ? "i" : "" + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === "string") ? regExpEscape(p) + : p._src + }).join("\\\/") + }).join("|") + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = "^(?:" + re + ")$" + + // can match anything, as long as it's not this. + if (this.negate) re = "^(?!" + re + ").*$" -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) return this.regexp = false - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - , flags = options.nocase ? "i" : "" - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === "string") ? regExpEscape(p) - : p._src - }).join("\\\/") - }).join("|") - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = "^(?:" + re + ")$" - - // can match anything, as long as it's not this. - if (this.negate) re = "^(?!" + re + ").*$" - - try { - return this.regexp = new RegExp(re, flags) - } catch (ex) { - return this.regexp = false + try { + return this.regexp = new RegExp(re, flags) + } catch (ex) { + return this.regexp = false + } } -} -minimatch.match = function (list, pattern, options) { - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (options.nonull && !list.length) { - list.push(pattern) + minimatch.match = function (list, pattern, options) { + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (options.nonull && !list.length) { + list.push(pattern) + } + return list } - return list -} -Minimatch.prototype.match = match -function match (f, partial) { - // console.error("match", f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === "" + Minimatch.prototype.match = match + function match (f, partial) { + // console.error("match", f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === "" - if (f === "/" && partial) return true + if (f === "/" && partial) return true - var options = this.options + var options = this.options - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - f = f.split("\\").join("/") - } + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + f = f.split("\\").join("/") + } - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - if (options.debug) { - console.error(this.pattern, "split", f) - } + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + if (options.debug) { + console.error(this.pattern, "split", f) + } - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. - var set = this.set - // console.error(this.pattern, "set", set) + var set = this.set + // console.error(this.pattern, "set", set) - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i] - var hit = this.matchOne(f, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate + for (var i = 0, l = set.length; i < l; i ++) { + var pattern = set[i] + var hit = this.matchOne(f, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } } - } - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate + } // set partial to true to test if, for example, // "/a/b" matches the start of "/*/b/*/d" // Partial means, if you run out of file before you run // out of pattern, then that's fine, as long as all // the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - if (options.debug) { - console.error("matchOne", - { "this": this - , file: file - , pattern: pattern }) - } - - if (options.matchBase && pattern.length === 1) { - file = path.basename(file.join("/")).split("/") - } - - if (options.debug) { - console.error("matchOne", file.length, pattern.length) - } - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { + Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options if (options.debug) { - console.error("matchOne loop") + console.error("matchOne", + { "this": this + , file: file + , pattern: pattern }) + } + + if (options.matchBase && pattern.length === 1) { + file = path.basename(file.join("/")).split("/") } - var p = pattern[pi] - , f = file[fi] if (options.debug) { - console.error(pattern, p, f) + console.error("matchOne", file.length, pattern.length) } - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - if (options.debug) - console.error('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - , pr = pi + 1 - if (pr === pl) { - if (options.debug) - console.error('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for ( ; fi < fl; fi ++) { - if (file[fi] === "." || file[fi] === ".." || - (!options.dot && file[fi].charAt(0) === ".")) return false - } - return true + for ( var fi = 0 + , pi = 0 + , fl = file.length + , pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi ++, pi ++ ) { + + if (options.debug) { + console.error("matchOne loop") } + var p = pattern[pi] + , f = file[fi] - // ok, let's see if we can swallow whatever we can. - WHILE: while (fr < fl) { - var swallowee = file[fr] + if (options.debug) { + console.error(pattern, p, f) + } - if (options.debug) { - console.error('\nglobstar while', - file, fr, pattern, pr, swallowee) - } + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + if (p === GLOBSTAR) { + if (options.debug) + console.error('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + , pr = pi + 1 + if (pr === pl) { if (options.debug) - console.error('globstar found match!', fr, fl, swallowee) - // found a match. + console.error('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for ( ; fi < fl; fi ++) { + if (file[fi] === "." || file[fi] === ".." || + (!options.dot && file[fi].charAt(0) === ".")) return false + } return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === "." || swallowee === ".." || + } + + // ok, let's see if we can swallow whatever we can. + WHILE: while (fr < fl) { + var swallowee = file[fr] + + if (options.debug) { + console.error('\nglobstar while', + file, fr, pattern, pr, swallowee) + } + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + if (options.debug) + console.error('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === "." || swallowee === ".." || (!options.dot && swallowee.charAt(0) === ".")) { - if (options.debug) - console.error("dot detected!", file, fr, pattern, pr) - break WHILE + if (options.debug) + console.error("dot detected!", file, fr, pattern, pr) + break WHILE + } + + // ** swallows a segment, and continue. + if (options.debug) + console.error('globstar swallow a segment, and continue') + fr ++ + } } - - // ** swallows a segment, and continue. - if (options.debug) - console.error('globstar swallow a segment, and continue') - fr ++ + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + // console.error("\n>>> no match, partial?", file, fr, pattern, pr) + if (fr === fl) return true } + return false } - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - // console.error("\n>>> no match, partial?", file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === "string") { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === "string") { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + if (options.debug) { + console.error("string match", p, f, hit) + } } else { - hit = f === p - } - if (options.debug) { - console.error("string match", p, f, hit) - } - } else { - hit = f.match(p) - if (options.debug) { - console.error("pattern match", p, f, hit) + hit = f.match(p) + if (options.debug) { + console.error("pattern match", p, f, hit) + } } + + if (!hit) return false } - if (!hit) return false - } + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + return emptyFileEnd + } - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") - return emptyFileEnd + // should be unreachable. + throw new Error("wtf?") } - // should be unreachable. - throw new Error("wtf?") -} - // replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, "$1") -} + function globUnescape (s) { + return s.replace(/\\(.)/g, "$1") + } -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") -} + function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") + } })( typeof require === "function" ? require : null, - this, + this, typeof module === "object" ? module : null, typeof process === "object" ? process.platform : "win32" - ) +) })(require("__browserify_process")) },{"path":5,"lru-cache":10,"sigmund":11,"__browserify_process":4}],10:[function(require,module,exports){ diff --git a/vquery.js b/vquery.js index 4bc1afc..c732b55 100644 --- a/vquery.js +++ b/vquery.js @@ -16,8 +16,10 @@ * */ (function() { + NodeList.prototype.forEach = Array.prototype.forEach; + HTMLCollection.prototype.forEach = Array.prototype.forEach; - var nodeOrDocument = function (arg) { + var nodeOrDocument = function (arg) { return function(selector, node) { if (!node) node = document; return node[arg].call(node, selector); From 8249e3e0794828d12f3afe2eaf02e75f54c964cf Mon Sep 17 00:00:00 2001 From: Kirill Cherkashin Date: Sun, 20 Apr 2014 11:58:12 -0400 Subject: [PATCH 5/6] Disallow resizing textarea, Make textarea 200px tall by default. --- _build/style.css | 4 ++-- _build/style.min.css | 2 +- style.scss | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_build/style.css b/_build/style.css index feacea5..27af9a0 100644 --- a/_build/style.css +++ b/_build/style.css @@ -9,7 +9,7 @@ section { padding: 10px 0 0 0; } section input, section textarea, section pre { background-color: #ffffff; - resize: vertical; + resize: none; margin: 10px 20px; padding: 5px; width: 320px; @@ -17,7 +17,7 @@ section { section input.properties, section textarea.properties, section pre.properties { width: 310px; } section textarea, section pre { - height: 400px; + height: 200px; box-sizing: border-box; } .editorconfig { diff --git a/_build/style.min.css b/_build/style.min.css index aa982ac..3bf4111 100644 --- a/_build/style.min.css +++ b/_build/style.min.css @@ -1 +1 @@ -.content{width:800px;margin:0 auto}section{background-color:#60B9CE;width:360px;margin:20px;padding:10px 0 0}section input,section textarea,section pre{background-color:#fff;resize:vertical;margin:10px 20px;padding:5px;width:320px;border:0}section input.properties,section textarea.properties,section pre.properties{width:310px}section textarea,section pre{height:400px;box-sizing:border-box}.editorconfig{float:left}.output{float:right} \ No newline at end of file +.content{width:800px;margin:0 auto}section{background-color:#60B9CE;width:360px;margin:20px;padding:10px 0 0}section input,section textarea,section pre{background-color:#fff;resize:none;margin:10px 20px;padding:5px;width:320px;border:0}section input.properties,section textarea.properties,section pre.properties{width:310px}section textarea,section pre{height:200px;box-sizing:border-box}.editorconfig{float:left}.output{float:right} \ No newline at end of file diff --git a/style.scss b/style.scss index 127d4e5..a1a9cdd 100644 --- a/style.scss +++ b/style.scss @@ -17,7 +17,7 @@ section { input, textarea, pre { $width: $section-width - $input-margin * 2; background-color: #ffffff; - resize: vertical; + resize: none; margin: $input-margin/2 $input-margin; padding: $input-padding; width: $width; @@ -25,7 +25,7 @@ section { border: 0; } textarea, pre { - height: 400px; + height: 200px; box-sizing: border-box; } } From 64980c35195e17c8cf48e4ef46b0c1301b371938 Mon Sep 17 00:00:00 2001 From: Kirill Cherkashin Date: Sun, 20 Apr 2014 12:01:29 -0400 Subject: [PATCH 6/6] Do not set height for pre --- _build/style.css | 2 +- _build/style.min.css | 2 +- style.scss | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_build/style.css b/_build/style.css index 27af9a0..2eab157 100644 --- a/_build/style.css +++ b/_build/style.css @@ -16,7 +16,7 @@ section { border: 0; } section input.properties, section textarea.properties, section pre.properties { width: 310px; } - section textarea, section pre { + section textarea { height: 200px; box-sizing: border-box; } diff --git a/_build/style.min.css b/_build/style.min.css index 3bf4111..d21dbd7 100644 --- a/_build/style.min.css +++ b/_build/style.min.css @@ -1 +1 @@ -.content{width:800px;margin:0 auto}section{background-color:#60B9CE;width:360px;margin:20px;padding:10px 0 0}section input,section textarea,section pre{background-color:#fff;resize:none;margin:10px 20px;padding:5px;width:320px;border:0}section input.properties,section textarea.properties,section pre.properties{width:310px}section textarea,section pre{height:200px;box-sizing:border-box}.editorconfig{float:left}.output{float:right} \ No newline at end of file +.content{width:800px;margin:0 auto}section{background-color:#60B9CE;width:360px;margin:20px;padding:10px 0 0}section input,section textarea,section pre{background-color:#fff;resize:none;margin:10px 20px;padding:5px;width:320px;border:0}section input.properties,section textarea.properties,section pre.properties{width:310px}section textarea{height:200px;box-sizing:border-box}.editorconfig{float:left}.output{float:right} \ No newline at end of file diff --git a/style.scss b/style.scss index a1a9cdd..2c97b0c 100644 --- a/style.scss +++ b/style.scss @@ -24,7 +24,7 @@ section { &.properties { width: $width - $input-padding * 2; } border: 0; } - textarea, pre { + textarea { height: 200px; box-sizing: border-box; }