From 45941b2850b6e5b86cbe417431644ffa50289ee5 Mon Sep 17 00:00:00 2001 From: JasonHo Date: Wed, 16 Apr 2014 02:37:24 +0900 Subject: [PATCH] updated chiropractor compiled files --- chiropractor.js | 137 +++++++++++++++++++----------------- chiropractor.min.js | 6 +- chiropractor.min.map | 2 +- chiropractor.nodeps.js | 90 +++++++++++------------ chiropractor.nodeps.min.js | 6 +- chiropractor.nodeps.min.map | 2 +- 6 files changed, 127 insertions(+), 116 deletions(-) diff --git a/chiropractor.js b/chiropractor.js index fb2c125..87ac738 100644 --- a/chiropractor.js +++ b/chiropractor.js @@ -1579,7 +1579,7 @@ return Backbone; })); -// backbone-subroute.js v0.4.1 +// backbone-subroute.js v0.4.2 // // Copyright (C) 2012 Dave Cadwallader, Model N, Inc. // Distributed under the MIT License @@ -1587,21 +1587,24 @@ // Documentation and full license available at: // https://github.com/ModelN/backbone.subroute -(function (factory) { +(function(factory) { if (typeof define === 'function' && define.amd) { // Register as an AMD module if available... define('backbone.subroute',['underscore', 'backbone'], factory); + } else if (typeof exports === 'object') { + // Next for Node.js, CommonJS, browserify... + factory(require('underscore'), require('backbone')); } else { // Browser globals for the unenlightened... factory(_, Backbone); } -}(function(_, Backbone){ +}(function(_, Backbone) { - Backbone.SubRoute = Backbone.Router.extend( { - constructor:function ( prefix, options ) { + Backbone.SubRoute = Backbone.Router.extend({ + constructor: function(prefix, options) { // each subroute instance should have its own routes hash - this.routes = _.clone(this.routes); + this.routes = _.clone(this.routes) || {}; // Prefix is optional, set to empty string if not passed this.prefix = prefix = prefix || ""; @@ -1609,14 +1612,14 @@ // SubRoute instances may be instantiated using a prefix with or without a trailing slash. // If the prefix does *not* have a trailing slash, we need to insert a slash as a separator // between the prefix and the sub-route path for each route that we register with Backbone. - this.separator = ( prefix.slice( -1 ) === "/" ) ? "" : "/"; + this.separator = (prefix.slice(-1) === "/") ? "" : "/"; // if you want to match "books" and "books/" without creating separate routes, set this // option to "true" and the sub-router will automatically create those routes for you. this.createTrailingSlashRoutes = options && options.createTrailingSlashRoutes; // Required to have Backbone set up routes - Backbone.Router.prototype.constructor.call( this, options ); + Backbone.Router.prototype.constructor.call(this, options); // grab the full URL var hash; @@ -1629,9 +1632,9 @@ // Trigger the subroute immediately. this supports the case where // a user directly navigates to a URL with a subroute on the first page load. // Check every element, if one matches, break. Prevent multiple matches - _.every(this.routes, function(key, route){ + _.every(this.routes, function(key, route) { // Use the Backbone parser to turn route into regex for matching - if(hash.match(Backbone.Router.prototype._routeToRegExp(route))) { + if (hash.match(Backbone.Router.prototype._routeToRegExp(route))) { Backbone.history.loadUrl(hash); return false; } @@ -1642,17 +1645,17 @@ this.postInitialize(options); } }, - navigate:function ( route, options ) { - if ( route.substr( 0, 1 ) != '/' && - route.indexOf( this.prefix.substr( 0, this.prefix.length - 1 ) ) !== 0 ) { + navigate: function(route, options) { + if (route.substr(0, 1) != '/' && + route.indexOf(this.prefix.substr(0, this.prefix.length - 1)) !== 0) { route = this.prefix + - ( route ? this.separator : "") + - route; + (route ? this.separator : "") + + route; } - Backbone.Router.prototype.navigate.call( this, route, options ); + Backbone.Router.prototype.navigate.call(this, route, options); }, - route : function (route, name, callback) { + route: function(route, name, callback) { // strip off any leading slashes in the sub-route path, // since we already handle inserting them when needed. if (route.substr(0) === "/") { @@ -1660,8 +1663,12 @@ } var _route = this.prefix; - if (route && route.length > 0) - _route += (this.separator + route); + if (route && route.length > 0) { + if (this.prefix.length > 0) + _route += this.separator; + + _route += route; + } if (this.createTrailingSlashRoutes) { this.routes[_route + '/'] = name; @@ -1678,7 +1685,7 @@ // delegate the creation of the properly-prefixed route to Backbone return Backbone.Router.prototype.route.call(this, _route, name, callback); } - } ); + }); return Backbone.SubRoute; })); @@ -2378,7 +2385,9 @@ define('chiropractor/views/field',['require','json-ie7','jquery','underscore','h if (model) { id = model.fieldId(fieldName); //console.log(model); - value = model.get(field.id); + if (field) { + value = model.get(field.id); + } } _.defaults(opts, { @@ -2412,26 +2421,26 @@ var t = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { function program1(depth0,data,depth1) { var buffer = "", stack1, stack2, stack3, foundHelper; - buffer += "\n "; + buffer += "\r\n "; stack1 = depth1.model; stack2 = depth0.fieldtype; stack3 = {}; stack3['field'] = depth0; foundHelper = helpers.field; stack1 = foundHelper ? foundHelper.call(depth0, stack2, stack1, {hash:stack3}) : helperMissing.call(depth0, "field", stack2, stack1, {hash:stack3}); - buffer += escapeExpression(stack1) + "\n "; + buffer += escapeExpression(stack1) + "\r\n "; return buffer;} buffer += "\n "; + buffer += escapeExpression(stack1) + "\">\r\n "; stack1 = depth0.options; stack1 = stack1 == null || stack1 === false ? stack1 : stack1.fields; stack1 = helpers.each.call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.programWithDepth(program1, data, depth0)}); if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += "\n"; + buffer += "\r\n"; return buffer;}); Handlebars.registerPartial('chiropractor_views_templates_row_row', t); return t; @@ -2446,26 +2455,26 @@ var t = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression; - buffer += "
\n
×
\n
"; + buffer += "
\r\n
×
\r\n
"; stack1 = depth0.model; stack1 = stack1 == null || stack1 === false ? stack1 : stack1.errorMessage; stack1 = typeof stack1 === functionType ? stack1() : stack1; - buffer += escapeExpression(stack1) + "
\n
Message: "; + buffer += escapeExpression(stack1) + "
\r\n
Message: "; stack1 = depth0.model; stack1 = stack1 == null || stack1 === false ? stack1 : stack1.response; stack1 = stack1 == null || stack1 === false ? stack1 : stack1.responseText; stack1 = typeof stack1 === functionType ? stack1() : stack1; - buffer += escapeExpression(stack1) + "
\n
Status: "; + buffer += escapeExpression(stack1) + "
\r\n
Status: "; stack1 = depth0.model; stack1 = stack1 == null || stack1 === false ? stack1 : stack1.response; stack1 = stack1 == null || stack1 === false ? stack1 : stack1.statusText; stack1 = typeof stack1 === functionType ? stack1() : stack1; - buffer += escapeExpression(stack1) + "
\n
StatusCode: "; + buffer += escapeExpression(stack1) + "
\r\n
StatusCode: "; stack1 = depth0.model; stack1 = stack1 == null || stack1 === false ? stack1 : stack1.response; stack1 = stack1 == null || stack1 === false ? stack1 : stack1.status; stack1 = typeof stack1 === functionType ? stack1() : stack1; - buffer += escapeExpression(stack1) + "
\n
Url: \r\n\n
"; + buffer += escapeExpression(stack1) + "
\r\n
"; return buffer;}); Handlebars.registerPartial('chiropractor_views_templates_row_error_messagebox', t); return t; @@ -2602,7 +2611,7 @@ var t = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { foundHelper = helpers.id; if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); } else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1() : stack1; } - buffer += escapeExpression(stack1) + "\">\n
\r\n\r\n"; return buffer;}); Handlebars.registerPartial('chiropractor_views_templates_formfield_text', t); return t; @@ -2661,7 +2670,7 @@ var t = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { foundHelper = helpers.id; if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); } else { stack1 = depth0.id; stack1 = typeof stack1 === functionType ? stack1() : stack1; } - buffer += escapeExpression(stack1) + "\">\n