diff --git a/media/css/reader.css b/media/css/reader.css
index ad0a8ed4f..6a482cde1 100644
--- a/media/css/reader.css
+++ b/media/css/reader.css
@@ -4118,6 +4118,9 @@ background: transparent;
.NB-menu-manage .NB-menu-manage-preferences .NB-menu-manage-image {
background: transparent url('../img/icons/silk/color_wheel.png') no-repeat 0 2px;
}
+.NB-menu-manage .NB-menu-manage-account .NB-menu-manage-image {
+ background: transparent url('../img/icons/silk/weather_sun.png') no-repeat 0 1px;
+}
.NB-menu-manage .NB-menu-manage-feedchooser .NB-menu-manage-image {
background: transparent url('../img/icons/silk/color_swatch.png') no-repeat 0 2px;
}
@@ -5295,6 +5298,28 @@ background: transparent;
background: transparent url('../img/reader/instapaper.png') no-repeat 0 0;
}
+/* ================== */
+/* = Account Dialog = */
+/* ================== */
+
+.NB-modal-account .NB-preference-username input,
+.NB-modal-account .NB-preference-email input {
+ width: 306px;
+ font-size: 14px;
+ padding: 2px;
+ margin: 0px 4px 2px;
+ border: 1px solid #606060;
+ -moz-box-shadow:2px 2px 0 #D0D0D0;
+ -webkit-box-shadow:2px 2px 0 #D0D0D0;
+ box-shadow:2px 2px 0 #D0D0D0;
+}
+.NB-modal-preferences .NB-link-account-preferences {
+ float: right;
+ line-height: 30px;
+ text-decoration: none;
+}
+
+
/* ================ */
/* = Static Pages = */
/* ================ */
diff --git a/media/js/jquery.simplemodal-1.3.js b/media/js/jquery.simplemodal-1.3.js
index 695277380..587abb746 100644
--- a/media/js/jquery.simplemodal-1.3.js
+++ b/media/js/jquery.simplemodal-1.3.js
@@ -687,7 +687,6 @@
// reset the dialog object
s.d = {};
-
$.isFunction(callback) && callback();
}, 10);
}
diff --git a/media/js/newsblur/modal.js b/media/js/newsblur/modal.js
index 903bb59af..8ed129db4 100644
--- a/media/js/newsblur/modal.js
+++ b/media/js/newsblur/modal.js
@@ -29,12 +29,12 @@ NEWSBLUR.Modal.prototype = {
'onShow': function(dialog) {
$('#simplemodal-container').corner('6px');
},
- 'onClose': function(dialog) {
+ 'onClose': function(dialog, callback) {
dialog.data.hide().empty().remove();
dialog.container.hide().empty().remove();
dialog.overlay.fadeOut(200, function() {
dialog.overlay.empty().remove();
- $.modal.close();
+ $.modal.close(callback);
});
$('.NB-modal-holder').empty().remove();
}
@@ -45,9 +45,9 @@ NEWSBLUR.Modal.prototype = {
$(window).trigger('resize.simplemodal');
},
- close: function() {
+ close: function(callback) {
$('.NB-modal-loading', this.$modal).removeClass('NB-active');
- $.modal.close();
+ $.modal.close(callback);
}
};
\ No newline at end of file
diff --git a/media/js/newsblur/reader.js b/media/js/newsblur/reader.js
index 48fdae555..a3f1a6f91 100644
--- a/media/js/newsblur/reader.js
+++ b/media/js/newsblur/reader.js
@@ -3669,6 +3669,10 @@
open_preferences_modal: function() {
NEWSBLUR.preferences = new NEWSBLUR.ReaderPreferences();
},
+
+ open_account_modal: function() {
+ NEWSBLUR.account = new NEWSBLUR.ReaderAccount();
+ },
open_feedchooser_modal: function() {
NEWSBLUR.feedchooser = new NEWSBLUR.ReaderFeedchooser();
@@ -3721,6 +3725,10 @@
$.make('span', { className: 'NB-menu-manage-title' }, "Manage NewsBlur")
]).corner('tl tr 8px'),
$.make('li', { className: 'NB-menu-separator' }),
+ $.make('li', { className: 'NB-menu-manage-account' }, [
+ $.make('div', { className: 'NB-menu-manage-image' }),
+ $.make('div', { className: 'NB-menu-manage-title' }, 'My Account')
+ ]),
$.make('li', { className: 'NB-menu-manage-keyboard' }, [
$.make('div', { className: 'NB-menu-manage-image' }),
$.make('div', { className: 'NB-menu-manage-title' }, 'Keyboard shortcuts')
@@ -4479,7 +4487,6 @@
$stories_show.css({'display': 'block'});
}
setTimeout(function() {
- console.log(['show_story_titles_above_intelligence_level', self.active_story.id]);
if (!self.active_story) return;
var $story = self.find_story_in_story_titles(self.active_story.id);
// NEWSBLUR.log(['$story', $story]);
@@ -5506,6 +5513,12 @@
self.open_preferences_modal();
}
});
+ $.targetIs(e, { tagSelector: '.NB-menu-manage-account' }, function($t, $p){
+ e.preventDefault();
+ if (!$t.hasClass('NB-disabled')) {
+ self.open_account_modal();
+ }
+ });
$.targetIs(e, { tagSelector: '.NB-menu-manage-feedchooser' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
diff --git a/media/js/newsblur/reader_preferences.js b/media/js/newsblur/reader_preferences.js
index f1f8829a8..5482f4cd9 100644
--- a/media/js/newsblur/reader_preferences.js
+++ b/media/js/newsblur/reader_preferences.js
@@ -10,8 +10,11 @@ NEWSBLUR.ReaderPreferences = function(options) {
this.runner();
};
-NEWSBLUR.ReaderPreferences.prototype = {
-
+NEWSBLUR.ReaderPreferences.prototype = new NEWSBLUR.Modal;
+NEWSBLUR.ReaderPreferences.prototype.constructor = NEWSBLUR.ReaderPreferences;
+
+_.extend(NEWSBLUR.ReaderPreferences.prototype, {
+
runner: function() {
this.make_modal();
this.select_preferences();
@@ -27,6 +30,7 @@ NEWSBLUR.ReaderPreferences.prototype = {
var self = this;
this.$modal = $.make('div', { className: 'NB-modal-preferences NB-modal' }, [
+ $.make('a', { href: '#preferences', className: 'NB-link-account-preferences NB-splash-link' }, 'Switch to Account'),
$.make('h2', { className: 'NB-modal-title' }, 'Preferences'),
$.make('form', { className: 'NB-preferences-form' }, [
$.make('div', { className: 'NB-preference' }, [
@@ -392,35 +396,7 @@ NEWSBLUR.ReaderPreferences.prototype = {
})
]);
},
-
- open_modal: function() {
- var self = this;
- this.$modal.modal({
- 'minWidth': 600,
- 'maxWidth': 600,
- 'overlayClose': true,
- 'onOpen': function (dialog) {
- dialog.overlay.fadeIn(200, function () {
- dialog.container.fadeIn(200);
- dialog.data.fadeIn(200);
- });
- },
- 'onShow': function(dialog) {
- $('#simplemodal-container').corner('6px');
- },
- 'onClose': function(dialog) {
- dialog.data.hide().empty().remove();
- dialog.container.hide().empty().remove();
- dialog.overlay.fadeOut(200, function() {
- dialog.overlay.empty().remove();
- $.modal.close();
- });
- $('.NB-modal-holder').empty().remove();
- }
- });
- },
-
select_preferences: function() {
if (NEWSBLUR.Preferences.timezone) {
$('select[name=timezone] option', this.$modal).each(function() {
@@ -559,6 +535,12 @@ NEWSBLUR.ReaderPreferences.prototype = {
return message;
},
+ close_and_load_account: function() {
+ this.close(function() {
+ NEWSBLUR.reader.open_account_modal();
+ });
+ },
+
// ===========
// = Actions =
// ===========
@@ -571,6 +553,11 @@ NEWSBLUR.ReaderPreferences.prototype = {
self.save_preferences();
});
+ $.targetIs(e, { tagSelector: '.NB-link-account-preferences' }, function($t, $p) {
+ e.preventDefault();
+
+ self.close_and_load_account();
+ });
},
handle_change: function() {
@@ -587,4 +574,4 @@ NEWSBLUR.ReaderPreferences.prototype = {
$('input[type=submit]', this.$modal).attr('disabled', true).addClass('NB-disabled').val('Change what you like above...');
}
-};
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/settings.py b/settings.py
index 1bcd02b87..defea5406 100644
--- a/settings.py
+++ b/settings.py
@@ -191,6 +191,7 @@ COMPRESS_JS = {
'js/newsblur/reader_mark_read.js',
'js/newsblur/reader_goodies.js',
'js/newsblur/reader_preferences.js',
+ 'js/newsblur/reader_account.js',
'js/newsblur/reader_feedchooser.js',
'js/newsblur/reader_statistics.js',
'js/newsblur/reader_feed_exception.js',
diff --git a/templates/base.html b/templates/base.html
index 8e0e7e1b8..55b82a3ab 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -114,17 +114,19 @@
{% block content %}{% endblock %}
-
-
-
-
-
+ {% if not debug %}
+
+
+
+
+
+ {% endif %}