Merge branch 'master' into recommended

This commit is contained in:
Samuel Clay 2011-03-12 18:13:34 -05:00
commit 7a4a651c34
3 changed files with 18 additions and 6 deletions

View file

@ -57,7 +57,7 @@ class OPMLExporter:
def process_outline(self, body, folders):
for obj in folders:
if isinstance(obj, int):
if isinstance(obj, int) and obj in self.feeds:
feed = self.feeds[obj]
feed_attrs = self.make_feed_row(feed)
body.append(Element('outline', feed_attrs))

View file

@ -14,7 +14,7 @@ from apps.reader.forms import SignupForm
from apps.reader.models import UserSubscription
from apps.feed_import.models import OAuthToken, OPMLImporter, OPMLExporter, GoogleReaderImporter
from utils import json_functions as json
from utils.user_functions import ajax_login_required
from utils.user_functions import ajax_login_required, get_user
@ajax_login_required
@ -44,9 +44,9 @@ def opml_upload(request):
data = json.encode(dict(message=message, code=code, payload=payload))
return HttpResponse(data, mimetype='text/plain')
@ajax_login_required
def opml_export(request):
exporter = OPMLExporter(request.user)
user = get_user(request)
exporter = OPMLExporter(user)
opml = exporter.process()
now = datetime.datetime.now()

View file

@ -14,6 +14,7 @@ NEWSBLUR.ReaderAddFeed.prototype = {
this.open_modal();
this.handle_keystrokes();
this.setup_autocomplete();
this.focus_add_feed();
this.$modal.bind('click', $.rescope(this.handle_click, this));
},
@ -143,7 +144,9 @@ NEWSBLUR.ReaderAddFeed.prototype = {
'onOpen': function (dialog) {
dialog.overlay.fadeIn(200, function () {
dialog.container.fadeIn(200);
dialog.data.fadeIn(200);
dialog.data.fadeIn(200, function() {
self.focus_add_feed();
});
});
},
'onShow': function(dialog) {
@ -170,12 +173,21 @@ NEWSBLUR.ReaderAddFeed.prototype = {
});
},
focus_add_feed: function() {
var $add = $('.NB-add-url', this.$modal);
if (!NEWSBLUR.Globals.is_anonymous) {
_.delay(function() {
$add.focus();
}, 200);
}
},
setup_autocomplete: function() {
var self = this;
var $add = $('.NB-add-url', this.$modal);
$add.autocomplete({
minLength: 0,
minLength: 1,
source: '/rss_feeds/feed_autocomplete',
focus: function(e, ui) {
$add.val(ui.item.value);