Adding manage menu to every modal dialog's title. Needs an icon, but completely usable now.

This commit is contained in:
Samuel Clay 2013-04-11 16:50:18 -07:00
parent 3c84e79ec6
commit 4599fa9cb4
15 changed files with 276 additions and 306 deletions

View file

@ -87,6 +87,12 @@ fieldset legend {
background: none;
}
.NB-modal-tabs .NB-modal-loading,
.NB-modal-tabs .NB-loading {
float: left;
margin: 4px 8px 0 0;
}
.NB-modal .NB-modal-loading.NB-active {
background: transparent url('/media/img/reader/recycle_spinner.gif') no-repeat 0 0;
}

View file

@ -9001,19 +9001,6 @@ form.opml_import_form input {
margin: 6px 8px 0 0;
float: left;
}
.NB-modal-profile-editor fieldset {
border: 0;
border-top: 1px solid #E6E6E6;
padding: 0 12px;
margin: 0;
}
.NB-modal-profile-editor fieldset legend {
padding: 0 12px;
font-weight: bold;
font-size: 11px;
text-transform: uppercase;
color: #151775;
}
.NB-modal-profile-editor .NB-tab-profile .NB-modal-submit-button {
float: left;
margin: 12px 0 12px 12px;
@ -9417,20 +9404,6 @@ form.opml_import_form input {
float: none;
z-index: 1;
}
.NB-modal-profile fieldset {
border: 0;
border-top: 1px solid #E6E6E6;
padding: 0 12px;
margin: 8px 0 0;
}
.NB-modal-profile fieldset legend {
padding: 0 12px;
font-weight: bold;
font-size: 11px;
color: #151775;
text-transform: uppercase;
text-shadow: 0 1px 0 white;
}
.NB-modal.NB-modal-profile .NB-modal-section {
padding: 12px 0 2px;
}

View file

@ -462,14 +462,13 @@
self.storyPageControl.currentPage.webView.hidden = YES;
self.storyPageControl.nextPage.webView.hidden = YES;
self.storyPageControl.bottomPlaceholderToolbar.hidden = NO;
self.storyPageControl.progressViewContainer.hidden = YES;
self.storyPageControl.navigationItem.rightBarButtonItems = nil;
[self.storyPageControl resetPages];
int unreadCount = appDelegate.unreadCount;
if (unreadCount == 0) {
self.storyPageControl.progressView.progress = 1;
self.storyPageControl.circularProgressView.percentage = 1;
} else {
self.storyPageControl.progressView.progress = 0;
self.storyPageControl.circularProgressView.percentage = 0;
}
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;

View file

@ -93,7 +93,7 @@
radius:radius
lineWidth:radius / 4.0f
progressMode:THProgressModeFill
progressColor:[UIColor colorWithRed:0.96f green:0.96f blue:0.96f alpha:1.0f]
progressColor:[UIColor colorWithRed:1 green:1 blue:1 alpha:1.0f]
progressBackgroundMode:THProgressBackgroundModeCircumference
progressBackgroundColor:[UIColor colorWithRed:0.96f green:0.96f blue:0.96f alpha:.3f]
percentage:20];

View file

@ -2491,8 +2491,8 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = Entitlements.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution: NewsBlur, Inc.";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: NewsBlur, Inc.";
CODE_SIGN_IDENTITY = "iPhone Developer: Samuel Clay (G9HFWP68T7)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Samuel Clay (G9HFWP68T7)";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@ -2515,8 +2515,8 @@
"-all_load",
);
PRODUCT_NAME = NewsBlur;
PROVISIONING_PROFILE = "EE8BC292-FFF2-41A0-AE29-C4B39D6A2C5A";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "EE8BC292-FFF2-41A0-AE29-C4B39D6A2C5A";
PROVISIONING_PROFILE = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B";
TARGETED_DEVICE_FAMILY = "1,2";
VALID_ARCHS = armv7;
"WARNING_CFLAGS[arch=*]" = "-Wall";
@ -2530,8 +2530,8 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = Entitlements.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution: NewsBlur, Inc.";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: NewsBlur, Inc.";
CODE_SIGN_IDENTITY = "iPhone Developer: Samuel Clay (G9HFWP68T7)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Samuel Clay (G9HFWP68T7)";
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NewsBlur_Prefix.pch;
@ -2551,8 +2551,8 @@
"-all_load",
);
PRODUCT_NAME = NewsBlur;
PROVISIONING_PROFILE = "EE8BC292-FFF2-41A0-AE29-C4B39D6A2C5A";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "EE8BC292-FFF2-41A0-AE29-C4B39D6A2C5A";
PROVISIONING_PROFILE = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VALID_ARCHS = armv7;
@ -2563,8 +2563,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer: Samuel Clay (G9HFWP68T7)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Samuel Clay (G9HFWP68T7)";
CODE_SIGN_IDENTITY = "iPhone Developer: Samuel Clay (3PN8E5365D)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Samuel Clay (3PN8E5365D)";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
@ -2573,8 +2573,8 @@
HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/**";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_LDFLAGS = "-ObjC";
PROVISIONING_PROFILE = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B";
PROVISIONING_PROFILE = "0E4D73FC-DFF6-4E38-BA47-4A3F5AC9C6A2";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "0E4D73FC-DFF6-4E38-BA47-4A3F5AC9C6A2";
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
STRIP_INSTALLED_PRODUCT = NO;
@ -2586,8 +2586,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer: Samuel Clay (G9HFWP68T7)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Samuel Clay (G9HFWP68T7)";
CODE_SIGN_IDENTITY = "iPhone Developer: Samuel Clay (3PN8E5365D)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Samuel Clay (3PN8E5365D)";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
@ -2597,8 +2597,8 @@
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
OTHER_LDFLAGS = "-ObjC";
PROVISIONING_PROFILE = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B";
PROVISIONING_PROFILE = "0E4D73FC-DFF6-4E38-BA47-4A3F5AC9C6A2";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "0E4D73FC-DFF6-4E38-BA47-4A3F5AC9C6A2";
SDKROOT = iphoneos;
STRIP_INSTALLED_PRODUCT = NO;
VALID_ARCHS = armv7;

View file

@ -2,9 +2,37 @@
<Bucket
type = "1"
version = "1.0">
<FileBreakpoints>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Classes/StoryPageControl.m"
timestampString = "379293086.668773"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "298"
endingLineNumber = "298"
landmarkName = "-resizeScrollView"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Classes/NewsBlurAppDelegate.m"
timestampString = "378407777.087073"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "683"
endingLineNumber = "683"
landmarkName = "-recalculateIntelligenceScores:"
landmarkType = "5">
</FileBreakpoint>
</FileBreakpoints>
<SymbolicBreakpoints>
<SymbolicBreakpoint
shouldBeEnabled = "Yes"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "objc_exception_throw"
@ -13,7 +41,7 @@
</SymbolicBreakpoints>
<ExceptionBreakpoints>
<ExceptionBreakpoint
shouldBeEnabled = "Yes"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"

View file

@ -13,8 +13,8 @@
// #define BACKGROUND_REFRESH_SECONDS -5
#define BACKGROUND_REFRESH_SECONDS -10*60
#define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.com"]
// #define NEWSBLUR_URL [NSString stringWithFormat:@"dev.newsblur.com"]
// #define NEWSBLUR_URL [NSString stringWithFormat:@"nb.local.com"]
#define NEWSBLUR_URL [NSString stringWithFormat:@"dev.newsblur.com"]
#define NEWSBLUR_LINK_COLOR 0x405BA8
#define NEWSBLUR_HIGHLIGHT_COLOR 0xd2e6fd

View file

@ -90,8 +90,17 @@ NEWSBLUR.Modal.prototype = {
$('.NB-modal-subtitle .NB-modal-feed-image', this.$modal).attr('src', $.favicon(this.feed));
$('.NB-modal-subtitle .NB-modal-feed-title', this.$modal).html(this.feed.get('feed_title'));
$('.NB-modal-subtitle .NB-modal-feed-subscribers', this.$modal).html(Inflector.pluralize(' subscriber', this.feed.get('num_subscribers'), true));
},
switch_tab: function(newtab) {
var $modal_tabs = $('.NB-modal-tab', this.$modal);
var $tabs = $('.NB-tab', this.$modal);
$modal_tabs.removeClass('NB-active');
$tabs.removeClass('NB-active');
$modal_tabs.filter('.NB-modal-tab-'+newtab).addClass('NB-active');
$tabs.filter('.NB-tab-'+newtab).addClass('NB-active');
}
};

View file

@ -3066,12 +3066,21 @@
'top': 0,
'left': -2
});
} else if (options.right) {
$manage_menu_container.align($item, '-top -left', {
'top': -34,
'left': 0
});
} else {
$manage_menu_container.align($item, '-top left', {
'top': -24,
'left': 20
});
}
if (options.body) {
$manage_menu_container.appendTo(this.$s.$body);
$manage_menu_container.css('z-index', $("#simplemodal-container").css('z-index'));
}
$('.NB-task-manage').addClass('NB-hover');
} else if (type == 'feed' || type == 'folder' || type == 'story' || type == 'socialfeed') {
var left, top;
@ -4681,6 +4690,15 @@
self.show_manage_menu('site', $t, {inverse: true});
}
});
$.targetIs(e, { tagSelector: '.NB-modal-title' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
var $item = $(".NB-icon", $t);
if ($item.length) {
self.show_manage_menu('site', $item, {inverse: true, right: true, body: true});
}
}
});
// = Context Menu ================================================
@ -4715,19 +4733,25 @@
$.targetIs(e, { tagSelector: '.NB-menu-manage-trainer' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_trainer_modal();
$.modal.close(function() {
self.open_trainer_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-tutorial' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_tutorial_modal();
$.modal.close(function() {
self.open_tutorial_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-intro' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_intro_modal({page_number: 1});
$.modal.close(function() {
self.open_intro_modal({page_number: 1});
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-feed-stats' }, function($t, $p){
@ -4910,60 +4934,76 @@
var story = NEWSBLUR.assets.get_story(story_id);
story.star_story();
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-site-mark-read' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_mark_read_modal();
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-social-profile' }, function($t, $p){
e.preventDefault();
var feed_id = $t.parents('.NB-menu-manage').data('feed_id');
self.open_social_profile_modal(feed_id);
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-keyboard' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_keyboard_shortcuts_modal();
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-feed-exception' }, function($t, $p){
e.preventDefault();
var feed_id = $t.parents('.NB-menu-manage').data('feed_id');
self.open_feed_exception_modal(feed_id);
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-site-mark-read' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
$.modal.close(function() {
self.open_mark_read_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-social-profile' }, function($t, $p){
e.preventDefault();
var feed_id = $t.parents('.NB-menu-manage').data('feed_id');
$.modal.close(function() {
self.open_social_profile_modal(feed_id);
});
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-keyboard' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
$.modal.close(function() {
self.open_keyboard_shortcuts_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-goodies' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_goodies_modal();
$.modal.close(function() {
self.open_goodies_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-import' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
NEWSBLUR.reader.open_intro_modal({
'page_number': 2,
'force_import': true
$.modal.close(function() {
NEWSBLUR.reader.open_intro_modal({
'page_number': 2,
'force_import': true
});
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-friends' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_friends_modal();
$.modal.close(function() {
self.open_friends_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-profile-editor' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_profile_editor_modal();
$.modal.close(function() {
self.open_profile_editor_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-preferences' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_preferences_modal();
$.modal.close(function() {
self.open_preferences_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-logout' }, function($t, $p){
@ -4976,13 +5016,17 @@
$.targetIs(e, { tagSelector: '.NB-menu-manage-account' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_account_modal();
$.modal.close(function() {
self.open_account_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-menu-manage-feedchooser' }, function($t, $p){
e.preventDefault();
if (!$t.hasClass('NB-disabled')) {
self.open_feedchooser_modal();
$.modal.close(function() {
self.open_feedchooser_modal();
});
}
});
$.targetIs(e, { tagSelector: '.NB-module-account-upgrade' }, function($t, $p){

View file

@ -36,124 +36,133 @@ _.extend(NEWSBLUR.ReaderAccount.prototype, {
var self = this;
this.$modal = $.make('div', { className: 'NB-modal-preferences NB-modal-account NB-modal' }, [
$.make('a', { href: '#preferences', className: 'NB-link-account-preferences NB-splash-link' }, 'Switch to Preferences'),
$.make('div', { className: 'NB-modal-tabs' }, [
$.make('div', { className: 'NB-modal-loading' }),
$.make('div', { className: 'NB-modal-tab NB-active NB-modal-tab-account' }, 'Account'),
$.make('div', { className: 'NB-modal-tab NB-modal-tab-premium' }, 'Payments'),
$.make('div', { className: 'NB-modal-tab NB-modal-tab-emails' }, 'Emails')
]),
$.make('h2', { className: 'NB-modal-title' }, [
$.make('div', { className: 'NB-icon' }),
'Account'
]),
$.make('form', { className: 'NB-preferences-form' }, [
$.make('div', { className: 'NB-preference NB-preference-username' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', { className: 'NB-preference-option' }, [
$.make('input', { id: 'NB-preference-username', type: 'text', name: 'username', value: NEWSBLUR.Globals.username })
])
]),
$.make('div', { className: 'NB-preference-label'}, [
$.make('label', { 'for': 'NB-preference-username' }, 'Username'),
$.make('div', { className: 'NB-preference-error'})
])
]),
$.make('div', { className: 'NB-preference NB-preference-email' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', { className: 'NB-preference-option' }, [
$.make('input', { id: 'NB-preference-email', type: 'text', name: 'email', value: NEWSBLUR.Globals.email })
])
]),
$.make('div', { className: 'NB-preference-label'}, [
$.make('label', { 'for': 'NB-preference-email' }, 'Email address'),
$.make('div', { className: 'NB-preference-error'})
])
]),
$.make('div', { className: 'NB-preference NB-preference-password' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', { className: 'NB-preference-option', style: (this.options.change_password ? 'opacity: .2' : '') }, [
$.make('label', { 'for': 'NB-preference-password-old' }, 'Old password'),
$.make('input', { id: 'NB-preference-password-old', type: 'password', name: 'old_password', value: '' })
$.make('div', { className: 'NB-tab NB-tab-account NB-active' }, [
$.make('div', { className: 'NB-preference NB-preference-username' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', { className: 'NB-preference-option' }, [
$.make('input', { id: 'NB-preference-username', type: 'text', name: 'username', value: NEWSBLUR.Globals.username })
])
]),
$.make('div', { className: 'NB-preference-option' }, [
$.make('label', { 'for': 'NB-preference-password-new' }, 'New password'),
$.make('input', { id: 'NB-preference-password-new', type: 'password', name: 'new_password', value: '' })
$.make('div', { className: 'NB-preference-label'}, [
$.make('label', { 'for': 'NB-preference-username' }, 'Username'),
$.make('div', { className: 'NB-preference-error'})
])
]),
$.make('div', { className: 'NB-preference-label'}, [
'Change password',
$.make('div', { className: 'NB-preference-error'})
])
]),
$.make('div', { className: 'NB-preference NB-preference-premium' }, [
$.make('div', { className: 'NB-preference-options' }, [
(!NEWSBLUR.Globals.is_premium && $.make('a', { className: 'NB-modal-submit-button NB-modal-submit-green NB-account-premium-modal' }, 'Go Premium!')),
(NEWSBLUR.Globals.is_premium && $.make('div', [
'Thank you! You have a ',
$.make('b', 'premium account'),
'.',
$.make('div', { className: 'NB-block' }, 'Your premium account will expire on:'),
$.make('div', { className: 'NB-block' }, [
$.make('span', { className: 'NB-raquo' }, '&raquo;'),
' ',
NEWSBLUR.utils.format_date(NEWSBLUR.Globals.premium_expire)
$.make('div', { className: 'NB-preference NB-preference-email' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', { className: 'NB-preference-option' }, [
$.make('input', { id: 'NB-preference-email', type: 'text', name: 'email', value: NEWSBLUR.Globals.email })
])
]),
$.make('div', { className: 'NB-preference-label'}, [
$.make('label', { 'for': 'NB-preference-email' }, 'Email address'),
$.make('div', { className: 'NB-preference-error'})
])
]),
$.make('div', { className: 'NB-preference NB-preference-password' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', { className: 'NB-preference-option', style: (this.options.change_password ? 'opacity: .2' : '') }, [
$.make('label', { 'for': 'NB-preference-password-old' }, 'Old password'),
$.make('input', { id: 'NB-preference-password-old', type: 'password', name: 'old_password', value: '' })
]),
$.make('a', { href: '#', className: 'NB-block NB-account-premium-renew NB-splash-link' }, 'Renew and change your payment amount'),
$.make('a', { href: '#', className: 'NB-block NB-account-premium-cancel NB-splash-link' }, 'Cancel subscription renewal')
]))
]),
$.make('div', { className: 'NB-preference-label'}, [
'Premium'
])
]),
(NEWSBLUR.Globals.is_premium && $.make('div', { className: 'NB-preference NB-preference-premium-history' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('ul', { className: 'NB-account-payments' }, [
$.make('li', { className: 'NB-payments-loading' }, 'Loading...')
])
]),
$.make('div', { className: 'NB-preference-label'}, [
'Payment history'
])
])),
$.make('div', { className: 'NB-preference NB-preference-opml' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('a', { className: 'NB-splash-link', href: NEWSBLUR.URLs['opml-export'] }, 'Download OPML')
]),
$.make('div', { className: 'NB-preference-label'}, [
'Backup your sites',
$.make('div', { className: 'NB-preference-sublabel' }, 'Download this XML file as a backup')
])
]),
$.make('div', { className: 'NB-preference NB-preference-emails' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', [
$.make('input', { id: 'NB-preference-emails-1', type: 'radio', name: 'send_emails', value: 'true' }),
$.make('label', { 'for': 'NB-preference-emails-1' }, [
'Email replies, re-shares, and new followers'
$.make('div', { className: 'NB-preference-option' }, [
$.make('label', { 'for': 'NB-preference-password-new' }, 'New password'),
$.make('input', { id: 'NB-preference-password-new', type: 'password', name: 'new_password', value: '' })
])
]),
$.make('div', [
$.make('input', { id: 'NB-preference-emails-2', type: 'radio', name: 'send_emails', value: 'false' }),
$.make('label', { 'for': 'NB-preference-emails-2' }, [
'Never ever send me an email'
])
$.make('div', { className: 'NB-preference-label'}, [
'Change password',
$.make('div', { className: 'NB-preference-error'})
])
]),
$.make('div', { className: 'NB-preference-label'}, [
'Emails'
$.make('div', { className: 'NB-preference NB-preference-opml' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('a', { className: 'NB-splash-link', href: NEWSBLUR.URLs['opml-export'] }, 'Download OPML')
]),
$.make('div', { className: 'NB-preference-label'}, [
'Backup your sites',
$.make('div', { className: 'NB-preference-sublabel' }, 'Download this XML file as a backup')
])
]),
$.make('div', { className: 'NB-preference NB-preference-delete' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('a', { className: 'NB-splash-link', href: NEWSBLUR.URLs['delete-account'] }, 'Delete my account')
]),
$.make('div', { className: 'NB-preference-label'}, [
'Erase yourself',
$.make('div', { className: 'NB-preference-sublabel' }, 'Warning: This is actually permanent')
])
])
]),
$.make('div', { className: 'NB-preference NB-preference-delete' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('a', { className: 'NB-splash-link', href: NEWSBLUR.URLs['delete-account'] }, 'Delete my account')
$.make('div', { className: 'NB-tab NB-tab-premium' }, [
$.make('div', { className: 'NB-preference NB-preference-premium' }, [
$.make('div', { className: 'NB-preference-options' }, [
(!NEWSBLUR.Globals.is_premium && $.make('a', { className: 'NB-modal-submit-button NB-modal-submit-green NB-account-premium-modal' }, 'Go Premium!')),
(NEWSBLUR.Globals.is_premium && $.make('div', [
'Thank you! You have a ',
$.make('b', 'premium account'),
'.',
$.make('div', { className: 'NB-block' }, 'Your premium account will expire on:'),
$.make('div', { className: 'NB-block' }, [
$.make('span', { className: 'NB-raquo' }, '&raquo;'),
' ',
NEWSBLUR.utils.format_date(NEWSBLUR.Globals.premium_expire)
]),
$.make('a', { href: '#', className: 'NB-block NB-account-premium-renew NB-splash-link' }, 'Renew and change your payment amount'),
$.make('a', { href: '#', className: 'NB-block NB-account-premium-cancel NB-splash-link' }, 'Cancel subscription renewal')
]))
]),
$.make('div', { className: 'NB-preference-label'}, [
'Premium'
])
]),
$.make('div', { className: 'NB-preference-label'}, [
'Erase yourself',
$.make('div', { className: 'NB-preference-sublabel' }, 'Warning: This is actually permanent')
$.make('div', { className: 'NB-preference NB-preference-premium-history' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('ul', { className: 'NB-account-payments' }, [
$.make('li', { className: 'NB-payments-loading' }, 'Loading...')
])
]),
$.make('div', { className: 'NB-preference-label'}, [
'Payment history'
])
])
]),
$.make('div', { className: 'NB-tab NB-tab-emails' }, [
$.make('div', { className: 'NB-preference NB-preference-emails' }, [
$.make('div', { className: 'NB-preference-options' }, [
$.make('div', [
$.make('input', { id: 'NB-preference-emails-1', type: 'radio', name: 'send_emails', value: 'true' }),
$.make('label', { 'for': 'NB-preference-emails-1' }, [
'Email replies, re-shares, and new followers'
])
]),
$.make('div', [
$.make('input', { id: 'NB-preference-emails-2', type: 'radio', name: 'send_emails', value: 'false' }),
$.make('label', { 'for': 'NB-preference-emails-2' }, [
'Never ever send me an email'
])
])
]),
$.make('div', { className: 'NB-preference-label'}, [
'Emails'
])
])
]),
$.make('div', { className: 'NB-modal-submit' }, [
$.make('input', { type: 'submit', disabled: 'true', className: 'NB-modal-submit-button NB-modal-submit-green NB-disabled', value: 'Change what you like above...' }),
' or ',
$.make('a', { href: '#', className: 'NB-modal-cancel' }, 'cancel')
$.make('input', { type: 'submit', disabled: 'true', className: 'NB-modal-submit-button NB-modal-submit-green NB-disabled', value: 'Change what you like above...' })
])
]).bind('submit', function(e) {
e.preventDefault();
@ -165,6 +174,7 @@ _.extend(NEWSBLUR.ReaderAccount.prototype, {
animate_fields: function() {
if (this.options.animate_email) {
this.switch_tab('emails');
_.delay(_.bind(function() {
var $emails = $('.NB-preference-emails', this.$modal);
var bgcolor = $emails.css('backgroundColor');
@ -210,12 +220,6 @@ _.extend(NEWSBLUR.ReaderAccount.prototype, {
},
close_and_load_preferences: function() {
this.close(function() {
NEWSBLUR.reader.open_preferences_modal();
});
},
close_and_load_premium: function() {
this.close(function() {
NEWSBLUR.reader.open_feedchooser_modal();
@ -315,6 +319,18 @@ _.extend(NEWSBLUR.ReaderAccount.prototype, {
handle_click: function(elem, e) {
var self = this;
$.targetIs(e, { tagSelector: '.NB-modal-tab' }, function($t, $p) {
e.preventDefault();
var newtab;
if ($t.hasClass('NB-modal-tab-account')) {
newtab = 'account';
} else if ($t.hasClass('NB-modal-tab-premium')) {
newtab = 'premium';
} else if ($t.hasClass('NB-modal-tab-emails')) {
newtab = 'emails';
}
self.switch_tab(newtab);
});
$.targetIs(e, { tagSelector: '.NB-account-premium-modal' }, function($t, $p) {
e.preventDefault();
@ -330,11 +346,6 @@ _.extend(NEWSBLUR.ReaderAccount.prototype, {
self.cancel_premium();
});
$.targetIs(e, { tagSelector: '.NB-link-account-preferences' }, function($t, $p) {
e.preventDefault();
self.close_and_load_preferences();
});
$.targetIs(e, { tagSelector: '.NB-modal-cancel' }, function($t, $p) {
e.preventDefault();

View file

@ -6,7 +6,10 @@ NEWSBLUR.ReaderGoodies = function(options) {
this.runner();
};
NEWSBLUR.ReaderGoodies.prototype = {
NEWSBLUR.ReaderGoodies.prototype = new NEWSBLUR.Modal;
NEWSBLUR.ReaderGoodies.prototype.constructor = NEWSBLUR.ReaderGoodies;
_.extend(NEWSBLUR.ReaderGoodies.prototype, {
runner: function() {
this.make_modal();
@ -154,37 +157,6 @@ NEWSBLUR.ReaderGoodies.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);
setTimeout(function() {
$(window).resize();
});
});
},
'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();
}
});
},
// ===========
// = Actions =
// ===========
@ -229,4 +201,4 @@ NEWSBLUR.ReaderGoodies.prototype = {
});
}
};
});

View file

@ -1,6 +1,6 @@
NEWSBLUR.ReaderKeyboard = function(options) {
var defaults = {
modal_container_class: "NB-full-container"
width: 620
};
this.options = $.extend({}, defaults, options);
@ -304,35 +304,6 @@ _.extend(NEWSBLUR.ReaderKeyboard.prototype, {
]);
},
open_modal: function() {
var self = this;
this.$modal.modal({
'minWidth': 620,
'maxWidth': 620,
'overlayClose': true,
'onOpen': function (dialog) {
dialog.overlay.fadeIn(200, function () {
dialog.container.fadeIn(200);
dialog.data.fadeIn(200);
$(window).resize();
});
},
'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();
}
});
},
handle_cancel: function() {
var $cancel = $('.NB-modal-cancel', this.$modal);

View file

@ -40,9 +40,7 @@ _.extend(NEWSBLUR.ReaderMarkRead.prototype, {
$.make('div', { className: 'NB-markread-slider'}),
$.make('div', { className: 'NB-markread-explanation'}),
$.make('div', { className: 'NB-modal-submit' }, [
$.make('input', { type: 'submit', className: 'NB-modal-submit-button NB-modal-submit-green', value: 'Do it' }),
' or ',
$.make('a', { href: '#', className: 'NB-modal-cancel' }, 'cancel')
$.make('input', { type: 'submit', className: 'NB-modal-submit-button NB-modal-submit-green', value: 'Do it' })
])
]).bind('submit', function(e) {
e.preventDefault();
@ -52,36 +50,6 @@ _.extend(NEWSBLUR.ReaderMarkRead.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');
// $('.NB-classifier-tag', self.$modal).corner('4px');
},
'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();
$(document).unbind('.mark_read');
}
});
},
load_slider: function() {
var self = this;
var $slider = $('.NB-markread-slider', this.$modal);
@ -109,16 +77,16 @@ _.extend(NEWSBLUR.ReaderMarkRead.prototype, {
},
generate_explanation: function(value) {
var $explanation = $('.NB-markread-explanation', this.$modal);
var $button = $('.NB-modal-submit-button', this.$modal);
var explanation;
if (value == 0) {
explanation = "Mark <b>every story</b> as read.";
explanation = "Mark every story as read";
} else if (value >= 1) {
explanation = "Mark all stories older than <b>" + value + " day" + (value==1?'':'s') + " old</b> as read.";
explanation = "Mark all stories older than " + value + " day" + (value==1?'':'s') + " old as read";
}
$explanation.html(explanation);
$button.val(explanation);
},
save_mark_read: function() {

View file

@ -859,6 +859,7 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
} else if ($t.hasClass('NB-modal-tab-stories')) {
newtab = 'stories';
}
self.resize_modal();
self.switch_tab(newtab);
});
$.targetIs(e, { tagSelector: '.NB-modal-submit-button' }, function($t, $p) {
@ -899,19 +900,6 @@ _.extend(NEWSBLUR.ReaderPreferences.prototype, {
$('input[type=radio],input[type=checkbox],select', this.$modal).bind('change', _.bind(this.enable_save, this));
},
switch_tab: function(newtab) {
var $modal_tabs = $('.NB-modal-tab', this.$modal);
var $tabs = $('.NB-tab', this.$modal);
$modal_tabs.removeClass('NB-active');
$tabs.removeClass('NB-active');
$modal_tabs.filter('.NB-modal-tab-'+newtab).addClass('NB-active');
$tabs.filter('.NB-tab-'+newtab).addClass('NB-active');
this.resize_modal();
},
enable_save: function() {
$('.NB-modal-submit-button', this.$modal).removeAttr('disabled').removeClass('NB-disabled').text('Save Preferences');
},

View file

@ -643,6 +643,7 @@
// prevent close when dialog does not exist
if (!s.d.data) {
callback && callback();
return false;
}