diff --git a/media/css/reader.css b/media/css/reader.css index 7f2137797..32caa01fc 100644 --- a/media/css/reader.css +++ b/media/css/reader.css @@ -9088,6 +9088,7 @@ form.opml_import_form input { opacity: 0; } +.NB-modal-notifications .NB-preference-label, .NB-modal-feed-settings .NB-preference-label, .NB-modal-folder-settings .NB-preference-label { float: left; @@ -9095,6 +9096,7 @@ form.opml_import_form input { width: 102px; clear: both; } +.NB-modal-notifications .NB-preference-options, .NB-modal-feed-settings .NB-preference-options, .NB-modal-folder-settings .NB-preference-options { margin: 6px 0; @@ -9127,15 +9129,10 @@ form.opml_import_form input { width: 100%; } .NB-modal-notifications .NB-preference-label { - float: left; - margin: 10px 0; - width: 102px; - clear: both; + clear: none; } .NB-modal-notifications .NB-preference-options { - margin: 6px 0; - float: left; - overflow: hidden; + float: right; } .NB-modal-notifications .NB-modal-section-site { margin: 12px 0 0; @@ -9995,6 +9992,7 @@ form.opml_import_form input { padding-right: 12px; } +.NB-modal-notifications .NB-preference, .NB-modal-preferences .NB-preference { overflow: hidden; margin: 12px 0 0; diff --git a/media/js/newsblur/reader/reader_notifications.js b/media/js/newsblur/reader/reader_notifications.js index 7fb8417b5..71c88cc0d 100644 --- a/media/js/newsblur/reader/reader_notifications.js +++ b/media/js/newsblur/reader/reader_notifications.js @@ -26,6 +26,13 @@ _.extend(NEWSBLUR.ReaderNotifications.prototype, { if (this.feed_id) { this.initialize_feed(this.feed_id); } + + $('input[name=notification_title_only]', this.$modal).each(function() { + if ($(this).val() == NEWSBLUR.Preferences.notification_title_only) { + $(this).attr('checked', true); + return false; + } + }); this.$modal.bind('click', $.rescope(this.handle_click, this)); this.$modal.bind('change', $.rescope(this.handle_change, this)); @@ -79,6 +86,33 @@ _.extend(NEWSBLUR.ReaderNotifications.prototype, { 'Notifications', $.make('div', { className: 'NB-icon-dropdown' }) ]), + $.make('div', { className: 'NB-fieldset NB-modal-submit' }, [ + $.make('fieldset', [ + $.make('legend', 'Notification Preferences'), + $.make('div', { className: 'NB-modal-section NB-modal-section-preferences'}, [ + $.make('div', { className: 'NB-preference NB-preference-notification-title-only' }, [ + $.make('div', { className: 'NB-preference-options' }, [ + $.make('div', [ + $.make('input', { id: 'NB-preference-notificationtitleonly-1', type: 'radio', name: 'notification_title_only', value: 0 }), + $.make('label', { 'for': 'NB-preference-notificationtitleonly-1' }, [ + 'See the story title and a short content preview' + ]) + ]), + $.make('div', [ + $.make('input', { id: 'NB-preference-notificationtitleonly-2', type: 'radio', name: 'notification_title_only', value: 1 }), + $.make('label', { 'for': 'NB-preference-notificationtitleonly-2' }, [ + 'Only see the full story title' + ]) + ]) + ]), + $.make('div', { className: 'NB-preference-label' }, [ + 'Story preview', + $.make('div', { className: 'NB-preference-sublabel' }, '') + ]) + ]) + ]) + ]) + ]), (this.feed && $.make('div', { className: 'NB-fieldset NB-modal-submit' }, [ $.make('fieldset', [ $.make('legend', 'Site Notifications'), @@ -188,6 +222,11 @@ _.extend(NEWSBLUR.ReaderNotifications.prototype, { self.initialize_feed(feed_id); self.get_feed_settings(); }); + $.targetIs(e, { tagSelector: '[name=notification_title_only]' }, function ($t, $p) { + var notification_title_only = self.$modal.find("input[name=notification_title_only]:checked").val(); + console.log(['notification_title_only', notification_title_only]); + NEWSBLUR.assets.preference('notification_title_only', notification_title_only); + }); } -}); \ No newline at end of file +}); diff --git a/templates/base.html b/templates/base.html index 676a10db2..be0fa7750 100644 --- a/templates/base.html +++ b/templates/base.html @@ -50,6 +50,7 @@ 'hide_read_feeds' : 0, 'show_tooltips' : 1, 'show_contextmenus' : 1, + 'notification_title_only' : 0, 'feed_order' : 'ALPHABETICAL', 'keyboard_verticalarrows' : 'story', 'keyboard_horizontalarrows': 'view',