spree_summernote 3.0.0 → 3.0.1

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
  SHA1:
3
- metadata.gz: b2000c4cf521e7f3ddc05b473709fcd8bb4cc1db
4
- data.tar.gz: 53d77f0631c228cf51e59d9c6a123352b215d0e1
3
+ metadata.gz: 171140b3bf6ea165c59f04295497cb4fb04dc6f7
4
+ data.tar.gz: d9aa23922e6db0d68e2f9f6f29e166fda43a94fd
5
5
  SHA512:
6
- metadata.gz: 673ba5a7668a8f8b325dc7d09f9ac5883ceff3778e6082cdda74e5d98bce870d726a83726778ba99ed130ec6bbbd9c8c53131d127e1042c429ce0d259d4011db
7
- data.tar.gz: 7bbef436c8876ec17f65cfdd78b1e30130113de08c452387ff09ebf18d5a7ec2de7bbaa18f70a75961ce06b5b41cf64a34f5d35493484b302c46f321adf6de50
6
+ metadata.gz: d5e2c861b5b859d51f4b1a92e8400a09fd871abe39384354d0788e27953deaf5323289640125ac86ae7983b5a11206d5c99c729f17de5b73c041c8dc86937b78
7
+ data.tar.gz: aa88686e43f3f8c4a182451c8dc90209f765e54a4e0b688e2b54766a927a5248921f3bf66a2767771c0430e62718de36e354402d522e7e22a762bfe64aeab8d4
@@ -1,49 +1,60 @@
1
1
  (function() {
2
2
  // Spree's locales are different to Summernotes
3
3
  // Summernote defaults to english if it doesn't get what's being set
4
- var metaTranslations = {
5
- "ca": "ca-ES",
6
- "cs": "cs-CZ",
7
- "da": "da-DK",
8
- "de": "de-DE",
9
- "es": "es-ES",
10
- "fa": "fa-FA",
11
- "fi": "fi-FI",
12
- "fr": "fr-FR",
13
- "id": "id-ID",
14
- "it": "it-IT",
15
- "ja": "ja-JP",
16
- "ko": "ko-KR",
17
- "nb": "nb-NO",
18
- "nl": "nl-NL",
19
- "pl": "pl-PL",
20
- "pt": "pt-PT",
21
- "ro": "ro-RO",
22
- "ru": "ru-RU",
23
- "sk": "sk-SK",
24
- "sl-SI": "sl-SI",
25
- "sv": "sv-SE",
26
- "th": "th-TH",
27
- "uk": "uk-UA",
28
- "vi": "vi-VN",
29
- "zh-CN": "zh-CN",
30
- "zh-TW": "zh-TW"
31
- };
4
+ var SpreeSummernote = {
5
+ localeMap: function(value){
6
+ var locales = {
7
+ "ca": "ca-ES",
8
+ "cs": "cs-CZ",
9
+ "da": "da-DK",
10
+ "de": "de-DE",
11
+ "es": "es-ES",
12
+ "fa": "fa-FA",
13
+ "fi": "fi-FI",
14
+ "fr": "fr-FR",
15
+ "id": "id-ID",
16
+ "it": "it-IT",
17
+ "ja": "ja-JP",
18
+ "ko": "ko-KR",
19
+ "nb": "nb-NO",
20
+ "nl": "nl-NL",
21
+ "pl": "pl-PL",
22
+ "pt": "pt-PT",
23
+ "ro": "ro-RO",
24
+ "ru": "ru-RU",
25
+ "sk": "sk-SK",
26
+ "sl-SI": "sl-SI",
27
+ "sv": "sv-SE",
28
+ "th": "th-TH",
29
+ "uk": "uk-UA",
30
+ "vi": "vi-VN",
31
+ "zh-CN": "zh-CN",
32
+ "zh-TW": "zh-TW"
33
+ };
34
+ return ((value in locales) ? locales[value] : value);
35
+ },
36
+ locale: function() {
37
+ return document.documentElement.lang
38
+ },
39
+ translatedLocale: function() {
40
+ return this.localeMap(document.documentElement.lang);
41
+ }
42
+ }
43
+
44
+ window.Spree.SpreeSummernote = SpreeSummernote;
32
45
 
33
46
  $(document).ready(function() {
34
47
 
35
- var locale = $('html').attr('lang');
36
- var translation = metaTranslations[locale];
37
48
  var selectors = [
38
49
  '.summernote',
39
- '.description .panel-body textarea',
50
+ '.description .panel-body textarea',
40
51
  '#product_description',
41
52
  '#taxon_description',
42
53
  '#promotion_description'
43
54
  ].join(',');
44
55
 
45
56
  $(selectors).summernote({
46
- lang: translation
57
+ lang: SpreeSummernote.translatedLocale()
47
58
  });
48
59
 
49
60
  });
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_summernote'
5
- s.version = '3.0.0'
5
+ s.version = '3.0.1'
6
6
  s.summary = 'Adds Summernote RTE to Spree 3.0.0 backend'
7
7
  s.description = 'Adds Summernote RTE to Spree 3.0.0 backend'
8
8
  s.required_ruby_version = '>= 2.0.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_summernote
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Stockdale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-10 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core