thredded_create_app 0.1.20 → 0.1.21

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: 58df12ef08d081b4c78d0c95e38d426018be837f
4
- data.tar.gz: 6135482b370814c1688992c2b0c167b9a182b334
3
+ metadata.gz: f3781d88ef7fa272c8f7c4e534978ac43ac8123b
4
+ data.tar.gz: 29aa6258e78cd211d52bf3589aebf09f276f1632
5
5
  SHA512:
6
- metadata.gz: 9b60d13f38d59c351602e85abc180d0287e89c8630630c655cbe22ad6f685a935c51d589c2a9f7b89a82e4a6669f269c33e8008f76df419c069dce530fb0c616
7
- data.tar.gz: 4f1982ae32e859e929491894aeecb2f1778eb0eed94a4f264cfd5014fd67bddc3475e24e1c78f70b4f282003060d2cc0a1095e47c556296d5947b382773021aa
6
+ metadata.gz: 05fe3a2f93a6ef740ac94d196cea7fd6668564ef68f22f34b9d4e40f023733cbed62e2b816a98589dcd197515e83c503bdb952ce67de87f81e10d44a67765f3e
7
+ data.tar.gz: c91ff781d8b83c803b4b7c6a5ceb93a53d6f3501d95d44ebd1ac4961a7b413c3d4661933f693ddae65a726ef5c99282c597a462981766a905e332c4734f3d1f6
@@ -9,7 +9,6 @@ require 'thredded_create_app/tasks/add_simple_form'
9
9
  require 'thredded_create_app/tasks/add_devise'
10
10
  require 'thredded_create_app/tasks/add_roadie'
11
11
  require 'thredded_create_app/tasks/add_rails_email_preview'
12
- require 'thredded_create_app/tasks/add_jquery'
13
12
  require 'thredded_create_app/tasks/add_thredded'
14
13
  require 'thredded_create_app/tasks/add_display_name_to_users'
15
14
  require 'thredded_create_app/tasks/setup_database'
@@ -70,7 +69,6 @@ module ThreddedCreateApp
70
69
  Tasks::AddDevise,
71
70
  Tasks::AddRailsEmailPreview,
72
71
  Tasks::AddRoadie,
73
- Tasks::AddJquery,
74
72
  Tasks::AddThredded,
75
73
  Tasks::AddDisplayNameToUsers,
76
74
  Tasks::SetupAppSkeleton,
@@ -71,8 +71,6 @@ module ThreddedCreateApp
71
71
  def add_thredded_javascripts
72
72
  copy 'add_thredded/myapp_thredded.js',
73
73
  "app/assets/javascripts/#{app_name}_thredded.js"
74
- copy 'add_thredded/javascripts/thredded/dependencies/ujs.js',
75
- 'app/assets/javascripts/thredded/dependencies/ujs.js'
76
74
  end
77
75
 
78
76
  def add_admin_column_to_users
@@ -2,7 +2,8 @@
2
2
  <% is_thredded = content_for?(:thredded_page_id) %>
3
3
  <%= content_tag :div,
4
4
  class: 'app-container',
5
- id: ('app-page-container' unless is_thredded) do %>
5
+ id: ('app-page-container' unless is_thredded),
6
+ 'data-locale' => I18n.locale do %>
6
7
  <%= render 'shared/header' %>
7
8
  <%= render 'shared/flash_messages' unless is_thredded %>
8
9
  <div class="app-content-container"><%= yield %></div>
@@ -1,10 +1,13 @@
1
1
  window.App.onPageLoad(function () {
2
- jQuery('.app-nav-theme li button').click(function(evt) {
3
- var expiresAt = new Date();
4
- expiresAt.setMonth(expiresAt.getMonth() + 12);
5
- document.cookie = 'app-theme=' + $(this.parentNode).data('theme') +
6
- ';expires=' + expiresAt + ';path=/';
7
- document.location.reload();
2
+ Array.prototype.forEach.call(document.querySelectorAll('.app-nav-theme li button'), function(button) {
3
+ button.addEventListener('click', function(evt) {
4
+ var expiresAt = new Date();
5
+ expiresAt.setMonth(expiresAt.getMonth() + 12);
6
+ document.cookie = 'app-theme=' +
7
+ evt.currentTarget.parentNode.getAttribute('data-theme') +
8
+ ';expires=' + expiresAt + ';path=/';
9
+ document.location.reload();
10
+ });
8
11
  });
9
12
  });
10
13
 
@@ -1,13 +1,16 @@
1
- //= require jquery.timeago
2
- (function () {
3
- if (!this.App.isAppPage()) {
4
- return;
5
- }
6
- var COMPONENT_SELECTOR = '[data-time-ago]';
7
- this.App.onPageLoad(function () {
8
- const allowFutureWas = jQuery.timeago.settings.allowFuture;
9
- jQuery.timeago.settings.allowFuture = true;
10
- jQuery(COMPONENT_SELECTOR).timeago();
11
- jQuery.timeago.settings.allowFuture = allowFutureWas;
1
+ //= require timeago
2
+ (function() {
3
+ window.App.onPageLoad(function() {
4
+ if (!window.App.isAppPage()) {
5
+ return;
6
+ }
7
+ var COMPONENT_SELECTOR = '[data-time-ago]';
8
+ window.timeago().render(
9
+ document.querySelectorAll(COMPONENT_SELECTOR),
10
+ document.querySelector('#app-page-container')
11
+ .getAttribute('data-locale'));
12
12
  });
13
- }).call(this);
13
+ document.addEventListener('turbolinks:before-cache', function() {
14
+ timeago.cancel();
15
+ });
16
+ })();
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ThreddedCreateApp
4
- VERSION = '0.1.20'
4
+ VERSION = '0.1.21'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thredded_create_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor
@@ -138,7 +138,6 @@ files:
138
138
  - lib/thredded_create_app/tasks/add_thredded.rb
139
139
  - lib/thredded_create_app/tasks/add_thredded/_thredded-custom.scss
140
140
  - lib/thredded_create_app/tasks/add_thredded/_thredded-variables.scss
141
- - lib/thredded_create_app/tasks/add_thredded/javascripts/thredded/dependencies/ujs.js
142
141
  - lib/thredded_create_app/tasks/add_thredded/myapp_thredded.js
143
142
  - lib/thredded_create_app/tasks/add_thredded/spec/features/thredded_spec.rb
144
143
  - lib/thredded_create_app/tasks/add_thredded/thredded.en.yml