caboose-cms 0.9.229 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +5 -5
  2. data/app/assets/javascripts/caboose/admin.js +1 -1
  3. data/app/assets/javascripts/caboose/admin/application.js +20 -0
  4. data/app/assets/javascripts/caboose/admin_main.js +13 -3
  5. data/app/assets/javascripts/caboose/admin_media_index.js +158 -161
  6. data/app/assets/javascripts/caboose/application.js +7 -8
  7. data/app/assets/javascripts/caboose/block_content_controller_dragdrop.js +4 -60
  8. data/app/assets/javascripts/caboose/block_modal_controllers/block_dd_modal_controller.js +2 -3
  9. data/app/assets/javascripts/caboose/block_modal_controllers/media_modal_controller.js +6 -17
  10. data/app/assets/javascripts/caboose/model/all.js +1 -5
  11. data/app/assets/stylesheets/caboose/admin/_config.scss +102 -0
  12. data/app/assets/stylesheets/caboose/admin/application.css +11 -0
  13. data/app/assets/stylesheets/caboose/admin/component.css +183 -0
  14. data/app/assets/stylesheets/caboose/admin/froala.min.css +91 -0
  15. data/app/assets/stylesheets/caboose/admin/ie.scss +67 -0
  16. data/app/assets/stylesheets/caboose/admin/integrations/main.scss +6 -0
  17. data/app/assets/stylesheets/caboose/admin/integrations/shopify.scss +128 -0
  18. data/app/assets/stylesheets/caboose/admin/jquery-ui-subnav-theme.min.css +5 -0
  19. data/app/assets/stylesheets/caboose/admin/layout.scss +150 -0
  20. data/app/assets/stylesheets/caboose/admin/main.scss +34 -0
  21. data/app/assets/stylesheets/caboose/admin/modules/body.scss +176 -0
  22. data/app/assets/stylesheets/caboose/admin/modules/buttons.scss +120 -0
  23. data/app/assets/stylesheets/caboose/admin/modules/countdown.css +21 -0
  24. data/app/assets/stylesheets/caboose/admin/modules/crumbtrail.scss +80 -0
  25. data/app/assets/stylesheets/caboose/admin/modules/data_table.scss +92 -0
  26. data/app/assets/stylesheets/caboose/admin/modules/footer.scss +62 -0
  27. data/app/assets/stylesheets/caboose/admin/modules/forms.scss +72 -0
  28. data/app/assets/stylesheets/caboose/admin/modules/functions.scss +31 -0
  29. data/app/assets/stylesheets/caboose/admin/modules/grid.scss +108 -0
  30. data/app/assets/stylesheets/caboose/admin/modules/header.scss +77 -0
  31. data/app/assets/stylesheets/caboose/admin/modules/headings.scss +38 -0
  32. data/app/assets/stylesheets/caboose/admin/modules/main_nav.scss +73 -0
  33. data/app/assets/stylesheets/caboose/admin/modules/message_boxes.scss +55 -0
  34. data/app/assets/stylesheets/caboose/admin/modules/model_binder.scss +189 -0
  35. data/app/assets/stylesheets/caboose/admin/modules/navigation.scss +261 -0
  36. data/app/assets/stylesheets/caboose/admin/modules/order_bumps.scss +57 -0
  37. data/app/assets/stylesheets/caboose/admin/modules/pager.scss +34 -0
  38. data/app/assets/stylesheets/caboose/admin/modules/product_images.scss +21 -0
  39. data/app/assets/stylesheets/caboose/admin/modules/products.css +86 -0
  40. data/app/assets/stylesheets/caboose/admin/modules/search.scss +49 -0
  41. data/app/assets/stylesheets/caboose/admin/modules/selects.scss +12 -0
  42. data/app/assets/stylesheets/caboose/admin/modules/subnav_tabs.scss +34 -0
  43. data/app/assets/stylesheets/caboose/admin/modules/tabs.scss +140 -0
  44. data/app/assets/stylesheets/caboose/admin/page_edit/block_anchors.scss +48 -0
  45. data/app/assets/stylesheets/caboose/admin/page_edit/block_overlays.scss +182 -0
  46. data/app/assets/stylesheets/caboose/admin/page_edit/device_selector.scss +65 -0
  47. data/app/assets/stylesheets/caboose/admin/page_edit/froala.scss +81 -0
  48. data/app/assets/stylesheets/caboose/admin/page_edit/group_overlay.scss +115 -0
  49. data/app/assets/stylesheets/caboose/admin/page_edit/layout.scss +128 -0
  50. data/app/assets/stylesheets/caboose/admin/page_edit/main.scss +18 -0
  51. data/app/assets/stylesheets/caboose/admin/page_edit/modal.scss +11 -0
  52. data/app/assets/stylesheets/caboose/admin/page_edit/preview.scss +25 -0
  53. data/app/assets/stylesheets/caboose/admin/page_edit/publish.scss +25 -0
  54. data/app/assets/stylesheets/caboose/admin/page_edit/revisions.scss +58 -0
  55. data/app/assets/stylesheets/caboose/admin/page_edit/subnav.scss +273 -0
  56. data/app/assets/stylesheets/caboose/admin/page_edit/top_nav.scss +109 -0
  57. data/app/assets/stylesheets/caboose/admin/pages/assets_index.css +48 -0
  58. data/app/assets/stylesheets/caboose/admin/pages/block_edit_image.css.scss +386 -0
  59. data/app/assets/stylesheets/caboose/admin/pages/media_index.css.scss +300 -0
  60. data/app/assets/stylesheets/caboose/admin/pages/new_block.css +9 -0
  61. data/app/assets/stylesheets/caboose/admin/pages/page_edit.scss +960 -0
  62. data/app/assets/stylesheets/caboose/admin/pages/page_edit_content.scss +103 -0
  63. data/app/assets/stylesheets/caboose/admin/pages/pages_index.scss +79 -0
  64. data/app/assets/stylesheets/caboose/admin/pages/post_edit_content.css +46 -0
  65. data/app/assets/stylesheets/caboose/admin/print.css +3 -0
  66. data/app/assets/stylesheets/caboose/admin/slack.scss +51 -0
  67. data/app/assets/stylesheets/caboose/admin_block_edit_image.css.scss +1 -2
  68. data/app/assets/stylesheets/caboose/admin_edit_page_content_dragdrop.scss +15 -71
  69. data/app/assets/stylesheets/caboose/admin_main.css.scss +29 -25
  70. data/app/assets/stylesheets/caboose/admin_media_index.css.scss +5 -26
  71. data/app/assets/stylesheets/caboose/application.css +5 -11
  72. data/app/assets/stylesheets/caboose/login.scss +0 -1
  73. data/app/assets/stylesheets/caboose/modal_main.css +19 -21
  74. data/app/assets/stylesheets/caboose/model_binder.css +4 -13
  75. data/app/assets/stylesheets/caboose/page_bar_generator.css +1 -2
  76. data/app/controllers/caboose/admin_controller.rb +4 -3
  77. data/app/controllers/caboose/application_controller.rb +19 -16
  78. data/app/controllers/caboose/assets_controller.rb +65 -0
  79. data/app/controllers/caboose/block_types_controller.rb +6 -8
  80. data/app/controllers/caboose/cart_controller.rb +2 -2
  81. data/app/controllers/caboose/fonts_controller.rb +2 -139
  82. data/app/controllers/caboose/invoices_controller.rb +4 -5
  83. data/app/controllers/caboose/login_logs_controller.rb +7 -5
  84. data/app/controllers/caboose/media_categories_controller.rb +2 -16
  85. data/app/controllers/caboose/media_controller.rb +11 -14
  86. data/app/controllers/caboose/pages_controller.rb +42 -104
  87. data/app/controllers/caboose/posts_controller.rb +7 -53
  88. data/app/controllers/caboose/products_controller.rb +1 -1
  89. data/app/controllers/caboose/sites_controller.rb +6 -25
  90. data/app/controllers/caboose/sns_controller.rb +3 -3
  91. data/app/controllers/caboose/themes_controller.rb +0 -30
  92. data/app/controllers/caboose/users_controller.rb +10 -17
  93. data/app/controllers/caboose/variants_controller.rb +9 -9
  94. data/app/models/caboose/ab_variant.rb +1 -1
  95. data/app/models/caboose/asset.rb +23 -0
  96. data/app/models/caboose/asset_manager.rb +92 -0
  97. data/app/models/caboose/asset_manifest.rb +91 -0
  98. data/app/models/caboose/block.rb +24 -100
  99. data/app/models/caboose/block_cache.rb +105 -0
  100. data/app/models/caboose/block_cache_file.rb +22 -0
  101. data/app/models/caboose/block_cache_image.rb +53 -0
  102. data/app/models/caboose/block_type.rb +3 -4
  103. data/app/models/caboose/block_type_category.rb +2 -2
  104. data/app/models/caboose/block_type_parser.rb +1 -1
  105. data/app/models/caboose/block_type_source.rb +2 -2
  106. data/app/models/caboose/calendar_event_group.rb +2 -2
  107. data/app/models/caboose/category.rb +2 -2
  108. data/app/models/caboose/comment_routes.rb +8 -7
  109. data/app/models/caboose/core_plugin.rb +3 -4
  110. data/app/models/caboose/export.rb +1 -1
  111. data/app/models/caboose/font.rb +2 -7
  112. data/app/models/caboose/font_variant.rb +0 -12
  113. data/app/models/caboose/invoice.rb +14 -14
  114. data/app/models/caboose/line_item.rb +4 -4
  115. data/app/models/caboose/media.rb +4 -15
  116. data/app/models/caboose/media_category.rb +7 -5
  117. data/app/models/caboose/modification.rb +2 -2
  118. data/app/models/caboose/page.rb +54 -325
  119. data/app/models/caboose/page_bar_generator.rb +10 -20
  120. data/app/models/caboose/page_cache.rb +12 -0
  121. data/app/models/caboose/page_cacher.rb +137 -0
  122. data/app/models/caboose/post.rb +8 -108
  123. data/app/models/caboose/product.rb +5 -5
  124. data/app/models/caboose/product_image.rb +1 -1
  125. data/app/models/caboose/role.rb +2 -2
  126. data/app/models/caboose/schema.rb +72 -73
  127. data/app/models/caboose/site.rb +1 -203
  128. data/app/models/caboose/theme.rb +5 -70
  129. data/app/views/caboose/admin/_content.html.erb +44 -0
  130. data/app/views/caboose/admin/_fonts.html.erb +47 -0
  131. data/app/views/caboose/admin/_footer.html.erb +1 -0
  132. data/app/views/caboose/admin/_header.html.erb +12 -0
  133. data/app/views/caboose/admin/_icons.html.erb +6 -0
  134. data/app/views/caboose/admin/_mobile_navigation.html.erb +22 -0
  135. data/app/views/caboose/admin/_post.html.erb +74 -0
  136. data/app/views/caboose/admin/index.html.erb +33 -36
  137. data/app/views/caboose/block_types/admin_edit.html.erb +8 -6
  138. data/app/views/caboose/blocks/_file.html.erb +2 -2
  139. data/app/views/caboose/blocks/_ga.html.erb +2 -1
  140. data/app/views/caboose/blocks/_image.html.erb +0 -4
  141. data/app/views/caboose/blocks/_render_function.html.erb +4 -9
  142. data/app/views/caboose/fonts/admin_index.html.erb +10 -55
  143. data/app/views/caboose/invoices_mailer/customer_status_updated.html.erb +14 -5
  144. data/app/views/caboose/login_logs/admin_index_for_user.html.erb +1 -1
  145. data/app/views/caboose/media/admin_index.html.erb +24 -14
  146. data/app/views/caboose/my_account/index.html.erb +0 -1
  147. data/app/views/caboose/pages/_admin_header.html.erb +0 -5
  148. data/app/views/caboose/pages/admin_edit_content.html.erb +2 -6
  149. data/app/views/caboose/pages/admin_edit_general.html.erb +4 -32
  150. data/app/views/caboose/pages/admin_new_old.html.erb +46 -0
  151. data/app/views/caboose/pages/test.html.erb +64 -0
  152. data/app/views/caboose/posts/_admin_header.html.erb +0 -5
  153. data/app/views/caboose/posts/admin_delete_form.html.erb +1 -1
  154. data/app/views/caboose/posts/admin_edit_content.html.erb +2 -6
  155. data/app/views/caboose/products/admin_group_variants.html.erb +1 -1
  156. data/app/views/caboose/products/admin_sort.html copy.erb +1 -1
  157. data/app/views/caboose/sites/admin_edit.html.erb +0 -21
  158. data/app/views/caboose/themes/admin_edit.html.erb +3 -7
  159. data/app/views/caboose/users/_admin_header.html.erb +0 -4
  160. data/app/views/caboose/users/admin_edit_roles.html.erb +0 -1
  161. data/app/views/caboose/variants/admin_group.html.erb +1 -1
  162. data/app/views/layouts/caboose/admin.html.erb +2 -9
  163. data/app/views/layouts/caboose/application.html.erb +92 -62
  164. data/config/routes.rb +1 -4
  165. data/lib/caboose/version.rb +1 -1
  166. data/lib/tasks/caboose.rake +14 -3
  167. metadata +238 -57
  168. data/app/controllers/caboose/change_logs_controller.rb +0 -13
  169. data/app/models/caboose/change_log.rb +0 -97
  170. data/app/views/caboose/blocks/_cached_block.html.erb +0 -28
  171. data/app/views/caboose/change_logs/admin_index.html.erb +0 -65
  172. data/app/views/caboose/fonts/admin_family_edit.html.erb +0 -63
  173. data/app/views/caboose/fonts/admin_family_index.html.erb +0 -42
  174. data/app/views/caboose/fonts/admin_variant_edit.html.erb +0 -84
  175. data/app/views/caboose/pages/admin_change_logs.html.erb +0 -56
  176. data/app/views/caboose/pages/compiled_asset.css.erb +0 -0
  177. data/app/views/caboose/pages/compiled_asset.js.erb +0 -0
  178. data/app/views/caboose/posts/admin_change_logs.html.erb +0 -56
  179. data/app/views/caboose/sites/compiled_asset.css.erb +0 -0
  180. data/app/views/caboose/sites/compiled_asset.js.erb +0 -0
  181. data/app/views/caboose/themes/admin_error_log.html.erb +0 -9
  182. data/app/views/caboose/themes/admin_js.html.erb +0 -131
  183. data/app/views/caboose/users/admin_change_logs.html.erb +0 -63
  184. data/app/views/layouts/caboose/css.css.erb +0 -44
  185. data/app/views/layouts/caboose/footer_css.css.erb +0 -41
  186. data/app/views/layouts/caboose/footer_js.js.erb +0 -31
  187. data/app/views/layouts/caboose/js.js.erb +0 -34
@@ -1,56 +0,0 @@
1
- <%= render :partial => 'caboose/posts/admin_header' %>
2
-
3
- <div style="padding-right:30px;">
4
- <table cellpadding="0" cellspacing="0">
5
- <thead>
6
- <tr>
7
- <th>User</th>
8
- <th>Date</th>
9
- <th>Action</th>
10
- <th>Field</th>
11
- <th>Old Value</th>
12
- <th>New Value</th>
13
- </tr>
14
- </thead>
15
- <% @logs.each do |log| %>
16
- <tr>
17
- <td><%= log.user.username %></td>
18
- <td><%= log.timestamp.in_time_zone('Central Time (US & Canada)').strftime('%-m/%-d/%y, %l:%M%P') %></td>
19
- <td><%= log.describe_action %></td>
20
- <td><%= log.description %></td>
21
- <td><%== !log.describe_old.blank? && log.describe_old.include?('</') ? "<pre>" : "" %><%= log.describe_old %><%== !log.describe_old.blank? && log.describe_old.include?('</') ? "</pre>" : "" %></td>
22
- <td><%== !log.describe_new.blank? && log.describe_new.include?('</') ? "<pre>" : "" %><%= log.describe_new %><%== !log.describe_new.blank? && log.describe_new.include?('</') ? "</pre>" : "" %></td>
23
- </tr>
24
- <% end %>
25
- </table>
26
- </div>
27
-
28
-
29
- <% content_for :caboose_css do %>
30
- <style>
31
- table {
32
- width: 100%;
33
- }
34
- table tr {
35
-
36
- }
37
- table td, table th {
38
- font-family: "Roboto";
39
- font-weight: 300;
40
- font-size: 13px;
41
- padding: 6px 8px 6px 4px;
42
- text-align: left;
43
- max-width: 200px;
44
- border-bottom: 1px solid #eaeaea;
45
- }
46
- td pre {
47
- overflow: hidden;
48
- white-space: pre-line;
49
- font-size: 12px;
50
- font-family: monospace;
51
- }
52
- table th {
53
- font-weight: bold;
54
- }
55
- </style>
56
- <% end %>
@@ -1,9 +0,0 @@
1
- <h1>Error Log</h1>
2
-
3
- <a href="#" onclick="window.history.back();return false;" class="caboose-btn">Back</a>
4
-
5
- <% if !@theme.sass_error.blank? %>
6
- <div class="error" style="font-size:13px;line-height:18px;font-family:monospace;margin-top:10px;">
7
- <%== @theme.sass_error.gsub("\n","<br />") %>
8
- </div>
9
- <% end %>
@@ -1,131 +0,0 @@
1
-
2
- <h1 id='page_title'>Edit Site Javascript</h1>
3
-
4
-
5
- <div class="editor-wrapper">
6
-
7
- <div class="holder">
8
- <div class="clearfix buttons">
9
- <p class="warning">WARNING: This code will apply to the entire website. Edit with caution.</p>
10
- <a href="/admin/theme" class="caboose-btn">Back</a>
11
- <a href="#" onclick="save();return false;" class="caboose-btn green">Save</a>
12
- <span id="modified">Modified</span>
13
- <div id="message"></div>
14
- <p id="tips">
15
- <span>Command+S = Save</span>
16
- </p>
17
- </div>
18
- <div id="editor"><%= @theme.main_js %></div>
19
- </div>
20
-
21
- </div>
22
-
23
- <% content_for :caboose_css do %>
24
- <style>
25
- p.warning {
26
- color: #d43030;
27
- font-size: 14px;
28
- font-weight: bold;
29
- margin: 0 0 8px 0;
30
- }
31
- p#tips {
32
- display: inline-block;
33
- float: right;
34
- font-size: 13px;
35
- color: gray;
36
- margin: 0;
37
- padding-top: 15px;
38
- padding-right: 2px;
39
- }
40
- p#tips span {
41
- display: inline-block;
42
- margin-left: 12px;
43
- }
44
- span#modified {
45
- font-size: 13px;
46
- color: gray;
47
- margin: 0 10px;
48
- opacity: 0;
49
- transition: opacity 100ms ease;
50
- }
51
- .buttons {
52
- margin-bottom: 10px;
53
- }
54
- .buttons .caboose-btn {
55
- margin-right: 5px;
56
- }
57
- .editor-wrapper {
58
-
59
- padding-right: 30px;
60
- }
61
-
62
- .holder {
63
-
64
- }
65
- #editor {
66
- height: 800px;
67
- width: 100%;
68
- opacity: 0;
69
- }
70
- #editor.ace_editor {
71
- opacity: 1;
72
- }
73
- #message {
74
- display: inline-block;
75
- }
76
- #message p.note {
77
- padding: 1px 15px 2px 15px;
78
- font-size: 15px;
79
- line-height: 30px;
80
- border-radius: 5px;
81
- }
82
- #message p.note.loading {
83
- padding-left: 40px;
84
- }
85
- </style>
86
- <% end %>
87
-
88
- <% content_for :caboose_js do %>
89
- <%= javascript_include_tag 'https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.1/ace.js' %>
90
- <script>
91
- var editor = ace.edit("editor");
92
- editor.setTheme("ace/theme/monokai");
93
- editor.session.setMode("ace/mode/javascript");
94
- editor.session.setOptions({
95
- tabSize: 2
96
- });
97
-
98
- editor.on("change", function() {
99
- $("span#modified").css('opacity',1);
100
- });
101
-
102
- editor.commands.addCommand({
103
- name: 'save',
104
- bindKey: {win: "Ctrl-S", "mac": "Cmd-S"},
105
- exec: function(editor) { save(); }
106
- });
107
-
108
- function save() {
109
- $('#message').html("<p class='note loading'>Saving code...</p>").fadeIn();
110
- $.ajax({
111
- url: '/admin/theme/js',
112
- type: 'put',
113
- data: {
114
- code: editor.getValue()
115
- },
116
- success: function(resp) {
117
- if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>").fadeIn();
118
- if (resp.success) {
119
- $("span#modified").css('opacity',0);
120
- $('#message').html("<p class='note success'>JS saved!</p>").fadeIn().delay(2000).fadeOut();
121
- }
122
- }
123
- });
124
- }
125
-
126
- </script>
127
- <% end %>
128
-
129
- <br style='clear: left; line-height: 0;' />
130
-
131
-
@@ -1,63 +0,0 @@
1
- <%= render :partial => 'caboose/users/admin_header' %>
2
-
3
- <div style="padding-right:30px;">
4
- <table cellpadding="0" cellspacing="0">
5
- <thead>
6
- <tr>
7
- <th>Resource</th>
8
- <th>Title</th>
9
- <th>Date</th>
10
- <th>Action</th>
11
- <th>Field</th>
12
- <th>Old Value</th>
13
- <th>New Value</th>
14
- </tr>
15
- </thead>
16
- <% @logs.each do |log| %>
17
- <%
18
- res = log.page_id ? Caboose::Page.where(:id => log.page_id).first : (log.post_id ? Caboose::Post.where(:id => log.post_id).first : (log.media_id ? Caboose::Media.where(:id => log.media_id).first : nil))
19
- res_type = log.page_id ? "Page" : (log.post_id ? "Post" : (log.description.include?('Media Category') && log.media_id ? ('Media Category') : (log.media_id ? "Media" : nil)))
20
- res_title = res ? (log.page_id ? res.title : (log.post_id ? res.title : (log.description.include?('Media Category') && log.media_id ? (log.description.gsub('Media Category: ','')) : (log.media_id ? Caboose::Media.title_for_id(res.id) : "N/A")))) : log.description.gsub("Media Category: ","")
21
- %>
22
- <tr>
23
- <td><%= res_type %></td>
24
- <td><%= res_title %></td>
25
- <td><%= log.timestamp.in_time_zone('Central Time (US & Canada)').strftime('%-m/%-d/%y, %l:%M%P') %></td>
26
- <td><%= log.describe_action %></td>
27
- <td><%= log.description.blank? ? '' : log.description.gsub("Media Category: ",'') %></td>
28
- <td><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_old.blank? && log.describe_old.include?('</')) ? "<pre>" : "" %><%= log.describe_old %><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_old.blank? && log.describe_old.include?('</')) ? "</pre>" : "" %></td>
29
- <td><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_new.blank? && log.describe_new.include?('</')) ? "<pre>" : "" %><%= log.describe_new %><%== (!log.description.blank? && log.description.include?('Custom Css') || log.description.include?('Custom Js')) || (!log.describe_new.blank? && log.describe_new.include?('</')) ? "</pre>" : "" %></td>
30
- </tr>
31
- <% end %>
32
- </table>
33
- </div>
34
-
35
-
36
- <% content_for :caboose_css do %>
37
- <style>
38
- table {
39
- width: 100%;
40
- }
41
- table tr {
42
-
43
- }
44
- table td, table th {
45
- font-family: "Roboto";
46
- font-weight: 300;
47
- font-size: 13px;
48
- padding: 6px 8px 6px 4px;
49
- text-align: left;
50
- max-width: 200px;
51
- border-bottom: 1px solid #eaeaea;
52
- }
53
- td pre {
54
- overflow: hidden;
55
- white-space: pre-line;
56
- font-size: 12px;
57
- font-family: monospace;
58
- }
59
- table th {
60
- font-weight: bold;
61
- }
62
- </style>
63
- <% end %>
@@ -1,44 +0,0 @@
1
- <% if @page.custom_css && !@page.custom_css.blank? %>
2
- <%== @page.custom_css %>
3
- <% end %>
4
- <%
5
- css = ''
6
- css << raw(@post ? @post.cached_css : @page.cached_css) if @site.use_caching
7
- if !css.blank?
8
- css = css.gsub('<style>','')
9
- css = css.gsub('</style>','')
10
- links = css.scan(/@import(\s)*url\(('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")\);/).flatten
11
- links2 = css.scan(/<link href=('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\/>/).flatten
12
- css_files = []
13
- if links && links.length > 0
14
- links.to_a.each do |link|
15
- if !link.blank? && link.include?('.css') && !link.include?('@import')
16
- if !css_files.include?(link)
17
- css_files << link
18
- end
19
- end
20
- end
21
- end
22
- if links2 && links2.length > 0
23
- links2.to_a.each do |link|
24
- if !link.blank? && link.include?('.css') && !link.include?('media')
25
- if !css_files.include?(link)
26
- css_files << link
27
- end
28
- end
29
- end
30
- end
31
- str = @page.custom_css_files.blank? ? '' : @page.custom_css_files
32
- css_files.each do |csf|
33
- str += "\n" if !str.blank? && !str.include?(csf)
34
- str += "#{csf}" if !str.include?(csf)
35
- end
36
- @page.custom_css_files = str
37
- @page.save
38
- if !css.blank?
39
- css = css.gsub(/@import(\s)*url\(('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")\);/,'')
40
- css = css.gsub(/<link href=('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\/>/,'')
41
- end
42
- %>
43
- <%== css %>
44
- <% end %>
@@ -1,41 +0,0 @@
1
- <%
2
- css = ''
3
- css << raw(@site.cached_footer_css) if @site.use_caching
4
- if !css.blank?
5
- css = css.gsub('<style>','')
6
- css = css.gsub('</style>','')
7
- links = css.scan(/@import(\s)*url\(('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")\);/).flatten
8
- links2 = css.scan(/<link href=('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9?@="'\/]*)\/>/).flatten
9
- css_files = []
10
- if links && links.length > 0
11
- links.to_a.each do |link|
12
- if !link.blank? && link.include?('.css') && !link.include?('@import')
13
- if !css_files.include?(link)
14
- css_files << link
15
- end
16
- end
17
- end
18
- end
19
- if links2 && links2.length > 0
20
- links2.to_a.each do |link|
21
- if !link.blank? && link.include?('.css') && !link.include?('media')
22
- if !css_files.include?(link)
23
- css_files << link
24
- end
25
- end
26
- end
27
- end
28
- str = @site.custom_css_files.blank? ? '' : @site.custom_css_files
29
- css_files.each do |csf|
30
- str += "\n" if !str.blank? && !str.include?(csf)
31
- str += "#{csf}" if !str.include?(csf)
32
- end
33
- @site.custom_css_files = str
34
- @site.save
35
- if !css.blank?
36
- css = css.gsub(/@import(\s)*url\(('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")\);/,'')
37
- css = css.gsub(/<link href=('|")(http(s)?:)?(\/\/[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\/>/,'')
38
- end
39
- %>
40
- <%== css %>
41
- <% end %>
@@ -1,31 +0,0 @@
1
- <%
2
- js = ''
3
- js << raw(@site.cached_footer_js) if @site.use_caching
4
- if !js.blank?
5
- links = js.scan(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\><\/script>/).flatten
6
- js_files = []
7
- if links && links.length > 0
8
- links.to_a.each do |link|
9
- if !link.blank? && link.include?('.js')
10
- if !js_files.include?(link)
11
- js_files << link
12
- end
13
- end
14
- end
15
- end
16
- str = @site.custom_js_files.blank? ? '' : @site.custom_js_files
17
- js_files.each do |csf|
18
- str += "\n" if !str.blank? && !str.include?(csf)
19
- str += "#{csf}" if !str.include?(csf)
20
- end
21
- @site.custom_js_files = str
22
- @site.save
23
- if !js.blank?
24
- js = js.gsub(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\><\/script>/,'')
25
- js = js.gsub(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\>/,'')
26
- js = js.gsub('<script>','')
27
- js = js.gsub('</script>','')
28
- end
29
- %>
30
- <%== js %>
31
- <% end %>
@@ -1,34 +0,0 @@
1
- <% if @page.custom_js && !@page.custom_js.blank? %>
2
- <%== @page.custom_js %>
3
- <% end %>
4
- <%
5
- js = ''
6
- js << raw(@post ? @post.cached_js : @page.cached_js) if @site.use_caching
7
- if !js.blank?
8
- links = js.scan(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\><\/script>/).flatten
9
- js_files = []
10
- if links && links.length > 0
11
- links.to_a.each do |link|
12
- if !link.blank? && link.include?('.js')
13
- if !js_files.include?(link)
14
- js_files << link
15
- end
16
- end
17
- end
18
- end
19
- str = @page.custom_js_files.blank? ? '' : @page.custom_js_files
20
- js_files.each do |csf|
21
- str += "\n" if !str.blank? && !str.include?(csf)
22
- str += "#{csf}" if !str.include?(csf)
23
- end
24
- @page.custom_js_files = str
25
- @page.save
26
- if !js.blank?
27
- js = js.gsub(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\><\/script>/,'')
28
- js = js.gsub(/<script src=('|")(http(s)?:)?(\/{1,2}[A-z 0-9?=@._\-\/]*)('|")([A-z 0-9@?="'\/]*)\>/,'')
29
- js = js.gsub('<script>','')
30
- js = js.gsub('</script>','')
31
- end
32
- %>
33
- <%== js %>
34
- <% end %>