tb_cms 1.2.0 → 1.2.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: 605748db3cf3fd63c1605b3fef7298d1eace65c7
4
- data.tar.gz: 7a6d640888624de140b24cfde91098057aeb4b94
3
+ metadata.gz: cb4c30b7c4e397f11e7a61298f72afc3ca7cc037
4
+ data.tar.gz: 1d8bb49c58f150e2dcd4974a41069fea937ec51f
5
5
  SHA512:
6
- metadata.gz: c24b3c28ec9157510f1e3ef94126bc1eb608d64651e32d9344e01f1dca2756e5d7817e8a31986dc0e03dd66d38b8707568170b1c66b3be4afd4ea04488af8d8e
7
- data.tar.gz: fffcbe87671ed135abe1489aadfa030ea758dd708d6b5c3312fb64782ccd9f270a9ff4ea3a8d2aec7a62b14c9b74d7037fce3a773adfb2b00c79350ca508358d
6
+ metadata.gz: 65e1663eaceeb04f7a82f785e84efa71cc5e0f0246c73d114ef6a19c4ca21f710dfd7e5d53ab4474945447ef6dd1877b8c9ef401807c45b91bab0a5e293588f6
7
+ data.tar.gz: 53ac03e900dd63e3a50e67fef342cb7e0012a0b3c6a652f80c42c2c8e900f9b978eece9e3d48f7f2c170519d565a603d210a3012508d8690c25a46034e343a42
@@ -3,23 +3,3 @@
3
3
  //= require admin/cms/menu_items
4
4
 
5
5
  spud.admin.cms = {};
6
-
7
- $(document).ready(function() {
8
- spud.admin.cms.pages.initFormTabs();
9
-
10
- $("#spud_page_layout").bind('change', function() {
11
- var $this = $(this);
12
- $.get($this.attr("data-source"), { template: $this.val() }, function(data) {
13
-
14
- spud.admin.editor.unload();
15
-
16
- $("#page_partials_form").replaceWith(data);
17
- spud.admin.cms.pages.initFormTabs();
18
-
19
- spud.admin.editor.init();
20
-
21
- }, 'text').error(function(jqXHR) {
22
- alert("Error: " + jqXHR.responseText);
23
- });
24
- });
25
- });
@@ -4,7 +4,10 @@ spud.admin.cms.pages = {};
4
4
 
5
5
  spud.admin.cms.pages = {
6
6
  edit: function(){
7
+ spud.admin.editor.init({selector: '.page-partial-content-editor', width: $("#page_partials_form").width()});
8
+ spud.admin.cms.pages.initFormTabs();
7
9
  $(".btn-preview").on('click', clickedPreviewButton);
10
+ $("#spud_page_layout").on('change', changedLayoutSelection);
8
11
  }
9
12
  };
10
13
 
@@ -24,11 +27,27 @@ var clickedPreviewButton = function(e){
24
27
  }, 200);
25
28
  };
26
29
 
30
+ var changedLayoutSelection = function(e){
31
+ var $this = $(this);
32
+ $.get($this.attr("data-source"), { template: $this.val() }, function(data) {
33
+
34
+ spud.admin.editor.unload();
35
+
36
+ $("#page_partials_form").replaceWith(data);
37
+ spud.admin.cms.pages.initFormTabs();
38
+
39
+ spud.admin.editor.init({selector: '.page-partial-content-editor', width: $("#page_partials_form").width()});
40
+
41
+ }, 'text').error(function(jqXHR) {
42
+ alert("Error: " + jqXHR.responseText);
43
+ });
44
+ };
45
+
27
46
  spud.admin.cms.pages.initFormTabs = function(){
28
47
  var tabNames = [];
29
48
 
30
49
  $('.formtabs .formtab').each(function(tabind) {
31
- if(tabind === 0) {
50
+ if(tabind === 0){
32
51
  $(this).addClass('active');
33
52
  }
34
53
  this.id = 'tab-' + tabind;
@@ -36,8 +55,7 @@ spud.admin.cms.pages.initFormTabs = function(){
36
55
  });
37
56
 
38
57
  var tabButtons = $('.formtabs .formtab_buttons').first();
39
- for(var x=0;x<tabNames.length;x++)
40
- {
58
+ for(var x = 0; x < tabNames.length; x++){
41
59
  var tabButton = $('<li><a href="#tab-' + x + '" data-toggle="tab">' + tabNames[x] + '</a></li>');
42
60
  if(x === 0) {
43
61
  tabButton.addClass('active');
@@ -17,7 +17,7 @@
17
17
  <%= f.fields_for :spud_page_partials do |b| %>
18
18
  <div class="formtab tab-pane">
19
19
  <%= b.hidden_field :name, :class => "tab_name" %>
20
- <%= b.text_area :content, :class => "tinymce" %>
20
+ <%= b.text_area :content, :class => "page-partial-content-editor" %>
21
21
  </div>
22
22
  <% end %>
23
23
  </div>
@@ -8,7 +8,7 @@
8
8
  <% if spud_page_partial.id %>
9
9
  <%= hidden_field_tag "spud_page[spud_page_partials_attributes][#{index}][id]", spud_page_partial.id %>
10
10
  <% end %>
11
- <textarea class="tinymce" name="spud_page[spud_page_partials_attributes][<%= index %>][content]">
11
+ <textarea class="page-partial-content-editor" name="spud_page[spud_page_partials_attributes][<%= index %>][content]">
12
12
  <%= spud_page_partial.content %>
13
13
  </textarea>
14
14
  </div>
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Cms
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tb_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Westlake Design
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-16 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tb_core