simplec 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c5c2b1f64ae1b643867b467dcf837eda87b347e10c5c993843a21c7f3fc70cf
4
- data.tar.gz: 9c2d2e28104710ec36ca402b1c58c1f96c27d534ec5fd5b8a20efaf40e81f608
3
+ metadata.gz: d5b8ea5b96bff494112424c200b279792510b182b5f4257532b51c0cbab55456
4
+ data.tar.gz: b3f51e5e8b47228b7d5c6e20f7ee629623a9928749a75f740a744c2110308336
5
5
  SHA512:
6
- metadata.gz: 1bc7d27d0fcfe823dba6b7be4d87fa635077f0ebdba3781ffbab53ce4c05f458a28bd837e9e3d39b3d27785057ac9338aab27e295e09b4f13ef2b135db4ac99b
7
- data.tar.gz: c0e7ac175f44165692551c6210bca7046dde03c9a07a97a9d16e6ed8aabbab06550ab8910d70bab498a1ff0ae214c2681adee9c7b10537fd889830358c6e04b9
6
+ metadata.gz: 80537e4ead797944467ebc0f49bc3944637922b532200704f3e60647bebe8a695477f85700094b4f8b8cfdd460cf193e8997ac97575cc2bdafc01a2dfd49da6f
7
+ data.tar.gz: 8912a37ff6adac737267014c5430cf206ad58ff89aba050e7d03a5e474011a1e80a8e62820feb7f43ce246610d7b256992979af813270e6fcbda3d4a36d11f15
@@ -24,6 +24,10 @@ $.summernote.options.toolbar = [
24
24
 
25
25
  if (!window.simplec) window.simplec = {};
26
26
 
27
+ window.simplec.csrfToken = function() {
28
+ return $('meta[name=csrf-token]').attr('content');
29
+ };
30
+
27
31
  window.simplec.initSummernote = function() {
28
32
  $('.editor-field').each(function(idx, el) {
29
33
  var $el = $(el);
@@ -55,7 +59,10 @@ window.simplec.initSummernote = function() {
55
59
  url: '/embedded-images',
56
60
  dataType: 'json',
57
61
  contentType: 'application/json',
58
- headers: { 'X-Engine': 'simplec' },
62
+ headers: {
63
+ 'X-Engine': 'simplec',
64
+ 'X-CSRF-Token': simplec.csrfToken()
65
+ },
59
66
  data: JSON.stringify({
60
67
  asset_url: reader.result,
61
68
  asset_name: file.name
@@ -1,3 +1,3 @@
1
1
  module Simplec
2
- VERSION = '0.9.1'
2
+ VERSION = '0.9.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Smith