Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

1 change: 0 additions & 1 deletion .eslintrc.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
...require("@discourse/lint-configs/prettier"),
printWidth: 100,
tabWidth: 2,
useTabs: false,
};
2 changes: 1 addition & 1 deletion .streerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
--print-width=100
--plugins=plugin/trailing_comma,disable_ternary
--plugins=plugin/trailing_comma,plugin/disable_auto_ternary
6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
"recommendations": ["dbaeumer.vscode-eslint"]
}
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ source "https://rubygems.org"
group :development do
gem "rubocop-discourse"
gem "syntax_tree"
gem "syntax_tree-disable_ternary"
end
93 changes: 65 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,50 +1,87 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.3.3)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
ast (2.4.2)
json (2.6.2)
parallel (1.22.1)
parser (3.1.2.1)
base64 (0.2.0)
bigdecimal (3.1.8)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
drb (2.2.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
minitest (5.23.1)
mutex_m (0.2.0)
parallel (1.24.0)
parser (3.3.1.0)
ast (~> 2.4.1)
prettier_print (1.2.0)
racc
prettier_print (1.2.1)
racc (1.8.0)
rack (3.0.12)
rainbow (3.1.1)
regexp_parser (2.6.0)
rexml (3.2.5)
rubocop (1.36.0)
regexp_parser (2.9.2)
rexml (3.3.9)
rubocop (1.64.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.1.2.1)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.20.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.21.0)
parser (>= 3.1.1.0)
rubocop-discourse (3.0)
rubocop (>= 1.1.0)
rubocop-rspec (>= 2.0.0)
rubocop-rspec (2.13.2)
rubocop (~> 1.33)
ruby-progressbar (1.11.0)
syntax_tree (5.1.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-discourse (3.8.0)
activesupport (>= 6.1)
rubocop (>= 1.59.0)
rubocop-capybara (>= 2.0.0)
rubocop-factory_bot (>= 2.0.0)
rubocop-rails (>= 2.25.0)
rubocop-rspec (>= 2.25.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rails (2.25.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.29.2)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.28.3)
rubocop (~> 1.40)
ruby-progressbar (1.13.0)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
syntax_tree-disable_ternary (1.0.0)
unicode-display_width (2.3.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)

PLATFORMS
arm64-darwin-20
ruby
x86_64-darwin-18
x86_64-darwin-19
x86_64-darwin-20
x86_64-linux

DEPENDENCIES
rubocop-discourse
syntax_tree
syntax_tree-disable_ternary

BUNDLED WITH
2.3.10
2.5.10
1 change: 1 addition & 0 deletions app/controllers/bb_code/admin/refresh_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module ::BbCode
module Admin
class RefreshController < ::Admin::AdminController
requires_plugin PLUGIN_NAME
def index
PrettyText.reset_context
begin
Expand Down
5 changes: 3 additions & 2 deletions assets/javascripts/discourse/initializers/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Accordion {
{
duration: 400,
easing: "linear",
},
}
);

// When the animation is complete, call onAnimationFinish()
Expand All @@ -123,6 +123,7 @@ class Accordion {
}
window.requestAnimationFrame(() => this.expand(slide));
}

/**
* @param {Slide} slide
*/
Expand All @@ -149,7 +150,7 @@ class Accordion {
{
duration: 400,
easing: "linear",
},
}
);
// When the animation is complete, call onAnimationFinish()
slide.animation.onfinish = () => this.onAnimationFinish(true, slide);
Expand Down
4 changes: 2 additions & 2 deletions assets/javascripts/discourse/initializers/bbscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const documentObserver = new IntersectionObserver(
{
threshold: 0,
rootMargin: "10px 0px 0px 0px",
},
}
);

/**
Expand Down Expand Up @@ -147,7 +147,7 @@ function initializeBBScript(api) {
{
id: "add bbscript",
afterAdopt: true,
},
}
);
}

Expand Down
2 changes: 1 addition & 1 deletion assets/javascripts/discourse/initializers/fontawesome.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function initializeFontAwesome(api) {
{
id: "add fontawesome",
afterAdopt: true,
},
}
);
})
.catch((err) => {
Expand Down
4 changes: 2 additions & 2 deletions assets/javascripts/discourse/initializers/spoiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Spoiler {
{
duration: 200,
easing: "ease-in-out",
},
}
);

// When the animation is complete, call onAnimationFinish()
Expand Down Expand Up @@ -112,7 +112,7 @@ class Spoiler {
{
duration: 200,
easing: "ease-in-out",
},
}
);
// When the animation is complete, call onAnimationFinish()
this.animation.onfinish = () => this.onAnimationFinish(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<p>{{i18n "bbcode.resetDesc"}}</p>

<div class="buttons">
{{#if resetEnabled}}
{{#if this.resetEnabled}}
<DButton
@label="bbcode.reset"
@action={{action "resetServerJSContext"}}
@icon="sync"
@id="reset-bbcode"
/>
{{#if success}}
{{#if this.success}}
<span style="color: var(--success-medium)">{{i18n "bbcode.success"}}</span>
{{/if}}
{{#if error}}
{{#if this.error}}
<span style="color: var(--danger-medium)">{{i18n "bbcode.error"}}</span>
{{/if}}
{{else}}
Expand Down
8 changes: 4 additions & 4 deletions assets/javascripts/lib/discourse-markdown/bbcode-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function preprocessor(raw, opts, previewing = false) {
console.warn(
"Attempted to get the bbcode parser: does not exist. Defaulting to standard markdown-it.",
"\ncalled on: \n",
raw,
raw
);
return [raw, {}];
}
Expand All @@ -39,7 +39,7 @@ function postprocessor(raw, previewing = false, data = {}) {
console.warn(
"Attempted to get the bbcode parser: does not exist. Defaulting to standard markdown-it.",
"\ncalled on: \n",
raw,
raw
);
return raw;
}
Expand Down Expand Up @@ -79,13 +79,13 @@ export function setup(helper) {
const [preprocessed, data] = preprocessor(
raw,
preprocessor_options,
engine.options?.discourse?.previewing,
engine.options?.discourse?.previewing
);
const processed = md.apply(this, [preprocessed]);
const postprocessed = postprocessor(
processed,
engine.options?.discourse?.previewing,
data,
data
);
return postprocessed;
};
Expand Down
6 changes: 4 additions & 2 deletions assets/stylesheets/common/note.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@
width: 0.2em;
}
&:after {
background-image: linear-gradient(45deg, transparent 50%, hsla(0, 0%, 100%, 0.3) 50%),
background-image:
linear-gradient(45deg, transparent 50%, hsla(0, 0%, 100%, 0.3) 50%),
linear-gradient(-45deg, transparent 50%, hsla(0, 0%, 100%, 0.3) 50%);
background-position: 0 100%;
left: -0.2em;
}
&:before {
background-image: linear-gradient(135deg, transparent 50%, hsla(0, 0%, 100%, 0.3) 50%),
background-image:
linear-gradient(135deg, transparent 50%, hsla(0, 0%, 100%, 0.3) 50%),
linear-gradient(-135deg, transparent 50%, hsla(0, 0%, 100%, 0.3) 50%);
background-position: 100% 100%;
right: -0.2em;
Expand Down
19 changes: 11 additions & 8 deletions assets/stylesheets/common/print.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ div.bb-print {
font-size: 16px;
width: auto;
margin: 0 auto;
background-image: url("/plugins/bbcode/images/paper-top3.png"),
url("/plugins/bbcode/images/paper-bottom3.png"), url("/plugins/bbcode/images/paper.jpg");
background-image:
url("/plugins/bbcode/images/paper-top3.png"), url("/plugins/bbcode/images/paper-bottom3.png"),
url("/plugins/bbcode/images/paper.jpg");
background-position:
50% 0,
50% 100%,
Expand All @@ -19,18 +20,20 @@ div.bb-print {

&-line {
@extend .bb-print;
background-image: url("/plugins/bbcode/images/paper-top3.png"),
url("/plugins/bbcode/images/paper-bottom3.png"), url("/plugins/bbcode/images/paperlined.jpg");
background-image:
url("/plugins/bbcode/images/paper-top3.png"), url("/plugins/bbcode/images/paper-bottom3.png"),
url("/plugins/bbcode/images/paperlined.jpg");
}
&-graph {
@extend .bb-print;
background-image: url("/plugins/bbcode/images/paper-top3.png"),
url("/plugins/bbcode/images/paper-bottom3.png"), url("/plugins/bbcode/images/papergraph.jpg");
background-image:
url("/plugins/bbcode/images/paper-top3.png"), url("/plugins/bbcode/images/paper-bottom3.png"),
url("/plugins/bbcode/images/papergraph.jpg");
}
&-parchment {
@extend .bb-print;
background-image: url("/plugins/bbcode/images/paper-top3.png"),
url("/plugins/bbcode/images/paper-bottom.png"),
background-image:
url("/plugins/bbcode/images/paper-top3.png"), url("/plugins/bbcode/images/paper-bottom.png"),
url("/plugins/bbcode/images/paperparchment.jpg");
}
}
2 changes: 1 addition & 1 deletion bbcode-src/utils/postprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function createScriptTagTemplate(raw, data) {
}
const templates = data.bbscripts.map(
(s) =>
`<template data-bbcode-plus="script" data-bbscript-id="${s.id}" data-bbscript-class="${s.class}" data-bbscript-on="${s.on}" data-bbscript-ver="${s.version}">${s.content}</template>`,
`<template data-bbcode-plus="script" data-bbscript-id="${s.id}" data-bbscript-class="${s.class}" data-bbscript-on="${s.on}" data-bbscript-ver="${s.version}">${s.content}</template>`
);
return templates.join("") + raw;
}
Expand Down
7 changes: 7 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import DiscourseRecommended from "@discourse/lint-configs/eslint";
import { defineConfig, globalIgnores } from "eslint/config";

export default defineConfig([
globalIgnores(["assets/bundled/**", "public/javascripts/**", "rollup.config.js"]),
...DiscourseRecommended,
]);
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
},
"devDependencies": {
"@bbob/types": "^4.2.0",
"@discourse/lint-configs": "^1.3.9",
"@discourse/lint-configs": "2.12.0",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-terser": "^0.4.3",
"ember-template-lint": "^6.0.0",
"eslint": "^8.57.0",
"ember-template-lint": "7.0.4",
"eslint": "9.24.0",
"husky": ">=6",
"lint-staged": ">=10",
"prettier": "3.3.2",
"rollup": "^4.30.1"
"prettier": "3.5.3",
"rollup": "^4.30.1",
"stylelint": "16.16.0"
},
"dependencies": {
"@bbob/core": "^4.2.0",
Expand Down
Loading