Show More
@@ -16,9 +16,25 b' var rhodeCodeApp = Polymer({' | |||||
16 | for (var i = 0; i < alertMessagePayloads.length; i++) { |
|
16 | for (var i = 0; i < alertMessagePayloads.length; i++) { | |
17 | $.Topic('/notifications').publish(alertMessagePayloads[i]); |
|
17 | $.Topic('/notifications').publish(alertMessagePayloads[i]); | |
18 | } |
|
18 | } | |
|
19 | this.initPlugins(); | |||
|
20 | // after rest of application loads and topics get fired, launch connection | |||
|
21 | $(document).ready(function () { | |||
19 | this.kickoffChannelstreamPlugin(); |
|
22 | this.kickoffChannelstreamPlugin(); | |
|
23 | }.bind(this)); | |||
20 | }, |
|
24 | }, | |
21 |
|
25 | |||
|
26 | initPlugins: function(){ | |||
|
27 | for (var i = 0; i < window.APPLICATION_PLUGINS.length; i++) { | |||
|
28 | var pluginDef = window.APPLICATION_PLUGINS[i]; | |||
|
29 | if (pluginDef.component){ | |||
|
30 | var pluginElem = document.createElement(pluginDef.component); | |||
|
31 | this.shadowRoot.appendChild(pluginElem); | |||
|
32 | if (typeof pluginElem.init !== 'undefined'){ | |||
|
33 | pluginElem.init(); | |||
|
34 | } | |||
|
35 | } | |||
|
36 | } | |||
|
37 | }, | |||
22 | /** proxy to channelstream connection */ |
|
38 | /** proxy to channelstream connection */ | |
23 | getChannelStreamConnection: function () { |
|
39 | getChannelStreamConnection: function () { | |
24 | return this.$['channelstream-connection']; |
|
40 | return this.$['channelstream-connection']; |
@@ -70,6 +70,7 b" c.template_context['default_user'] = {" | |||||
70 | var templateContext = ${h.json.dumps(c.template_context)|n}; |
|
70 | var templateContext = ${h.json.dumps(c.template_context)|n}; | |
71 |
|
71 | |||
72 | var APPLICATION_URL = "${h.route_path('home').rstrip('/')}"; |
|
72 | var APPLICATION_URL = "${h.route_path('home').rstrip('/')}"; | |
|
73 | var APPLICATION_PLUGINS = []; | |||
73 | var ASSET_URL = "${h.asset('')}"; |
|
74 | var ASSET_URL = "${h.asset('')}"; | |
74 | var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}"; |
|
75 | var DEFAULT_RENDERER = "${h.get_visual_attr(c, 'default_renderer')}"; | |
75 | var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}"; |
|
76 | var CSRF_TOKEN = "${getattr(c, 'csrf_token', '')}"; |
General Comments 0
You need to be logged in to leave comments.
Login now