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/about.js6
-rw-r--r--app/javascript/packs/application.js11
-rw-r--r--app/javascript/packs/public.js18
-rw-r--r--app/javascript/packs/share.js6
4 files changed, 27 insertions, 14 deletions
diff --git a/app/javascript/packs/about.js b/app/javascript/packs/about.js
index 50c81198e..6ce8757dc 100644
--- a/app/javascript/packs/about.js
+++ b/app/javascript/packs/about.js
@@ -1,9 +1,9 @@
-import loadPolyfills from '../mastodon/load_polyfills';
+import loadPolyfills from 'themes/glitch/util/load_polyfills';
 
 require.context('../images/', true);
 
 function loaded() {
-  const TimelineContainer = require('../mastodon/containers/timeline_container').default;
+  const TimelineContainer = require('themes/glitch/containers/timeline_container').default;
   const React             = require('react');
   const ReactDOM          = require('react-dom');
   const mountNode         = document.getElementById('mastodon-timeline');
@@ -15,7 +15,7 @@ function loaded() {
 }
 
 function main() {
-  const ready = require('../mastodon/ready').default;
+  const ready = require('themes/glitch/util/ready').default;
   ready(loaded);
 }
 
diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js
index 116632dea..21dc78986 100644
--- a/app/javascript/packs/application.js
+++ b/app/javascript/packs/application.js
@@ -1,5 +1,16 @@
+//  THIS IS THE `vanilla` THEME PACK FILE!!
+//  IT'S HERE FOR UPSTREAM COMPATIBILITY!!
+//  THE `glitch` PACK FILE IS IN `themes/glitch/index.js`!!
+
 import loadPolyfills from '../mastodon/load_polyfills';
 
+// import default stylesheet with variables
+require('font-awesome/css/font-awesome.css');
+
+import '../styles/application.scss';
+
+require.context('../images/', true);
+
 loadPolyfills().then(() => {
   require('../mastodon/main').default();
 }).catch(e => {
diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js
index a47fc2830..6adacad98 100644
--- a/app/javascript/packs/public.js
+++ b/app/javascript/packs/public.js
@@ -1,5 +1,6 @@
-import loadPolyfills from '../mastodon/load_polyfills';
-import ready from '../mastodon/ready';
+import loadPolyfills from 'themes/glitch/util/load_polyfills';
+import { processBio } from 'themes/glitch/util/bio_metadata';
+import ready from 'themes/glitch/util/ready';
 
 window.addEventListener('message', e => {
   const data = e.data || {};
@@ -21,12 +22,12 @@ function main() {
   const { length } = require('stringz');
   const IntlRelativeFormat = require('intl-relativeformat').default;
   const { delegate } = require('rails-ujs');
-  const emojify = require('../mastodon/features/emoji/emoji').default;
-  const { getLocale } = require('../mastodon/locales');
+  const emojify = require('../themes/glitch/util/emoji').default;
+  const { getLocale } = require('mastodon/locales');
   const { localeData } = getLocale();
-  const VideoContainer = require('../mastodon/containers/video_container').default;
-  const MediaGalleryContainer = require('../mastodon/containers/media_gallery_container').default;
-  const CardContainer = require('../mastodon/containers/card_container').default;
+  const VideoContainer = require('../themes/glitch/containers/video_container').default;
+  const MediaGalleryContainer = require('../themes/glitch/containers/media_gallery_container').default;
+  const CardContainer = require('../themes/glitch/containers/card_container').default;
   const React = require('react');
   const ReactDOM = require('react-dom');
 
@@ -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);
     }
   });
 
diff --git a/app/javascript/packs/share.js b/app/javascript/packs/share.js
index 51e4ae38b..9cd95bcee 100644
--- a/app/javascript/packs/share.js
+++ b/app/javascript/packs/share.js
@@ -1,9 +1,9 @@
-import loadPolyfills from '../mastodon/load_polyfills';
+import loadPolyfills from 'themes/glitch/util/load_polyfills';
 
 require.context('../images/', true);
 
 function loaded() {
-  const ComposeContainer = require('../mastodon/containers/compose_container').default;
+  const ComposeContainer = require('themes/glitch/containers/compose_container').default;
   const React = require('react');
   const ReactDOM = require('react-dom');
   const mountNode = document.getElementById('mastodon-compose');
@@ -15,7 +15,7 @@ function loaded() {
 }
 
 function main() {
-  const ready = require('../mastodon/ready').default;
+  const ready = require('themes/glitch/util/ready').default;
   ready(loaded);
 }