26 Commits
Author SHA1 Message Date
YuCheng Hu dd71576e97 fixed issue for : https://www.isharkfly.com/t/discourse/17568 2025-07-24 09:47:19 -04:00
YuCheng Hu 93c9c848f0 Merge remote-tracking branch 'remotes/Discourse/main'
# Conflicts:
#	common/head_tag.html
2025-06-16 16:27:51 -04:00
Jarek Radosz ff2cc11fce DEV: Update linting config and run gjs-codemod (#19)
* DEV: Update linting config and run gjs-codemod

* DEV: Update linting config and run gjs-codemod
2025-06-06 11:53:24 +01:00
David Taylor 470bf3773c DEV: Convert script[type=text/discourse-plugin] to initializer (#18) 2025-05-15 18:01:15 +01:00
Loïc Guitaut 845f27cb2d DEV: Add system spec to check core features are working fine (#16) 2025-04-09 15:20:40 +02:00
Jarek Radosz 69f416869b DEV: Update linting (#15) 2025-03-19 11:55:19 +00:00
David Taylor ceefec97b2 DEV: Bump dependencies and fix linting (#13) 2025-02-06 18:41:39 +01:00
David Taylor 5dbbbd4d4a DEV: Pin version for Discourse <3.5.0.beta1-dev (#12) 2025-02-05 19:45:32 +01:00
David Taylor eea53e6512 DEV: Update linting (#11) 2024-11-28 15:24:26 +01:00
David Taylor 2fc26e2bbd DEV: Update linting (#10) 2024-11-20 19:16:09 +01:00
David Taylor d9ebc42434 DEV: Update eslint config (#9) 2024-11-19 15:14:13 +01:00
Kelv 923f68e8dd DEV: Update linting setup (#8) 2024-10-17 11:27:12 +02:00
Kelv 0c4b78262f DEV: Switch to use pnpm (#7) 2024-10-14 10:15:26 +02:00
dependabot[bot] 9fa86acbe7 Bump micromatch from 4.0.5 to 4.0.8 (#6)
Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.5...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 15:19:57 +02:00
Natalie Tay 21a1f165c8 DEV: Pin theme for Discourse < 3.4.0.beta1-dev (#5) 2024-08-02 17:39:15 +08:00
David Taylor fbaabb28b7 DEV: Update linting (#4) 2024-03-27 19:17:39 +01:00
Selase Krakani b326adc815 DEV: Pin theme for Discourse < 3.3.0.beta1-dev (#3) 2024-02-29 12:58:03 -07:00
YuCheng Hu 965e762310 Update the link and config 2024-01-15 12:20:02 -05:00
YuCheng Hu 346d08559f Update the information and try to fixed the issue for https://www.isharkfly.com/t/discourse/15258/2 2024-01-12 22:43:15 -05:00
honeymoose e56e9cb9c9 Update about.json 2024-01-13 03:30:32 +00:00
kees-closed a488709d75 FEATURE: Add do_not_track and disableCookies settings (#2) 2022-10-04 09:25:56 -04:00
YuCheng Hu 1c8225fb78 change document link 2020-05-20 17:19:47 -04:00
YuCheng Hu 2d755f9849 Add words for CWIKI 2020-05-20 16:53:07 -04:00
YuCheng Hu d6ca673710 Change new lic link 2020-05-20 16:42:42 -04:00
YuCheng Hu 758d48ec96 Change to matomo.js 2020-05-20 16:29:33 -04:00
Ryan Boder bbd0dcb82d Fix current user issue and add tracking features (#1)
* Add cross subdomain tracking

* Add cross subdomain tracking

* Enable crossdomain linking

* Move crossdomain code to a better place

* Remove subdomain from site title

* Fix all subdomains parameter

* Be more specific in subdomain tracking description

* Add user ID tracking

* Handle whitespace around user id field

* Exclude some groups from tracking

* Add exmaple groups to exclude from tracking

* Fix whitespace handling in user ID tracking

* Fix null reference on anonymous users
2019-09-19 13:04:24 -04:00
20 changed files with 3734 additions and 27 deletions
+4
View File
@@ -0,0 +1,4 @@
< 3.5.0.beta5-dev: 470bf3773cd2c4f3e68324f1f18bee07bfdd06dc
< 3.5.0.beta1-dev: eea53e651236b19aefb9805d3ba1ffb99514f641
< 3.4.0.beta1-dev: fbaabb28b715d095e800e5b19c3e74378ea5d431
< 3.3.0.beta1-dev: a488709d752505091c22d12581d1d624d3254d62
+11
View File
@@ -0,0 +1,11 @@
name: Discourse Theme
on:
push:
branches:
- main
pull_request:
jobs:
ci:
uses: discourse/.github/.github/workflows/discourse-theme.yml@v1
+2
View File
@@ -0,0 +1,2 @@
node_modules
.discourse-site
+2
View File
@@ -0,0 +1,2 @@
engine-strict = true
auto-install-peers = false
+1
View File
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/prettier");
+2
View File
@@ -0,0 +1,2 @@
inherit_gem:
rubocop-discourse: stree-compat.yml
+2
View File
@@ -0,0 +1,2 @@
--print-width=100
--plugins=plugin/trailing_comma,plugin/disable_auto_ternary
+1
View File
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/template-lint");
+8
View File
@@ -0,0 +1,8 @@
# frozen_string_literal: true
source "https://rubygems.org"
group :development do
gem "rubocop-discourse"
gem "syntax_tree"
end
+103
View File
@@ -0,0 +1,103 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (8.0.2)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.3)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.1)
concurrent-ruby (1.3.5)
connection_pool (2.5.3)
drb (2.2.3)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.12.2)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
minitest (5.25.5)
parallel (1.27.0)
parser (3.3.8.0)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (1.4.0)
racc (1.8.1)
rack (3.1.15)
rainbow (3.1.1)
regexp_parser (2.10.0)
rubocop (1.76.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.45.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.45.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-capybara (2.22.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-discourse (3.12.1)
activesupport (>= 6.1)
lint_roller (>= 1.1.0)
rubocop (>= 1.73.2)
rubocop-capybara (>= 2.22.0)
rubocop-factory_bot (>= 2.27.0)
rubocop-rails (>= 2.30.3)
rubocop-rspec (>= 3.0.1)
rubocop-rspec_rails (>= 2.31.0)
rubocop-factory_bot (2.27.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.32.0)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rspec (3.6.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec_rails (2.31.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec (~> 3.5)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
PLATFORMS
arm64-darwin-23
ruby
DEPENDENCIES
rubocop-discourse
syntax_tree
BUNDLED WITH
2.6.9
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2018 Kyle Zhao Copyright (c) 2024 iSharkFly
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "Matomo Analytics", "name": "iSharkFly Matomo Analytics",
"about_url": "https://meta.discourse.org/t/how-to-enable-matomo-analytics-on-discourse/33090", "about_url": "https://www.isharkfly.com/t/discourse-matomo/51",
"license_url": "https://github.com/discourse/discourse-matomo-analytics/blob/master/LICENSE", "license_url": "https://github.com/Discourse-C/discourse-matomo-analytics/blob/master/LICENSE",
"component": true "component": true
} }
-22
View File
@@ -1,22 +0,0 @@
<script type="text/discourse-plugin" version="0.2">
api.onPageChange((url, title) => {
window._paq = window._paq || [];
window._paq_loaded = window._paq_loaded || false;
if (!_paq_loaded) {
var u = `//${settings.host_url}/`;
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', settings.website_id]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
_paq_loaded = true;
}
const currentUser = api._currentUser;
_paq.push(['setCustomVariable', 1, 'Anonymous', !currentUser, 'visit']);
_paq.push(["setCustomUrl", url]);
_paq.push(["setDocumentTitle", title]);
_paq.push(["trackPageView"]);
_paq.push(['enableLinkTracking']);
});
</script>
+3
View File
@@ -0,0 +1,3 @@
import DiscourseRecommendedTheme from "@discourse/lint-configs/eslint-theme";
export default [...DiscourseRecommendedTheme];
@@ -0,0 +1,60 @@
import { apiInitializer } from "discourse/lib/api";
export default apiInitializer((api) => {
api.onPageChange((url, title) => {
const currentUser = api.getCurrentUser();
if (settings.exclude_groups.trim() && currentUser) {
const excludedGroups = settings.exclude_groups
.split(",")
.map((g) => g.trim());
const currentUserGroups = currentUser.groups.map((g) => g.name);
if (excludedGroups.filter((g) => currentUserGroups.includes(g)).length) {
return;
}
}
const _paq = (window._paq = window._paq || []);
window._paq_loaded = window._paq_loaded || false;
if (!window._paq_loaded) {
let u = `//${settings.host_url}/`;
_paq.push(["setTrackerUrl", u + "piwik.php"]);
_paq.push(["setSiteId", settings.website_id]);
let d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
g.type = "text/javascript";
g.async = true;
g.defer = true;
g.src = u + "piwik.js";
s.parentNode.insertBefore(g, s);
window._paq_loaded = true;
}
const userIdField = settings.user_id_tracking.trim();
if (userIdField && currentUser && currentUser[userIdField]) {
_paq.push(["setUserId", currentUser[userIdField]]);
}
if (settings.subdomain_tracking) {
const allDomains =
"*" + document.domain.substring(document.domain.indexOf("."));
_paq.push(["setCookieDomain", allDomains]);
_paq.push(["setDomains", allDomains]);
}
if (settings.do_not_track) {
_paq.push(["setDoNotTrack", true]);
}
if (settings.disable_cookies) {
_paq.push(["disableCookies"]);
}
_paq.push(["setCustomUrl", url]);
_paq.push(["setDocumentTitle", title]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
});
});
+17
View File
@@ -0,0 +1,17 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "2.25.0",
"ember-template-lint": "7.8.1",
"eslint": "9.28.0",
"prettier": "3.5.3",
"stylelint": "16.20.0"
},
"engines": {
"node": ">= 22",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": "9.x"
},
"packageManager": "[email protected]"
}
+3483
View File
File diff suppressed because it is too large Load Diff
+20
View File
@@ -5,3 +5,23 @@ host_url:
website_id: website_id:
type: string type: string
default: '' default: ''
exclude_groups:
type: string
default: ''
description: Comma separated list of groups to exclude from tracking such as admins, staff.
user_id_tracking:
type: string
default: ''
description: An indentifying field name on the current user object such as id, username or external_id.
subdomain_tracking:
type: bool
default: false
description: Track visitors across main domain & subdomains, assuming discourse is on a subdomain.
do_not_track:
type: bool
default: false
description: So tracking requests will not be sent if visitors do not wish to be tracked.
disable_cookies:
type: bool
default: false
description: Disables all first party cookies. Existing Matomo cookies for this website will be deleted on the next pageview.
+7
View File
@@ -0,0 +1,7 @@
# frozen_string_literal: true
RSpec.describe "Core features", type: :system do
before { upload_theme_or_component }
it_behaves_like "having working core features"
end
+3
View File
@@ -0,0 +1,3 @@
export default {
extends: ["@discourse/lint-configs/stylelint"],
};