diff options
-rw-r--r-- | css/addnew.css | 5 | ||||
-rw-r--r-- | js/app/controllers/feedcontroller.coffee | 32 | ||||
-rw-r--r-- | js/app/controllers/settingscontroller.coffee | 4 | ||||
-rw-r--r-- | js/app/services/bl/feedbl.coffee | 2 | ||||
-rw-r--r-- | js/public/app.js | 31 | ||||
-rw-r--r-- | templates/part.addnew.php | 2 | ||||
-rw-r--r-- | templates/part.feed.starred.php | 5 | ||||
-rw-r--r-- | templates/part.feed.unread.php | 4 | ||||
-rw-r--r-- | templates/part.listfeed.php | 10 | ||||
-rw-r--r-- | templates/part.listfolder.php | 8 | ||||
-rw-r--r-- | templates/part.settings.php | 3 |
11 files changed, 52 insertions, 54 deletions
diff --git a/css/addnew.css b/css/addnew.css index 52759e755..e2bcb48f5 100644 --- a/css/addnew.css +++ b/css/addnew.css @@ -16,11 +16,14 @@ } .add-new select { - width: 134px; + width: 133px; margin-top: 1px !important; + height: 30px; + background-color: #eee; } .add-new input { + margin-top: 15px; height: 16px !important; } diff --git a/js/app/controllers/feedcontroller.coffee b/js/app/controllers/feedcontroller.coffee index 580bd4763..1b6a79c53 100644 --- a/js/app/controllers/feedcontroller.coffee +++ b/js/app/controllers/feedcontroller.coffee @@ -41,7 +41,7 @@ angular.module('News').factory '_FeedController', -> @$scope.isShown = (type, id) => - return @isShown(type, id) + return true @$scope.getUnreadCount = => return @_transFormCount(@_feedBl.getUnreadCount()) @@ -53,7 +53,7 @@ angular.module('News').factory '_FeedController', -> return @_transFormCount(@_feedBl.getFeedUnreadCount(feedId)) @$scope.getUnreadCount = (folderId) => - return @_transFormCount(@_folderBl.getFolderUnreadCount(folderId)) + return @_transFormCount(@_feedBl.getFolderUnreadCount(folderId)) @$scope.isShowAll = => return @isShowAll() @@ -133,20 +133,20 @@ angular.module('News').factory '_FeedController', -> return type == @_active.getType() and id == @_active.getId() - isShown: (type, id) -> - hasUnread = @getUnreadCount(type, id) > 0 - if hasUnread - return true - else - if @isShowAll() - switch type - when @_feedType.Subscriptions - return @_feedModel.size() > 0 - when @_feedType.Folder - return @_folderModel.size() > 0 - when @_feedType.Feed - return @_feedModel.size() > 0 - return false + #isShown: (type, id) -> + # hasUnread = @getUnreadCount(type, id) > 0 + # if hasUnread + # return true + # else + # if @isShowAll() + # switch type + # when @_feedType.Subscriptions + # return @_feedModel.size() > 0 + # when @_feedType.Folder + # return @_folderModel.size() > 0 + # when @_feedType.Feed + # return @_feedModel.size() > 0 + # return false isShowAll: -> diff --git a/js/app/controllers/settingscontroller.coffee b/js/app/controllers/settingscontroller.coffee index 0383b13fe..ec94b843c 100644 --- a/js/app/controllers/settingscontroller.coffee +++ b/js/app/controllers/settingscontroller.coffee @@ -27,5 +27,9 @@ angular.module('News').factory '_SettingsController', -> constructor: (@$scope) -> + @$scope.import = (fileContent) => + console.log 'hi' + console.log fileContent + return SettingsController
\ No newline at end of file diff --git a/js/app/services/bl/feedbl.coffee b/js/app/services/bl/feedbl.coffee index 1c2e4af09..ffbc6e51c 100644 --- a/js/app/services/bl/feedbl.coffee +++ b/js/app/services/bl/feedbl.coffee @@ -28,7 +28,7 @@ angular.module('News').factory '_FeedBl', -> constructor: (@_feedModel, @_itemBl, @_persistence) -> - getUnreadCount: (feedId) -> + getFeedUnreadCount: (feedId) -> @_feedModel.getFeedUnreadCount(feedId) diff --git a/js/public/app.js b/js/public/app.js index 463bf8c4c..bcca24fb1 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -234,7 +234,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. this.$scope.folderBl = this._folderBl; this.$scope.feedBl = this._feedBl; this.$scope.isShown = function(type, id) { - return _this.isShown(type, id); + return true; }; this.$scope.getUnreadCount = function() { return _this._transFormCount(_this._feedBl.getUnreadCount()); @@ -246,7 +246,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return _this._transFormCount(_this._feedBl.getFeedUnreadCount(feedId)); }; this.$scope.getUnreadCount = function(folderId) { - return _this._transFormCount(_this._folderBl.getFolderUnreadCount(folderId)); + return _this._transFormCount(_this._feedBl.getFolderUnreadCount(folderId)); }; this.$scope.isShowAll = function() { return _this.isShowAll(); @@ -331,26 +331,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return type === this._active.getType() && id === this._active.getId(); }; - FeedController.prototype.isShown = function(type, id) { - var hasUnread; - hasUnread = this.getUnreadCount(type, id) > 0; - if (hasUnread) { - return true; - } else { - if (this.isShowAll()) { - switch (type) { - case this._feedType.Subscriptions: - return this._feedModel.size() > 0; - case this._feedType.Folder: - return this._folderModel.size() > 0; - case this._feedType.Feed: - return this._feedModel.size() > 0; - } - } - } - return false; - }; - FeedController.prototype.isShowAll = function() { return this._showAll.getShowAll(); }; @@ -484,7 +464,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. SettingsController = (function() { function SettingsController($scope) { + var _this = this; this.$scope = $scope; + this.$scope["import"] = function(fileContent) { + console.log('hi'); + return console.log(fileContent); + }; } return SettingsController; @@ -590,7 +575,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. this._persistence = _persistence; } - FeedBl.prototype.getUnreadCount = function(feedId) { + FeedBl.prototype.getFeedUnreadCount = function(feedId) { return this._feedModel.getFeedUnreadCount(feedId); }; diff --git a/templates/part.addnew.php b/templates/part.addnew.php index d49a0b61c..05117ea5a 100644 --- a/templates/part.addnew.php +++ b/templates/part.addnew.php @@ -12,7 +12,7 @@ <?php p($l->t('Add Website'))?> </a> - <div class="add-new-popup" > + <div class="add-new-popup"> <fieldset class="personalblock"> <p class="error"> <span ng-show="feedEmptyError"><?php p($l->t('Address must not be empty!')); ?></span> diff --git a/templates/part.feed.starred.php b/templates/part.feed.starred.php index 1d96d9fe8..4bd0a5fef 100644 --- a/templates/part.feed.starred.php +++ b/templates/part.feed.starred.php @@ -5,4 +5,9 @@ ng-click="loadFeed(feedType.Starred, 0)"> <?php p($l->t('Starred')) ?> </a> + <span class="utils"> + <span class="unread-counter"> + {{ getStarredCount() }} + </span> + </span> </li>
\ No newline at end of file diff --git a/templates/part.feed.unread.php b/templates/part.feed.unread.php index 32aa867e7..85f4c8766 100644 --- a/templates/part.feed.unread.php +++ b/templates/part.feed.unread.php @@ -17,10 +17,10 @@ </a> <span class="utils"> <span class="unread-counter"> - {{ getUnreadCount(feedType.Subscriptions, 0) }} + {{ getUnreadCount() }} </span> <button class="svg action mark-read-icon" - ng-click="markAllRead(feedType.Subscriptions, 0)" + ng-click="feedBl.markAllRead()" title="<?php p($l->t('Mark all read')) ?>"></button> </span> </li>
\ No newline at end of file diff --git a/templates/part.listfeed.php b/templates/part.listfeed.php index 2f136801c..4db9cd385 100644 --- a/templates/part.listfeed.php +++ b/templates/part.listfeed.php @@ -2,7 +2,7 @@ active: isFeedActive(feedType.Feed, feed.id), unread: feed.unreadCount!=0 }" - ng-repeat="feed in getFeedsOfFolder(<?php p($_['folderId']); ?>)" + ng-repeat="feed in feedBl.getFeedsOfFolder(<?php p($_['folderId']); ?>)" ng-show="isShown(feedType.Feed, feed.id)" data-id="{{feed.id}}" class="feed" @@ -15,17 +15,17 @@ </a> <span class="utils"> - <button ng-click="delete(feedType.Feed, feed.id)" + <button ng-click="feedBl.delete(feed.id)" class="svg action delete-icon" title="<?php p($l->t('Delete feed')); ?>"></button> <span class="unread-counter"> - {{ getUnreadCount(feedType.Feed, feed.id) }} + {{ getFeedUnreadCount(feed.id) }} </span> <button class="svg action mark-read-icon" - ng-show="getUnreadCount(feedType.Feed, feed.id)>0" - ng-click="markAllRead(feedType.Feed, feed.id)" + ng-show="feed.unreadCount > 0" + ng-click="feedBl.markFeedRead(feed.id)" title="<?php p($l->t('Mark all read')); ?>"></button> </span> diff --git a/templates/part.listfolder.php b/templates/part.listfolder.php index f237daa54..6d02aea7a 100644 --- a/templates/part.listfolder.php +++ b/templates/part.listfolder.php @@ -1,8 +1,8 @@ <li ng-class="{ active: isFeedActive(feedType.Folder, folder.id), open: folder.open, - collapsible: hasFeeds(folder.id), - unread: getUnreadCount(feedType.Folder, folder.id)!=0}" + collapsible: folderBl.hasFeeds(folder.id), + unread: getFolderUnreadCount(folder.id) != 0}" ng-repeat="folder in folders" ng-show="isShown(feedType.Folder, folder.id)" class="folder" @@ -10,7 +10,7 @@ droppable> <button class="collapse" title="<?php p($l->t('Collapse'));?>" - ng-click="toggleFolder(folder.id)"></button> + ng-click="folderBl.toggleFolder(folder.id)"></button> <a href="#" class="title folder-icon" ng-click="loadFeed(feedType.Folder, folder.id)"> @@ -19,7 +19,7 @@ <span class="utils"> - <button ng-click="delete(feedType.Folder, folder.id)" + <button ng-click="folderBl.delete(folder.id)" class="svg action delete-icon" title="<?php p($l->t('Delete folder')); ?>"></button> diff --git a/templates/part.settings.php b/templates/part.settings.php index 4fd963e8a..38c51933f 100644 --- a/templates/part.settings.php +++ b/templates/part.settings.php @@ -1,6 +1,7 @@ <fieldset class="personalblock"> <legend><strong><?php p($l->t('Import / Export OPML')); ?></strong></legend> - <input type="file" id="opml-upload" name="files[]" read-file/> + <input type="file" id="opml-upload" name="import" + oc-read-file="import($fileContent)"/> <button title="<?php p($l->t('Import')); ?>" oc-forward-click="{selector:'#opml-upload'}"> <?php p($l->t('Import')); ?> |