From b5360c301e410da1e4ddf044ded1a96c6a9156b5 Mon Sep 17 00:00:00 2001 From: Kabir Shah Date: Fri, 3 Feb 2017 18:08:55 -0800 Subject: [PATCH] v0.2.0 --- dist/moon.js | 4 ++-- dist/moon.min.js | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/moon.js b/dist/moon.js index 2911af75..fe614c77 100644 --- a/dist/moon.js +++ b/dist/moon.js @@ -1,5 +1,5 @@ /* -* Moon 0.1.3 +* Moon 0.2.0 * Copyright 2016-2017, Kabir Shah * https://github.com/KingPixil/moon/ * Free to use under the MIT license. @@ -1037,7 +1037,7 @@ /** * Version of Moon */ - Moon.version = '0.1.3'; + Moon.version = '0.2.0'; /** * Moon Utilities diff --git a/dist/moon.min.js b/dist/moon.min.js index c1576b01..dca9b9c1 100644 --- a/dist/moon.min.js +++ b/dist/moon.min.js @@ -1,8 +1,8 @@ /* -* Moon 0.1.3 +* Moon 0.2.0 * Copyright 2016-2017, Kabir Shah * https://github.com/KingPixil/moon/ * Free to use under the MIT license. * https://kingpixil.github.io/license */ -!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.Moon=e()}(this,function(){"use strict";function t(r){this.$opts=r||{};var o=this;this.$id=i++,this.$name=this.$opts.name||"root",this.$parent=this.$opts.parent||null,this.$data=this.$opts.data||{},this.$render=this.$opts.render||k,this.$hooks=this.$opts.hooks||{},this.$methods=this.$opts.methods||{},this.$events={},this.$dom={},this.$destroyed=!1,this.$initialRender=!0,this.$queued=!1,n[t.config.prefix+"if"]=function(t,e,n){return"("+a(t,!1)+") ? "+e+" : ''"},n[t.config.prefix+"for"]=function(t,e,n){var r=t.split(" in "),i=r[0].split(","),o='instance.get("'+r[1]+'")',s=i.join(","),u=function(t,e,n,r){return i.indexOf(n)===-1?t:t.replace(e,'" + '+n+r+' + "')};return"instance.renderLoop("+o+", function("+s+") { return "+a(e,!0,u)+"; })"},n[t.config.prefix+"on"]=function(e,n,r){var i={stop:"event.stopPropagation();",prevent:"event.preventDefault();",ctrl:"if(!event.ctrlKey) {return;};",shift:"if(!event.shiftKey) {return;};",alt:"if(!event.altKey) {return;};"},o=e.split(":"),s=o[0].split("."),u=s[0],c="";s.shift();for(var a=0;a",t.current);return r===-1?(t.tokens.push({type:"comment",value:e.slice(t.current)}),void(t.current=n)):(t.tokens.push({type:"comment",value:e.slice(t.current,r)}),void(t.current=r+3))},O=function(t){var e=t.input,n=(e.length,"/"===e.charAt(t.current+1));e.charAt(t.current);t.tokens.push({type:"tagStart",close:n}),t.current+=n?2:1;var r=A(t);E(t);var i="/"===e.charAt(t.current);t.tokens.push({type:"tagEnd",close:!1}),t.current+=i?2:1,i&&(t.tokens.push({type:"tagStart",close:!0}),t.tokens.push({type:"tag",value:r}),t.tokens.push({type:"attribute",value:{}}),t.tokens.push({type:"tagEnd",close:!1}))},A=function(t){for(var e=t.input,n=e.length,r=t.current;r"!==i&&" "!==i)break;r++}for(var o=r;o"===i||" "===i)break;o++}var s=e.slice(r,o);return t.tokens.push({type:"tag",value:s}),t.current=o,s},E=function(t){for(var e=t.input,n=e.length,r=t.current,i={},o="",s=/([^=\s]*)(=?)("[^"]*"|[^\s"]*)/gi;r"===u||"/"===u)break;o+=u,r++}o.replace(s,function(t,e,n,r){var o=r[0],s=r[r.length-1];("'"===o&&"'"===s||'"'===o&&'"'===s)&&(r=r.slice(1,-1)),r||(r=e),e&&r&&(i[e]=r)}),t.current=r,t.tokens.push({type:"attribute",value:i})},C=function(t){for(var e={type:"ROOT",children:[]},n={current:0,tokens:t};n.current",t.current);return r===-1?(t.tokens.push({type:"comment",value:e.slice(t.current)}),void(t.current=n)):(t.tokens.push({type:"comment",value:e.slice(t.current,r)}),void(t.current=r+3))},O=function(t){var e=t.input,n=(e.length,"/"===e.charAt(t.current+1));e.charAt(t.current);t.tokens.push({type:"tagStart",close:n}),t.current+=n?2:1;var r=A(t);E(t);var i="/"===e.charAt(t.current);t.tokens.push({type:"tagEnd",close:!1}),t.current+=i?2:1,i&&(t.tokens.push({type:"tagStart",close:!0}),t.tokens.push({type:"tag",value:r}),t.tokens.push({type:"attribute",value:{}}),t.tokens.push({type:"tagEnd",close:!1}))},A=function(t){for(var e=t.input,n=e.length,r=t.current;r"!==i&&" "!==i)break;r++}for(var o=r;o"===i||" "===i)break;o++}var s=e.slice(r,o);return t.tokens.push({type:"tag",value:s}),t.current=o,s},E=function(t){for(var e=t.input,n=e.length,r=t.current,i={},o="",s=/([^=\s]*)(=?)("[^"]*"|[^\s"]*)/gi;r"===u||"/"===u)break;o+=u,r++}o.replace(s,function(t,e,n,r){var o=r[0],s=r[r.length-1];("'"===o&&"'"===s||'"'===o&&'"'===s)&&(r=r.slice(1,-1)),r||(r=e),e&&r&&(i[e]=r)}),t.current=r,t.tokens.push({type:"attribute",value:i})},C=function(t){for(var e={type:"ROOT",children:[]},n={current:0,tokens:t};n.current