diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-13 23:56:41 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-13 23:56:41 +0200 |
commit | 33342f4ea6c217975a7c2998ba3d13d9becd8f24 (patch) | |
tree | e73cc421ca41148d6d5d8d6f54722e00bb8c0899 /js | |
parent | ce7cd121f42b093569d7a31fac3bcd5837429cff (diff) |
add code to get favicons, fix #49
Diffstat (limited to 'js')
-rw-r--r-- | js/app/services/bl/feedbl.coffee | 9 | ||||
-rw-r--r-- | js/public/app.js | 10 | ||||
-rw-r--r-- | js/tests/services/bl/feedblSpec.coffee | 6 |
3 files changed, 17 insertions, 8 deletions
diff --git a/js/app/services/bl/feedbl.coffee b/js/app/services/bl/feedbl.coffee index ead15fcd7..38aa5bff0 100644 --- a/js/app/services/bl/feedbl.coffee +++ b/js/app/services/bl/feedbl.coffee @@ -23,14 +23,14 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. angular.module('News').factory 'FeedBl', ['_Bl', 'ShowAll', 'Persistence', 'ActiveFeed', 'FeedType', 'ItemModel', -'FeedModel', 'NewLoading', '_ExistsError', +'FeedModel', 'NewLoading', '_ExistsError', 'Utils', (_Bl, ShowAll, Persistence, ActiveFeed, FeedType, ItemModel, FeedModel, -NewLoading, _ExistsError) -> +NewLoading, _ExistsError, Utils) -> class FeedBl extends _Bl constructor: (@_showAll, @_feedModel, persistence, activeFeed, feedType, - itemModel, @_newLoading) -> + itemModel, @_newLoading, @_utils) -> super(activeFeed, persistence, itemModel, feedType.Feed) @@ -147,6 +147,7 @@ NewLoading, _ExistsError) -> urlHash: urlHash folderId: parentId unreadCount: 0 + faviconLink: 'url('+@_utils.imagePath('core', 'loading.gif')+')' @_feedModel.add(feed) @@ -171,6 +172,6 @@ NewLoading, _ExistsError) -> return new FeedBl(ShowAll, FeedModel, Persistence, ActiveFeed, FeedType, - ItemModel, NewLoading) + ItemModel, NewLoading, Utils) ]
\ No newline at end of file diff --git a/js/public/app.js b/js/public/app.js index 04dfaaf79..826ed2891 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -625,16 +625,17 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module('News').factory('FeedBl', [ - '_Bl', 'ShowAll', 'Persistence', 'ActiveFeed', 'FeedType', 'ItemModel', 'FeedModel', 'NewLoading', '_ExistsError', function(_Bl, ShowAll, Persistence, ActiveFeed, FeedType, ItemModel, FeedModel, NewLoading, _ExistsError) { + '_Bl', 'ShowAll', 'Persistence', 'ActiveFeed', 'FeedType', 'ItemModel', 'FeedModel', 'NewLoading', '_ExistsError', 'Utils', function(_Bl, ShowAll, Persistence, ActiveFeed, FeedType, ItemModel, FeedModel, NewLoading, _ExistsError, Utils) { var FeedBl; FeedBl = (function(_super) { __extends(FeedBl, _super); - function FeedBl(_showAll, _feedModel, persistence, activeFeed, feedType, itemModel, _newLoading) { + function FeedBl(_showAll, _feedModel, persistence, activeFeed, feedType, itemModel, _newLoading, _utils) { this._showAll = _showAll; this._feedModel = _feedModel; this._newLoading = _newLoading; + this._utils = _utils; FeedBl.__super__.constructor.call(this, activeFeed, persistence, itemModel, feedType.Feed); } @@ -780,7 +781,8 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. url: url, urlHash: urlHash, folderId: parentId, - unreadCount: 0 + unreadCount: 0, + faviconLink: 'url(' + this._utils.imagePath('core', 'loading.gif') + ')' }; this._feedModel.add(feed); success = function(response) { @@ -817,7 +819,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return FeedBl; })(_Bl); - return new FeedBl(ShowAll, FeedModel, Persistence, ActiveFeed, FeedType, ItemModel, NewLoading); + return new FeedBl(ShowAll, FeedModel, Persistence, ActiveFeed, FeedType, ItemModel, NewLoading, Utils); } ]); diff --git a/js/tests/services/bl/feedblSpec.coffee b/js/tests/services/bl/feedblSpec.coffee index 0303dd4c1..6e83874b2 100644 --- a/js/tests/services/bl/feedblSpec.coffee +++ b/js/tests/services/bl/feedblSpec.coffee @@ -34,6 +34,12 @@ describe 'FeedBl', -> getItems: @getItemsSpy createFeed: -> } + angular.module('News').factory 'Utils', => + @imagePath = jasmine.createSpy('imagePath') + @utils = { + imagePath: @imagePath + } + beforeEach inject (@FeedBl, @FeedModel, @ItemModel, @FeedType, @ShowAll, @ActiveFeed, @_ExistsError) => |