Show More
@@ -0,0 +1,7 b'' | |||
|
1 | <link rel="import" href="../../../../../../bower_components/polymer/polymer.html"> | |
|
2 | ||
|
3 | <dom-module id="rhodecode-favicon"> | |
|
4 | <template> | |
|
5 | </template> | |
|
6 | <script src="rhodecode-favicon.js"></script> | |
|
7 | </dom-module> |
@@ -0,0 +1,20 b'' | |||
|
1 | Polymer({ | |
|
2 | is: 'rhodecode-favicon', | |
|
3 | properties: { | |
|
4 | favicon: Object, | |
|
5 | counter: { | |
|
6 | type: Number, | |
|
7 | observer: '_handleCounter' | |
|
8 | } | |
|
9 | }, | |
|
10 | ||
|
11 | ready: function () { | |
|
12 | this.favicon = new Favico({ | |
|
13 | type: 'rectangle', | |
|
14 | animation: 'none' | |
|
15 | }); | |
|
16 | }, | |
|
17 | _handleCounter: function (newVal, oldVal) { | |
|
18 | this.favicon.badge(this.counter); | |
|
19 | } | |
|
20 | }); |
@@ -37,6 +37,7 b'' | |||
|
37 | 37 | "<%= dirs.js.src %>/mousetrap.js", |
|
38 | 38 | "<%= dirs.js.src %>/moment.js", |
|
39 | 39 | "<%= dirs.js.node_modules %>/appenlight-client/appenlight-client.min.js", |
|
40 | "<%= dirs.js.node_modules %>/favico.js/favico-0.3.10.min.js", | |
|
40 | 41 | "<%= dirs.js.src %>/i18n_utils.js", |
|
41 | 42 | "<%= dirs.js.src %>/deform.js", |
|
42 | 43 | "<%= dirs.js.src %>/plugins/jquery.pjax.js", |
@@ -1,8 +1,11 b'' | |||
|
1 | 1 | <link rel="import" href="../../../../../../bower_components/polymer/polymer.html"> |
|
2 | 2 | <link rel="import" href="../channelstream-connection/channelstream-connection.html"> |
|
3 | <link rel="import" href="../rhodecode-toast/rhodecode-toast.html"> | |
|
4 | <link rel="import" href="../rhodecode-favicon/rhodecode-favicon.html"> | |
|
3 | 5 | |
|
4 | 6 | <dom-module id="rhodecode-app"> |
|
5 | 7 | <template> |
|
8 | <rhodecode-favicon></rhodecode-favicon> | |
|
6 | 9 | <rhodecode-toast id="notifications"></rhodecode-toast> |
|
7 | 10 | <channelstream-connection |
|
8 | 11 | id="channelstream-connection" |
@@ -6,6 +6,7 b' var rhodeCodeApp = Polymer({' | |||
|
6 | 6 | attached: function () { |
|
7 | 7 | ccLog.debug('rhodeCodeApp created'); |
|
8 | 8 | $.Topic('/notifications').subscribe(this.handleNotifications.bind(this)); |
|
9 | $.Topic('/favicon/update').subscribe(this.faviconUpdate.bind(this)); | |
|
9 | 10 | $.Topic('/connection_controller/subscribe').subscribe( |
|
10 | 11 | this.subscribeToChannelTopic.bind(this)); |
|
11 | 12 | // this event can be used to coordinate plugins to do their |
@@ -27,6 +28,10 b' var rhodeCodeApp = Polymer({' | |||
|
27 | 28 | this.$['notifications'].handleNotification(data); |
|
28 | 29 | }, |
|
29 | 30 | |
|
31 | faviconUpdate: function (data) { | |
|
32 | this.$$('rhodecode-favicon').counter = data.count; | |
|
33 | }, | |
|
34 | ||
|
30 | 35 | /** opens connection to ws server */ |
|
31 | 36 | kickoffChannelstreamPlugin: function (data) { |
|
32 | 37 | ccLog.debug('kickoffChannelstreamPlugin'); |
@@ -13,9 +13,11 b' Polymer({' | |||
|
13 | 13 | ], |
|
14 | 14 | _changedToasts: function(newValue, oldValue){ |
|
15 | 15 | this.$['p-toast'].notifyResize(); |
|
16 | $.Topic('/favicon/update').publish({count: this.toasts.length}); | |
|
16 | 17 | }, |
|
17 | 18 | dismissNotifications: function(){ |
|
18 | 19 | this.$['p-toast'].close(); |
|
20 | $.Topic('/favicon/update').publish({count: 0}); | |
|
19 | 21 | }, |
|
20 | 22 | handleClosed: function(){ |
|
21 | 23 | this.splice('toasts', 0); |
General Comments 0
You need to be logged in to leave comments.
Login now