summaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Expand)Author
2023-01-01Add scrollbarJunegunn Choi
2022-12-31Add transform-prompt(...) actionJunegunn Choi
2022-12-30Always execute preview command if {q} is in the templateJunegunn Choi
2022-12-29Add reload-sync actionJunegunn Choi
2022-12-28Add transform-query(...) actionJunegunn Choi
2022-12-27Allow put action with an argument i.e. put(...)Junegunn Choi
2022-12-27Add pos(...) action to move the cursor to the numeric positionJunegunn Choi
2022-12-25Revert "Add GET endpoints for getting the state of the finder"Junegunn Choi
2022-12-25Add GET endpoints for getting the state of the finderJunegunn Choi
2022-12-21Add test case for --listenJunegunn Choi
2022-12-18Add change-query(...) actionJunegunn Choi
2022-12-11Add 'next-selected' and 'prev-selected' actionsJunegunn Choi
2022-11-18Fix panic on inverse match query with `--tiebreak=chunk`Junegunn Choi
2022-11-10Add --separator to customize the info separatorJunegunn Choi
2022-11-01Add tests for --border-label and --preview-labelJunegunn Choi
2022-10-27Add 'start' event that is triggered once when fzf finder startsJunegunn Choi
2022-10-16[shell] Make bash/zsh completion and bindings work with 'set -u' (#2999)John Fred Fadrigalan
2022-09-28Implement height range (--height ~[VALUE][%])Junegunn Choi
2022-08-03Fix incorrect ordering of `--tiebreak=chunk`Junegunn Choi
2022-08-02Add new tiebreak: 'chunk'Junegunn Choi
2022-07-21[shell] 'kill' completion will now require trigger sequence (**)Junegunn Choi
2022-04-04Add `rebind` action for restoring bindings after `unbind`Junegunn Choi
2022-03-29Make preview updated when reload and change-query are combinedJunegunn Choi
2022-03-29Add --ellipsis=.. optionJunegunn Choi
2021-12-05change-preview-window to take multiple option sets separated by '|'Junegunn Choi
2021-11-30Implement change-preview and change-preview-window actionsJunegunn Choi
2021-11-03Add --header-first option to display header before prompt lineJunegunn Choi
2021-11-02Implement --scroll-off=LINESJunegunn Choi
2021-10-23Reload should update preview windowJunegunn Choi
2021-09-14Reset {n} after reloadJunegunn Choi
2021-05-22Add 'unbind' actionJunegunn Choi
2021-03-12Add support for preview window headerJunegunn Choi
2021-03-07Fix GitHub Action buildJunegunn Choi
2021-03-07Add test cases for killing input command on terminate (#2381 #2382)yoshida.shinya
2021-02-28Don't exit fzf by SIGINT while executing command (#2375)bitterfox
2021-02-25Add select and deselect actionsJunegunn Choi
2021-02-02Add `close` actionJunegunn Choi
2021-02-01Fix toggle-preview-wrap actionJunegunn Choi
2021-01-13Migrate to GitHub ActionsJunegunn Choi
2021-01-03Make search toggleableJunegunn Choi
2020-12-30Update test case for 'first' and 'last'Junegunn Choi
2020-12-05Add --preview-window follow optionJunegunn Choi
2020-12-04Fix typo in test caseJunegunn Choi
2020-12-04Add change-prompt actionJunegunn Choi
2020-10-23Support ANSI escape sequence for clearing display in preview windowJunegunn Choi
2020-10-23Fix Travis CI buildJunegunn Choi
2020-10-23Fix test casesJunegunn Choi
2020-10-20Always show the number of selected entries to indicate if --multi is enabledJunegunn Choi
2020-08-02Ignore punctuation characters before and after preview offset columnJunegunn Choi
2020-07-28Smart match of accented charactersJunegunn Choi
.highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
###

ownCloud - News

@_author Bernhard Posselt
@copyright 2012 Bernhard Posselt nukeawhale@gmail.com

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU AFFERO GENERAL PUBLIC LICENSE for more details.

You should have received a copy of the GNU Affero General Public
License along with this library.  If not, see <http://www.gnu.org/licenses/>.

###


angular.module('News').controller 'ItemController',
['$scope', 'ItemBusinessLayer', 'FeedModel', 'FeedLoading', 'FeedBusinessLayer',
'Language',
($scope, ItemBusinessLayer, FeedModel, FeedLoading, FeedBusinessLayer,
Language) ->

	class ItemController

		constructor: (@_$scope, @_itemBusinessLayer, @_feedModel, @_feedLoading,
		              @_feedBusinessLayer, @_language) ->
			@_autoPaging = true

			@_$scope.itemBusinessLayer = @_itemBusinessLayer
			@_$scope.feedBusinessLayer = @_feedBusinessLayer


			@_$scope.isLoading = =>
				return @_feedLoading.isLoading()

			@_$scope.getFeedTitle = (feedId) =>
				feed = @_feedModel.getById(feedId)
				if angular.isDefined(feed)
					return feed.title
				else
					return ''

			# TODO: unittest
			@_$scope.getRelativeDate = (date) =>
				if date
					return @_language.getMomentFromTimestamp(date).fromNow()
				else
					return ''


			@_$scope.$on 'readItem', (scope, data) =>
				@_itemBusinessLayer.setRead(data)

			@_$scope.$on 'autoPage', =>
				if @_autoPaging
					# prevent multiple autopaging requests
					@_autoPaging = false
					@_itemBusinessLayer.loadNext =>
						@_autoPaging = true


	return new ItemController($scope, ItemBusinessLayer, FeedModel, FeedLoading,
	                          FeedBusinessLayer, Language)
]