o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1383239450.3162172: @value"È{I" class:ETI"ProcessedAsset;FI"logical_path;TI" locomotive/backbone.sync.js;FI" pathname;TI"Œ/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.0/vendor/assets/javascripts/locomotive/backbone.sync.js;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-10-31T17:26:43+01:00;TI" length;TiÙ I" digest;TI"%c95ef3126d0879072fa9101bbf9981c1;FI" source;TI"Ù (function() { var methodMap = { 'create': 'POST', 'update': 'PUT', 'delete': 'DELETE', 'read' : 'GET' }; var getUrl = function(object) { if (!(object && object.url)) return null; return _.isFunction(object.url) ? object.url() : object.url; }; var urlError = function() { throw new Error("A 'url' property or function must be specified"); }; Backbone.sync = function(method, model, options) { var type = methodMap[method]; // Default JSON-request options. var params = _.extend({ type: type, dataType: 'json', beforeSend: function( xhr ) { var token = $('meta[name="csrf-token"]').prop('content'); if (token) xhr.setRequestHeader('X-CSRF-Token', token); } }, options); if (!params.url) { params.url = getUrl(model) || urlError(); } // Ensure that we have the appropriate request data. if (!params.data && model && (method == 'create' || method == 'update')) { params.contentType = 'application/json'; var data = {} if(model.paramRoot) { data[model.paramRoot] = model.toJSON(); } else { data = model.toJSON(); } if (typeof(FormData) != 'undefined') { // XHR2 var formData = new FormData(); formData.append('xhr', true); // fix a bug with POW which happens to not like empty form if (typeof(window.content_locale) != 'undefined' && window.content_locale != '') formData.append('content_locale', window.content_locale); var _buildParams = function(prefix, obj, fn) { // code grabbed from jquery if (jQuery.isArray(obj)) { if (obj.length == 0) { // empty arrays fn(prefix, obj); return; } jQuery.each(obj, function(i, v) { if (/\[\]$/.test(prefix)) { // rbracket fn(prefix, v); } else { _buildParams(prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, fn); } }); } else if (obj != null && typeof obj === "object" && !(obj instanceof File)) { for (var name in obj) { _buildParams(prefix + "[" + name + "]", obj[name], fn); } } else { fn(prefix, obj); } } for (var prefix in data) { _buildParams(prefix, data[prefix], function(key, value) { // console.log('append ' + key + ', ' + value + ', is Array = ' + jQuery.isArray(value)); if (jQuery.isArray(value) && value.length == 0) formData.append(key + '[]', ''); else if (value != null) formData.append(key, value); }); } params.data = formData; params.processData = false; params.contentType = false; } else { params.data = JSON.stringify(data); } } // Don't process data on a non-GET request. if (params.type !== 'GET') { params.processData = false; } params.complete = function(xhr, textStatus) { var noticeType = xhr.getResponseHeader('X-Message-Type'); if (noticeType != null) { var growlType = noticeType == 'notice' ? 'notice' : 'alert'; // for now, only 2 kind of growl messages $.growl(noticeType, decodeURIComponent(jQuery.parseJSON(xhr.getResponseHeader('X-Message')))); } } // Make the request. return $.ajax(params); } }).call(this); ;TI"dependency_digest;TI"%b58afbe4980fbd0b53528219b4613e40;FI"required_paths;T[I"Œ/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.0/vendor/assets/javascripts/locomotive/backbone.sync.js;FI"dependency_paths;T[{I" path;TI"Œ/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.0/vendor/assets/javascripts/locomotive/backbone.sync.js;FI" mtime;TI"2013-10-31T17:26:43+01:00;TI" digest;TI"%c95ef3126d0879072fa9101bbf9981c1;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F