Version bump

This commit is contained in:
Neil Lalonde 2020-06-01 14:14:38 -04:00
commit e5a7937177
No known key found for this signature in database
GPG Key ID: FF871CA9037D0A91
444 changed files with 3601 additions and 3147 deletions

View File

@ -11,24 +11,12 @@ dafd3c3b47f116c6c1dc56cb18df614c11747733
# Rename many `.js.es6` files to `.js`
032205e2029cbf82dc8f05b459fb93adf2503c60
# Rename admin app es6 -> js
181758e3248b14ad8b53abe063da8dc6a82d3089
# Rename pretty-text from es6 -> js
c15056650647e8650288f973d9038500dc9cf7bb
# Rename select kit from es6 -> js
acc5cbdf8ecb9293a0fa9474ee73baf499c02428
# Rename wizard from es6 -> js
1ac02422011f89716ab27250d39b0e0212e03892
# Rename some root files
11938d58d4b1bea1ff43306450da7b24f05db0a
# The last remaining ES6
aabeb17aab4e73de5ef56753ab22ef5d416d2932
# DEV: enforces block-indentation of ember-template-lint rules
b66b277dc44bcd2122dc21965dab209c30636214

16
Gemfile
View File

@ -18,13 +18,13 @@ else
# this allows us to include the bits of rails we use without pieces we do not.
#
# To issue a rails update bump the version number here
gem 'actionmailer', '6.0.3'
gem 'actionpack', '6.0.3'
gem 'actionview', '6.0.3'
gem 'activemodel', '6.0.3'
gem 'activerecord', '6.0.3'
gem 'activesupport', '6.0.3'
gem 'railties', '6.0.3'
gem 'actionmailer', '6.0.3.1'
gem 'actionpack', '6.0.3.1'
gem 'actionview', '6.0.3.1'
gem 'activemodel', '6.0.3.1'
gem 'activerecord', '6.0.3.1'
gem 'activesupport', '6.0.3.1'
gem 'railties', '6.0.3.1'
gem 'sprockets-rails'
end
@ -249,4 +249,4 @@ gem 'webpush', require: false
gem 'colored2', require: false
gem 'maxminddb'
gem 'rails_failover', require: false
gem 'rails_failover', require: false, git: 'https://github.com/discourse/rails_failover'

View File

@ -1,21 +1,30 @@
GIT
remote: https://github.com/discourse/rails_failover
revision: 0e668eba86591c20aa7a43f47b0cd36d4eacaeb6
specs:
rails_failover (0.4.0)
activerecord (~> 6.0)
listen (~> 3.2)
railties (~> 6.0)
GEM
remote: https://rubygems.org/
specs:
actionmailer (6.0.3)
actionpack (= 6.0.3)
actionview (= 6.0.3)
activejob (= 6.0.3)
actionmailer (6.0.3.1)
actionpack (= 6.0.3.1)
actionview (= 6.0.3.1)
activejob (= 6.0.3.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.3)
actionview (= 6.0.3)
activesupport (= 6.0.3)
actionpack (6.0.3.1)
actionview (= 6.0.3.1)
activesupport (= 6.0.3.1)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.0.3)
activesupport (= 6.0.3)
actionview (6.0.3.1)
activesupport (= 6.0.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
@ -24,15 +33,15 @@ GEM
actionview (>= 6.0.a)
active_model_serializers (0.8.4)
activemodel (>= 3.0)
activejob (6.0.3)
activesupport (= 6.0.3)
activejob (6.0.3.1)
activesupport (= 6.0.3.1)
globalid (>= 0.3.6)
activemodel (6.0.3)
activesupport (= 6.0.3)
activerecord (6.0.3)
activemodel (= 6.0.3)
activesupport (= 6.0.3)
activesupport (6.0.3)
activemodel (6.0.3.1)
activesupport (= 6.0.3.1)
activerecord (6.0.3.1)
activemodel (= 6.0.3.1)
activesupport (= 6.0.3.1)
activesupport (6.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
@ -45,20 +54,20 @@ GEM
rake (>= 10.4, < 14.0)
ast (2.4.0)
aws-eventstream (1.1.0)
aws-partitions (1.298.0)
aws-sdk-core (3.94.0)
aws-partitions (1.322.0)
aws-sdk-core (3.96.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.30.0)
aws-sdk-kms (1.31.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.62.0)
aws-sdk-core (~> 3, >= 3.83.0)
aws-sdk-s3 (1.66.0)
aws-sdk-core (~> 3, >= 3.96.1)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sdk-sns (1.22.0)
aws-sdk-sns (1.23.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.3)
@ -82,7 +91,7 @@ GEM
cbor (0.5.9.6)
certified (1.0.0)
chunky_png (1.3.11)
coderay (1.1.2)
coderay (1.1.3)
colored2 (3.1.2)
concurrent-ruby (1.1.6)
connection_pool (2.2.2)
@ -121,7 +130,7 @@ GEM
railties (>= 3.1)
ember-source (2.18.2)
erubi (1.9.0)
excon (0.72.0)
excon (0.73.0)
execjs (2.7.0)
exifr (1.3.6)
fabrication (2.21.1)
@ -134,7 +143,7 @@ GEM
rake-compiler
fast_xs (0.8.0)
fastimage (2.1.7)
ffi (1.12.2)
ffi (1.13.0)
flamegraph (0.9.5)
fspath (3.1.2)
gc_tracer (1.5.1)
@ -183,7 +192,7 @@ GEM
mini_mime (>= 0.1.1)
maxminddb (0.1.22)
memory_profiler (0.9.14)
message_bus (3.2.0)
message_bus (3.3.0)
rack (>= 1.1.3)
method_source (1.0.0)
mini_mime (1.0.2)
@ -240,7 +249,7 @@ GEM
omniauth-twitter (1.4.0)
omniauth-oauth (~> 1.1)
rack
onebox (1.9.28.1)
onebox (1.9.28.3)
addressable (~> 2.7.0)
htmlentities (~> 4.3)
multi_json (~> 1.11)
@ -252,7 +261,7 @@ GEM
parallel (1.19.1)
parallel_tests (2.32.0)
parallel
parser (2.7.1.2)
parser (2.7.1.3)
ast (~> 2.4.0)
pg (1.2.3)
progress (3.5.2)
@ -277,14 +286,12 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
rails_failover (0.2.0)
redis (~> 4)
rails_multisite (2.1.2)
activerecord (> 5.0, < 7)
railties (> 5.0, < 7)
railties (6.0.3)
actionpack (= 6.0.3)
activesupport (= 6.0.3)
railties (6.0.3.1)
actionpack (= 6.0.3.1)
activesupport (= 6.0.3.1)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
@ -431,14 +438,14 @@ PLATFORMS
ruby
DEPENDENCIES
actionmailer (= 6.0.3)
actionpack (= 6.0.3)
actionview (= 6.0.3)
actionmailer (= 6.0.3.1)
actionpack (= 6.0.3.1)
actionview (= 6.0.3.1)
actionview_precompiler
active_model_serializers (~> 0.8.3)
activemodel (= 6.0.3)
activerecord (= 6.0.3)
activesupport (= 6.0.3)
activemodel (= 6.0.3.1)
activerecord (= 6.0.3.1)
activesupport (= 6.0.3.1)
addressable
annotate
aws-sdk-s3
@ -514,9 +521,9 @@ DEPENDENCIES
rack (= 2.2.2)
rack-mini-profiler
rack-protection
rails_failover
rails_failover!
rails_multisite
railties (= 6.0.3)
railties (= 6.0.3.1)
rake
rb-fsevent
rb-inotify (~> 0.9)

View File

@ -2,6 +2,7 @@ import I18n from "I18n";
import { ajax } from "discourse/lib/ajax";
import { extractError } from "discourse/lib/ajax-error";
import EmberObject from "@ember/object";
import MessageBus from "message-bus-client";
const Backup = EmberObject.extend({
destroy() {
@ -11,7 +12,7 @@ const Backup = EmberObject.extend({
restore() {
return ajax("/admin/backups/" + this.filename + "/restore", {
type: "POST",
data: { client_id: window.MessageBus.clientId }
data: { client_id: MessageBus.clientId }
});
}
});
@ -38,7 +39,7 @@ Backup.reopenClass({
type: "POST",
data: {
with_uploads: withUploads,
client_id: window.MessageBus.clientId
client_id: MessageBus.clientId
}
}).then(result => {
if (!result.success) {

View File

@ -517,6 +517,7 @@
{{admin-group-selector
content=availableGroups
value=customGroupIdsBuffer
labelProperty="name"
onChange=(action (mut customGroupIdsBuffer))
}}
</div>

View File

@ -1,3 +1,9 @@
export const INPUT_DELAY = 250;
export default { environment: Ember.testing ? "test" : "development" };
let environment = Ember.testing ? "test" : "development";
export function isTesting() {
return environment === "test";
}
export default { environment };

View File

@ -1,8 +1,6 @@
import I18n from "I18n";
import { h } from "virtual-dom";
import attributeHook from "discourse-common/lib/attribute-hook";
import deprecated from "discourse-common/lib/deprecated";
import jQuery from "jquery";
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
let _renderers = [];
@ -43,474 +41,6 @@ const REPLACEMENTS = {
"notification.membership_request_consolidated": "users"
};
// TODO: use lib/svg_sprite/fa4-renames.json here
// Note: these should not be edited manually. They define the fa4-fa5 migration
const fa4Replacements = {
"500px": "fab-500px",
"address-book-o": "far-address-book",
"address-card-o": "far-address-card",
adn: "fab-adn",
amazon: "fab-amazon",
android: "fab-android",
angellist: "fab-angellist",
apple: "fab-apple",
"area-chart": "chart-area",
"arrow-circle-o-down": "far-arrow-alt-circle-down",
"arrow-circle-o-left": "far-arrow-alt-circle-left",
"arrow-circle-o-right": "far-arrow-alt-circle-right",
"arrow-circle-o-up": "far-arrow-alt-circle-up",
arrows: "arrows-alt",
"arrows-alt": "expand-arrows-alt",
"arrows-h": "arrows-alt-h",
"arrows-v": "arrows-alt-v",
"asl-interpreting": "american-sign-language-interpreting",
automobile: "car",
bandcamp: "fab-bandcamp",
bank: "university",
"bar-chart": "far-chart-bar",
"bar-chart-o": "far-chart-bar",
bathtub: "bath",
battery: "battery-full",
"battery-0": "battery-empty",
"battery-1": "battery-quarter",
"battery-2": "battery-half",
"battery-3": "battery-three-quarters",
"battery-4": "battery-full",
behance: "fab-behance",
"behance-square": "fab-behance-square",
"bell-o": "far-bell",
"bell-slash-o": "far-bell-slash",
bitbucket: "fab-bitbucket",
"bitbucket-square": "fab-bitbucket",
bitcoin: "fab-btc",
"black-tie": "fab-black-tie",
bluetooth: "fab-bluetooth",
"bluetooth-b": "fab-bluetooth-b",
"bookmark-o": "far-bookmark",
btc: "fab-btc",
"building-o": "far-building",
buysellads: "fab-buysellads",
cab: "taxi",
calendar: "calendar-alt",
"calendar-check-o": "far-calendar-check",
"calendar-minus-o": "far-calendar-minus",
"calendar-o": "far-calendar",
"calendar-plus-o": "far-calendar-plus",
"calendar-times-o": "far-calendar-times",
"caret-square-o-down": "far-caret-square-down",
"caret-square-o-left": "far-caret-square-left",
"caret-square-o-right": "far-caret-square-right",
"caret-square-o-up": "far-caret-square-up",
cc: "far-closed-captioning",
"cc-amex": "fab-cc-amex",
"cc-diners-club": "fab-cc-diners-club",
"cc-discover": "fab-cc-discover",
"cc-jcb": "fab-cc-jcb",
"cc-mastercard": "fab-cc-mastercard",
"cc-paypal": "fab-cc-paypal",
"cc-stripe": "fab-cc-stripe",
"cc-visa": "fab-cc-visa",
chain: "link",
"chain-broken": "unlink",
"check-circle-o": "far-check-circle",
"check-square-o": "far-check-square",
chrome: "fab-chrome",
"circle-o": "far-circle",
"circle-o-notch": "circle-notch",
"circle-thin": "far-circle",
clipboard: "far-clipboard",
"clock-o": "far-clock",
clone: "far-clone",
close: "times",
"cloud-download": "cloud-download-alt",
"cloud-upload": "cloud-upload-alt",
cny: "yen-sign",
"code-fork": "code-branch",
codepen: "fab-codepen",
codiepie: "fab-codiepie",
"comment-o": "far-comment",
commenting: "far-comment-dots",
"commenting-o": "far-comment-dots",
"comments-o": "far-comments",
compass: "far-compass",
connectdevelop: "fab-connectdevelop",
contao: "fab-contao",
copyright: "far-copyright",
"creative-commons": "fab-creative-commons",
"credit-card": "far-credit-card",
"credit-card-alt": "credit-card",
css3: "fab-css3",
cutlery: "utensils",
dashboard: "tachometer-alt",
dashcube: "fab-dashcube",
deafness: "deaf",
dedent: "outdent",
delicious: "fab-delicious",
deviantart: "fab-deviantart",
diamond: "far-gem",
digg: "fab-digg",
discord: "fab-discord",
dollar: "dollar-sign",
"dot-circle-o": "far-dot-circle",
dribbble: "fab-dribbble",
"drivers-license": "id-card",
"drivers-license-o": "far-id-card",
dropbox: "fab-dropbox",
drupal: "fab-drupal",
edge: "fab-edge",
eercast: "fab-sellcast",
empire: "fab-empire",
"envelope-o": "far-envelope",
"envelope-open-o": "far-envelope-open",
envira: "fab-envira",
etsy: "fab-etsy",
eur: "euro-sign",
euro: "euro-sign",
exchange: "exchange-alt",
expeditedssl: "fab-expeditedssl",
"external-link": "external-link-alt",
"external-link-square": "external-link-square-alt",
eye: "far-eye",
"eye-slash": "far-eye-slash",
eyedropper: "eye-dropper",
fa: "fab-font-awesome",
facebook: "fab-facebook-f",
"facebook-f": "fab-facebook-f",
"facebook-official": "fab-facebook",
"facebook-square": "fab-facebook-square",
feed: "rss",
"file-archive-o": "far-file-archive",
"file-audio-o": "far-file-audio",
"file-code-o": "far-file-code",
"file-excel-o": "far-file-excel",
"file-image-o": "far-file-image",
"file-movie-o": "far-file-video",
"file-o": "far-file",
"file-pdf-o": "far-file-pdf",
"file-photo-o": "far-file-image",
"file-picture-o": "far-file-image",
"file-powerpoint-o": "far-file-powerpoint",
"file-sound-o": "far-file-audio",
"file-text": "file-alt",
"file-text-o": "far-file-alt",
"file-video-o": "far-file-video",
"file-word-o": "far-file-word",
"file-zip-o": "far-file-archive",
"files-o": "far-copy",
firefox: "fab-firefox",
"first-order": "fab-first-order",
"flag-o": "far-flag",
flash: "bolt",
flickr: "fab-flickr",
"floppy-o": "far-save",
"folder-o": "far-folder",
"folder-open-o": "far-folder-open",
"font-awesome": "fab-font-awesome",
fonticons: "fab-fonticons",
"fort-awesome": "fab-fort-awesome",
forumbee: "fab-forumbee",
foursquare: "fab-foursquare",
"free-code-camp": "fab-free-code-camp",
"frown-o": "far-frown",
"futbol-o": "far-futbol",
gbp: "pound-sign",
ge: "fab-empire",
gear: "cog",
gears: "cogs",
"get-pocket": "fab-get-pocket",
gg: "fab-gg",
"gg-circle": "fab-gg-circle",
git: "fab-git",
"git-square": "fab-git-square",
github: "fab-github",
"github-alt": "fab-github-alt",
"github-square": "fab-github-square",
gitlab: "fab-gitlab",
gittip: "fab-gratipay",
glass: "glass-martini",
glide: "fab-glide",
"glide-g": "fab-glide-g",
google: "fab-google",
"google-plus": "fab-google-plus-g",
"google-plus-circle": "fab-google-plus",
"google-plus-official": "fab-google-plus",
"google-plus-square": "fab-google-plus-square",
"google-wallet": "fab-google-wallet",
gratipay: "fab-gratipay",
grav: "fab-grav",
group: "users",
"hacker-news": "fab-hacker-news",
"hand-grab-o": "far-hand-rock",
"hand-lizard-o": "far-hand-lizard",
"hand-o-down": "far-hand-point-down",
"hand-o-left": "far-hand-point-left",
"hand-o-right": "far-hand-point-right",
"hand-o-up": "far-hand-point-up",
"hand-paper-o": "far-hand-paper",
"hand-peace-o": "far-hand-peace",
"hand-pointer-o": "far-hand-pointer",
"hand-rock-o": "far-hand-rock",
"hand-scissors-o": "far-hand-scissors",
"hand-spock-o": "far-hand-spock",
"hand-stop-o": "far-hand-paper",
"handshake-o": "far-handshake",
"hard-of-hearing": "deaf",
"hdd-o": "far-hdd",
header: "heading",
"heart-o": "far-heart",
"hospital-o": "far-hospital",
hotel: "bed",
"hourglass-1": "hourglass-start",
"hourglass-2": "hourglass-half",
"hourglass-3": "hourglass-end",
"hourglass-o": "far-hourglass",
houzz: "fab-houzz",
html5: "fab-html5",
"id-card-o": "far-id-card",
ils: "shekel-sign",
image: "far-image",
imdb: "fab-imdb",
inr: "rupee-sign",
instagram: "fab-instagram",
institution: "university",
"internet-explorer": "fab-internet-explorer",
intersex: "transgender",
ioxhost: "fab-ioxhost",
joomla: "fab-joomla",
jpy: "yen-sign",
jsfiddle: "fab-jsfiddle",
"keyboard-o": "far-keyboard",
krw: "won-sign",
lastfm: "fab-lastfm",
"lastfm-square": "fab-lastfm-square",
leanpub: "fab-leanpub",
legal: "gavel",
"lemon-o": "far-lemon",
"level-down": "level-down-alt",
"level-up": "level-up-alt",
"life-bouy": "far-life-ring",
"life-buoy": "far-life-ring",
"life-ring": "far-life-ring",
"life-saver": "far-life-ring",
"lightbulb-o": "far-lightbulb",
"line-chart": "chart-line",
linkedin: "fab-linkedin-in",
"linkedin-square": "fab-linkedin",
linode: "fab-linode",
linux: "fab-linux",
"list-alt": "far-list-alt",
"long-arrow-down": "long-arrow-alt-down",
"long-arrow-left": "long-arrow-alt-left",
"long-arrow-right": "long-arrow-alt-right",
"long-arrow-up": "long-arrow-alt-up",
"mail-forward": "share",
"mail-reply": "reply",
"mail-reply-all": "reply-all",
"map-marker": "map-marker-alt",
"map-o": "far-map",
maxcdn: "fab-maxcdn",
meanpath: "fab-font-awesome",
medium: "fab-medium",
meetup: "fab-meetup",
"meh-o": "far-meh",
"minus-square-o": "far-minus-square",
mixcloud: "fab-mixcloud",
mobile: "mobile-alt",
"mobile-phone": "mobile-alt",
modx: "fab-modx",
money: "far-money-bill-alt",
"moon-o": "far-moon",
"mortar-board": "graduation-cap",
navicon: "bars",
"newspaper-o": "far-newspaper",
"object-group": "far-object-group",
"object-ungroup": "far-object-ungroup",
odnoklassniki: "fab-odnoklassniki",
"odnoklassniki-square": "fab-odnoklassniki-square",
opencart: "fab-opencart",
openid: "fab-openid",
opera: "fab-opera",
"optin-monster": "fab-optin-monster",
pagelines: "fab-pagelines",
"paper-plane-o": "far-paper-plane",
paste: "far-clipboard",
patreon: "fab-patreon",
"pause-circle-o": "far-pause-circle",
paypal: "fab-paypal",
pencil: "pencil-alt",
"pencil-square": "pen-square",
"pencil-square-o": "far-edit",
photo: "far-image",
"picture-o": "far-image",
"pie-chart": "chart-pie",
"pied-piper": "fab-pied-piper",
"pied-piper-alt": "fab-pied-piper-alt",
"pied-piper-pp": "fab-pied-piper-pp",
pinterest: "fab-pinterest",
"pinterest-p": "fab-pinterest-p",
"pinterest-square": "fab-pinterest-square",
"play-circle-o": "far-play-circle",
"plus-square-o": "far-plus-square",
"product-hunt": "fab-product-hunt",
qq: "fab-qq",
"question-circle-o": "far-question-circle",
quora: "fab-quora",
ra: "fab-rebel",
ravelry: "fab-ravelry",
rebel: "fab-rebel",
reddit: "fab-reddit",
"reddit-alien": "fab-reddit-alien",
"reddit-square": "fab-reddit-square",
refresh: "sync",
registered: "far-registered",
remove: "times",
renren: "fab-renren",
reorder: "bars",
repeat: "redo",
resistance: "fab-rebel",
rmb: "yen-sign",
"rotate-left": "undo",
"rotate-right": "redo",
rouble: "ruble-sign",
rub: "ruble-sign",
ruble: "ruble-sign",
rupee: "rupee-sign",
s15: "bath",
safari: "fab-safari",
scissors: "cut",
scribd: "fab-scribd",
sellsy: "fab-sellsy",
send: "paper-plane",
"send-o": "far-paper-plane",
"share-square-o": "far-share-square",
shekel: "shekel-sign",
sheqel: "shekel-sign",
shield: "shield-alt",
shirtsinbulk: "fab-shirtsinbulk",
"sign-in": "sign-in-alt",
"sign-out": "sign-out-alt",
signing: "sign-language",
simplybuilt: "fab-simplybuilt",
skyatlas: "fab-skyatlas",
skype: "fab-skype",
slack: "fab-slack",
sliders: "sliders-h",
slideshare: "fab-slideshare",
"smile-o": "far-smile",
snapchat: "fab-snapchat",
"snapchat-ghost": "fab-snapchat-ghost",
"snapchat-square": "fab-snapchat-square",
"snowflake-o": "far-snowflake",
"soccer-ball-o": "far-futbol",
"sort-alpha-asc": "sort-alpha-down",
"sort-alpha-desc": "sort-alpha-up",
"sort-amount-asc": "sort-amount-down",
"sort-amount-desc": "sort-amount-up",
"sort-asc": "sort-up",
"sort-desc": "sort-down",
"sort-numeric-asc": "sort-numeric-down",
"sort-numeric-desc": "sort-numeric-up",
soundcloud: "fab-soundcloud",
spoon: "utensil-spoon",
spotify: "fab-spotify",
"square-o": "far-square",
"stack-exchange": "fab-stack-exchange",
"stack-overflow": "fab-stack-overflow",
"star-half-empty": "far-star-half",
"star-half-full": "far-star-half",
"star-half-o": "far-star-half",
"star-o": "far-star",
steam: "fab-steam",
"steam-square": "fab-steam-square",
"sticky-note-o": "far-sticky-note",
"stop-circle-o": "far-stop-circle",
stumbleupon: "fab-stumbleupon",
"stumbleupon-circle": "fab-stumbleupon-circle",
"sun-o": "far-sun",
superpowers: "fab-superpowers",
support: "far-life-ring",
tablet: "tablet-alt",
tachometer: "tachometer-alt",
telegram: "fab-telegram",
television: "tv",
"tencent-weibo": "fab-tencent-weibo",
themeisle: "fab-themeisle",
thermometer: "thermometer-full",
"thermometer-0": "thermometer-empty",
"thermometer-1": "thermometer-quarter",
"thermometer-2": "thermometer-half",
"thermometer-3": "thermometer-three-quarters",
"thermometer-4": "thermometer-full",
"thumb-tack": "thumbtack",
"thumbs-o-down": "far-thumbs-down",
"thumbs-o-up": "far-thumbs-up",
ticket: "ticket-alt",
"times-circle-o": "far-times-circle",
"times-rectangle": "window-close",
"times-rectangle-o": "far-window-close",
"toggle-down": "far-caret-square-down",
"toggle-left": "far-caret-square-left",
"toggle-right": "far-caret-square-right",
"toggle-up": "far-caret-square-up",
trash: "trash-alt",
"trash-o": "far-trash-alt",
trello: "fab-trello",
tripadvisor: "fab-tripadvisor",
try: "lira-sign",
tumblr: "fab-tumblr",
"tumblr-square": "fab-tumblr-square",
"turkish-lira": "lira-sign",
twitch: "fab-twitch",
twitter: "fab-twitter",
"twitter-square": "fab-twitter-square",
unsorted: "sort",
usb: "fab-usb",
usd: "dollar-sign",
"user-circle-o": "far-user-circle",
"user-o": "far-user",
vcard: "address-card",
"vcard-o": "far-address-card",
viacoin: "fab-viacoin",
viadeo: "fab-viadeo",
"viadeo-square": "fab-viadeo-square",
"video-camera": "video",
vimeo: "fab-vimeo-v",
"vimeo-square": "fab-vimeo-square",
vine: "fab-vine",
vk: "fab-vk",
vkontakte: "fab-vk",
"volume-control-phone": "phone-volume",
warning: "exclamation-triangle",
wechat: "fab-weixin",
weibo: "fab-weibo",
weixin: "fab-weixin",
whatsapp: "fab-whatsapp",
"wheelchair-alt": "fab-accessible-icon",
"wikipedia-w": "fab-wikipedia-w",
"window-close-o": "far-window-close",
"window-maximize": "far-window-maximize",
"window-restore": "far-window-restore",
windows: "fab-windows",
won: "won-sign",
wordpress: "fab-wordpress",
wpbeginner: "fab-wpbeginner",
wpexplorer: "fab-wpexplorer",
wpforms: "fab-wpforms",
xing: "fab-xing",
"xing-square": "fab-xing-square",
"y-combinator": "fab-y-combinator",
"y-combinator-square": "fab-hacker-news",
yahoo: "fab-yahoo",
yc: "fab-y-combinator",
"yc-square": "fab-hacker-news",
yelp: "fab-yelp",
yen: "yen-sign",
yoast: "fab-yoast",
youtube: "fab-youtube",
"youtube-play": "fab-youtube",
"youtube-square": "fab-youtube-square"
};
export function replaceIcon(source, destination) {
REPLACEMENTS[source] = destination;
}
@ -584,36 +114,9 @@ function warnIfMissing(id) {
}
}
const reportedIcons = [];
function warnIfDeprecated(oldId, newId) {
deprecated(
`Please replace all occurrences of "${oldId}"" with "${newId}". FontAwesome 4.7 icon names are now deprecated and will be removed in the next release.`
);
if (!Discourse.testing && !reportedIcons.includes(oldId)) {
const errorData = {
message: `FA icon deprecation: replace "${oldId}"" with "${newId}".`,
stacktrace: Error().stack
};
jQuery.ajax(`${Discourse.BaseUri}/logs/report_js_error`, {
data: errorData,
type: "POST",
cache: false
});
reportedIcons.push(oldId);
}
}
function handleIconId(icon) {
let id = icon.replacementId || icon.id || "";
if (fa4Replacements.hasOwnProperty(id)) {
warnIfDeprecated(id, fa4Replacements[id]);
id = fa4Replacements[id];
}
// TODO: clean up "thumbtack unpinned" at source instead of here
id = id.replace(" unpinned", "");

View File

@ -1,7 +1,7 @@
var define, requirejs;
(function() {
var EMBER_MODULES = {};
var JS_MODULES = {};
var ALIASES = {
"ember-addons/ember-computed-decorators":
"discourse-common/utils/decorators",
@ -11,7 +11,7 @@ var define, requirejs;
// In future versions of ember we don't need this
if (typeof Ember !== "undefined") {
EMBER_MODULES = {
JS_MODULES = {
jquery: { default: $ },
"@ember/array": {
default: Ember.Array,
@ -285,7 +285,7 @@ var define, requirejs;
name = "@ember/object";
}
var mod = EMBER_MODULES[name] || registry[name];
var mod = JS_MODULES[name] || registry[name];
if (!mod) {
throw new Error(
"Could not find module `" + name + "` imported from `" + origin + "`"
@ -308,8 +308,8 @@ var define, requirejs;
requirejs = require = function(name) {
name = transformForAliases(name);
if (EMBER_MODULES[name]) {
return EMBER_MODULES[name];
if (JS_MODULES[name]) {
return JS_MODULES[name];
}
var mod = registry[name];

View File

@ -12,3 +12,7 @@ define("ember", ["exports"], function(__exports__) {
__exports__.default = Ember;
});
define("message-bus-client", ["exports"], function(__exports__) {
__exports__.default = window.MessageBus;
});

View File

@ -20,7 +20,10 @@ export default Component.extend({
this._removeClass();
let classes = [];
if (slug) classes.push(`category-${slug}`);
if (slug) {
classes.push("category");
classes.push(`category-${slug}`);
}
if (tags) tags.forEach(t => classes.push(`tag-${t}`));
if (classes.length > 0) $("body").addClass(classes.join(" "));
},
@ -32,7 +35,7 @@ export default Component.extend({
_removeClass() {
$("body").removeClass((_, css) =>
(css.match(/\b(?:category|tag)-\S+/g) || []).join(" ")
(css.match(/\b(?:category|tag)-\S+|( category )/g) || []).join(" ")
);
},

View File

@ -483,8 +483,15 @@ export default Component.extend({
}
}
if (translations[full]) {
return resolve([translations[full]]);
// note this will only work for emojis starting with :
// eg: :-)
const allTranslations = Object.assign(
{},
translations,
this.getWithDefault("site.custom_emoji_translation", {})
);
if (allTranslations[full]) {
return resolve([allTranslations[full]]);
}
const match = term.match(/^:?(.*?):t([2-6])?$/);

View File

@ -68,13 +68,6 @@ export default buildCategoryPanel("settings", {
);
},
@discourseComputed
availableListFilters() {
return ["all", "none"].map(p => {
return { name: I18n.t(`category.list_filters.${p}`), value: p };
});
},
@discourseComputed
searchPrioritiesOptions() {
const options = [];

View File

@ -1,4 +1,4 @@
import { alias, match, gt, or } from "@ember/object/computed";
import { alias, match, gt } from "@ember/object/computed";
import Component from "@ember/component";
import { setting } from "discourse/lib/computed";
import discourseComputed from "discourse-common/utils/decorators";
@ -27,11 +27,6 @@ export default Component.extend(CardContentsBase, CleansUp, {
viewingTopic: match("currentPath", /^topic\./),
showMoreMembers: gt("moreMembersCount", 0),
hasMembersOrIsMember: or(
"group.members",
"group.is_group_owner_display",
"group.is_group_user"
),
group: null,

View File

@ -1,5 +1,6 @@
import I18n from "I18n";
import Component from "@ember/component";
import { or } from "@ember/object/computed";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend({
@ -47,6 +48,21 @@ export default Component.extend({
];
},
membersVisibilityLevel: or(
"model.members_visibility_level",
"visibilityLevelOptions.firstObject.value"
),
messageableLevel: or(
"model.messageable_level",
"aliasLevelOptions.firstObject.value"
),
mentionableLevel: or(
"model.mentionable_level",
"aliasLevelOptions.firstObject.value"
),
@discourseComputed(
"siteSettings.email_in",
"model.automatic",

View File

@ -21,7 +21,7 @@ const REGEXP_MIN_POST_COUNT_PREFIX = /^min_post_count:/gi;
const REGEXP_POST_TIME_PREFIX = /^(before|after):/gi;
const REGEXP_TAGS_REPLACE = /(^(tags?:|#(?=[a-z0-9\-]+::tag))|::tag\s?$)/gi;
const REGEXP_IN_MATCH = /^(in|with):(posted|created|watching|tracking|bookmarks|first|pinned|unpinned|wiki|unseen|image)/gi;
const REGEXP_IN_MATCH = /^(in|with):(posted|created|watching|tracking|bookmarks|first|pinned|wiki|unseen|image)/gi;
const REGEXP_SPECIAL_IN_LIKES_MATCH = /^in:likes/gi;
const REGEXP_SPECIAL_IN_TITLE_MATCH = /^in:title/gi;
const REGEXP_SPECIAL_IN_PERSONAL_MATCH = /^in:personal/gi;
@ -51,7 +51,6 @@ export default Component.extend({
this.inOptionsForAll = [
{ name: I18n.t("search.advanced.filters.first"), value: "first" },
{ name: I18n.t("search.advanced.filters.pinned"), value: "pinned" },
{ name: I18n.t("search.advanced.filters.unpinned"), value: "unpinned" },
{ name: I18n.t("search.advanced.filters.wiki"), value: "wiki" },
{ name: I18n.t("search.advanced.filters.images"), value: "images" }
];

View File

@ -6,6 +6,6 @@ export default MountWidget.extend({
widget: "topic-admin-menu-button",
buildArgs() {
return this.getProperties("topic", "fixed", "openUpwards", "rightSide");
return this.getProperties("topic", "openUpwards", "rightSide");
}
});

View File

@ -30,10 +30,7 @@ export default Component.extend(PanEvents, {
let info = this.info;
if (info.get("topicProgressExpanded")) {
info.setProperties({
renderTimeline: true,
renderAdminMenuButton: true
});
info.set("renderTimeline", true);
} else {
let renderTimeline = !this.site.mobileView;
@ -51,10 +48,7 @@ export default Component.extend(PanEvents, {
}
}
info.setProperties({
renderTimeline,
renderAdminMenuButton: !renderTimeline
});
info.set("renderTimeline", renderTimeline);
}
},
@ -76,7 +70,6 @@ export default Component.extend(PanEvents, {
if (
!$target.is(".widget-button") &&
!$parents.is(".widget-button") &&
!$parents.is(".dropdown-menu") &&
!$parents.is("#discourse-modal") &&
!$target.is("#discourse-modal") &&
!$parents.is(".modal-footer") &&

View File

@ -1,7 +1,7 @@
import I18n from "I18n";
import { isEmpty } from "@ember/utils";
import { and, or, alias, reads } from "@ember/object/computed";
import { debounce } from "@ember/runloop";
import { cancel, debounce } from "@ember/runloop";
import { inject as service } from "@ember/service";
import { inject } from "@ember/controller";
import Controller from "@ember/controller";
@ -982,6 +982,10 @@ export default Controller.extend({
this.send("clearTopicDraft");
}
if (this._saveDraftPromise) {
return this._saveDraftPromise.then(() => this.destroyDraft());
}
return Draft.clear(key, this.get("model.draftSequence")).then(() =>
this.appEvents.trigger("draft:destroyed", key)
);
@ -1028,6 +1032,10 @@ export default Controller.extend({
cancelComposer(differentDraft = false) {
this.skipAutoSave = true;
if (this._saveDraftDebounce) {
cancel(this._saveDraftDebounce);
}
const keyPrefix =
this.model.action === "edit" ? "post.abandon_edit" : "post.abandon";
@ -1043,8 +1051,8 @@ export default Controller.extend({
if (differentDraft) {
this.model.clearState();
this.close();
resolve();
}
resolve();
}
},
{
@ -1052,22 +1060,30 @@ export default Controller.extend({
class: "btn-danger",
callback: result => {
if (result) {
this.destroyDraft().then(() => {
this.model.clearState();
this.close();
resolve();
});
this.destroyDraft()
.then(() => {
this.model.clearState();
this.close();
})
.finally(() => {
resolve();
});
} else {
resolve();
}
}
}
]);
} else {
// it is possible there is some sort of crazy draft with no body ... just give up on it
this.destroyDraft().then(() => {
this.model.clearState();
this.close();
resolve();
});
this.destroyDraft()
.then(() => {
this.model.clearState();
this.close();
})
.finally(() => {
resolve();
});
}
});
@ -1094,11 +1110,12 @@ export default Controller.extend({
// in test debounce is Ember.run, this will cause
// an infinite loop
if (ENV.environment !== "test") {
debounce(this, this._saveDraft, 2000);
this._saveDraftDebounce = debounce(this, this._saveDraft, 2000);
}
} else {
model.saveDraft().finally(() => {
this._saveDraftPromise = model.saveDraft().finally(() => {
this._lastDraftSaved = Date.now();
this._saveDraftPromise = null;
});
}
}
@ -1119,7 +1136,7 @@ export default Controller.extend({
if (Date.now() - this._lastDraftSaved > 15000) {
this._saveDraft();
} else {
debounce(this, this._saveDraft, 2000);
this._saveDraftDebounce = debounce(this, this._saveDraft, 2000);
}
}
},

View File

@ -5,7 +5,7 @@ import { setDefaultHomepage } from "discourse/lib/utilities";
import discourseComputed from "discourse-common/utils/decorators";
import { listThemes, setLocalTheme } from "discourse/lib/theme-selector";
import { popupAjaxError } from "discourse/lib/ajax-error";
import pageReloader from "discourse/helpers/page-reloader";
import { reload } from "discourse/helpers/page-reloader";
import {
safariHacksDisabled,
isiPad,
@ -193,7 +193,7 @@ export default Controller.extend({
}
if (this.themeId !== this.currentThemeId) {
pageReloader.reload();
reload();
}
})
.catch(popupAjaxError);

View File

@ -57,14 +57,12 @@ export default Controller.extend({
@discourseComputed
sortOrders() {
return ["priority", "priority_asc", "created_at", "created_at_asc"].map(
order => {
return {
id: order,
name: I18n.t(`review.filters.orders.${order}`)
};
}
);
return ["score", "score_asc", "created_at", "created_at_asc"].map(order => {
return {
id: order,
name: I18n.t(`review.filters.orders.${order}`)
};
});
},
@discourseComputed
@ -129,14 +127,14 @@ export default Controller.extend({
priorityStatuses.includes(nextStatus) &&
nextOrder === "created_at"
) {
nextOrder = "priority";
nextOrder = "score";
}
if (
priorityStatuses.includes(currentStatus) &&
currentOrder === "priority" &&
currentOrder === "score" &&
createdAtStatuses.includes(nextStatus) &&
nextOrder === "priority"
nextOrder === "score"
) {
nextOrder = "created_at";
}

View File

@ -2,6 +2,7 @@ import { equal } from "@ember/object/computed";
import Controller, { inject as controller } from "@ember/controller";
import discourseDebounce from "discourse/lib/debounce";
import { observes } from "discourse-common/utils/decorators";
import { longDate } from "discourse/lib/formatter";
export default Controller.extend({
application: controller(),
@ -12,9 +13,29 @@ export default Controller.extend({
name: "",
group: null,
exclude_usernames: null,
isLoading: false,
showTimeRead: equal("period", "all"),
loadUsers(params) {
this.set("isLoading", true);
this.store
.find("directoryItem", params)
.then(model => {
const lastUpdatedAt = model.get("resultSetMeta.last_updated_at");
this.setProperties({
model,
lastUpdatedAt: lastUpdatedAt ? longDate(lastUpdatedAt) : null,
period: params.period,
nameInput: params.name
});
})
.finally(() => {
this.set("isLoading", false);
});
},
@observes("nameInput")
_setName: discourseDebounce(function() {
this.set("name", this.nameInput);

View File

@ -1,10 +1,7 @@
import EmberObject from "@ember/object";
import Ember from "ember";
import { isTesting } from "discourse-common/config/environment";
export default EmberObject.create({
reload: function() {
if (!Ember.testing) {
location.reload();
}
export function reload() {
if (!isTesting()) {
location.reload();
}
});
}

View File

@ -7,7 +7,6 @@ const SHARE_PRIORITY = 1000;
const BOOKMARK_PRIORITY = 900;
const ARCHIVE_PRIORITY = 800;
const FLAG_PRIORITY = 700;
const EDIT_MESSAGE_PRIORITY = 600;
const DEFER_PRIORITY = 500;
export default {
@ -166,23 +165,6 @@ export default {
}
});
registerTopicFooterButton({
id: "edit-message",
priority: EDIT_MESSAGE_PRIORITY,
icon: "pencil-alt",
label: "topic.edit_message.title",
title: "topic.edit_message.help",
action: "editFirstPost",
classNames: ["edit-message"],
dependentKeys: ["editFirstPost", "showEditOnFooter"],
dropdown() {
return this.site.mobileView && this.get("topic.isPrivateMessage");
},
displayed() {
return this.showEditOnFooter;
}
});
registerTopicFooterButton({
id: "defer",
icon: "circle",

View File

@ -274,6 +274,9 @@ export default function(options) {
ul.find("li").click(function() {
selectedOption = ul.find("li").index(this);
completeTerm(autocompleteOptions[selectedOption]);
if (!options.single) {
me.focus();
}
return false;
});
var pos = null;

View File

@ -5,10 +5,11 @@ import { TAG_HASHTAG_POSTFIX } from "discourse/lib/tag-hashtags";
import { SEPARATOR } from "discourse/lib/category-hashtags";
import { Promise } from "rsvp";
import { later, cancel } from "@ember/runloop";
import { isTesting } from "discourse-common/config/environment";
var cache = {};
var cacheTime;
var oldSearch;
let cache = {};
let cacheTime;
let oldSearch;
function updateCache(term, results) {
cache[term] = results;
@ -22,7 +23,7 @@ function searchTags(term, categories, limit) {
() => {
resolve(CANCELLED_STATUS);
},
Ember.testing ? 50 : 5000
isTesting() ? 50 : 5000
);
const debouncedSearch = discourseDebounce((q, cats, resultFunc) => {

View File

@ -18,6 +18,7 @@ function getOpts(opts) {
getURL: getURLWithCDN,
currentUser: Discourse.__container__.lookup("current-user:main"),
censoredRegexp: site.censored_regexp,
customEmojiTranslation: site.custom_emoji_translation,
siteSettings,
formatUsername
},

View File

@ -4,6 +4,7 @@ import { userPath } from "discourse/lib/url";
import { emailValid } from "discourse/lib/utilities";
import { Promise } from "rsvp";
import { later, cancel } from "@ember/runloop";
import { isTesting } from "discourse-common/config/environment";
var cache = {},
cacheKey,
@ -185,7 +186,7 @@ export default function userSearch(options) {
() => {
resolve(CANCELLED_STATUS);
},
Ember.testing ? 50 : 5000
isTesting() ? 250 : 5000
);
if (skipSearch(term, options.allowEmails)) {

View File

@ -187,8 +187,7 @@ const Category = RestModel.extend({
),
search_priority: this.search_priority,
reviewable_by_group_name: this.reviewable_by_group_name,
read_only_banner: this.read_only_banner,
default_list_filter: this.default_list_filter
read_only_banner: this.read_only_banner
},
type: id ? "PUT" : "POST"
});

View File

@ -404,10 +404,10 @@ const TopicTrackingState = EmberObject.extend({
return new Set(result);
},
countNew(categoryId) {
countCategoryByState(fn, categoryId) {
const subcategoryIds = this.getSubCategoryIds(categoryId);
return _.chain(this.states)
.filter(isNew)
.filter(fn)
.filter(
topic =>
topic.archetype !== "private_message" &&
@ -417,17 +417,45 @@ const TopicTrackingState = EmberObject.extend({
.value().length;
},
countNew(categoryId) {
return this.countCategoryByState(isNew, categoryId);
},
countUnread(categoryId) {
const subcategoryIds = this.getSubCategoryIds(categoryId);
return _.chain(this.states)
.filter(isUnread)
.filter(
topic =>
topic.archetype !== "private_message" &&
!topic.deleted &&
(!categoryId || subcategoryIds.has(topic.category_id))
)
.value().length;
return this.countCategoryByState(isUnread, categoryId);
},
countTags(tags) {
let counts = {};
tags.forEach(tag => {
counts[tag] = { unreadCount: 0, newCount: 0 };
});
Object.values(this.states).forEach(topic => {
if (
topic.archetype !== "private_message" &&
!topic.deleted &&
topic.tags
) {
let newTopic = isNew(topic);
let unreadTopic = isUnread(topic);
if (isUnread || isNew) {
tags.forEach(tag => {
if (topic.tags.indexOf(tag) > -1) {
if (unreadTopic) {
counts[tag].unreadCount++;
}
if (newTopic) {
counts[tag].newCount++;
}
}
});
}
}
});
return counts;
},
countCategory(category_id) {

View File

@ -0,0 +1,94 @@
import PreloadStore from "discourse/lib/preload-store";
import I18n from "I18n";
import Session from "discourse/models/session";
import RSVP from "rsvp";
import { isTesting } from "discourse-common/config/environment";
export default {
name: "discourse-bootstrap",
// The very first initializer to run
initialize(container, app) {
// Our test environment has its own bootstrap code
if (isTesting()) {
return;
}
const preloadedDataElement = document.getElementById("data-preloaded");
const setupData = document.getElementById("data-discourse-setup").dataset;
if (preloadedDataElement) {
const preloaded = JSON.parse(preloadedDataElement.dataset.preloaded);
Object.keys(preloaded).forEach(function(key) {
PreloadStore.store(key, JSON.parse(preloaded[key]));
if (setupData.debugPreloadedAppData === "true") {
/* eslint-disable no-console */
console.log(key, PreloadStore.get(key));
/* eslint-enable no-console */
}
});
}
app.CDN = setupData.cdn;
app.BaseUrl = setupData.baseUrl;
app.BaseUri = setupData.baseUri;
app.Environment = setupData.environment;
app.SiteSettings = PreloadStore.get("siteSettings");
app.ThemeSettings = PreloadStore.get("themeSettings");
app.LetterAvatarVersion = setupData.letterAvatarVersion;
app.MarkdownItURL = setupData.markdownItUrl;
app.ServiceWorkerURL = setupData.serviceWorkerUrl;
I18n.defaultLocale = setupData.defaultLocale;
window.Logster = window.Logster || {};
window.Logster.enabled = setupData.enableJsErrorReporting === "true";
app.set("assetVersion", setupData.assetVersion);
Session.currentProp(
"disableCustomCSS",
setupData.disableCustomCss === "true"
);
if (setupData.safeMode) {
Session.currentProp("safe_mode", setupData.safeMode);
}
app.HighlightJSPath = setupData.highlightJsPath;
app.SvgSpritePath = setupData.svgSpritePath;
if (app.Environment === "development") {
app.SvgIconList = setupData.svgIconList;
}
if (setupData.s3BaseUrl) {
app.S3CDN = setupData.s3Cdn;
app.S3BaseUrl = setupData.s3BaseUrl;
}
RSVP.configure("onerror", function(e) {
// Ignore TransitionAborted exceptions that bubble up
if (e && e.message === "TransitionAborted") {
return;
}
if (Discourse.Environment === "development") {
/* eslint-disable no-console */
if (e) {
if (e.message || e.stack) {
console.log(e.message);
console.log(e.stack);
} else {
console.log("Uncaught promise: ", e);
}
} else {
console.log("A promise failed but was not caught.");
}
/* eslint-enable no-console */
}
window.onerror(e && e.message, null, null, null, e);
});
}
};

View File

@ -9,11 +9,13 @@ import TopicTrackingState, {
import ScreenTrack from "discourse/lib/screen-track";
import Site from "discourse/models/site";
import User from "discourse/models/user";
import MessageBus from "message-bus-client";
const ALL_TARGETS = ["controller", "component", "route", "model", "adapter"];
export default {
name: "inject-discourse-objects",
after: "discourse-bootstrap",
initialize(container, app) {
ALL_TARGETS.forEach(t => app.inject(t, "appEvents", "service:app-events"));
@ -27,8 +29,7 @@ export default {
ALL_TARGETS.forEach(t => app.inject(t, "store", "service:store"));
}
const messageBus = window.MessageBus;
app.register("message-bus:main", messageBus, { instantiate: false });
app.register("message-bus:main", MessageBus, { instantiate: false });
ALL_TARGETS.concat("service").forEach(t =>
app.inject(t, "messageBus", "message-bus:main")
@ -39,7 +40,7 @@ export default {
app.currentUser = currentUser;
const topicTrackingState = TopicTrackingState.create({
messageBus,
messageBus: MessageBus,
currentUser
});
app.register("topic-tracking-state:main", topicTrackingState, {

View File

@ -7,7 +7,7 @@ export default DiscourseRoute.extend({
if (params.status === "reviewed" || params.status === "all") {
params.sort_order = "created_at";
} else {
params.sort_order = "priority";
params.sort_order = "score";
}
}

View File

@ -1,6 +1,5 @@
import I18n from "I18n";
import DiscourseRoute from "discourse/routes/discourse";
import { longDate } from "discourse/lib/formatter";
export default DiscourseRoute.extend({
queryParams: {
@ -37,20 +36,11 @@ export default DiscourseRoute.extend({
},
model(params) {
// If we refresh via `refreshModel` set the old model to loading
this._params = params;
return this.store.find("directoryItem", params);
return params;
},
setupController(controller, model) {
const params = this._params;
const lastUpdatedAt = model.get("resultSetMeta.last_updated_at");
controller.setProperties({
model,
lastUpdatedAt: lastUpdatedAt ? longDate(lastUpdatedAt) : null,
period: params.period,
nameInput: params.name
});
setupController(controller, params) {
controller.loadUsers(params);
},
actions: {

View File

@ -2,6 +2,8 @@
<div class="container badges">
<h1>{{i18n "badges.title"}}</h1>
{{plugin-outlet name="below-badges-title"}}
<div class="badge-groups">
{{#each badgeGroups as |bg|}}
<div class="badge-grouping">

View File

@ -1,4 +1,6 @@
<div class="composer-controls">
{{plugin-outlet name="before-composer-toggles"}}
{{#if site.mobileView}}
{{flat-button
class="toggle-toolbar"
@ -19,4 +21,4 @@
action=toggleFullscreen
title=fullscreenTitle}}
{{/unless}}
</div>
</div>

View File

@ -10,7 +10,6 @@
onOpen=(action b.action b)
class=b.className
options=(hash
popupTitle=b.title
icon=b.icon
focusAfterOnChange=false
)

View File

@ -196,22 +196,6 @@
{{/unless}}
</div>
</section>
<section class="field">
<label for="category-default-filter">
{{i18n "category.default_list_filter"}}
</label>
<div class="controls">
{{combo-box
id="category-default-filter"
valueProperty="value"
content=availableListFilters
value=category.default_list_filter
none="category.list_filters.all"
}}
</div>
</section>
{{#if isParentCategory}}
<section class="field show-subcategory-list-field">
<label>

View File

@ -49,35 +49,15 @@
</div>
{{/if}}
{{#if hasMembersOrIsMember}}
<div class="card-row third-row">
<div class="metadata">
<h3>
<span class="desc">
{{i18n "groups.user_count"}}
</span>
{{group.user_count}}
</h3>
<h3>
{{#if group.is_group_owner_display}}
{{i18n "groups.index.is_group_owner"}}
{{else if group.is_group_user}}
{{i18n "groups.index.is_group_user"}}
{{/if}}
</h3>
</div>
</div>
{{/if}}
{{#if group.members}}
<div class="card-row fourth-row">
<div class="card-row third-row">
<div class="members metadata">
{{#each group.members as |user|}}
<a href {{action "showUser" user}} class="card-tiny-avatar">{{bound-avatar user "tiny"}}</a>
{{/each}}
{{#if showMoreMembers}}
<a href={{groupPath}} {{action "showGroup" group}} class="more-members-link">
<span class="more-members-count">+{{moreMembersCount}}{{i18n "more"}}</span>
<span class="more-members-count">+{{moreMembersCount}} {{i18n "more"}}</span>
</a>
{{/if}}
</div>

View File

@ -22,11 +22,12 @@
<label for="visiblity">{{i18n "admin.groups.manage.interaction.members_visibility_levels.title"}}</label>
{{combo-box name="alias"
valueProperty="value"
value=model.members_visibility_level
content=visibilityLevelOptions
castInteger=true
class="groups-form-members-visibility-level"}}
valueProperty="value"
value=membersVisibilityLevel
content=visibilityLevelOptions
class="groups-form-members-visibility-level"
onChange=(action (mut model.members_visibility_level))
}}
<div class="control-instructions">
{{i18n "admin.groups.manage.interaction.members_visibility_levels.description"}}
@ -41,7 +42,7 @@
{{combo-box
name="alias"
valueProperty="value"
value=model.mentionable_level
value=mentionableLevel
content=aliasLevelOptions
class="groups-form-mentionable-level"
onChange=(action (mut model.mentionable_level))
@ -54,7 +55,7 @@
{{combo-box
name="alias"
valueProperty="value"
value=model.messageable_level
value=messageableLevel
content=aliasLevelOptions
class="groups-form-messageable-level"
onChange=(action (mut model.messageable_level))

View File

@ -8,7 +8,6 @@
action=(action "turnon")
label="user.desktop_notifications.enable"
}}
.
</span>
{{d-button
icon="times"

View File

@ -125,7 +125,11 @@
<div class="suspended">
<div class="suspension-date">
{{d-icon "ban"}}
{{i18n "user.suspended_notice" date=this.user.suspendedTillDate}}
{{#if this.user.suspendedForever}}
{{i18n 'user.suspended_permanently'}}
{{else}}
{{i18n 'user.suspended_notice' date=this.user.suspendedTillDate}}
{{/if}}
</div>
<div class="suspension-reason">
<span class="suspension-reason-title">{{i18n "user.suspended_reason"}}</span>

View File

@ -14,6 +14,8 @@
{{conditional-loading-spinner condition=loading}}
{{plugin-outlet name="discovery-above"}}
<div class="container list-container {{if loading "hidden"}}">
<div class="row">
<div class="full-width">
@ -34,4 +36,4 @@
</div>
{{plugin-outlet name="discovery-below"}}
{{/if}}
{{/if}}

View File

@ -50,6 +50,7 @@
</div>
{{/if}}
{{/if}}
{{plugin-outlet name="before-topic-list" args=(hash category=category)}}
{{#if hasTopics}}
{{topic-list
@ -73,6 +74,8 @@
scrollOnLoad=true
onScroll=discoveryTopicList.saveScrollPosition}}
{{/if}}
{{plugin-outlet name="after-topic-list" args=(hash category=category)}}
{{/discovery-topics-list}}
<footer class="topic-list-bottom">
@ -107,4 +110,4 @@
{{/footer-message}}
{{/if}}
</footer>
</footer>

View File

@ -127,24 +127,6 @@
{{#topic-navigation topic=model jumpToDate=(action "jumpToDate") jumpToIndex=(action "jumpToIndex") as |info|}}
{{#if info.renderTimeline}}
{{#if info.renderAdminMenuButton}}
{{topic-admin-menu-button
topic=model
fixed="true"
toggleMultiSelect=(action "toggleMultiSelect")
deleteTopic=(action "deleteTopic")
recoverTopic=(action "recoverTopic")
toggleClosed=(action "toggleClosed")
toggleArchived=(action "toggleArchived")
toggleVisibility=(action "toggleVisibility")
showTopicStatusUpdate=(route-action "showTopicStatusUpdate")
showFeatureTopic=(route-action "showFeatureTopic")
showChangeTimestamp=(route-action "showChangeTimestamp")
resetBumpDate=(action "resetBumpDate")
convertToPublicTopic=(action "convertToPublicTopic")
convertToPrivateMessage=(action "convertToPrivateMessage")}}
{{/if}}
{{topic-timeline
topic=model
notificationLevel=model.details.notification_level
@ -178,24 +160,22 @@
expanded=info.topicProgressExpanded
jumpToPost=(action "jumpToPost")}}
{{plugin-outlet name="before-topic-progress" args=(hash model=model jumpToPost=(action "jumpToPost"))}}
{{#if info.renderAdminMenuButton}}
{{topic-admin-menu-button
topic=model
openUpwards="true"
rightSide="true"
toggleMultiSelect=(action "toggleMultiSelect")
deleteTopic=(action "deleteTopic")
recoverTopic=(action "recoverTopic")
toggleClosed=(action "toggleClosed")
toggleArchived=(action "toggleArchived")
toggleVisibility=(action "toggleVisibility")
showTopicStatusUpdate=(route-action "showTopicStatusUpdate")
showFeatureTopic=(route-action "showFeatureTopic")
showChangeTimestamp=(route-action "showChangeTimestamp")
resetBumpDate=(action "resetBumpDate")
convertToPublicTopic=(action "convertToPublicTopic")
convertToPrivateMessage=(action "convertToPrivateMessage")}}
{{/if}}
{{topic-admin-menu-button
topic=model
openUpwards="true"
rightSide="true"
toggleMultiSelect=(action "toggleMultiSelect")
deleteTopic=(action "deleteTopic")
recoverTopic=(action "recoverTopic")
toggleClosed=(action "toggleClosed")
toggleArchived=(action "toggleArchived")
toggleVisibility=(action "toggleVisibility")
showTopicStatusUpdate=(route-action "showTopicStatusUpdate")
showFeatureTopic=(route-action "showFeatureTopic")
showChangeTimestamp=(route-action "showChangeTimestamp")
resetBumpDate=(action "resetBumpDate")
convertToPublicTopic=(action "convertToPublicTopic")
convertToPrivateMessage=(action "convertToPrivateMessage")}}
{{/topic-progress}}
{{/if}}
{{/topic-navigation}}

View File

@ -16,7 +16,7 @@
{{text-field value=nameInput placeholderKey="directory.filter_name" class="filter-name no-blur"}}
</div>
{{#conditional-loading-spinner condition=model.loading}}
{{#conditional-loading-spinner condition=isLoading}}
{{#if model.length}}
<table>

View File

@ -299,17 +299,20 @@ export default createWidget("header", {
html(attrs, state) {
let contents = () => {
const panels = [
this.attach("header-buttons", attrs),
this.attach("header-icons", {
hamburgerVisible: state.hamburgerVisible,
userVisible: state.userVisible,
searchVisible: state.searchVisible,
ringBackdrop: state.ringBackdrop,
flagCount: attrs.flagCount,
user: this.currentUser
})
];
const headerIcons = this.attach("header-icons", {
hamburgerVisible: state.hamburgerVisible,
userVisible: state.userVisible,
searchVisible: state.searchVisible,
ringBackdrop: state.ringBackdrop,
flagCount: attrs.flagCount,
user: this.currentUser
});
if (attrs.onlyIcons) {
return headerIcons;
}
const panels = [this.attach("header-buttons", attrs), headerIcons];
if (state.searchVisible) {
const contextType = this.searchContextType();

View File

@ -1,4 +1,3 @@
import I18n from "I18n";
import { createWidget } from "discourse/widgets/widget";
import { h } from "virtual-dom";
import { ButtonClass } from "discourse/widgets/button";
@ -8,6 +7,20 @@ createWidget(
jQuery.extend(ButtonClass, { tagName: "li.btn" })
);
createWidget("post-admin-menu-button", {
tagName: "li",
html(attrs) {
return this.attach("button", {
className: attrs.className,
action: attrs.action,
icon: attrs.icon,
label: attrs.label,
secondaryAction: attrs.secondaryAction
});
}
});
export function buildManageButtons(attrs, currentUser, siteSettings) {
if (!currentUser) {
return [];
@ -27,7 +40,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
const buttonAtts = {
action: "togglePostType",
icon: "shield-alt",
className: "btn-default toggle-post-type"
className: "popup-menu-button toggle-post-type"
};
if (attrs.isModeratorAction) {
@ -44,14 +57,14 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
icon: "user-shield",
label: "post.controls.remove_post_notice",
action: "removeNotice",
className: "btn-default remove-notice"
className: "popup-menu-button remove-notice"
});
} else {
contents.push({
icon: "user-shield",
label: "post.controls.add_post_notice",
action: "addNotice",
className: "btn-default add-notice"
className: "popup-menu-button add-notice"
});
}
}
@ -61,7 +74,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
icon: "far-eye",
label: "post.controls.unhide",
action: "unhidePost",
className: "btn-default unhide-post"
className: "popup-menu-button unhide-post"
});
}
@ -70,7 +83,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
icon: "user",
label: "post.controls.change_owner",
action: "changePostOwner",
className: "btn-default change-owner"
className: "popup-menu-button change-owner"
});
}
@ -80,7 +93,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
icon: "certificate",
label: "post.controls.grant_badge",
action: "grantBadge",
className: "btn-default grant-badge"
className: "popup-menu-button grant-badge"
});
}
@ -90,7 +103,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
label: "post.controls.unlock_post",
action: "unlockPost",
title: "post.controls.unlock_post_description",
className: "btn-default unlock-post"
className: "popup-menu-button unlock-post"
});
} else {
contents.push({
@ -98,7 +111,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
label: "post.controls.lock_post",
action: "lockPost",
title: "post.controls.lock_post_description",
className: "btn-default lock-post"
className: "popup-menu-button lock-post"
});
}
}
@ -109,14 +122,14 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
action: "toggleWiki",
label: "post.controls.unwiki",
icon: "far-edit",
className: "btn-default wiki wikied"
className: "popup-menu-button wiki wikied"
});
} else {
contents.push({
action: "toggleWiki",
label: "post.controls.wiki",
icon: "far-edit",
className: "btn-default wiki"
className: "popup-menu-button wiki"
});
}
}
@ -126,7 +139,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
icon: "file",
label: "post.controls.publish_page",
action: "showPagePublish",
className: "btn-default publish-page"
className: "popup-menu-button publish-page"
});
}
@ -135,7 +148,7 @@ export function buildManageButtons(attrs, currentUser, siteSettings) {
icon: "cog",
label: "post.controls.rebake",
action: "rebakePost",
className: "btn-default rebuild-html"
className: "popup-menu-button rebuild-html"
});
}
@ -147,7 +160,6 @@ export default createWidget("post-admin-menu", {
html() {
const contents = [];
contents.push(h("h3", I18n.t("admin_title")));
buildManageButtons(this.attrs, this.currentUser, this.siteSettings).forEach(
b => {
@ -156,7 +168,7 @@ export default createWidget("post-admin-menu", {
}
);
return contents;
return h("ul", contents);
},
clickOutside() {

View File

@ -3,6 +3,7 @@ import { createWidget } from "discourse/widgets/widget";
import transformPost from "discourse/lib/transform-post";
import { Placeholder } from "discourse/lib/posts-with-placeholders";
import { addWidgetCleanCallback } from "discourse/components/mount-widget";
import { isTesting } from "discourse-common/config/environment";
let transformCallbacks = null;
export function postTransformCallbacks(transformed) {
@ -19,7 +20,7 @@ export function addPostTransformCallback(callback) {
transformCallbacks.push(callback);
}
const CLOAKING_ENABLED = !window.inTestEnv;
const CLOAKING_ENABLED = !isTesting();
const DAY = 1000 * 60 * 60 * 24;
const _dontCloak = {};

View File

@ -1,32 +1,33 @@
import I18n from "I18n";
import { createWidget, applyDecorators } from "discourse/widgets/widget";
import { h } from "virtual-dom";
createWidget("admin-menu-button", {
tagName: "li",
buildClasses(attrs) {
return attrs.className;
},
html(attrs) {
let className;
if (attrs.buttonClass) {
className = attrs.buttonClass;
}
return h(
"li",
{ className: attrs.className },
this.attach("button", {
className,
action: attrs.action,
url: attrs.url,
icon: attrs.icon,
label: attrs.fullLabel || `topic.${attrs.label}`,
secondaryAction: "hideAdminMenu"
})
);
return this.attach("button", {
className,
action: attrs.action,
url: attrs.url,
icon: attrs.icon,
label: attrs.fullLabel || `topic.${attrs.label}`,
secondaryAction: "hideAdminMenu"
});
}
});
createWidget("topic-admin-menu-button", {
tagName: "span",
buildKey: () => `topic-admin-menu-button`,
buildKey: () => "topic-admin-menu-button",
defaultState() {
return { expanded: false, position: null };
@ -37,7 +38,6 @@ createWidget("topic-admin-menu-button", {
const menu = this.attach("topic-admin-menu", {
position: state.position,
fixed: attrs.fixed,
topic: attrs.topic,
openUpwards: attrs.openUpwards,
rightSide: !this.site.mobileView && attrs.rightSide,
@ -52,8 +52,7 @@ createWidget("topic-admin-menu-button", {
result.push(
this.attach("button", {
className:
"btn-default toggle-admin-menu" +
(attrs.fixed ? " show-topic-admin" : "") +
"popup-menu-button toggle-admin-menu" +
(attrs.addKeyboardTargetClass ? " keyboard-target-admin-menu" : ""),
title: "topic_admin_menu",
icon: "wrench",
@ -73,10 +72,6 @@ createWidget("topic-admin-menu-button", {
hideAdminMenu() {
this.state.expanded = false;
this.state.position = null;
if (this.site.mobileView && !this.attrs.rightSide) {
$(".header-cloak").css("display", "");
}
},
showAdminMenu(e) {
@ -89,21 +84,25 @@ createWidget("topic-admin-menu-button", {
$button = $(e.target).closest("button");
}
const position = $button.position();
const position = $button.position(),
SPACING = 3,
MENU_WIDTH = 217;
const rtl = $("html").hasClass("rtl");
position.outerHeight = $button.outerHeight();
if (rtl) {
position.left -= 217 - $button.outerWidth();
position.left -= MENU_WIDTH - $button.outerWidth();
}
if (this.attrs.fixed) {
position.left += $button.width() - 203;
}
if (this.site.mobileView && !this.attrs.rightSide) {
$(".header-cloak").css("display", "block");
if (this.attrs.openUpwards) {
if (rtl) {
position.left -= $button[0].offsetWidth + SPACING;
} else {
position.left += $button[0].offsetWidth + SPACING;
}
} else {
position.top += $button[0].offsetHeight + SPACING;
}
this.state.position = position;
@ -134,7 +133,7 @@ export default createWidget("topic-admin-menu", {
if (this.currentUser && this.currentUser.get("canManageTopic")) {
this.addActionButton({
className: "topic-admin-multi-select",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "toggleMultiSelect",
icon: "tasks",
label: "actions.multi_select"
@ -143,7 +142,7 @@ export default createWidget("topic-admin-menu", {
if (details.get("can_delete")) {
this.addActionButton({
className: "topic-admin-delete",
buttonClass: "btn-danger",
buttonClass: "popup-menu-btn-danger",
action: "deleteTopic",
icon: "far-trash-alt",
label: "actions.delete"
@ -153,7 +152,7 @@ export default createWidget("topic-admin-menu", {
if (topic.get("deleted") && details.get("can_recover")) {
this.addActionButton({
className: "topic-admin-recover",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "recoverTopic",
icon: "undo",
label: "actions.recover"
@ -163,7 +162,7 @@ export default createWidget("topic-admin-menu", {
if (topic.get("closed")) {
this.addActionButton({
className: "topic-admin-open",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "toggleClosed",
icon: "unlock",
label: "actions.open"
@ -171,7 +170,7 @@ export default createWidget("topic-admin-menu", {
} else {
this.addActionButton({
className: "topic-admin-close",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "toggleClosed",
icon: "lock",
label: "actions.close"
@ -180,7 +179,7 @@ export default createWidget("topic-admin-menu", {
this.addActionButton({
className: "topic-admin-status-update",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "showTopicStatusUpdate",
icon: "far-clock",
label: "actions.timed_update"
@ -189,7 +188,7 @@ export default createWidget("topic-admin-menu", {
if (!isPrivateMessage && (topic.get("visible") || featured)) {
this.addActionButton({
className: "topic-admin-pin",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "showFeatureTopic",
icon: "thumbtack",
label: featured ? "actions.unpin" : "actions.pin"
@ -199,7 +198,7 @@ export default createWidget("topic-admin-menu", {
if (this.currentUser.get("staff")) {
this.addActionButton({
className: "topic-admin-change-timestamp",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "showChangeTimestamp",
icon: "calendar-alt",
label: "change_timestamp.title"
@ -208,7 +207,7 @@ export default createWidget("topic-admin-menu", {
this.addActionButton({
className: "topic-admin-reset-bump-date",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "resetBumpDate",
icon: "anchor",
label: "actions.reset_bump_date"
@ -217,7 +216,7 @@ export default createWidget("topic-admin-menu", {
if (!isPrivateMessage) {
this.addActionButton({
className: "topic-admin-archive",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "toggleArchived",
icon: "folder",
label: topic.get("archived") ? "actions.unarchive" : "actions.archive"
@ -226,7 +225,7 @@ export default createWidget("topic-admin-menu", {
this.addActionButton({
className: "topic-admin-visible",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: "toggleVisibility",
icon: visible ? "far-eye-slash" : "far-eye",
label: visible ? "actions.invisible" : "actions.visible"
@ -235,7 +234,7 @@ export default createWidget("topic-admin-menu", {
if (details.get("can_convert_topic")) {
this.addActionButton({
className: "topic-admin-convert",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
action: isPrivateMessage
? "convertToPublicTopic"
: "convertToPrivateMessage",
@ -249,7 +248,7 @@ export default createWidget("topic-admin-menu", {
if (this.currentUser.get("staff")) {
this.addActionButton({
icon: "list",
buttonClass: "btn-default",
buttonClass: "popup-menu-btn",
fullLabel: "review.moderation_history",
url: `/review?topic_id=${topic.id}&status=all`
});
@ -259,7 +258,7 @@ export default createWidget("topic-admin-menu", {
buildAttributes(attrs) {
let { top, left, outerHeight } = attrs.position;
const position = attrs.fixed || this.site.mobileView ? "fixed" : "absolute";
const position = this.site.mobileView ? "fixed" : "absolute";
if (attrs.rightSide) {
return;
@ -275,7 +274,7 @@ export default createWidget("topic-admin-menu", {
}
if (this.site.mobileView) {
bottom = 0;
bottom = 50;
left = 0;
}
@ -300,26 +299,13 @@ export default createWidget("topic-admin-menu", {
this.attrs,
this.state
);
return [
h("div.header", [
h("h3", I18n.t("topic.actions.title")),
h(
"div",
this.attach("button", {
action: "clickOutside",
icon: "times",
className: "close-button"
})
)
]),
h(
"ul",
attrs.actionButtons
.concat(extraButtons)
.filter(Boolean)
.map(b => this.attach("admin-menu-button", b))
)
];
return h(
"ul",
attrs.actionButtons
.concat(extraButtons)
.filter(Boolean)
.map(b => this.attach("admin-menu-button", b))
);
},
clickOutside() {

View File

@ -359,7 +359,7 @@ createWidget("timeline-footer-controls", {
if (topic.get("details.can_create_post")) {
controls.push(
this.attach("button", {
className: "btn-default create",
className: "btn-default create reply-to-post",
icon: "reply",
title: "topic.reply.help",
action: "replyToPost"
@ -396,6 +396,15 @@ createWidget("timeline-footer-controls", {
["notificationLevel"]
)
);
if (this.site.mobileView) {
controls.push(
this.attach("topic-admin-menu-button", {
topic,
addKeyboardTargetClass: true,
openUpwards: true
})
);
}
}
return controls;

View File

@ -3,4 +3,3 @@
//= require jquery
//= require ember_include
//= require discourse-loader
//= require ember-shim

View File

@ -1,84 +0,0 @@
// discourse-skip-module
(function() {
const ps = require("discourse/lib/preload-store").default;
const preloadedDataElement = document.getElementById("data-preloaded");
const setupData = document.getElementById("data-discourse-setup").dataset;
const I18n = require("I18n").default;
if (preloadedDataElement) {
const preloaded = JSON.parse(preloadedDataElement.dataset.preloaded);
Object.keys(preloaded).forEach(function(key) {
ps.store(key, JSON.parse(preloaded[key]));
if (setupData.debugPreloadedAppData === "true") {
/* eslint-disable no-console */
console.log(key, ps.get(key));
/* eslint-enable no-console */
}
});
}
window.Logster = window.Logster || {};
window.Logster.enabled = setupData.enableJsErrorReporting === "true";
Discourse.CDN = setupData.cdn;
Discourse.BaseUrl = setupData.baseUrl;
Discourse.BaseUri = setupData.baseUri;
Discourse.Environment = setupData.environment;
Discourse.SiteSettings = ps.get("siteSettings");
Discourse.ThemeSettings = ps.get("themeSettings");
Discourse.LetterAvatarVersion = setupData.letterAvatarVersion;
Discourse.MarkdownItURL = setupData.markdownItUrl;
Discourse.ServiceWorkerURL = setupData.serviceWorkerUrl;
I18n.defaultLocale = setupData.defaultLocale;
Discourse.start();
Discourse.set("assetVersion", setupData.assetVersion);
const Session = require("discourse/models/session").default;
Session.currentProp(
"disableCustomCSS",
setupData.disableCustomCss === "true"
);
if (setupData.safeMode) {
Session.currentProp("safe_mode", setupData.safeMode);
}
Discourse.HighlightJSPath = setupData.highlightJsPath;
Discourse.SvgSpritePath = setupData.svgSpritePath;
if (Discourse.Environment === "development") {
Discourse.SvgIconList = setupData.svgIconList;
}
if (setupData.s3BaseUrl) {
Discourse.S3CDN = setupData.s3Cdn;
Discourse.S3BaseUrl = setupData.s3BaseUrl;
}
// eslint-disable-next-line
Ember.RSVP.configure("onerror", function(e) {
// Ignore TransitionAborted exceptions that bubble up
if (e && e.message === "TransitionAborted") {
return;
}
if (Discourse.Environment === "development") {
/* eslint-disable no-console */
if (e) {
if (e.message || e.stack) {
console.log(e.message);
console.log(e.stack);
} else {
console.log("Uncaught promise: ", e);
}
} else {
console.log("A promise failed but was not caught.");
}
/* eslint-enable no-console */
}
window.onerror(e && e.message, null, null, null, e);
});
})();

View File

@ -98,13 +98,18 @@ export function performEmojiUnescape(string, opts) {
const inlineEmoji = opts.inlineEmoji;
const regexp = unicodeRegexp(inlineEmoji);
const allTranslations = Object.assign(
{},
translations,
opts.customEmojiTranslation || {}
);
return string.replace(regexp, (m, index) => {
const isEmoticon = opts.enableEmojiShortcuts && !!translations[m];
const isEmoticon = opts.enableEmojiShortcuts && !!allTranslations[m];
const isUnicodeEmoticon = !!replacements[m];
let emojiVal;
if (isEmoticon) {
emojiVal = translations[m];
emojiVal = allTranslations[m];
} else if (isUnicodeEmoticon) {
emojiVal = replacements[m];
} else {
@ -131,11 +136,16 @@ export function performEmojiUnescape(string, opts) {
export function performEmojiEscape(string, opts) {
const inlineEmoji = opts.inlineEmoji;
const regexp = unicodeRegexp(inlineEmoji);
const allTranslations = Object.assign(
{},
translations,
opts.customEmojiTranslation || {}
);
return string.replace(regexp, (m, index) => {
if (isReplacableInlineEmoji(string, index, inlineEmoji)) {
if (!!translations[m]) {
return opts.emojiShortcuts ? `:${translations[m]}:` : m;
if (!!allTranslations[m]) {
return opts.emojiShortcuts ? `:${allTranslations[m]}:` : m;
} else if (!!replacements[m]) {
return `:${replacements[m]}:`;
}

View File

@ -5,15 +5,25 @@ const MAX_NAME_LENGTH = 60;
let translationTree = null;
export function resetTranslationTree() {
translationTree = null;
}
// This allows us to efficiently search for aliases
// We build a data structure that allows us to quickly
// search through our N next chars to see if any match
// one of our alias emojis.
function buildTranslationTree() {
function buildTranslationTree(customEmojiTranslation) {
let tree = [];
let lastNode;
Object.keys(translations).forEach(key => {
const allTranslations = Object.assign(
{},
translations,
customEmojiTranslation || {}
);
Object.keys(allTranslations).forEach(key => {
let node = tree;
for (let i = 0; i < key.length; i++) {
@ -37,7 +47,7 @@ function buildTranslationTree() {
}
}
lastNode[2] = translations[key];
lastNode[2] = allTranslations[key];
});
return tree;
@ -114,8 +124,14 @@ function getEmojiTokenByName(name, state) {
}
}
function getEmojiTokenByTranslation(content, pos, state) {
translationTree = translationTree || buildTranslationTree();
function getEmojiTokenByTranslation(
content,
pos,
state,
customEmojiTranslation
) {
translationTree =
translationTree || buildTranslationTree(customEmojiTranslation);
let t = translationTree;
let start = pos;
@ -175,7 +191,8 @@ function applyEmoji(
state,
emojiUnicodeReplacer,
enableShortcuts,
inlineEmoji
inlineEmoji,
customEmojiTranslation
) {
let result = null;
let start = 0;
@ -201,7 +218,12 @@ function applyEmoji(
if (enableShortcuts && !token) {
// handle aliases (note: we can't do this in inline cause ; is not a split point)
const info = getEmojiTokenByTranslation(content, i, state);
const info = getEmojiTokenByTranslation(
content,
i,
state,
customEmojiTranslation
);
if (info) {
offset = info.pos - i;
@ -310,7 +332,8 @@ export function setup(helper) {
s,
md.options.discourse.emojiUnicodeReplacer,
md.options.discourse.features.emojiShortcuts,
md.options.discourse.features.inlineEmoji
md.options.discourse.features.inlineEmoji,
md.options.discourse.customEmojiTranslation
)
)
);

View File

@ -30,7 +30,8 @@ export function buildOptions(state) {
previewing,
linkify,
censoredRegexp,
disableEmojis
disableEmojis,
customEmojiTranslation
} = state;
let features = {
@ -68,6 +69,7 @@ export function buildOptions(state) {
emojiUnicodeReplacer,
lookupUploadUrls,
censoredRegexp,
customEmojiTranslation,
allowedHrefSchemes: siteSettings.allowed_href_schemes
? siteSettings.allowed_href_schemes.split("|")
: null,

View File

@ -36,5 +36,13 @@ export default DropdownSelectBoxComponent.extend({
}
return items;
})
}),
_onChange(value, item) {
if (item.onChange) {
item.onChange(value, item);
} else if (this.attrs.onChange) {
this.attrs.onChange(value, item);
}
}
});

View File

@ -57,6 +57,8 @@ export default Component.extend(
nameProperty: "name",
singleSelect: false,
multiSelect: false,
labelProperty: null,
titleProperty: null,
init() {
this._super(...arguments);
@ -76,6 +78,8 @@ export default Component.extend(
uniqueID: guidFor(this),
valueProperty: this.valueProperty,
nameProperty: this.nameProperty,
labelProperty: this.labelProperty,
titleProperty: this.titleProperty,
options: EmberObject.create(),
isLoading: false,

View File

@ -38,13 +38,18 @@ export default Component.extend(UtilsMixin, {
return this.getProperty(this.item, "ariaLabel") || this.title;
}),
title: computed("item.title", "rowName", function() {
return this.getProperty(this.item, "title") || this.rowName;
title: computed("rowTitle", "item.title", "rowName", function() {
return (
this.rowTitle || this.getProperty(this.item, "title") || this.rowName
);
}),
label: computed("item.label", "title", "rowName", function() {
label: computed("rowLabel", "item.label", "title", "rowName", function() {
const label =
this.getProperty(this.item, "label") || this.title || this.rowName;
this.rowLabel ||
this.getProperty(this.item, "label") ||
this.title ||
this.rowName;
if (
this.selectKit.options.allowAny &&
this.rowValue === this.selectKit.filter &&
@ -61,7 +66,9 @@ export default Component.extend(UtilsMixin, {
this.setProperties({
rowName: this.getName(this.item),
rowValue: this.getValue(this.item)
rowValue: this.getValue(this.item),
rowLabel: this.getProperty(this.item, "labelProperty"),
rowTitle: this.getProperty(this.item, "titleProperty")
});
},

View File

@ -22,6 +22,8 @@ export default Component.extend(UtilsMixin, {
// we can't listen on `item.nameProperty` given it's variable
this.setProperties({
headerLabel: this.getProperty(this.item, "labelProperty"),
headerTitle: this.getProperty(this.item, "titleProperty"),
name: this.getName(this.item),
value:
this.item === this.selectKit.noneItem ? null : this.getValue(this.item)
@ -38,12 +40,22 @@ export default Component.extend(UtilsMixin, {
return String(this.title).replace("&hellip;", "");
}),
title: computed("item", function() {
return this._safeProperty("title", this.item) || this.name || "";
title: computed("headerTitle", "item", function() {
return (
this.headerTitle ||
this._safeProperty("title", this.item) ||
this.name ||
""
);
}),
label: computed("title", "name", function() {
return this._safeProperty("label", this.item) || this.title || this.name;
label: computed("headerLabel", "title", "name", function() {
return (
this.headerLabel ||
this._safeProperty("label", this.item) ||
this.title ||
this.name
);
}),
icons: computed("item.{icon,icons}", function() {

View File

@ -1,36 +1,16 @@
import I18n from "I18n";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
const HEADING_COLLECTION = "HEADING_COLLECTION";
export default DropdownSelectBoxComponent.extend({
pluginApiIdentifiers: ["toolbar-popup-menu-options"],
classNames: ["toolbar-popup-menu-options"],
init() {
this._super(...arguments);
this.prependCollection(HEADING_COLLECTION);
},
selectKitOptions: {
showFullTitle: false,
filterable: false,
autoFilterable: false
},
modifyContentForCollection(collection) {
if (collection === HEADING_COLLECTION) {
return { title: this.selectKit.options.popupTitle };
}
},
modifyComponentForCollection(collection) {
if (collection === HEADING_COLLECTION) {
return "toolbar-popup-menu-options/toolbar-popup-menu-options-heading";
}
},
modifyContent(contents) {
return contents
.map(content => {

View File

@ -1,10 +0,0 @@
import Component from "@ember/component";
import { reads } from "@ember/object/computed";
export default Component.extend({
tagName: "h3",
layoutName:
"select-kit/templates/components/toolbar-popup-menu-options/toolbar-popup-menu-options-heading",
classNames: ["toolbar-popup-menu-options-heading"],
heading: reads("collection.content.title")
});

View File

@ -0,0 +1,4 @@
// discourse-skip-module
(function() {
Discourse.start();
})();

View File

@ -29,3 +29,4 @@
//= require virtual-dom
//= require virtual-dom-amd
//= require intersection-observer
//= require discourse-shims

View File

@ -429,7 +429,7 @@ export default createPreviewComponent(659, 320, {
ctx.font = `${bodyFontSize}em 'Arial'`;
for (let j = 2; j <= 4; j++) {
ctx.fillText(
j === 5 ? "1h" : Math.floor(Math.random() * 90) + 10,
j === 4 ? "1h" : Math.floor(Math.random() * 90) + 10,
cols[j] + margin,
y + rowHeight * 0.6
);

View File

@ -28,7 +28,7 @@ const Wizard = EmberObject.extend({
getCurrentColors(schemeId) {
const colorStep = this.steps.findBy("id", "colors");
if (!colorStep) {
return;
return this.current_color_scheme;
}
const themeChoice = colorStep.get("fieldsById.theme_previews");

View File

@ -12,7 +12,7 @@
//= require ember-template-compiler
//= require qunit/qunit/qunit
//= require ember-qunit
//= require ember-shim
//= require discourse-shims
//= require wizard-application
//= require wizard-vendor
//= require helpers/assertions

View File

@ -487,10 +487,14 @@
.hex-input {
width: 80px;
margin-bottom: 0;
margin-right: 6px;
}
.hex {
text-align: center;
}
.color-input {
display: flex;
}
h3 {
margin: 0;
}

View File

@ -351,21 +351,21 @@
flex-direction: column;
.dashboard-inline-table {
// and "hides" margin when the item spans 100% width
flex: 1 0 auto;
max-width: 95%;
}
.table-cell {
display: flex;
flex: 0 1 auto;
margin: 0 10px 5px 0;
border: 1px solid $primary-low;
padding: 1px;
border-radius: 10px;
.label {
display: flex;
align-items: center;
color: $primary;
background: $primary-very-low;
justify-content: center;
border-radius: 9px 0 0 9px;
padding: 0 5px 0 8px;
@ -377,8 +377,11 @@
}
.value {
background: $secondary;
border-radius: 0 9px 9px 0;
padding: 0 8px 0 5px;
}
&.user-newuser {
.label {
color: $primary-high;
@ -386,26 +389,20 @@
}
&.user-basic,
&.user-member {
border-color: $bronze;
background: $bronze;
.label {
border-color: $bronze;
background: $bronze;
color: $secondary;
}
}
&.user-regular {
border-color: $silver;
background: $silver;
.label {
border-color: $silver;
background: $silver;
color: $secondary;
}
}
&.user-leader {
border-color: $gold;
background: $gold;
.label {
background: $gold;
border-color: $gold;
color: $secondary;
}
}

View File

@ -166,7 +166,7 @@
}
.whisper {
margin-right: 0.25em;
margin: 0 0.25em;
}
.unlist {

View File

@ -75,20 +75,19 @@ $d-popover-border: $primary-medium;
color: transparent;
content: "";
position: absolute;
z-index: calc(z("tooltip") - 100);
z-index: z("tooltip") - 100;
}
.d-popover-top-arrow {
border-color: transparent transparent $d-popover-border;
top: 8px;
transform: translate(0, -15px);
top: -8px;
border-width: 0 8px 8px;
&:after {
border-color: transparent transparent $d-popover-background;
border-style: solid;
border-width: 0 7px 7px;
bottom: -8px;
bottom: -8.5px;
margin-left: -7px;
position: absolute;
content: "";
@ -97,8 +96,7 @@ $d-popover-border: $primary-medium;
.d-popover-bottom-arrow {
border-color: $d-popover-border transparent transparent;
top: calc(100% + 16px);
transform: translate(0, -16px);
top: 100%;
border-width: 8px 8px 0;
&:after {
@ -107,7 +105,7 @@ $d-popover-border: $primary-medium;
border-color: $d-popover-background transparent transparent;
border-style: solid;
border-width: 7px 7px 0;
bottom: 2px;
bottom: 1.5px;
transform: translate(-7px, 0);
}
}

View File

@ -687,14 +687,6 @@ table {
}
}
}
.dropdown-menu {
width: 120px;
& .icon {
margin-top: auto;
}
}
}
.topic-statuses {

View File

@ -19,6 +19,7 @@
}
}
.buttons {
align-items: center;
display: inline-flex;
margin-top: 15px;

View File

@ -66,14 +66,20 @@
.menu-panel {
li,
li.heading {
a.widget-link {
a.widget-link,
a.categories-link {
padding: 0.25em 0.5em;
display: block;
color: $primary;
&:hover,
&:focus {
background-color: $highlight-medium;
outline: none;
}
.d-icon {
color: $primary-medium;
}
}
.new {
@ -83,11 +89,6 @@
}
}
.categories-link {
display: block;
padding: 0.25em 0.5em;
}
li.category-link {
float: left;
background-color: transparent;
@ -101,6 +102,10 @@
&:hover,
&:focus {
background: transparent;
.category-name {
color: $primary;
}
}
}
.badge-notification {
@ -149,6 +154,9 @@
.quick-access-panel {
width: 100%;
display: table;
margin-top: -1px;
border-top: 1px solid $primary-low;
padding-top: 0.5em;
h3 {
padding: 0 0.4em;
@ -163,6 +171,7 @@
.icon {
color: $primary-high;
}
li {
background-color: $tertiary-low;
@ -184,6 +193,7 @@
a {
padding: 0;
> div {
overflow: hidden; // clears the text from wrapping below icons
overflow-wrap: anywhere;
@ -204,11 +214,15 @@
}
}
li:not(.show-all) {
padding: 0.25em 0.5em;
padding: 0;
a {
display: flex;
padding: 0.25em 0.5em;
}
.d-icon {
float: left;
margin-right: 5px;
padding-top: 0.2em;
margin-right: 0.5em;
}
}
.is-warning {
@ -246,6 +260,18 @@
}
/* as a big ol' click target, don't let text inside be selected */
@include unselectable;
&.quick-access-profile {
li:not(.show-all) a {
color: $primary;
.d-icon {
color: $primary-medium;
}
// accounts for menu "ears" 4px + border 1px
padding: 0.25em calc(0.5em + 4px + 1px);
}
}
}
.dismiss-link {
@ -256,13 +282,10 @@
div.menu-links-header {
width: 100%;
display: table;
border-collapse: separate;
border-spacing: 0 0.5em;
.menu-links-row {
border-bottom: 1px solid dark-light-choose($primary-low, $secondary-medium);
box-sizing: border-box;
display: flex;
z-index: 2;
// Tabs should have "ears".
padding: 0 4px;
@ -272,9 +295,11 @@ div.menu-links-header {
flex-wrap: wrap;
&.user {
margin-right: auto;
flex: 1 1 0;
overflow: hidden;
}
&.glyphs {
flex-wrap: wrap;
flex-wrap: nowrap;
text-align: right;
a {
@ -288,26 +313,17 @@ div.menu-links-header {
// This is to make sure active and inactive tab icons have the same
// size. `box-sizing` does not work and I have no idea why.
border: 1px solid transparent;
border-bottom: 0;
&:not(.active):hover {
border-bottom: 0;
margin-top: -1px;
}
}
a.active {
border: 1px solid dark-light-choose($primary-low, $secondary-medium);
border-bottom: 0;
border-bottom: 1px solid $secondary;
position: relative;
&:after {
display: block;
position: absolute;
top: 100%;
left: 0;
z-index: z("header") + 1; // Higher than .menu-panel
width: 100%;
height: 0;
content: "";
border-top: 1px solid $secondary;
}
&:focus,
&:hover {
background-color: inherit;
@ -324,10 +340,10 @@ div.menu-links-header {
padding: 0.3em 0.5em;
}
a.user-activity-link {
box-sizing: border-box;
align-items: center;
display: flex;
margin: -0.5em 0;
max-width: 130px;
max-width: 100%;
// `overflow: hidden` on `.user-activity-link` would hide the `::after`
// pseudo element (used to create the tab-looking effect). Sets `overflow:
@ -336,7 +352,6 @@ div.menu-links-header {
span.d-label {
display: block;
max-width: 130px;
@include ellipsis;
}

View File

@ -29,9 +29,6 @@
}
.modal-open {
.dropdown-menu {
z-index: z("modal", "dropdown");
}
.popover {
z-index: z("modal", "popover");
}

View File

@ -0,0 +1,59 @@
.popup-menu {
background-color: $secondary;
width: 215px;
border: 1px solid $primary-low;
z-index: z("dropdown");
box-shadow: shadow("card");
ul {
margin: 0;
list-style: none;
li {
border-bottom: 1px solid rgba($primary-low, 0.5);
&:last-child {
border: none;
}
}
}
.btn {
text-align: left;
background: none;
width: 100%;
padding: 0.75em;
border-radius: 0;
.d-icon {
color: $primary-medium;
}
&:hover {
color: $primary;
background: $tertiary-low;
.d-icon {
color: $primary-medium;
}
}
&.popup-menu-btn-danger {
.d-icon {
color: $danger;
}
.d-button-label {
color: $primary;
}
&:hover {
.d-icon,
.d-button-label {
color: $danger;
}
background: $danger-low;
}
}
}
}

View File

@ -68,6 +68,10 @@
display: contents;
}
}
a.widget-link {
color: $tertiary;
}
}
.main-results {

View File

@ -1,43 +1,9 @@
// Styles for the topic admin menu
.show-topic-admin {
position: fixed;
top: 120px;
right: 10px;
z-index: z("dropdown");
height: 35px;
}
.popup-menu {
background-color: $secondary;
width: 215px;
padding: 10px;
border: 1px solid $primary-low;
z-index: z("dropdown");
box-shadow: shadow("card");
ul {
list-style: none;
margin: 10px 0 0 0;
}
.btn {
text-align: left;
}
button {
width: 100%;
margin-bottom: 5px;
}
.header {
.close-button {
display: none;
}
}
.topic-admin-popup-menu {
@include breakpoint(mobile-extra-large) {
width: 100%;
width: calc(100% - 20px);
margin: 0 10px;
padding: 0;
padding-bottom: env(safe-area-inset-bottom);
z-index: z("modal", "popover");
@ -51,19 +17,6 @@
}
}
animation: slideUp 0.3s;
.header {
padding: 10px 0 0 10px;
display: flex;
justify-content: space-between;
.close-button {
display: block;
background: transparent;
}
}
ul {
margin-top: 0;
}
}
.mobile-view & {

View File

@ -644,18 +644,20 @@ pre {
}
kbd {
border-radius: 3px;
box-shadow: shadow("kbd");
align-items: center;
background: dark-light-choose(#fafafa, #303030);
border: 1px solid dark-light-choose(#d0d0d0, #505050);
border-bottom: none;
border-bottom-width: 2px;
border-radius: 3px;
box-sizing: border-box;
color: $primary;
display: inline-block;
display: inline-flex;
font-size: $font-down-1;
justify-content: center;
line-height: $line-height-large;
margin: 0 0.1em;
padding: 0.1em 0.6em;
margin: 0 0.15em;
min-width: 24px;
padding: 0.15em 0.6em;
// don't allow more than 3 nested elements to prevent FF from crashing
// cf. http://what.thedailywtf.com/t/nested-elements/7927
@ -833,12 +835,6 @@ a.mention-group {
}
}
.popup-menu {
h3 {
margin-top: 0;
}
}
.suggested-topics {
.topics {
padding-bottom: 15px;
@ -1053,3 +1049,15 @@ a.mention-group {
}
}
}
.post-admin-menu {
display: inline-flex;
flex-direction: column;
box-sizing: border-box;
width: auto;
max-width: 320px;
position: absolute;
text-align: left;
bottom: -2px;
right: 15px;
}

View File

@ -15,6 +15,7 @@
}
.ember-text-field.bookmark-name {
min-width: 220px;
width: 100%;
margin-bottom: 0.5em;
}

View File

@ -55,7 +55,7 @@
border-radius: 3px;
display: inline-flex;
margin: 0 6px;
padding: 1px 0 5px;
padding: 2px 1px 4px;
}
span:first-child {
@ -63,19 +63,8 @@
}
kbd {
align-items: center;
box-sizing: border-box;
color: dark-light-choose(#333, #aaa);
display: inline-flex;
font-family: $base-font-family;
font-weight: bold;
height: 24px;
justify-content: center;
margin: 0 3px;
min-width: 24px;
padding: 0 6px;
vertical-align: bottom;
white-space: nowrap;
}
}
}

View File

@ -4,14 +4,17 @@
.tap-tile {
color: $primary-high;
padding: 0.75em;
padding: 0.75em 0.25em;
display: flex;
flex-wrap: wrap;
align-items: center;
border: 1px solid $primary-low;
margin: 0 0 0.5em;
border-bottom: 1px solid $primary-low;
cursor: pointer;
&:first-child {
border-top: 1px solid $primary-low;
}
&:hover {
background-color: $tertiary-low;
}
@ -21,12 +24,12 @@
}
.d-icon {
color: $primary-medium;
color: $primary-high;
margin: 0 0.5em 0 0;
}
.tap-tile-title {
font-weight: bold;
color: $primary;
margin-right: auto;
}

View File

@ -35,10 +35,10 @@ $bronze: #cd7f32 !default;
// Fonts
// --------------------------------------------------
$base-font-size-smaller: 14px !default;
$base-font-size: 15px !default;
$base-font-size-larger: 17px !default;
$base-font-size-largest: 19px !default;
$base-font-size-smaller: 0.875em !default; // eq. to 14px
$base-font-size: 0.938em !default; // eq. to 15px
$base-font-size-larger: 1.063em !default; // eq. to 17px
$base-font-size-largest: 1.118em !default; // eq. to 19px
$base-font-family: Helvetica, Arial, sans-serif !default;
// Font-size defintions, multiplier ^ (step / interval)

View File

@ -13,7 +13,6 @@
#topic-progress-wrapper,
div.nums,
._flyout,
.show-topic-admin,
#topic-progress,
.quote-controls,
.topic-status-info,

View File

@ -60,13 +60,17 @@
}
.topic-count {
margin-left: 5px;
margin-left: 0.5em;
font-weight: normal;
color: $primary-medium;
}
.category-name {
color: $primary;
}
.badge-wrapper {
margin: 0;
font-weight: bold;
&:nth-child(2) {
margin-left: 10px;

View File

@ -8,7 +8,7 @@
.select-kit-row {
margin: 0;
min-height: 1px;
padding: 6px 10px;
&.no-content {
font-weight: normal;
}
@ -44,7 +44,6 @@
flex-direction: column;
padding: 0;
min-width: 100px;
max-height: 200px;
.collection-header {
a {
@ -53,7 +52,7 @@
line-height: $line-height-medium;
font-weight: bold;
display: block;
padding: 6px 10px;
padding: 0.75em;
color: $tertiary;
&:hover {

View File

@ -1,7 +1,5 @@
.select-kit {
&.dropdown-select-box {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
min-width: auto;
border: none;
@ -21,55 +19,27 @@
.select-kit-row {
margin: 0;
padding: 10px 5px;
.icons {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
flex: 0 0 auto;
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-item-align: start;
align-self: flex-start;
margin-right: 0.357em;
margin-top: 2px;
width: 30px;
margin-right: 0.5em;
.d-icon {
font-size: $font-up-2;
-ms-flex-item-align: center;
align-self: center;
margin-right: 0;
opacity: 1;
}
}
.texts {
line-height: $line-height-large;
-webkit-box-flex: 1;
-ms-flex: 1;
line-height: $line-height-medium;
flex: 1 1 0%;
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
.name {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1 1 auto;
font-weight: bold;
font-size: $font-0;
@ -80,8 +50,6 @@
}
.desc {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1 1 auto;
font-size: $font-down-1;
font-weight: normal;
@ -98,27 +66,15 @@
}
.dropdown-select-box-header {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: 0;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
.d-icon + .d-icon {
margin-left: 5px;
margin-left: 0.25em;
}
&.is-focused {

View File

@ -10,9 +10,13 @@
}
.future-date-input-selector-datetime {
color: lighten($primary, 40%);
margin-left: 5px;
color: $primary-medium;
margin-left: auto;
white-space: nowrap;
+ svg {
margin-left: 0.25em;
}
}
.future-date-input-selector-icons {

View File

@ -46,8 +46,14 @@
background: $tertiary-low;
}
.discourse-tag {
&:hover {
color: $primary;
}
}
.discourse-tag-count {
margin-left: 5px;
margin-left: 0.5em;
}
}

View File

@ -7,8 +7,8 @@
.select-kit-row {
.icons {
-ms-flex-item-align: start;
align-self: flex-start;
margin-right: 0.75em;
}
}
}

View File

@ -139,13 +139,13 @@
.select-kit-row {
cursor: pointer;
line-height: $line-height-medium;
outline: none;
display: flex;
flex: 1 0 auto;
box-sizing: border-box;
align-items: center;
justify-content: flex-start;
padding: 0.75em;
.name {
margin: 0;
@ -190,7 +190,7 @@
-webkit-overflow-scrolling: touch;
margin: 0;
padding: 0;
max-height: 200px;
max-height: 250px;
width: 100%;
.validation-message {

View File

@ -3,52 +3,32 @@
&.toolbar-popup-menu-options {
.select-kit-body {
box-shadow: none;
padding: 0.5em 0.5em 0.25em 0.5em;
width: 230px;
}
.toolbar-popup-menu-options-heading {
width: 100%;
border-radius: 0;
}
.select-kit-row {
margin-bottom: 0.25em;
padding: 0.5em 0.25em;
background: $primary-low;
transition: all 0.25s;
padding: 0.75em 0.5em;
border-bottom: 1px solid rgba($primary-low, 0.5);
&:last-child {
border: none;
}
.texts .name,
.icons .d-icon {
font-size: $font-0;
font-weight: normal;
color: $primary;
}
.d-icon {
opacity: 0.7;
}
&.is-highlighted {
background: $primary-medium;
.name,
.d-icon {
color: $secondary;
}
color: $primary-medium;
}
&.is-highlighted,
&.is-selected,
&:hover {
background: $primary-medium;
color: $secondary;
}
&.is-selected {
color: $primary;
background: $primary-low;
}
&.is-selected.is-highlighted {
background: $primary-medium;
background: $tertiary-low;
color: $primary;
}
}

View File

@ -33,6 +33,7 @@
&.timeline-fullscreen.show {
max-height: 700px;
transition: max-height 0.4s ease-out;
@media screen and (max-height: 425px) {
max-height: 75vh;
}
@ -58,7 +59,7 @@
right: 0;
border-top: 1px solid dark-light-choose($primary-low, $secondary-low);
box-shadow: shadow("composer");
padding-top: 20px;
padding: 20px 0px;
z-index: z("fullscreen");
@media screen and (max-height: 425px) {
padding-top: 10px;
@ -119,21 +120,21 @@
.timeline-footer-controls {
display: none;
position: absolute;
bottom: 10px;
bottom: 20px;
left: 10px;
button,
.btn-group {
float: none;
display: inline-block;
margin-bottom: 0;
margin-right: 15px;
position: static;
}
.widget-component-connector {
vertical-align: top;
}
}
.timeline-scrollarea-wrapper {
display: table-cell;
padding-bottom: 20px;
padding-right: 1.5em;
width: 100px;
}
@ -178,10 +179,6 @@
.timeline-controls {
margin-bottom: 1em;
button {
margin-right: 0.5em;
}
}
.timeline-footer-controls {
@ -189,7 +186,7 @@
transition: opacity 0.2s ease-in;
display: flex;
button {
.reply-to-post {
margin-right: 0.5em;
}

View File

@ -218,15 +218,6 @@ button.dismiss-read {
margin-left: 10px;
}
.tags-admin-menu {
.dropdown-menu {
right: 0;
top: 30px;
bottom: auto;
left: auto;
}
}
.category-heading {
p {
line-height: $line-height-large;

View File

@ -53,93 +53,6 @@ section.post-menu-area {
nav.post-controls {
padding: 0;
// Some buttons can be doubled up, like likes or flags
.double-button {
display: inline-flex;
color: $primary-low-mid;
margin-right: 0.15em;
&:hover {
button {
background: $primary-low;
color: $primary-medium;
}
}
button {
// It looks really confusing when one half a double button has an inner shadow on click.
&:active {
box-shadow: none;
}
margin-left: 0;
margin-right: 0;
&.my-likes,
&.read-indicator,
&.regular-likes {
// Like count on posts
.d-icon {
color: $primary-low-mid;
padding-left: 0.45em;
}
}
&.like {
// Like button with 0 likes
&.d-hover {
background: $love-low;
.d-icon {
color: $love;
}
}
}
&.has-like {
// Like button after I've liked
.d-icon {
color: $love;
}
&.d-hover {
background: $primary-low;
.d-icon {
color: $primary-medium;
}
}
}
&[disabled] {
// Disabled like button
cursor: not-allowed;
}
&.button-count {
// Like count button
&:not(.my-likes) {
padding-right: 0;
}
&.d-hover {
color: $primary;
}
+ .toggle-like {
// Like button when like count is present
padding-left: 0.45em;
&.d-hover {
background: $primary-low;
}
}
}
}
}
a,
button {
color: dark-light-choose($primary-low-mid, $secondary-high);
.d-icon {
opacity: 1;
}
margin-right: 2px;
display: inline-block;
}
a.toggle-likes {
padding: 8px 0;
margin-right: -3px;
}
span.badge-posts {
margin-right: 5px;
transition: all linear 0.15s;
}
.actions {
text-align: right;
float: right;
@ -148,103 +61,160 @@ nav.post-controls {
display: none;
overflow: hidden;
}
}
.show-replies {
margin-left: -10px;
font-size: inherit;
span.badge-posts {
color: dark-light-choose($primary-medium, $secondary-high);
// Some buttons can be doubled up, like likes or flags
.double-button {
display: inline-flex;
color: $primary-low-mid;
margin-right: 0.15em;
&:hover {
button {
background: $primary-low;
color: $primary-medium;
}
}
button {
// It looks really confusing when one half a double button has an inner shadow on click.
&:active {
box-shadow: none;
}
margin-left: 0;
margin-right: 0;
&.my-likes,
&.read-indicator,
&.regular-likes {
// Like count on posts
.d-icon {
color: $primary-low-mid;
padding-left: 0.45em;
}
}
&.like {
// Like button with 0 likes
&.d-hover {
background: $love-low;
.d-icon {
color: $love;
}
}
}
&.has-like {
// Like button after I've liked
.d-icon {
color: $love;
}
&.d-hover {
background: $primary-low;
.d-icon {
color: $primary-medium;
}
}
}
&[disabled] {
// Disabled like button
cursor: not-allowed;
}
&.button-count {
// Like count button
&:not(.my-likes) {
padding-right: 0;
}
&.d-hover {
color: $primary;
}
+ .toggle-like {
// Like button when like count is present
padding-left: 0.45em;
&.d-hover {
background: $primary-low;
}
}
}
}
}
&:hover {
background: $primary-low;
span.badge-posts {
a,
button {
color: dark-light-choose($primary-low-mid, $secondary-high);
.d-icon {
opacity: 1;
}
margin-right: 2px;
display: inline-block;
}
a.toggle-likes {
padding: 8px 0;
margin-right: -3px;
}
span.badge-posts {
margin-right: 5px;
transition: all linear 0.15s;
}
button.create {
margin-right: 0;
color: dark-light-choose($primary-high, $secondary-low);
margin-left: 10px;
.d-icon {
color: dark-light-choose($primary-high, $secondary-low);
}
}
.create .d-icon {
margin-right: 5px;
}
button {
font-size: $font-up-1;
padding: 8px 10px;
vertical-align: top;
background: transparent;
border: none;
margin-left: 3px;
&.d-hover,
&:focus {
background: $primary-low;
color: $primary;
}
&:active {
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
&.hidden {
display: none;
}
&.admin {
position: relative;
}
&.delete.d-hover,
&.delete:hover,
&.delete:focus {
background: $danger;
color: $secondary;
.d-icon {
color: $secondary;
}
}
&.bookmark {
padding: 8px 11px;
&.bookmarked .d-icon {
color: $tertiary;
}
}
}
}
.show-replies {
font-size: $font-up-1;
margin-left: -10px;
font-size: inherit;
padding: 10px;
color: $primary-medium;
&:hover {
color: $primary;
background: $primary-low;
}
.d-icon {
margin-left: 5px;
font-size: $font-down-1;
}
}
button.create {
margin-right: 0;
color: dark-light-choose($primary-high, $secondary-low);
margin-left: 10px;
.d-icon {
color: dark-light-choose($primary-high, $secondary-low);
}
}
.create .d-icon {
margin-right: 5px;
}
button {
font-size: $font-up-1;
padding: 8px 10px;
vertical-align: top;
background: transparent;
border: none;
margin-left: 3px;
&.d-hover,
&:focus {
background: $primary-low;
color: $primary;
}
&:active {
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
&.hidden {
display: none;
}
&.admin {
position: relative;
}
&.delete.d-hover,
&.delete:hover,
&.delete:focus {
background: $danger;
color: $secondary;
.d-icon {
color: $secondary;
}
}
&.bookmark {
padding: 8px 11px;
&.bookmarked .d-icon {
color: $tertiary;
}
}
}
.post-admin-menu {
display: inline-flex;
flex-direction: column;
box-sizing: border-box;
background-color: $secondary;
width: auto;
max-width: 320px;
padding: 10px;
border: 1px solid $primary-low;
position: absolute;
text-align: left;
bottom: -2px;
right: 15px;
z-index: z("dropdown");
h3 {
margin-top: 0;
color: $primary;
font-size: $font-0;
}
ul {
list-style: none;
margin: 10px 0 0 0;
}
li {
margin-bottom: 5px;
.d-icon {
width: 14px;
margin-right: 10px;
}
}
}
}
pre.copy-codeblocks .copy-cmd:not(.copied) {
@ -533,10 +503,6 @@ video {
}
}
.open > .dropdown-menu {
display: block;
}
.btn-group {
position: relative;
}
@ -671,72 +637,6 @@ blockquote {
margin-left: 5px;
}
.dropdown-menu {
position: absolute;
bottom: 115%;
left: 0;
z-index: z("dropdown");
display: none;
float: left;
width: 550px;
margin: 1px 0 0;
list-style: none;
background-color: $secondary;
border: 1px solid $primary-low;
box-shadow: shadow("dropdown");
background-clip: padding-box;
span {
font-size: $font-down-1;
color: dark-light-choose($primary-medium, $secondary-medium);
}
span.title {
font-weight: bold;
display: block;
font-size: $font-0;
color: $primary;
}
}
.dropdown-menu a {
display: block;
padding: 9px;
clear: both;
font-weight: normal;
line-height: $line-height-medium;
color: $primary;
transition: all linear 0.15s;
& > div {
margin-left: 26px;
}
}
.dropdown-menu li > a:hover,
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover {
color: $primary;
text-decoration: none;
background-color: $highlight-medium;
}
.dropdown-menu .disabled > a,
.dropdown-menu .disabled > a:hover {
text-decoration: none;
color: $primary;
background-color: $tertiary-low;
cursor: default;
}
.dropdown-menu .icon {
margin-top: 3px;
float: left;
font-size: $font-up-2;
}
.open > .dropdown-menu {
display: block;
clear: both;
}
.selected-posts {
width: 200px;
position: fixed;

View File

@ -2,9 +2,29 @@
&.combo-box {
&.topic-footer-mobile-dropdown {
.select-kit-row {
.svg-icon-title {
margin-right: 0.5em;
padding: 0.75em 0.5em;
border-bottom: 1px solid rgba($primary-low, 0.5);
.name {
line-height: $line-height-medium;
}
&:last-child {
border: none;
}
.d-icon {
color: $primary-medium;
}
&.is-highlighted {
background: $tertiary-low;
.name {
color: $primary;
}
}
&.bookmarked {
.d-icon {
color: $tertiary;

View File

@ -11,13 +11,17 @@
left: 0;
display: none;
touch-action: pan-y pinch-zoom;
&.animate {
transition: opacity 0.2s ease-out;
}
}
.user-menu .quick-access-profile li:not(.show-all) {
margin: 0.5em 0 0.75em;
padding: 0.75em;
border: 1px solid $primary-low;
.user-menu .quick-access-panel.quick-access-profile li:not(.show-all) {
border-bottom: 1px solid $primary-low;
a {
// accounts for menu "ears" 4px + border 1px
padding: 0.75em calc(0.5em + 4px + 1px);
}
}

View File

@ -1,12 +1,20 @@
.select-kit {
&.dropdown-select-box {
.select-kit-collection {
max-height: 200px;
overflow-y: auto;
}
.select-kit-row {
.svg-icon-title {
width: auto;
height: auto;
}
.texts {
.name {
font-weight: normal;
}
}
}
}
}
.select-kit.combo-box .select-kit-row {
padding: 10px;
}

View File

@ -424,50 +424,7 @@ tr.category-topic-link {
content: "";
margin-left: 5px;
}
.dropdown-menu {
position: relative;
top: 100%;
left: 0;
z-index: z("dropdown");
display: none;
float: left;
width: 280px;
padding: 4px 0;
list-style: none;
background-color: $secondary;
border: 1px solid dark-light-choose(rgba(0, 0, 0, 0.2), $primary);
border-radius: 5px;
box-shadow: shadow("dropdown");
background-clip: padding-box;
margin: 1px 0 20px;
.title {
font-weight: bold;
display: block;
}
}
.dropdown-menu a {
display: block;
padding: 3px 15px;
clear: both;
font-weight: normal;
line-height: $line-height-medium;
color: $primary;
}
.dropdown-menu li > a:hover,
.dropdown-menu .active > a,
.dropdown-menu .active > a:hover {
color: $tertiary;
text-decoration: none;
background-color: $tertiary-low;
}
.open > .dropdown-menu {
display: block;
clear: both;
}
.fade {
opacity: 0;
transition: opacity linear 0.15s;
}
.fade.in {
opacity: 1;
}

View File

@ -31,69 +31,70 @@ span.badge-posts {
color: dark-light-choose($primary-low-mid, $secondary-high);
.actions {
display: flex;
}
// Handles the like and flag buttons in the post menu.
.double-button {
display: flex;
flex: 0 1 auto;
align-items: center;
button {
&.like,
&.read-indicator,
&.create-flag {
flex: 1 1 auto;
}
&.button-count {
padding: 8px 4px 8px 8px;
+ .toggle-like,
+ .create-flag {
padding: 8px 8px 8px 4px;
// Handles the like and flag buttons in the post menu.
.double-button {
display: flex;
flex: 0 1 auto;
align-items: center;
button {
&.like,
&.read-indicator,
&.create-flag {
flex: 1 1 auto;
}
&.my-likes,
&.regular-likes {
display: flex;
max-width: unset;
padding: 8px;
.d-icon {
padding-left: 8px;
&.button-count {
padding: 8px 4px 8px 8px;
+ .toggle-like,
+ .create-flag {
padding: 8px 8px 8px 4px;
}
&.my-likes,
&.regular-likes {
display: flex;
max-width: unset;
padding: 8px;
.d-icon {
padding-left: 8px;
}
}
}
}
}
}
.d-icon {
opacity: 1;
}
button {
border: none;
font-size: $font-up-1;
padding: 10px 8px;
background: transparent;
flex: 1 1 auto;
max-width: 45px;
&.hidden {
display: none;
.d-icon {
opacity: 1;
}
&.admin {
position: relative;
}
&.expand-post {
margin: 10px 0 10px 0;
}
&.reply {
.d-icon {
color: $primary-high;
button {
border: none;
font-size: $font-up-1;
padding: 10px 8px;
background: transparent;
flex: 1 1 auto;
max-width: 45px;
&.hidden {
display: none;
}
margin-left: auto;
}
&.has-like {
.d-icon {
color: $love;
&.admin {
position: relative;
}
}
&.bookmarked {
.d-icon {
color: $tertiary;
&.expand-post {
margin: 10px 0 10px 0;
}
&.reply {
.d-icon {
color: $primary-high;
}
margin-left: auto;
}
&.has-like {
.d-icon {
color: $love;
}
}
&.bookmarked {
.d-icon {
color: $tertiary;
}
}
}
}
@ -101,38 +102,11 @@ span.badge-posts {
}
.post-admin-menu {
display: inline-flex;
flex-direction: column;
box-sizing: border-box;
background-color: $secondary;
width: auto;
max-width: 320px;
padding: 10px;
border: 1px solid $primary-low;
position: absolute;
text-align: left;
bottom: -50px;
left: 135px;
@media screen and (max-width: 374px) {
left: 50px;
}
z-index: z("dropdown");
h3 {
margin-top: 0;
color: $primary;
font-size: $font-0;
}
ul {
list-style: none;
margin: 10px 0 0 0;
}
li {
margin-bottom: 5px;
.d-icon {
width: 14px;
margin-right: 10px;
}
}
}
.embedded-posts {
@ -313,25 +287,6 @@ iframe {
max-width: 100%;
}
.open > .dropdown-menu {
display: block;
}
.dropdown-menu li {
margin: 5px 0;
.fa {
float: left;
margin-right: 5px;
padding-top: 1px;
}
span {
color: dark-light-choose($primary-medium, $secondary-medium);
}
span.title {
color: $primary;
}
}
.btn-group {
margin-top: 25px;
position: relative;
@ -466,22 +421,6 @@ span.highlighted {
}
}
.popup-menu,
#topic-footer-buttons .popup-menu {
h3 {
margin-bottom: 0;
}
ul div li {
border-bottom: 0.25em solid transparent;
border-top: 0.25em solid transparent;
button.btn {
margin-bottom: 0;
}
}
}
.post-notice {
margin-bottom: 1em;
&.old {

View File

@ -221,36 +221,23 @@ sub sub {
@media screen and (max-height: 600px) {
.topic-admin-popup-menu {
box-sizing: border-box;
width: 100%;
padding: 1em;
.header {
padding: 0;
position: relative;
.close-button {
position: absolute;
display: inline-block;
right: 0;
top: -0.1em;
width: auto;
background: transparent;
}
}
padding: 0.25em;
ul {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
@media screen and (max-width: 550px) {
grid-template-columns: 1fr 1fr;
}
> div {
margin-right: 0.5em;
overflow: hidden;
&:nth-of-type(2) {
// move delete further from modal close
order: 12;
}
button {
@include ellipsis;
}
.popup-menu-btn {
@include ellipsis;
}
li {
border: 0;
min-width: 0;
}
}
}

Some files were not shown because too many files have changed in this diff Show More