Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding Makefile and make output, fixes #3 allows us to sanely ensure …

…that we can quickly build the minified output
  • Loading branch information...
commit 65a43b2722becce756d073c81ce3b5b37a49c346 1 parent 0234c4c
Paul Kinlan authored
Showing with 8 additions and 1 deletion.
  1. +7 −0 Makefile
  2. +1 −1  routes-min.js
View
7 Makefile
@@ -0,0 +1,7 @@
+all: routes-min.js
+
+routes-min.js: routes.js
+ uglifyJs $^ > $@
+
+clean:
+ rm routes-min.js
View
2  routes-min.js
@@ -12,4 +12,4 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-*/var routes=function(){var a=[];this.parseRoute=function(a){this.parseGroups=function(a){var b=new RegExp(":([^/.\\\\]+)","g"),c=""+a,d={},e=null,f=0;while(e=b.exec(a))d[e[1]]=f++,c=c.replace(e[0],"([^/.\\\\]+)");c+="$";return{groups:d,regexp:new RegExp(c)}};return this.parseGroups(a)};var b=function(b){var c=null;for(var d=0;c=a[d];d++){var e=c.regex.regexp.exec(b);if(!!e==!1)continue;var f={};for(var g in c.regex.groups){var h=c.regex.groups[g];f[g]=e[h+1]}c.callback({url:b,params:f});return}};this.get=function(b,c){a.push({regex:this.parseRoute(b),callback:c})},this.test=function(a){b(a)},this.getRoutes=function(){return a};var c=function(){var a=!1,c=!1,d=!1;window.addEventListener("popstate",function(a){d?d=!1:(b(document.location.pathname),c=!0)},!1),window.addEventListener("load",function(a){b(document.location.pathname),c=!0,d=!0},!1),window.addEventListener("hashchange",function(a){c?c=!1:b(document.location.pathname)},!1)};c()}
+*/var routes=function(){var a=[],b=this;this.parseRoute=function(a){this.parseGroups=function(a){var b=new RegExp(":([^/.\\\\]+)","g"),c=""+a,d={},e=null,f=0;while(e=b.exec(a))d[e[1]]=f++,c=c.replace(e[0],"([^/.\\\\]+)");c+="$";return{groups:d,regexp:new RegExp(c)}};return this.parseGroups(a)};var c=function(b,c){var d=null;for(var e=0;d=a[e];e++){var f=d.regex.regexp.exec(b);if(!!f==!1)continue;var g={};for(var h in d.regex.groups){var i=d.regex.groups[h];g[h]=f[i+1]}d.callback({url:b,params:g,e:c});return!0}return!1};this.get=function(b,c){a.push({regex:this.parseRoute(b),callback:c,method:"get"})},this.post=function(b,c){a.push({regex:this.parseRoute(b),callback:c,method:"post"})},this.test=function(a){c(a)},this.getRoutes=function(){return a};var d=function(){var a=!1,d=!1,e=!1;b.run=function(){a||(c(document.location.pathname),a=!0)},window.addEventListener("submit",function(a){if(a.target.method=="post"&&c(a.target.action,a)){a.preventDefault();return!1}return!0}),window.addEventListener("popstate",function(a){e?(e=!1,d=!1):(c(document.location.pathname),d=!0)},!1),window.addEventListener("load",function(b){a||(c(document.location.pathname),a=!0),d=!0,e=!0},!1),window.addEventListener("hashchange",function(a){d?(d=!1,e=!1):c(document.location.pathname)},!1)};d()}
Please sign in to comment.
Something went wrong with that request. Please try again.