var View = Backbone.View.extend({\r
events: {\r
'change [data-setting]': 'saveSettings',\r
- 'click [data-setting="theme"]': 'selectTheme'\r
+ 'click [data-setting="theme"]': 'selectTheme',\r
+ 'click .registerProtocol': 'registerProtocol'\r
},\r
\r
initialize: function (options) {\r
this.$el = $($('#tmpl_applet_settings').html().trim());\r
\r
+ if (!navigator.registerProtocolHandler) {\r
+ this.$el.find('.protoHandler').remove();\r
+ }\r
+\r
// Incase any settings change while we have this open, update them\r
_kiwi.global.settings.on('change', this.loadSettings, this);\r
\r
$('[data-setting="theme"].active', this.$el).removeClass('active');\r
$(event.currentTarget).addClass('active').trigger('change');\r
event.preventDefault();\r
+ },\r
+\r
+ registerProtocol: function (event) {\r
+ navigator.registerProtocolHandler('irc', document.location.origin + _kiwi.app.get('base_path') + '/%s', 'Kiwi IRC');\r
+ navigator.registerProtocolHandler('ircs', document.location.origin + _kiwi.app.get('base_path') + '/%s', 'Kiwi IRC');\r
}\r
});\r
\r
</label>\r
</div>\r
</section>\r
+\r
+ <section class="protoHandler">\r
+ <h6>irc: protocol hander</h6>\r
+ <div class="control-group">\r
+ <button class="registerProtocol">Register protocol handler</button>\r
+ <br>\r
+ <span>Allow Kiwi IRC to handle irc: links <small>(Example: <a href="irc:irc.example.com:6667/irchelp">irc:irc.example.com:6667/irchelp</a>)</small></span>\r
+ </div>\r
+ </section>\r
</div>\r
</script>\r
\r