You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			JavaScript
		
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			JavaScript
		
	
/*
 | 
						|
 * vim: ts=4:sw=4:expandtab
 | 
						|
 */
 | 
						|
(function () {
 | 
						|
    'use strict';
 | 
						|
    window.Whisper = window.Whisper || {};
 | 
						|
 | 
						|
    Whisper.SettingsView = Whisper.View.extend({
 | 
						|
        className: 'settings modal',
 | 
						|
        templateName: 'settings',
 | 
						|
        events: {
 | 
						|
            'change': 'change',
 | 
						|
            'click .close': 'remove'
 | 
						|
        },
 | 
						|
        change: function(e) {
 | 
						|
            var value = this.$(e.target).val();
 | 
						|
            storage.put('notification-setting', value);
 | 
						|
            console.log('notification setting changed to', value);
 | 
						|
        },
 | 
						|
        update: function() {
 | 
						|
            var setting = storage.get('notification-setting');
 | 
						|
            if (!setting) {
 | 
						|
                setting = 'message';
 | 
						|
            }
 | 
						|
            this.$('#notification-setting-' + setting).attr('checked','checked');
 | 
						|
        },
 | 
						|
        render_attributes: function() {
 | 
						|
            return {
 | 
						|
              notifications: i18n('notifications'),
 | 
						|
              notificationSettingsDialog: i18n('notificationSettingsDialog'),
 | 
						|
              settings: i18n('settings'),
 | 
						|
              disableNotifications: i18n('disableNotifications'),
 | 
						|
              nameAndMessage: i18n('nameAndMessage'),
 | 
						|
              noNameOrMessage: i18n('noNameOrMessage'),
 | 
						|
              nameOnly: i18n('nameOnly'),
 | 
						|
            };
 | 
						|
        }
 | 
						|
    });
 | 
						|
})();
 |