tbone 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/javascripts/backbone_rails_sync.js.coffee +27 -0
- data/app/assets/javascripts/tbone_backbone_datalink.js.coffee +3 -3
- data/lib/tbone/engine.rb +1 -1
- data/tbone.gemspec +4 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e67d35c442a40347e70411b3850f34815a2e56e
|
4
|
+
data.tar.gz: d1b9971a426d7ca625443da4dfaee8ed51af73d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1eb6c4a471e7ffc15e1203caeeb03db74f0f5f4864ffd2ffbed992d27b16c889ca14384312b812e8da49b2f6821afeb6f13bd8b3ebe7a8c1f6fd7f6c69cfe7cd
|
7
|
+
data.tar.gz: c8009b88c57cf7e9743e442afc0df09541a7cd0486451452dc59ff9a900cc3f7ececcd3c0b0a0df170b1f96d793e12936588197c0561138a09155c8b736c7aab
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
@@ -0,0 +1,27 @@
|
|
1
|
+
define [
|
2
|
+
'jquery'
|
3
|
+
'backbone'
|
4
|
+
], ($, Backbone) ->
|
5
|
+
Backbone._sync = Backbone.sync
|
6
|
+
|
7
|
+
Backbone.sync = (method, model, options) =>
|
8
|
+
if (!options.noCSRF)
|
9
|
+
beforeSend = options.beforeSend
|
10
|
+
|
11
|
+
options.beforeSend = (xhr) =>
|
12
|
+
token = $('meta[name="csrf-token"]').attr('content')
|
13
|
+
xhr.setRequestHeader('X-CSRF-Token', token) if token
|
14
|
+
return beforeSend.apply(this, arguments) if beforeSend
|
15
|
+
|
16
|
+
if (options.data == null && model && (method == 'create' || method == 'update' || method == 'patch'))
|
17
|
+
options.contentType = 'application/json'
|
18
|
+
data = JSON.stringify(options.attrs || model.toJSON(options))
|
19
|
+
if (model.paramRoot)
|
20
|
+
data = {}
|
21
|
+
data[model.paramRoot] = model.toJSON(options)
|
22
|
+
else
|
23
|
+
data = model.toJSON();
|
24
|
+
|
25
|
+
options.data = JSON.stringify(data);
|
26
|
+
|
27
|
+
Backbone._sync(method, model, options);
|
data/lib/tbone/engine.rb
CHANGED
data/tbone.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: tbone 0.4.
|
5
|
+
# stub: tbone 0.4.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "tbone"
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Pavel Tatarsky"]
|
14
|
-
s.date = "2014-12-
|
14
|
+
s.date = "2014-12-12"
|
15
15
|
s.description = "Library for mixing together requirejs backbone and twitter bootstrap"
|
16
16
|
s.email = "fazzzenda@mail.ru"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
"Rakefile",
|
28
28
|
"VERSION",
|
29
29
|
"app/assets/javascripts/backbone-rails.js.coffee",
|
30
|
+
"app/assets/javascripts/backbone_rails_sync.js.coffee",
|
30
31
|
"app/assets/javascripts/bootstrap.js.coffee",
|
31
32
|
"app/assets/javascripts/collections/paginated.js.coffee",
|
32
33
|
"app/assets/javascripts/helpers/alert_queue.js.coffee",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tbone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Tatarsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n-js
|
@@ -208,6 +208,7 @@ files:
|
|
208
208
|
- Rakefile
|
209
209
|
- VERSION
|
210
210
|
- app/assets/javascripts/backbone-rails.js.coffee
|
211
|
+
- app/assets/javascripts/backbone_rails_sync.js.coffee
|
211
212
|
- app/assets/javascripts/bootstrap.js.coffee
|
212
213
|
- app/assets/javascripts/collections/paginated.js.coffee
|
213
214
|
- app/assets/javascripts/helpers/alert_queue.js.coffee
|