diff --git a/README.md b/README.md
index c54dffe..e3d8b88 100644
--- a/README.md
+++ b/README.md
@@ -27,6 +27,10 @@ And each user need to enable and select a signature on his/her profile:
and thats it!
+## Advanced Mode
+
+You can now enable **advanced mode** on the plugin settings and use a full blow post editor to create your signature! With text, multiple images, etc.
+
## About
This is a work in progress! Feel free to use and ask questions here, or on [Meta](meta.discourse.org).
@@ -34,5 +38,4 @@ This is a work in progress! Feel free to use and ask questions here, or on [Meta
## TODO
- Figure out a way so the user doens't have to refresh te browser to change the `see signatures` options.
-- Use d-editor instead of a simple text field. (Allow text sigs, multi-images, etc)
-- Get some sane defaults for CSS
+- Cache the cooked signatures
diff --git a/assets/javascripts/discourse/initializers/extend-for-signatures.js.es6 b/assets/javascripts/discourse/initializers/extend-for-signatures.js.es6
index 22297fd..fe85b62 100644
--- a/assets/javascripts/discourse/initializers/extend-for-signatures.js.es6
+++ b/assets/javascripts/discourse/initializers/extend-for-signatures.js.es6
@@ -1,27 +1,25 @@
-import Post from 'discourse/models/post';
+import Preferences from 'discourse/controllers/preferences';
import { withPluginApi } from 'discourse/lib/plugin-api';
-
-function oldPluginCode() {
- Post.reopen({
- showSignatures: function() {
- return Discourse.User.currentProp("custom_fields.see_signatures");
- }.property()
- });
-}
+import RawHtml from 'discourse/widgets/raw-html';
function attachSignature(api) {
- api.includePostAttributes('user_signature_url');
+ api.includePostAttributes('user_signature');
api.decorateWidget('post-contents:after', dec => {
const attrs = dec.attrs;
- if (Ember.isEmpty(attrs.user_signature_url)) { return; }
+ if (Ember.isEmpty(attrs.user_signature)) { return; }
const currentUser = api.getCurrentUser();
+ const siteSettings = Discourse.SiteSettings; // TODO: change way to get the sitesettings
if (currentUser) {
const enabled = currentUser.get('custom_fields.see_signatures');
if (enabled) {
- return [dec.h('hr'), dec.h('img.signature-img', { attributes: { src: attrs.user_signature_url } } )];
+ if (siteSettings.signatures_advanced_mode) {
+ return [dec.h('hr'), dec.h('div', new RawHtml({html: `