Skip to content

Commit

Permalink
change option name
Browse files Browse the repository at this point in the history
  • Loading branch information
mboinet committed May 25, 2013
1 parent 8d5adc7 commit ae06b97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ <h1>Settings</h1>
id="articles-number" value="10" type="number">
<input name="artOldestFirst" id="articles-oldest-first" type="checkbox">
<label for="articles-oldest-first">Show oldest articles first</label>
<input name="hideEmptyCategories" id="hide-empty-categories" type="checkbox">
<label for="hide-empty-categories">Only show unread</label>
<input name="onlyUnread" id="only-unread" type="checkbox">
<label for="only-unread">Only show unread</label>
</form>
</div>
<div class="version">
Expand Down
8 changes: 4 additions & 4 deletions src/scripts/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ define(['api','backbone','utils'],
defaults: {
articlesNumber: 10,
articlesOldestFirst: false,
hideEmptyCategories: false
onlyUnread: false
},

validate: function(attrs, options){
Expand Down Expand Up @@ -89,7 +89,7 @@ define(['api','backbone','utils'],
var request = {
op: "getCategories",
enable_nested: "false", // we want nested ones but they will not be nested yet
unread_only: settings.attributes.hideEmptyCategories // get only feeds with unread articles
unread_only: settings.attributes.onlyUnread // get only feeds with unread articles
};

api.ttRssApiCall(request, function(res){
Expand Down Expand Up @@ -132,7 +132,7 @@ define(['api','backbone','utils'],
op: "getFeeds",
cat_id: catId,
include_nested: false,
unread_only: settings.attributes.hideEmptyCategories // get only feeds with unread articles
unread_only: settings.attributes.onlyUnread // get only feeds with unread articles
};

api.ttRssApiCall(
Expand Down Expand Up @@ -275,7 +275,7 @@ define(['api','backbone','utils'],
var orderBy = settings.get("articlesOldestFirst") === true ? "date_reverse" : "feed_dates";

// set view_mode depending on options
var viewMode = settings.get("hideEmptyCategories") ? "unread" : "adaptive";
var viewMode = settings.get("onlyUnread") ? "unread" : "adaptive";

// we need to fetch the articles list for this feed
var msg = {
Expand Down
12 changes: 6 additions & 6 deletions src/scripts/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ define(['jquery', 'models', 'templates','conf','utils'],

var msg = "No categories";

if (models.settingsModel.get("hideEmptyCategories")){
if (models.settingsModel.get("onlyUnread")){
msg = "No unread categories";
}

Expand Down Expand Up @@ -397,7 +397,7 @@ define(['jquery', 'models', 'templates','conf','utils'],

var msg = "No feeds";

if (models.settingsModel.get("hideEmptyCategories")){
if (models.settingsModel.get("onlyUnread")){
msg = "No unread feeds";
}

Expand Down Expand Up @@ -656,7 +656,7 @@ define(['jquery', 'models', 'templates','conf','utils'],
// no elements in the collection

// message depending on options
var msg = models.settingsModel.get("hideEmptyCategories") ?
var msg = models.settingsModel.get("onlyUnread") ?
"No unread articles" :"No articles" ;

this.$lv.html(tpl.roListElement({text: msg}));
Expand Down Expand Up @@ -1067,10 +1067,10 @@ define(['jquery', 'models', 'templates','conf','utils'],
render: function(){
var artNumber = this.model.get("articlesNumber");
var artOldestFirst = this.model.get("articlesOldestFirst");
var hideEmptyCategories = this.model.get("hideEmptyCategories");
var onlyUnread = this.model.get("onlyUnread");
this.$("#articles-number").attr("value", artNumber);
this.$("#articles-oldest-first").prop("checked", artOldestFirst).checkboxradio("refresh");
this.$("#hide-empty-categories").prop("checked", hideEmptyCategories).checkboxradio("refresh");
this.$("#only-unread").prop("checked", onlyUnread).checkboxradio("refresh");
return this;
},

Expand All @@ -1081,7 +1081,7 @@ define(['jquery', 'models', 'templates','conf','utils'],
{
articlesNumber: $("#articles-number").val(),
articlesOldestFirst: $("#articles-oldest-first").prop("checked"),
hideEmptyCategories: $("#hide-empty-categories").prop("checked")
onlyUnread: $("#only-unread").prop("checked")
},
{validate: true}
);
Expand Down

0 comments on commit ae06b97

Please sign in to comment.