Composer Help Button

I’ve now completed my work on a composer help button.
https://github.com/cpradio/composer-help-button

It adds a button to the composer window

and a setting in the Admin area:

Clicking on that icon, will open a modal window with the content from the first post at the URL set in the Admin area

The only caveat, is that you need to store the Topic in a publicly accessible location so ALL of your members can see it. Otherwise, they’ll get an access denied error.

26개의 좋아요

Something I should mention. By default the button will not appear until a URL is entered in the Admin Setting. So you won’t have a broken button out of the box :smile:

4개의 좋아요

@eviltrout, @lightyear, @santouras, @orodio (Jude and James, I included you in case you have a moment to help guide me too!)

Okay, so I started with this plugin, as it was a tad bit simplier than the ReplyGIF one to get my “feet wet”.

You can see my first attempt here
https://github.com/cpradio/composer-help-button/tree/convert-to-es6

I feel like I’m close! I just can’t get the ajax loaded content to appear in the body of the modal window. I feel like I’m missing something, but I’m not getting any errors to indicate what I’m missing.

Can one of you take a peek and push me in the right direction? I’d really appreciate it!

nm. Seems I figured it out (not sure how though… I simply renamed the composer-help.js.handlebars to composer-help.hbs and took it out of the plugin.rb. Then I fixed the showModal call and it started working!

Merging to main branch soon so this plugin is at least functional again.

Edit: Version 0.2 is now live on GitHub

2개의 좋아요

Awesome! Yeah we use hbs as extensions and they are automatically included now.

The help button doesn’t show up on Discourse version 1.4. Did you have time to check out why it isn’t working anymore?

1개의 좋아요

Yeah, it seems to be the ember upgrade, I’m trying to debug it, but running into problems, as it almost seems the plugin’s front-end isn’t being loaded at all.

There are a couple of things going on, first was the change that moved the composer window from #wmd-button-row to .wmd-button-row, now the second is far more confusing, as it states it can’t load discourse/controllers/controller…

Uncaught Error: Could not find module `discourse/controllers/controller` imported from 
`discourse/plugins/composer-help-button/discourse/controllers/composer-help`requireFrom @ loader:111
reify @ loader:98
mod.state @ loader:141
tryFinally @ loader:22
requireModule @ loader:140
__exports__.default.Ember.DefaultResolver.extend.customResolve @ discourse/ember/resolver:85
__exports__.default.Ember.DefaultResolver.extend.resolveController @ discourse/ember/resolver:110
superWrapper @ ember-template-compiler:9278
exports.default.EmberObject.default.extend.resolve @ ember.debug:4591
resolve @ ember.debug:4434
resolve @ ember.debug:2110
Registry.resolve @ ember.debug:1716
factoryFor @ ember.debug:1318
instantiate @ ember.debug:1376
lookup @ ember.debug:1274
Container.lookup @ ember.debug:1209
__exports__.default @ discourse/lib/show-modal:23
__exports__.default.initialize.ApplicationRoute.reopen.actions.showComposerHelp @ javascripts/discourse/initializers/composer-help:15
triggerEvent @ ember.debug:23488
trigger @ ember.debug:45006
Router.trigger @ ember.debug:43730
EmberObject.default.extend.send @ ember.debug:22983
mixin.Mixin.create.send @ ember.debug:26917
mixin.Mixin.create.send @ ember.debug:26917
(anonymous function) @ javascripts/discourse/initializers/composer-help:29
jQuery.event.dispatch @ jquery.debug:4431
jQuery.event.add.elemData.handle @ jquery.debug:4117

I believe this is functional again. Thanks for reporting it!
https://github.com/cpradio/composer-help-button/commit/b52fd9e7609f571405cb8a259c86874ffb5fd47f

5개의 좋아요

Awesome @cpradio It works for me. I added another issue. It’s just about moving the settings to the plugin-tab.

https://github.com/cpradio/composer-help-button/issues/6

1개의 좋아요

Yeah, I thought about looking into that too, but haven’t yet (as I believe that came about after this plugin was written).

Just finished this request

As an FYI
With this change, you will need to re-enable the plugin and re-enter the URL for the modal window (so you might want to copy the URL before upgrading).

Here are the new Admin Screenshots


4개의 좋아요

thanks, this will make the plugin behave nicer on multisite :slight_smile:

1개의 좋아요

Very nice plugin @cpradio, thanks!

I found difficult to write the message that would display when clicking the help button, and I ended up posting a table with formatting ↔ code equivalences, quite larger than the pop-up window.

Is there a way to resize the modal window so that my table fits completely inside it?

Yes. Change the max height for .composer-help-content in your admin > customize > css

Example:

.modal-body {
  max-height: 550px;
}
.composer-help-content {
  max-height: 500px;
}
2개의 좋아요

First time using CSS, it’s quite easy actually :wink:

The following customization did the trick for me:

.modal-inner-container {
    max-width: 950px;
    height: 820px;
}
.composer-help-modal {
  .composer-help-content {
    max-height: 750px;
  }
}

Thanks again!

1개의 좋아요

With the Ember 2.4 upgrade now merged in, there is a release branch to use for older versions of Discourse

git clone --branch v0.6.0 https://github.com/cpradio/discourse-plugin-composer-help-button.git

4개의 좋아요

방금 수정했습니다

3개의 좋아요

디스코스의 마크다운, BBCode, HTML 태그를 모두 설명하는 좋은 게시물이나 문서가 있을까요? 이걸 작성기(Composer)의 도움말 버튼에 사용할 수 있으면 좋겠어요.

개인적으로 한 게시물에 모든 사용자에게 이렇게 많은 정보를 제공하는 것은 과하다고 생각합니다.

저라면 내용을 나누어 팝업에는 기본 사항만 표시하고, 고급 기능에 대한 링크를 포함할 것입니다. 또한 디스코urs에 기본적으로 제공되며 햄버거 메뉴에서 접근할 수 있는 키보드 단축키에 대한 언급도 잊지 마세요.

2개의 좋아요