thredded-workgroup 0.2.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +23 -6
- data/.rubocop_todo.yml +392 -0
- data/.travis.yml +20 -28
- data/CHANGELOG.md +18 -0
- data/Gemfile +1 -0
- data/Guardfile +17 -40
- data/README.md +27 -10
- data/RELEASE_CHECKLIST.md +1 -2
- data/Rakefile +5 -0
- data/app/assets/config/thredded_workgroup_manifest.js +3 -0
- data/app/assets/images/thredded/workgroup/envelope-o.svg +2 -0
- data/app/assets/images/thredded/workgroup/envelope-open-o.svg +2 -0
- data/app/assets/javascripts/thredded/workgroup/components/followers.es6 +24 -0
- data/app/assets/javascripts/thredded/workgroup/components/overflow.es6 +60 -0
- data/app/assets/javascripts/thredded/workgroup/components/topics.es6 +151 -0
- data/app/assets/javascripts/thredded/workgroup/core/thredded_workgroup.js +1 -0
- data/app/assets/javascripts/thredded/workgroup/core/touch.es6 +16 -0
- data/app/assets/javascripts/thredded/workgroup/index.js +3 -0
- data/app/assets/javascripts/thredded-workgroup.js +1 -13
- data/app/assets/stylesheets/thredded/workgroup/_followers.scss +51 -0
- data/app/assets/stylesheets/thredded/workgroup/_navs.scss +29 -7
- data/app/assets/stylesheets/thredded/workgroup/_overflow.scss +71 -0
- data/app/assets/stylesheets/thredded/workgroup/_topics.scss +186 -16
- data/app/assets/stylesheets/thredded-workgroup.scss +2 -0
- data/app/controllers/concerns/thredded/workgroup/all_unread_followed_topics.rb +35 -0
- data/app/controllers/thredded/application_controller.rb +23 -0
- data/app/controllers/thredded/posts_controller.rb +3 -2
- data/app/controllers/thredded/workgroup/application_controller.rb +1 -0
- data/app/controllers/thredded/workgroup/navs_controller.rb +1 -0
- data/app/controllers/thredded/workgroup/read_states_controller.rb +14 -0
- data/app/controllers/thredded/workgroup/topics_controller.rb +18 -0
- data/app/helpers/thredded/application_helper.rb +1 -0
- data/app/helpers/thredded/workgroup/application_helper.rb +1 -0
- data/app/jobs/thredded/workgroup/mark_all_topics_read_job.rb +13 -0
- data/app/view_hooks/thredded/all_view_hooks.rb +9 -0
- data/app/view_hooks/thredded/workgroup/view_hooks.rb +28 -0
- data/app/view_models/thredded/topic_view.rb +17 -0
- data/app/view_models/thredded/topics_page_view.rb +1 -0
- data/app/views/thredded/shared/nav/_unread_topics.html.erb +1 -0
- data/app/views/thredded/topics/_followers.html.erb +23 -0
- data/app/views/thredded/topics/_topic.html.erb +25 -28
- data/app/views/thredded/workgroup/navs/_personal_nav.html.erb +7 -1
- data/app/views/thredded/workgroup/navs/all_topics.html.erb +1 -1
- data/app/views/thredded/workgroup/navs/awaiting.html.erb +1 -1
- data/app/views/thredded/workgroup/navs/following.html.erb +1 -1
- data/app/views/thredded/workgroup/navs/unread.html.erb +1 -1
- data/app/views/thredded/workgroup/topics/_controls.html.erb +21 -0
- data/app/views/thredded/workgroup/topics/_last_post.html.erb +11 -0
- data/app/views/thredded/workgroup/topics/_last_post_with_controls.html.erb +12 -0
- data/app/views/thredded/workgroup/topics/_topics_with_last_post.html.erb +16 -0
- data/bin/rails.rb +1 -0
- data/bin/rspec +1 -0
- data/bin/update_from_thredded +2 -1
- data/config/locales/en.yml +11 -0
- data/config/routes.rb +9 -0
- data/docs/followers-above-post.png +0 -0
- data/docs/navbar.png +0 -0
- data/lib/thredded/workgroup/engine.rb +11 -2
- data/lib/thredded/workgroup/thredded_route_delegator.rb +1 -0
- data/lib/thredded/workgroup/version.rb +2 -1
- data/lib/thredded/workgroup.rb +1 -0
- data/shared.gemfile +23 -16
- data/thredded-workgroup.gemspec +14 -18
- metadata +83 -88
- data/app/assets/javascripts/thredded/workgroup/follow.js +0 -36
- data/app/assets/javascripts/thredded/workgroup/topics.js +0 -18
- data/app/views/thredded/topics/_topics_with_last_post.html.erb +0 -14
data/README.md
CHANGED
@@ -1,22 +1,25 @@
|
|
1
1
|
# Thredded::Workgroup
|
2
2
|
|
3
|
-
Extension to [Thredded](http://github.com/thredded/thredded) with features useful to workgroup messaging
|
4
|
-
|
5
|
-
|
3
|
+
Extension to [Thredded](http://github.com/thredded/thredded) with features useful to workgroup messaging.
|
4
|
+
|
5
|
+
The point of Thredded-workgroup is to enable migration of workgroup communication from non-shared email to shared opt-in communications -- everyone can see any of the workgroup communications.
|
6
|
+
|
6
7
|
originated in https://github.com/thredded/thredded/issues/347
|
7
8
|
|
8
9
|
Out the box enables a homepage with a top-level nav menu consisting of:
|
9
10
|
|
10
11
|
* Unread: a list of unread topics (ordered by last post) across all messageboards
|
11
|
-
* Following: a list of followed topics (ordered by last post) across all messageboards
|
12
12
|
* Awaiting reply: a list of all topics you follow where yours is the last post
|
13
|
-
*
|
14
|
-
* All
|
15
|
-
|
16
|
-
It adds a navbar like this:
|
13
|
+
* Following: a list of followed topics (ordered by last post) across all messageboards
|
14
|
+
* All: a list of all topics (ordered by last post) across all messageboards
|
15
|
+
* Messageboards: a list of messageboards (as Thredded's normal home page)
|
17
16
|
|
18
|
-
|
17
|
+
![Screenshot of navbar](docs/navbar.png)
|
19
18
|
|
19
|
+
It also shows you the followers of the current topic before you post, and allows you to remove unneeded followers. (The logic for this is that (unlike a social forum) you need to broadcast as little as possible (because the aim is to reduce unnecessary noise, because people can find messages they need to). When you are adding to a topic it may become less relevant to existing followers. The person adding the message is able to adjust followers,
|
20
|
+
like you might adjust the cc-list of conversation).
|
21
|
+
|
22
|
+
![Screenshot of post form](docs/followers-above-post.png)
|
20
23
|
|
21
24
|
## Installation
|
22
25
|
|
@@ -73,6 +76,19 @@ Include thredded JavaScripts in your `application.js`:
|
|
73
76
|
//= require thredded-workgroup
|
74
77
|
```
|
75
78
|
|
79
|
+
### Configuration
|
80
|
+
|
81
|
+
**Reveal on hover?** The last topic shown in the thredded workflow top level pages is by default condensed when too long and revealed by click. You can also have it reveal on hover. This requires adding a data attribute in the layout (e.g. the body, or another high container element), as <div data-thredded-condensable-hover="reveal">. You can preview this behaviour in the demo, by adding `?hover=reveal` to the url.
|
82
|
+
|
83
|
+
### View hooks
|
84
|
+
|
85
|
+
Thredded::Workgroup augments Thredded with some extra view hooks (see https://github.com/thredded/thredded/#view-hooks) for customization.
|
86
|
+
|
87
|
+
To see the extra view hooks provided by Thredded::Workgroup (with their arguments), run:
|
88
|
+
|
89
|
+
```bash
|
90
|
+
grep view_hooks -R --include '*.html.erb' "$(bundle show thredded-workgroup)"
|
91
|
+
```
|
76
92
|
## Master vs Released versions
|
77
93
|
|
78
94
|
NB: if you are using the master version rather than a release version
|
@@ -104,8 +120,9 @@ bundle exec rake db:create db:migrate db:seed
|
|
104
120
|
Run the server
|
105
121
|
|
106
122
|
```
|
107
|
-
|
123
|
+
guard
|
108
124
|
```
|
125
|
+
(you can alternatively run `dummy-rails s -p 3012` but guard runs livereload for you too, which makes development much more pleasant)
|
109
126
|
|
110
127
|
### Updating when thredded changes
|
111
128
|
|
data/RELEASE_CHECKLIST.md
CHANGED
@@ -2,7 +2,6 @@ The checklist for releasing a new version of Thredded.
|
|
2
2
|
|
3
3
|
Pre-requisites for the releaser:
|
4
4
|
|
5
|
-
* The [gem-release gem](https://github.com/svenfuchs/gem-release): `gem install gem-release`.
|
6
5
|
* Push access to RubyGems.
|
7
6
|
|
8
7
|
Release checklist:
|
@@ -14,6 +13,6 @@ Release checklist:
|
|
14
13
|
- [ ] Tag the release and push it to rubygems:
|
15
14
|
|
16
15
|
```bash
|
17
|
-
|
16
|
+
rake release
|
18
17
|
```
|
19
18
|
- [ ] Copy the release notes from the changelog to [GitHub Releases](https://github.com/thredded/thredded/releases).
|
data/Rakefile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
begin
|
3
4
|
require "bundler/setup"
|
4
5
|
require "bundler/gem_tasks"
|
@@ -14,6 +15,10 @@ rescue LoadError
|
|
14
15
|
RDoc::Task = Rake::RDocTask
|
15
16
|
end
|
16
17
|
|
18
|
+
|
19
|
+
require "webdrivers"
|
20
|
+
load "webdrivers/Rakefile"
|
21
|
+
|
17
22
|
RDoc::Task.new(:rdoc) do |rdoc|
|
18
23
|
rdoc.rdoc_dir = "rdoc"
|
19
24
|
rdoc.title = "Thredded Workgroup"
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1664 1504v-768q-32 36-69 66-268 206-426 338-51 43-83 67t-86.5 48.5-102.5 24.5h-2q-48 0-102.5-24.5t-86.5-48.5-83-67q-158-132-426-338-37-30-69-66v768q0 13 9.5 22.5t22.5 9.5h1472q13 0 22.5-9.5t9.5-22.5zm0-1051v-24.5l-.5-13-3-12.5-5.5-9-9-7.5-14-2.5h-1472q-13 0-22.5 9.5t-9.5 22.5q0 168 147 284 193 152 401 317 6 5 35 29.5t46 37.5 44.5 31.5 50.5 27.5 43 9h2q20 0 43-9t50.5-27.5 44.5-31.5 46-37.5 35-29.5q208-165 401-317 54-43 100.5-115.5t46.5-131.5zm128-37v1088q0 66-47 113t-113 47h-1472q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1472q66 0 113 47t47 113z"/></svg>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1474 913l39 51q8 11 6.5 23.5t-11.5 20.5q-43 34-126.5 98.5t-146.5 113-67 51.5q-39 32-60 48t-60.5 41-76.5 36.5-74 11.5h-2q-37 0-74-11.5t-76-36.5-61-41.5-60-47.5q-5-4-65-50.5t-143.5-111-122.5-94.5q-11-8-12.5-20.5t6.5-23.5l37-52q8-11 21.5-13t24.5 7q94 73 306 236 5 4 43.5 35t60.5 46.5 56.5 32.5 58.5 17h2q24 0 58.5-17t56.5-32.5 60.5-46.5 43.5-35q258-198 313-242 11-8 24-6.5t21 12.5zm190 719v-928q-90-83-159-139-91-74-389-304-3-2-43-35t-61-48-56-32.5-59-17.5h-2q-24 0-59 17.5t-56 32.5-61 48-43 35q-215 166-315.5 245.5t-129.5 104-82 74.5q-14 12-21 19v928q0 13 9.5 22.5t22.5 9.5h1472q13 0 22.5-9.5t9.5-22.5zm128-928v928q0 66-47 113t-113 47h-1472q-66 0-113-47t-47-113v-928q0-56 41-94 123-114 350-290.5t233-181.5q36-30 59-47.5t61.5-42 76-36.5 74.5-12h2q37 0 74.5 12t76 36.5 61.5 42 59 47.5q43 36 156 122t226 177 201 173q41 38 41 94z"/></svg>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
(($) => {
|
2
|
+
function removeFollower($followerSelector) {
|
3
|
+
$followerSelector.remove();
|
4
|
+
}
|
5
|
+
|
6
|
+
function clickRemoveFollower(e) {
|
7
|
+
e.preventDefault();
|
8
|
+
e.stopPropagation();
|
9
|
+
var $this = $(this);
|
10
|
+
var $followerSelector = $this.closest('.thredded--follower');
|
11
|
+
var path = $this.data('kickPath');
|
12
|
+
$.ajax({
|
13
|
+
url: path, type: "POST", success: function (data) {
|
14
|
+
removeFollower($followerSelector);
|
15
|
+
}
|
16
|
+
});
|
17
|
+
}
|
18
|
+
|
19
|
+
const Thredded = window.Thredded;
|
20
|
+
|
21
|
+
Thredded.onPageLoad(() => {
|
22
|
+
$('.thredded--follower--remove').click(clickRemoveFollower);
|
23
|
+
});
|
24
|
+
})(jQuery);
|
@@ -0,0 +1,60 @@
|
|
1
|
+
(($) => {
|
2
|
+
|
3
|
+
const MAX_HEIGHT = 100; // $thredded-condensed-height
|
4
|
+
const MAX_SCROLL_HEIGHT = MAX_HEIGHT + 8; // why ?
|
5
|
+
const ThreddedWorkgroup = window.ThreddedWorkgroup;
|
6
|
+
|
7
|
+
function findOverflows() {
|
8
|
+
$('.thredded--condensable').each((i, elem) => {
|
9
|
+
let $elem = $(elem);
|
10
|
+
let sH = $elem.prop('scrollHeight');
|
11
|
+
if (sH > MAX_SCROLL_HEIGHT) {
|
12
|
+
// let h = $elem.height();
|
13
|
+
// let oH = $elem.prop('offsetHeight');;
|
14
|
+
// let overflow = sH - h;
|
15
|
+
// let id = $elem.closest(".thredded--topics--topic").attr("id");
|
16
|
+
// console.log({i, id, sH, h, oH, overflow});
|
17
|
+
$elem.addClass("thredded--condensable--overflowing");
|
18
|
+
$elem.find(".thredded--condensable--overflow-only").fadeIn()
|
19
|
+
}
|
20
|
+
});
|
21
|
+
}
|
22
|
+
|
23
|
+
function hoverOverflow() {
|
24
|
+
if (ThreddedWorkgroup.touching) {
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
let $elem = $(this);
|
28
|
+
if ($elem.hasClass('thredded--condensable--condensed')) {
|
29
|
+
$elem.addClass('thredded--condensable--hover');
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
function unhoverOverflow() {
|
34
|
+
let $elem = $(this);
|
35
|
+
$elem.removeClass('thredded--condensable--hover');
|
36
|
+
}
|
37
|
+
|
38
|
+
function clickOverflow(e) {
|
39
|
+
e.preventDefault();
|
40
|
+
// e.stopPropagation(); actually it needs to propagate to topics.es6
|
41
|
+
let $elem = $(this);
|
42
|
+
if ($elem.hasClass('thredded--condensable--hover')) {
|
43
|
+
$elem.removeClass('thredded--condensable--hover');
|
44
|
+
$elem.removeClass('thredded--condensable--condensed').addClass('thredded--condensable--expanded');
|
45
|
+
} else {
|
46
|
+
// touch only or already condensed, so clicking again
|
47
|
+
$elem.toggleClass('thredded--condensable--condensed').toggleClass('thredded--condensable--expanded');
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
const Thredded = window.Thredded;
|
52
|
+
|
53
|
+
Thredded.onPageLoad(() => {
|
54
|
+
findOverflows();
|
55
|
+
$('.thredded--condensable.thredded--condensable--overflowing')
|
56
|
+
.hover(hoverOverflow, unhoverOverflow)
|
57
|
+
.click(clickOverflow);
|
58
|
+
})
|
59
|
+
|
60
|
+
})(jQuery);
|
@@ -0,0 +1,151 @@
|
|
1
|
+
(($) => {
|
2
|
+
const ThreddedWorkgroup = window.ThreddedWorkgroup;
|
3
|
+
|
4
|
+
function updateFollowStatus($topic, followStatus) {
|
5
|
+
if (followStatus) {
|
6
|
+
$topic.removeClass('thredded--topic-notfollowing').addClass('thredded--topic-following')
|
7
|
+
} else {
|
8
|
+
$topic.removeClass('thredded--topic-following').addClass('thredded--topic-notfollowing')
|
9
|
+
}
|
10
|
+
};
|
11
|
+
|
12
|
+
function clickFollowToggle(e) {
|
13
|
+
e.preventDefault();
|
14
|
+
e.stopPropagation();
|
15
|
+
var $this = $(this);
|
16
|
+
var $topic = $this.parents('.thredded--topics--topic');
|
17
|
+
var following = $topic.hasClass('thredded--topic-following');
|
18
|
+
var topicId = $topic.data("topic");
|
19
|
+
var messageboardId = $topic.data("messageboard");
|
20
|
+
var rootPath = $('#thredded--container').data('thredded-root-url');
|
21
|
+
|
22
|
+
var path = "" + rootPath + messageboardId + "/" + topicId + "/" + (following ? 'unfollow.json' : 'follow.json');
|
23
|
+
// console.log("about to ajax: " + path);
|
24
|
+
$.ajax({
|
25
|
+
url: path, type: "POST", success: function (data) {
|
26
|
+
updateFollowStatus($topic, data["follow"])
|
27
|
+
}
|
28
|
+
});
|
29
|
+
}
|
30
|
+
|
31
|
+
function hoverTopicFollowToggle(){
|
32
|
+
if (ThreddedWorkgroup.touching) {
|
33
|
+
return;
|
34
|
+
}
|
35
|
+
console.log("i am trying to hover");
|
36
|
+
$(this).closest('.thredded--topics--topic').find('.js-thredded-follow-toggle').addClass("thredded--topic-hovering");
|
37
|
+
}
|
38
|
+
function unhoverTopicFollowToggle(){
|
39
|
+
$(this).closest('.thredded--topics--topic').find('.js-thredded-follow-toggle').removeClass("thredded--topic-hovering");
|
40
|
+
}
|
41
|
+
function hoverTopicTitle() {
|
42
|
+
if (ThreddedWorkgroup.touching) {
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
$(this).closest('.thredded--topics--topic').addClass("thredded--topic-hovering");
|
46
|
+
}
|
47
|
+
|
48
|
+
function unhoverTopicTitle() {
|
49
|
+
$(this).closest('.thredded--topics--topic').removeClass("thredded--topic-hovering");
|
50
|
+
}
|
51
|
+
|
52
|
+
function hoverTopic() {
|
53
|
+
if (ThreddedWorkgroup.touching) {
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
$(this).find('.thredded--topic-last-post-with-controls').addClass("thredded--topic-hovering");;
|
57
|
+
}
|
58
|
+
|
59
|
+
function revealControls($topic){
|
60
|
+
$topic
|
61
|
+
}
|
62
|
+
|
63
|
+
function toggleControlsOnTouch() {
|
64
|
+
if (ThreddedWorkgroup.touching) {
|
65
|
+
$(this).closest('.thredded--topics--topic').find('.thredded--topic-last-post-with-controls').toggleClass("thredded--topic-hovering");;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
function unhoverTopic() {
|
70
|
+
if (ThreddedWorkgroup.touching) {
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
$(this).find('.thredded--topic-last-post-with-controls').removeClass("thredded--topic-hovering");
|
74
|
+
}
|
75
|
+
|
76
|
+
function viewTopic(e) {
|
77
|
+
var $a = $(this).closest('.thredded--topics--topic').find("a.thredded--topic--view-button");
|
78
|
+
window.location.href = $a.attr('href');
|
79
|
+
e.preventDefault();
|
80
|
+
e.stopPropagation();
|
81
|
+
}
|
82
|
+
|
83
|
+
function hoverTopicReadToggle() {
|
84
|
+
if (ThreddedWorkgroup.touching) {
|
85
|
+
return;
|
86
|
+
}
|
87
|
+
$(this).closest('.thredded--topics--topic').find('.thredded--topic--read-state-toggle').addClass("thredded--topic-hovering");
|
88
|
+
}
|
89
|
+
|
90
|
+
function unhoverTopicReadToggle() {
|
91
|
+
$(this).closest('.thredded--topics--topic').find('.thredded--topic--read-state-toggle').removeClass("thredded--topic-hovering");
|
92
|
+
}
|
93
|
+
|
94
|
+
function updateReadStatus($topic, isRead) {
|
95
|
+
if (isRead) {
|
96
|
+
$topic.addClass("thredded--topic-read").removeClass("thredded--topic-unread");
|
97
|
+
} else {
|
98
|
+
$topic.addClass("thredded--topic-unread").removeClass("thredded--topic-read");
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
function readToggle() {
|
103
|
+
let $topic = $(this).closest('.thredded--topics--topic');
|
104
|
+
let path;
|
105
|
+
if ($topic.hasClass("thredded--topic-read")) {
|
106
|
+
path = $topic.find('a.thredded--topic--read-state-toggle.thredded--topic--mark-as-unread').data("postPath");
|
107
|
+
} else {
|
108
|
+
path = $topic.find('a.thredded--topic--read-state-toggle.thredded--topic--mark-as-read').data("postPath");
|
109
|
+
}
|
110
|
+
$.ajax({
|
111
|
+
url: path, type: "POST", success: function (data) {
|
112
|
+
updateReadStatus($topic, data["read"]);
|
113
|
+
}
|
114
|
+
});
|
115
|
+
}
|
116
|
+
|
117
|
+
function hoverHighlight() {
|
118
|
+
if (ThreddedWorkgroup.touching) {
|
119
|
+
return;
|
120
|
+
}
|
121
|
+
$(this).addClass('thredded--topic-hovering');
|
122
|
+
}
|
123
|
+
|
124
|
+
function unhoverHighlight() {
|
125
|
+
$(this).removeClass('thredded--topic-hovering');
|
126
|
+
}
|
127
|
+
|
128
|
+
const Thredded = window.Thredded;
|
129
|
+
|
130
|
+
Thredded.onPageLoad(() => {
|
131
|
+
console.log("I am load");
|
132
|
+
$('.js-thredded-follow-toggle')
|
133
|
+
.hover(hoverTopicFollowToggle, unhoverTopicFollowToggle)
|
134
|
+
.click(clickFollowToggle);
|
135
|
+
$('.thredded--topics--topic .thredded--topic-title')
|
136
|
+
.hover(hoverTopicTitle, unhoverTopicTitle)
|
137
|
+
.click(viewTopic);
|
138
|
+
$('.thredded--topic--read-state-toggle')
|
139
|
+
.hover(hoverTopicReadToggle, unhoverTopicReadToggle)
|
140
|
+
.click(readToggle);
|
141
|
+
$('.thredded--topics--topic')
|
142
|
+
.hover(hoverTopic, unhoverTopic)
|
143
|
+
$('.thredded--topics--topic thredded--topic--view-button')
|
144
|
+
.click(viewTopic);
|
145
|
+
$('.thredded--topic-last-post-with-controls')
|
146
|
+
.hover(hoverHighlight, unhoverHighlight)
|
147
|
+
.click(toggleControlsOnTouch);
|
148
|
+
});
|
149
|
+
|
150
|
+
})(jQuery);
|
151
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
window.ThreddedWorkgroup = window.ThreddedWorkgroup || {}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
(($) => {
|
2
|
+
const Thredded = window.Thredded;
|
3
|
+
const ThreddedWorkgroup = window.ThreddedWorkgroup;
|
4
|
+
|
5
|
+
Thredded.onPageLoad(() => {
|
6
|
+
ThreddedWorkgroup.touching = undefined;
|
7
|
+
$(document)
|
8
|
+
.on("touchstart", () => {
|
9
|
+
ThreddedWorkgroup.touching = true;
|
10
|
+
})
|
11
|
+
.on("touchend", () => {
|
12
|
+
// timeout to make sure it happens after any spurious hovers have happened
|
13
|
+
window.setTimeout(()=>{ ThreddedWorkgroup.touching = undefined; }, 200);
|
14
|
+
});
|
15
|
+
});
|
16
|
+
})(jQuery);
|
@@ -1,13 +1 @@
|
|
1
|
-
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree ./thredded/workgroup
|
1
|
+
//= require thredded/workgroup
|
@@ -0,0 +1,51 @@
|
|
1
|
+
.thredded--topic-header {
|
2
|
+
.thredded--topic-header--follow-info form {
|
3
|
+
position: static;
|
4
|
+
}
|
5
|
+
}
|
6
|
+
|
7
|
+
.thredded--topic-followers {
|
8
|
+
line-height: 1.75rem;
|
9
|
+
@include thredded--clearfix;
|
10
|
+
}
|
11
|
+
|
12
|
+
.thredded--follower {
|
13
|
+
background-color: #eeeeee;
|
14
|
+
border: 1px solid #eeeeee;
|
15
|
+
border-radius: 5px;
|
16
|
+
padding: 2px;
|
17
|
+
margin: 2px;
|
18
|
+
white-space: nowrap;
|
19
|
+
display: inline-block;
|
20
|
+
line-height: 1rem;
|
21
|
+
|
22
|
+
button {
|
23
|
+
color: rgba(0, 0, 0, 0.54);
|
24
|
+
background: inherit;
|
25
|
+
padding: 0;
|
26
|
+
border-style: none;
|
27
|
+
.thredded--topics--follow-icon,
|
28
|
+
.thredded--topics--unfollow-icon {
|
29
|
+
position: static;
|
30
|
+
opacity: 0.5;
|
31
|
+
height: 0.75rem;
|
32
|
+
width: 0.75rem;
|
33
|
+
}
|
34
|
+
|
35
|
+
& .thredded--topics--follow-icon,
|
36
|
+
&:hover .thredded--topics--unfollow-icon {
|
37
|
+
display: inline-block;
|
38
|
+
}
|
39
|
+
|
40
|
+
& .thredded--topics--unfollow-icon,
|
41
|
+
&:hover .thredded--topics--follow-icon {
|
42
|
+
display: none;
|
43
|
+
}
|
44
|
+
|
45
|
+
&:hover .thredded--topics--unfollow-icon {
|
46
|
+
opacity: 0.75;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
}
|
51
|
+
|
@@ -8,17 +8,33 @@ ul.thredded--workgroup {
|
|
8
8
|
padding-left: 0;
|
9
9
|
li {
|
10
10
|
display: inline-block;
|
11
|
-
margin-right: 1rem;
|
12
|
-
&.active {
|
13
|
-
font-weight: bold;
|
14
|
-
}
|
15
11
|
a {
|
16
12
|
display: inline-block;
|
17
|
-
color:
|
18
|
-
padding: 0.75rem 0;
|
13
|
+
color: $thredded-secondary-nav-color;
|
14
|
+
padding: 0.75rem 0.5rem;
|
15
|
+
@include thredded-media-tablet-and-up {
|
16
|
+
padding: 0.75rem 1rem;
|
17
|
+
}
|
18
|
+
@include thredded-media-desktop-and-up {
|
19
|
+
padding: 0.75rem 1.5rem;
|
20
|
+
}
|
19
21
|
text-decoration: none;
|
20
22
|
&:hover {
|
21
|
-
text-decoration:
|
23
|
+
text-decoration: none;
|
24
|
+
background-color: #eeeeee;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
&.active {
|
28
|
+
font-weight: bold;
|
29
|
+
position: relative;
|
30
|
+
top: 1px;
|
31
|
+
border: 1px solid #eee;
|
32
|
+
border-bottom: 1px solid white;
|
33
|
+
a {
|
34
|
+
color: $thredded-brand;
|
35
|
+
&:hover{
|
36
|
+
background-color: white;
|
37
|
+
}
|
22
38
|
}
|
23
39
|
}
|
24
40
|
.expanded {
|
@@ -31,5 +47,11 @@ ul.thredded--workgroup {
|
|
31
47
|
display: none;
|
32
48
|
}
|
33
49
|
}
|
50
|
+
.thredded--user-navigation--unread-topics--followed-count{
|
51
|
+
display: none;
|
52
|
+
@include thredded-media-desktop-and-up{
|
53
|
+
display: inline-block;
|
54
|
+
}
|
55
|
+
}
|
34
56
|
}
|
35
57
|
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
$thredded-condensed-height: 100px;
|
2
|
+
.thredded--condensable {
|
3
|
+
box-sizing: border-box;
|
4
|
+
position: relative;
|
5
|
+
top: 0;
|
6
|
+
z-index: 1;
|
7
|
+
|
8
|
+
&.thredded--condensable--condensed {
|
9
|
+
max-height: $thredded-condensed-height;
|
10
|
+
overflow: hidden;
|
11
|
+
opacity: 0.7;
|
12
|
+
|
13
|
+
&.thredded--topic-hovering, &.thredded--condensable--hover, .thredded--topic-hovering & {
|
14
|
+
opacity: 1;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
&.thredded--condensable--expanded,
|
19
|
+
[data-thredded-condensable-hover=reveal] &.thredded--condensable--condensed.thredded--condensable--hover {
|
20
|
+
max-height: unset;
|
21
|
+
overflow: unset;
|
22
|
+
}
|
23
|
+
|
24
|
+
cursor: pointer;
|
25
|
+
}
|
26
|
+
|
27
|
+
.thredded--condensable--expand, .thredded--condensable--condense {
|
28
|
+
color: #cccccc;
|
29
|
+
float: right;
|
30
|
+
font-size: 0.75rem;
|
31
|
+
|
32
|
+
.thredded--condensable.thredded--condensable--hover & {
|
33
|
+
color: $thredded-brand;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
.thredded--condensable--overflow-only {
|
38
|
+
display: none;
|
39
|
+
}
|
40
|
+
|
41
|
+
.thredded--condensable--overflowing {
|
42
|
+
$overflow-only-height: 20px;
|
43
|
+
|
44
|
+
.thredded--condensable--overflow-only {
|
45
|
+
display: block;
|
46
|
+
width: 100%;
|
47
|
+
display: none;
|
48
|
+
height: $overflow-only-height;
|
49
|
+
background-color: white;
|
50
|
+
z-index: 3;
|
51
|
+
border-top: 1px dashed #cccccc;
|
52
|
+
}
|
53
|
+
|
54
|
+
&.thredded--condensable--condensed .thredded--condensable--overflow-only {
|
55
|
+
position: absolute;
|
56
|
+
top: $thredded-condensed-height - $overflow-only-height;
|
57
|
+
.thredded--condensable--condense {
|
58
|
+
display: none;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
&.thredded--condensable--expanded .thredded--condensable--overflow-only,
|
63
|
+
[data-thredded-condensable-hover=reveal] &.thredded--condensable--condensed.thredded--condensable--hover .thredded--condensable--overflow-only{
|
64
|
+
position: static;
|
65
|
+
border-top: none;
|
66
|
+
.thredded--condensable--expand {
|
67
|
+
display: none;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
}
|