788 lines
16 KiB
SCSS
788 lines
16 KiB
SCSS
/*jquery-comments.js 1.2.0
|
|
|
|
(c) 2017 Joona Tykkyläinen, Viima Solutions Oy
|
|
jquery-comments may be freely distributed under the MIT license.
|
|
For all details and documentation:
|
|
http://viima.github.io/jquery-comments/*/
|
|
|
|
.jquery-comments {
|
|
* {
|
|
box-sizing: border-box;
|
|
text-shadow: none;
|
|
}
|
|
a[href] {
|
|
text-decoration: none;
|
|
&:hover {
|
|
text-decoration: underline;
|
|
}
|
|
}
|
|
.textarea, input, button {
|
|
-webkit-appearance: none;
|
|
-moz-appearance: none;
|
|
-ms-appearance: none;
|
|
appearance: none;
|
|
|
|
vertical-align: top;
|
|
border-radius: 0;
|
|
margin: 0;
|
|
padding: 0;
|
|
border: 0;
|
|
outline: 0;
|
|
background: rgba(0, 0, 0, 0);
|
|
}
|
|
|
|
button {
|
|
vertical-align: inherit;
|
|
}
|
|
}
|
|
|
|
.jquery-comments .tag {
|
|
font-size: 0.9em;
|
|
line-height: 1.2em;
|
|
background: $white;
|
|
border-bottom: dotted 1px $brand-primary;
|
|
color: $brand-primary;
|
|
cursor: pointer;
|
|
font-weight: normal;
|
|
border-radius: 0;
|
|
transition: all 0.3s ease;
|
|
@include hover-focus-active {
|
|
color: $black;
|
|
border-color: $brand-primary;
|
|
}
|
|
}
|
|
|
|
.jquery-comments [contentEditable=true]:empty:not(:focus):before {
|
|
content: attr(data-placeholder);
|
|
color: $black;
|
|
position: inherit;
|
|
}
|
|
|
|
.jquery-comments i.fa.image:before {
|
|
content: "";
|
|
}
|
|
|
|
.jquery-comments .spinner {
|
|
font-size: 2em;
|
|
text-align: center;
|
|
padding: 0.5em;
|
|
color: #666;
|
|
}
|
|
|
|
.jquery-comments ul {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
@include media-breakpoint-up(md) {
|
|
li {
|
|
margin-top: 10px;
|
|
}
|
|
&#comment-list > li:first-child {
|
|
margin-top: 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
.jquery-comments .profile-picture {
|
|
float: left;
|
|
width: 60px;
|
|
height: 60px;
|
|
max-width: 60px;
|
|
max-height: 60px;
|
|
background: $gray-200;
|
|
margin-bottom: 30px;
|
|
@include media-breakpoint-up(md) {
|
|
width: 90px;
|
|
height: 90px;
|
|
max-width: 90px;
|
|
max-height: 90px;
|
|
}
|
|
}
|
|
|
|
.jquery-comments i.profile-picture {
|
|
font-size: 3.4em;
|
|
text-align: center;
|
|
}
|
|
|
|
.jquery-comments {
|
|
.commenting-field.main {
|
|
margin-bottom: 50px;
|
|
}
|
|
}
|
|
|
|
.jquery-comments .commenting-field.main .profile-picture {
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.jquery-comments .textarea-wrapper {
|
|
overflow: hidden;
|
|
padding-left: 15px;
|
|
position: relative;
|
|
|
|
&:before {
|
|
content: '';
|
|
position: absolute;
|
|
border: 5px solid darken(saturate(adjust_hue(white, 0), 0%), 1.9607843137254974%);
|
|
left: 5px;
|
|
top: 0;
|
|
width: 10px;
|
|
height: 10px;
|
|
box-sizing: border-box;
|
|
border-bottom-color: rgba(0, 0, 0, 0);
|
|
border-left-color: rgba(0, 0, 0, 0);
|
|
}
|
|
&:after {
|
|
content: " ";
|
|
position: absolute;
|
|
border: 7px solid darken(saturate(adjust_hue(white, 0), 0%), 1.9607843137254974%);
|
|
left: 7px;
|
|
top: 1px;
|
|
width: 10px;
|
|
height: 10px;
|
|
box-sizing: border-box;
|
|
border-bottom-color: rgba(0, 0, 0, 0);
|
|
border-left-color: rgba(0, 0, 0, 0);
|
|
}
|
|
@include media-breakpoint-up(md) {
|
|
padding-left: 30px;
|
|
&:before {
|
|
left: 20px;
|
|
}
|
|
&:after {
|
|
left: 22px;
|
|
}
|
|
}
|
|
.inline-button {
|
|
cursor: pointer;
|
|
right: 0;
|
|
z-index: 10;
|
|
position: absolute;
|
|
border: 2px solid rgba(0, 0, 0, 0);
|
|
box-sizing: content-box;
|
|
font-size: inherit;
|
|
overflow: hidden;
|
|
user-select: none;
|
|
transition: all 0.3s ease-in-out;
|
|
opacity: 1;
|
|
@include hover-focus-active {
|
|
opacity: 1;
|
|
}
|
|
&.close i {
|
|
font-size: 24px;
|
|
}
|
|
}
|
|
.upload input {
|
|
cursor: pointer;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
min-width: 100%;
|
|
height: 100%;
|
|
margin: 0;
|
|
padding: 0;
|
|
opacity: 0;
|
|
}
|
|
.close {
|
|
span {
|
|
background: $gray-800;
|
|
width: 25%;
|
|
left: 37.5%;
|
|
height: 100%;
|
|
position: absolute;
|
|
transform: rotate(45deg);
|
|
transition: all 0.3s ease-in-out;
|
|
}
|
|
.right {
|
|
transform: rotate(-45deg);
|
|
}
|
|
&:hover {
|
|
span {
|
|
background: $brand-primary;
|
|
}
|
|
}
|
|
}
|
|
.textarea {
|
|
margin: 0;
|
|
outline: 0;
|
|
overflow-y: auto;
|
|
cursor: text;
|
|
border: 1px solid darken(saturate(adjust_hue($white, 0), 0%), 1.9607843137254974%);
|
|
background: darken(saturate(adjust_hue($white, 0), 0%), 1.9607843137254974%);
|
|
color: $black;
|
|
font-size: 1em;
|
|
line-height: 1.45em;
|
|
padding: 20px 2em 10px 30px;
|
|
-webkit-overflow-scrolling: touch;
|
|
min-height: 80px;
|
|
&::placeholder {
|
|
color: $black;
|
|
}
|
|
&::-webkit-scrollbar {
|
|
width: 6px;
|
|
}
|
|
&::-webkit-scrollbar-track {
|
|
background: $white;
|
|
border-radius: 0;
|
|
}
|
|
&::-webkit-scrollbar-thumb {
|
|
background: $gray-600;
|
|
transition: all 0.3s;
|
|
border-radius: 0;
|
|
&:hover {
|
|
background: $gray-800;
|
|
}
|
|
}
|
|
}
|
|
.upload.inline-button i {
|
|
font-size: 1.3em;
|
|
}
|
|
}
|
|
|
|
.jquery-comments:not(.mobile) .scrollable .textarea-wrapper {
|
|
.inline-button {
|
|
margin-right: 15px; /* Because of scrollbar */
|
|
}
|
|
.textarea {
|
|
padding-right: calc(2em + 15px); /* Because of scrollbar */
|
|
}
|
|
}
|
|
|
|
.jquery-comments .textarea-wrapper .control-row {
|
|
margin-top: 20px;
|
|
> span {
|
|
float: right;
|
|
margin: 0 10px;
|
|
opacity: 1;
|
|
&.save {
|
|
background: $brand-primary !important;
|
|
color: $white;
|
|
transition: all 0.3s ease-in-out;
|
|
@include hover-focus-active {
|
|
background: darken($brand-primary, 10)!important;
|
|
}
|
|
}
|
|
&.save, &.delete {
|
|
font-size: 14px;
|
|
line-height: 1.28;
|
|
padding: 10px 14px;
|
|
border-radius: 0;
|
|
}
|
|
&:not(:first-child) {
|
|
margin-right: .5em;
|
|
}
|
|
&.enabled {
|
|
opacity: 1;
|
|
cursor: pointer;
|
|
&:hover {
|
|
opacity: .8;
|
|
}
|
|
}
|
|
&:not(.enabled) {
|
|
pointer-events: none;
|
|
opacity: .5;
|
|
}
|
|
&.upload {
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
.delete {
|
|
color: $white;
|
|
&:hover, &:active, &:focus {
|
|
color: $white;
|
|
}
|
|
}
|
|
.upload {
|
|
transition: all 0.3s ease-in-out;
|
|
color: $black;
|
|
i {
|
|
font-size: 20px;
|
|
line-height: 1.73;
|
|
}
|
|
@include media-breakpoint-up(md) {
|
|
i {
|
|
font-size: 22px;
|
|
}
|
|
}
|
|
@include hover-focus-active {
|
|
color: $brand-primary;
|
|
}
|
|
}
|
|
}
|
|
|
|
.jquery-comments ul.navigation {
|
|
clear: both;
|
|
border-bottom: 1px solid $gray-800;
|
|
line-height: 2em;
|
|
font-size: 1em;
|
|
margin-bottom: 20px;
|
|
.navigation-wrapper {
|
|
position: relative;
|
|
&.responsive {
|
|
display: none;
|
|
}
|
|
li {
|
|
display: inline-block;
|
|
position: relative;
|
|
padding: 0;
|
|
margin-right: 20px;
|
|
margin-bottom: 20px;
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
font-size: 20px;
|
|
text-align: center;
|
|
color: $gray-800;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
transition: all 0.3s ease-in-out;
|
|
&.active, &:hover {
|
|
color: $brand-primary;
|
|
}
|
|
@include media-breakpoint-down(sm) {
|
|
padding: 5px 3px;
|
|
margin: 0;
|
|
}
|
|
}
|
|
}
|
|
li[data-sort-key="attachments"] {
|
|
float: right;
|
|
position: relative;
|
|
padding-left: 30px;
|
|
margin-left: 20px;
|
|
margin-right: 0;
|
|
i {
|
|
position: absolute;
|
|
font-size: 24px;
|
|
line-height: 1;
|
|
left: 0;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
color: $gray-600;
|
|
}
|
|
}
|
|
}
|
|
|
|
@include media-breakpoint-down(sm) {
|
|
.jquery-comments {
|
|
ul.navigation {
|
|
.navigation-wrapper {
|
|
display: none;
|
|
&.responsive {
|
|
display: inline;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.jquery-comments.responsive {
|
|
ul.navigation {
|
|
.navigation-wrapper {
|
|
display: none;
|
|
&.responsive {
|
|
display: inline;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.jquery-comments ul.navigation .navigation-wrapper.responsive {
|
|
li.title {
|
|
padding: 0 20px;
|
|
header:after {
|
|
display: inline-block;
|
|
content: "";
|
|
border-left: 0.3em solid rgba(0, 0, 0, 0) !important;
|
|
border-right: 0.3em solid rgba(0, 0, 0, 0) !important;
|
|
border-top: 0.4em solid $white;
|
|
margin-left: 0.5em;
|
|
position: relative;
|
|
top: -0.1em;
|
|
}
|
|
&.active header:after,
|
|
&:hover header:after {
|
|
border-top-color: $gray-800;
|
|
}
|
|
}
|
|
}
|
|
|
|
.jquery-comments ul.dropdown {
|
|
display: none;
|
|
position: absolute;
|
|
background: $white;
|
|
z-index: 99;
|
|
line-height: 1.2em;
|
|
border: 1px solid #CCC;
|
|
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
|
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
|
-moz-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
|
-ms-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
|
&.autocomplete {
|
|
margin-top: 0.25em;
|
|
}
|
|
li {
|
|
display: block;
|
|
white-space: nowrap;
|
|
clear: both;
|
|
padding: 0.5em 1em;
|
|
font-weight: normal;
|
|
cursor: pointer;
|
|
a {
|
|
display: block;
|
|
text-decoration: none;
|
|
color: inherit;
|
|
}
|
|
.profile-picture {
|
|
float: left;
|
|
width: 2.4em;
|
|
height: 2.4em;
|
|
margin-right: 0.5em;
|
|
}
|
|
.details {
|
|
display: inline-block;
|
|
}
|
|
.email {
|
|
color: $gray-800;
|
|
font-size: 0.95em;
|
|
margin-top: 0.1em;
|
|
}
|
|
}
|
|
}
|
|
|
|
.jquery-comments ul.navigation .navigation-wrapper.responsive ul.dropdown {
|
|
left: 0;
|
|
width: 100%;
|
|
li {
|
|
display: block;
|
|
text-align: left;
|
|
&:after {
|
|
display: none;
|
|
}
|
|
&.active, &:hover, &:focus {
|
|
background: $brand-primary;
|
|
color: $white;
|
|
}
|
|
}
|
|
}
|
|
|
|
.jquery-comments .no-data {
|
|
display: none;
|
|
padding: 30px 25px;
|
|
text-align: center;
|
|
font-size: 1.5em;
|
|
color: $gray-400;
|
|
i {
|
|
color: $gray-800;
|
|
font-size: 60px;
|
|
}
|
|
}
|
|
|
|
.jquery-comments ul.main:empty ~ .no-comments {
|
|
display: inherit;
|
|
}
|
|
|
|
.jquery-comments ul#attachment-list:empty ~ .no-attachments {
|
|
display: inherit;
|
|
}
|
|
|
|
.jquery-comments ul.main li.comment {
|
|
clear: both;
|
|
}
|
|
|
|
.jquery-comments ul.main li.comment .comment-wrapper,
|
|
.jquery-comments ul.main li.toggle-all,
|
|
.jquery-comments ul.main li.comment .commenting-field {
|
|
padding: 5px 0;
|
|
.profile-picture {
|
|
background: $gray-200;
|
|
}
|
|
}
|
|
|
|
.jquery-comments ul.main li.comment {
|
|
.comment-wrapper {
|
|
overflow: hidden;
|
|
> .profile-picture {
|
|
margin-right: 10px;
|
|
@include media-breakpoint-up(md) {
|
|
margin-right: 20px;
|
|
}
|
|
}
|
|
}
|
|
time {
|
|
float: right;
|
|
font-size: 13px;
|
|
line-height: 1.5;
|
|
color: $gray-600;
|
|
margin-top: 5px;
|
|
}
|
|
.name {
|
|
color: $gray-800;
|
|
font-weight: 500;
|
|
font-size: 16px;
|
|
line-height: 1.5;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
margin-right: 30px;
|
|
overflow: hidden;
|
|
.new {
|
|
margin-left: 10px;
|
|
color: white;
|
|
font-size: 0.8em;
|
|
font-weight: 400;
|
|
background: $brand-primary!important;
|
|
padding: 3px 5px;
|
|
}
|
|
a {
|
|
color: inherit;
|
|
}
|
|
.reply-to {
|
|
color: $brand-primary;
|
|
font-size: .8em;
|
|
font-weight: 400;
|
|
vertical-align: top;
|
|
}
|
|
&.highlight-font-bold {
|
|
color: $gray-800 !important;
|
|
}
|
|
@include media-breakpoint-up(md) {
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
.wrapper {
|
|
color: $gray-600;
|
|
overflow: hidden;
|
|
margin-top: 10px;
|
|
font-size: 12px;
|
|
/* Content */
|
|
.content {
|
|
white-space: pre-line;
|
|
word-break: break-word;
|
|
a.attachment {
|
|
i {
|
|
margin-right: 0.5em;
|
|
}
|
|
> * {
|
|
max-width: 100%;
|
|
max-height: 200px;
|
|
width: auto;
|
|
height: auto;
|
|
margin-top: .25em;
|
|
margin-bottom: .25em;
|
|
}
|
|
}
|
|
}
|
|
/* Actions */
|
|
.actions {
|
|
display: inline-block;
|
|
margin-top: 10px;
|
|
> * {
|
|
color: $brand-primary;
|
|
}
|
|
button {
|
|
@include hover-focus-active {
|
|
color: $brand-primary;
|
|
}
|
|
}
|
|
.highlight-font {
|
|
color: $brand-primary !important;
|
|
}
|
|
.action {
|
|
display: inline-block;
|
|
cursor: pointer;
|
|
margin-right: 1em;
|
|
font: 500 12px/16px $font-family-base;
|
|
letter-spacing: 0.1em;
|
|
text-transform: lowercase;
|
|
&.reply {
|
|
color: $brand-primary;
|
|
@include hover-focus-active {
|
|
color: $black;
|
|
}
|
|
}
|
|
&:not(:first-child) {
|
|
margin-left: 1em;
|
|
}
|
|
&.upvote {
|
|
cursor: inherit;
|
|
.upvote-count {
|
|
margin-right: .5em;
|
|
&:empty {
|
|
display: none;
|
|
}
|
|
}
|
|
i {
|
|
cursor: pointer;
|
|
}
|
|
@include hover-focus-active {
|
|
color: $black !important;
|
|
}
|
|
}
|
|
&.upvote:not(.highlight-font) i:hover {
|
|
color: $black;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.child-comments li.comment .wrapper {
|
|
overflow: visible;
|
|
}
|
|
}
|
|
|
|
.jquery-comments ul.main li.comment .name .reply-to i {
|
|
margin-left: .5em;
|
|
margin-right: .25em;
|
|
}
|
|
|
|
.jquery-comments ul.main li.comment .wrapper .content time.edited {
|
|
float: inherit;
|
|
margin: 0;
|
|
font-size: .9em;
|
|
font-style: italic;
|
|
color: #999;
|
|
}
|
|
|
|
.jquery-comments ul.main li.comment .wrapper .content time.edited:before {
|
|
content: " - ";
|
|
}
|
|
|
|
.jquery-comments ul.main li.comment .actions .action.delete {
|
|
opacity: 0.5;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.jquery-comments ul.main li.comment .actions .action.delete.enabled {
|
|
opacity: 1;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.jquery-comments ul#attachment-list li.comment .actions .action:not(.delete) {
|
|
display: none;
|
|
}
|
|
|
|
.jquery-comments ul#attachment-list li.comment .actions .action.delete {
|
|
margin: 0;
|
|
}
|
|
|
|
.jquery-comments ul#attachment-list li.comment .actions .separator {
|
|
display: none;
|
|
}
|
|
|
|
/* Child comments */
|
|
.jquery-comments ul.main li.comment .child-comments {
|
|
@include media-breakpoint-up(md) {
|
|
> *:before { /* Margin for second level content */
|
|
content: "";
|
|
height: 1px;
|
|
float: left;
|
|
width: calc(3.6em + .5em); /* Profile picture width plus margin */
|
|
max-width: calc(50px + .5em); /* Profile picture max width plus margin */
|
|
}
|
|
}
|
|
li.toggle-all {
|
|
padding: 10px 15px;
|
|
color: $gray-800;
|
|
span:first-child {
|
|
vertical-align: middle;
|
|
&:hover {
|
|
cursor: pointer;
|
|
text-decoration: underline;
|
|
}
|
|
}
|
|
.text {
|
|
vertical-align: middle;
|
|
transition: all 0.3s ease-in-out;
|
|
color: $gray-800;
|
|
@include hover-focus-active {
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
color: $brand-primary;
|
|
}
|
|
}
|
|
.caret {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
margin-left: 5px;
|
|
&:before {
|
|
display: block;
|
|
@include addIcon('\f107', 16px, 1, inherit, margin-left, margin-right, vertical-align);
|
|
transition: all 0.3s ease-in-out;
|
|
}
|
|
&.up {
|
|
&:before {
|
|
transform: rotate(-180deg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.hidden-reply {
|
|
display: none;
|
|
}
|
|
.visible {
|
|
display: inherit;
|
|
}
|
|
}
|
|
|
|
/* Editing comment */
|
|
.jquery-comments ul.main li.comment.edit > .comment-wrapper > *:not(.commenting-field) {
|
|
display: none;
|
|
}
|
|
|
|
.jquery-comments ul.main li.comment.edit > .comment-wrapper .commenting-field {
|
|
padding: 0 !important; /* Parent element has the padding */
|
|
}
|
|
|
|
/* Drag & drop attachments */
|
|
.jquery-comments.drag-ongoing {
|
|
overflow-y: hidden !important;
|
|
}
|
|
|
|
.jquery-comments .droppable-overlay {
|
|
display: table;
|
|
position: fixed;
|
|
z-index: 99;
|
|
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.3)
|
|
}
|
|
|
|
.jquery-comments .droppable-overlay .droppable-container {
|
|
display: table-cell;
|
|
vertical-align: middle;
|
|
text-align: center;
|
|
}
|
|
|
|
.jquery-comments .droppable-overlay .droppable-container .droppable {
|
|
background: #FFF;
|
|
color: #CCC;
|
|
padding: 6em;
|
|
}
|
|
|
|
.jquery-comments .droppable-overlay .droppable-container .droppable.drag-over {
|
|
color: #999;
|
|
}
|
|
|
|
.jquery-comments .droppable-overlay .droppable-container .droppable i {
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
/* Read-only mode */
|
|
.jquery-comments.read-only .commenting-field {
|
|
display: none;
|
|
}
|
|
|
|
.jquery-comments.read-only .actions {
|
|
display: none;
|
|
}
|
|
|
|
#comments-container .tag:empty {
|
|
display: inline-block;
|
|
}
|
|
|
|
.commenting-field {
|
|
display: block !important;
|
|
} |