about summary refs log tree commit diff
path: root/app/javascript/packs
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/packs')
-rw-r--r--app/javascript/packs/application.js6
-rw-r--r--app/javascript/packs/common.js4
-rw-r--r--app/javascript/packs/custom.js1
-rw-r--r--app/javascript/packs/public.js4
4 files changed, 12 insertions, 3 deletions
diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js
index 116632dea..aa94006c6 100644
--- a/app/javascript/packs/application.js
+++ b/app/javascript/packs/application.js
@@ -1,5 +1,11 @@
 import loadPolyfills from '../mastodon/load_polyfills';
 
+// import default stylesheet with variables
+require('font-awesome/css/font-awesome.css');
+import 'styles/application';
+
+require.context('../images/', true);
+
 loadPolyfills().then(() => {
   require('../mastodon/main').default();
 }).catch(e => {
diff --git a/app/javascript/packs/common.js b/app/javascript/packs/common.js
index 4880f0242..de0c68fa5 100644
--- a/app/javascript/packs/common.js
+++ b/app/javascript/packs/common.js
@@ -1,6 +1,6 @@
 import { start } from 'rails-ujs';
 
-require('font-awesome/css/font-awesome.css');
-require.context('../images/', true);
+// import common styling
+require('../styles/common.scss');
 
 start();
diff --git a/app/javascript/packs/custom.js b/app/javascript/packs/custom.js
new file mode 100644
index 000000000..4db2964f6
--- /dev/null
+++ b/app/javascript/packs/custom.js
@@ -0,0 +1 @@
+require('../styles/custom.scss');
diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js
index a47fc2830..59d0e98dd 100644
--- a/app/javascript/packs/public.js
+++ b/app/javascript/packs/public.js
@@ -1,4 +1,5 @@
 import loadPolyfills from '../mastodon/load_polyfills';
+import { processBio } from '../glitch/util/bio_metadata';
 import ready from '../mastodon/ready';
 
 window.addEventListener('message', e => {
@@ -121,7 +122,8 @@ function main() {
     const noteCounter = document.querySelector('.note-counter');
 
     if (noteCounter) {
-      noteCounter.textContent = 160 - length(target.value);
+      const noteWithoutMetadata = processBio(target.value).text;
+      noteCounter.textContent = 500 - length(noteWithoutMetadata);
     }
   });