# HG changeset patch # User Marcin Lulek # Date 2016-09-29 11:40:40 # Node ID 36b5db0ca6bcce2ea9df910ee75c01259e716c46 # Parent 3216087df5a11475cfd5a6844de74ddd9274fbd9 frontend: ensure polyfills are loaded as early as possible diff --git a/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js b/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js --- a/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js +++ b/rhodecode/public/js/src/components/rhodecode-app/rhodecode-app.js @@ -6,12 +6,15 @@ var rhodeCodeApp = Polymer({ attached: function () { ccLog.debug('rhodeCodeApp created'); $.Topic('/notifications').subscribe(this.handleNotifications.bind(this)); + $.Topic('/connection_controller/subscribe').subscribe( + this.subscribeToChannelTopic.bind(this)); + // this event can be used to coordinate plugins to do their + // initialization before channelstream is kicked off + $.Topic('/__MAIN_APP__').publish({}); for (var i = 0; i < alertMessagePayloads.length; i++) { $.Topic('/notifications').publish(alertMessagePayloads[i]); } - $.Topic('/connection_controller/subscribe').subscribe( - this.subscribeToChannelTopic.bind(this)); this.kickoffChannelstreamPlugin(); }, @@ -33,7 +36,7 @@ var rhodeCodeApp = Polymer({ channels.push(addChannels[i]); } if (window.CHANNELSTREAM_SETTINGS && CHANNELSTREAM_SETTINGS.enabled){ - var channelstreamConnection = this.$['channelstream-connection']; + var channelstreamConnection = this.getChannelStreamConnection(); channelstreamConnection.connectUrl = CHANNELSTREAM_URLS.connect; channelstreamConnection.subscribeUrl = CHANNELSTREAM_URLS.subscribe; channelstreamConnection.websocketUrl = CHANNELSTREAM_URLS.ws + '/ws'; diff --git a/rhodecode/public/js/topics_list.txt b/rhodecode/public/js/topics_list.txt --- a/rhodecode/public/js/topics_list.txt +++ b/rhodecode/public/js/topics_list.txt @@ -1,3 +1,4 @@ +/__MAIN_APP__ - launched when rhodecode-app element is attached to DOM /plugins/__REGISTER__ - launched after the onDomReady() code from rhodecode.js is executed /ui/plugins/code/anchor_focus - launched when rc starts to scroll on load to anchor on PR/Codeview /ui/plugins/code/comment_form_built - launched when injectInlineForm() is executed and the form object is created diff --git a/rhodecode/templates/base/root.html b/rhodecode/templates/base/root.html --- a/rhodecode/templates/base/root.html +++ b/rhodecode/templates/base/root.html @@ -17,6 +17,8 @@ c.template_context['visual']['default_re %> + + ${self.title()} <%def name="robots()"> @@ -64,10 +66,6 @@ c.template_context['visual']['default_re && 'content' in document.createElement('template') ); if (!webComponentsSupported) { - var e = document.createElement('script'); - e.async = true; - e.src = '${h.asset('js/vendors/webcomponentsjs/webcomponents-lite.min.js', ver=c.rhodecode_version_hash)}'; - document.head.appendChild(e); } else { onload(); } @@ -122,14 +120,9 @@ c.template_context['visual']['default_re - - ## avoide escaping the %N + ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates