discourse/discourse — pull request #2744 by riking (2014-09-03 07:20:59+00:00)
Title: PERF/FEATURE: Refactor renderButtons, allow '...' in post_menu

FEATURE section
----

Adding '...' to the post_menu site setting will cause the expansion to
be in that place, instead of inserted right before the last button.

An extensibility point is added, as well - rather than alwaysShowYours
and alwaysShowWiki options, button.shouldAlwaysShow() gets called with
the post, which can have any logic it wants.

PERF section
----

The check at the top causes PostMenuView to essentialy drop out of the
rendering timings for anons. It already wasn't rendering anything, now
it doesn't even check.

Two arrays that were computed from SiteSettings (and, hence, are always
the same for a given page load) are hoisted out into cached class
methods. I couldn't get a .property() to work right on the reopenClass,
so that's why the caching is done manually.