Skip to content

Commit

Permalink
Fixing the feed chooser to show total # of feeds. Also fixing a unico…
Browse files Browse the repository at this point in the history
…de issue in normalizing urls.
  • Loading branch information
samuelclay committed Aug 27, 2011
1 parent ad47d9b commit 5da8bf7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/mongodb.dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ verbose = true
#source = slave.example.com

# in replica set configuration, specify the name of the replica set
# replSet = setname
replSet = nbset

journal = true
6 changes: 3 additions & 3 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
env.user = 'sclay'
env.roledefs ={
'local': ['localhost'],
'app': ['app01.newsblur.com'],
'web': ['www.newsblur.com'],
'app': ['app01.newsblur.com', 'app02.newsblur.com'],
'web': ['www.newsblur.com', 'app02.newsblur.com'],
'db': ['db01.newsblur.com', 'db02.newsblur.com'],
'task': ['task01.newsblur.com', 'task02.newsblur.com', 'task03.newsblur.com'],
}
Expand Down Expand Up @@ -420,7 +420,7 @@ def setup_mongo():
sudo('apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10')
sudo('echo "deb http://downloads.mongodb.org/distros/ubuntu 10.10 10gen" >> /etc/apt/sources.list.d/10gen.list')
sudo('apt-get update')
sudo('apt-get -y install mongodb')
sudo('apt-get -y install mongodb-10gen')

# ================
# = Setup - Task =
Expand Down
6 changes: 4 additions & 2 deletions media/css/reader.css
Original file line number Diff line number Diff line change
Expand Up @@ -4790,8 +4790,8 @@ background: transparent;
float: right;
font-size: 14px;
line-height: 16px;
color: #707070;
margin: 24px 0 0;
color: #427700;
margin: 24px 0 1px;
font-weight: bold;
text-shadow:1px 1px 0 #F0F0F0;
}
Expand All @@ -4808,6 +4808,8 @@ background: transparent;
/* color: #5090D0;*/
}
.NB-modal-feedchooser .NB-feedchooser-info-counts.NB-error {
display: block;
padding: 0;
color: #C05050;
}

Expand Down
3 changes: 2 additions & 1 deletion media/js/newsblur/reader_feedchooser.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ NEWSBLUR.ReaderFeedchooser.prototype = {

make_feeds: function() {
var feeds = this.model.feeds;
this.feed_count = _.size(feeds);

var $feeds = $('#feed_list').clone(true).attr({
'id': 'NB-feedchooser-feeds',
Expand Down Expand Up @@ -260,7 +261,7 @@ NEWSBLUR.ReaderFeedchooser.prototype = {
var $submit = $('.NB-modal-submit-save', this.$modal);
var difference = approved - this.MAX_FEEDS;

$count.text(approved + '/' + this.MAX_FEEDS);
$count.text(approved + '/' + Inflector.commas(this.feed_count));
$count.toggleClass('NB-full', approved == this.MAX_FEEDS);
$count.toggleClass('NB-error', approved > this.MAX_FEEDS);
$('.NB-feedchooser-info-sort', this.$modal).fadeOut(500);
Expand Down
7 changes: 5 additions & 2 deletions utils/urlnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ def normalize(url):
# Always use uppercase A-through-F characters when percent-encoding.
# All portions of the URI must be utf-8 encoded NFC from Unicode strings
def clean(string):
string=unicode(unquote(string))
return unicodedata.normalize('NFC',string).encode('utf-8')
try:
string=unicode(unquote(string))
return unicodedata.normalize('NFC',string).encode('utf-8')
except UnicodeDecodeError:
return string
path=quote(clean(path),"~:/?#[]@!$&'()*+,;=")
fragment=quote(clean(fragment),"~")

Expand Down

0 comments on commit 5da8bf7

Please sign in to comment.