mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-08-18 11:31:46 +02:00
.github
.tx
appinfo
bin
css
docs
img
js
admin
app
controller
directive
AppNavigationEntryUtils.js
ClickOutside.js
NewsAddFeed.js
NewsArticleActions.js
NewsAutoFocus.js
NewsBindUnsafeHtml.js
NewsDraggable.js
NewsDroppable.js
NewsFinishedTransition.js
NewsFocus.js
NewsInstantNotification.js
NewsOnActive.js
NewsPlayOne.js
NewsReadFile.js
NewsRefreshMasonry.js
NewsScroll.js
NewsSearch.js
NewsStickyMenu.js
NewsStopPropagation.js
NewsTimeout.js
NewsTitleUnreadCount.js
NewsToggleShow.js
NewsTriggerClick.js
filter
gui
plugin
service
tests
.jshintignore
.jshintrc
README.md
gulpfile.js
karma.conf.js
package-lock.json
package.json
protractor.conf.js
l10n
lib
screenshots
src
templates
tests
.editorconfig
.eslintrc.js
.gitignore
.gitmodules
.mailmap
AUTHORS.md
CHANGELOG.md
CONTRIBUTING.md
COPYING
Makefile
README.md
babel.config.js
composer.json
composer.lock
mkdocs.yml
package-lock.json
package.json
phpstan.neon.dist
phpunit.xml
stylelint.config.js
webpack.config.js
30 lines
815 B
JavaScript
30 lines
815 B
JavaScript
/**
|
|
* Nextcloud - News
|
|
*
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
* later. See the COPYING file.
|
|
*
|
|
* @author Bernhard Posselt <dev@bernhard-posselt.com>
|
|
* @copyright Bernhard Posselt 2014
|
|
*/
|
|
app.directive('newsReadFile', function () {
|
|
'use strict';
|
|
|
|
return function (scope, elem, attr) {
|
|
|
|
elem.change(function () {
|
|
|
|
var file = elem[0].files[0];
|
|
var reader = new FileReader();
|
|
|
|
reader.onload = function (event) {
|
|
// FIXME: is there a more flexible solution where we dont have
|
|
// to bind the file to scope?
|
|
scope.$fileContent = event.target.result;
|
|
scope.$apply(attr.newsReadFile);
|
|
};
|
|
|
|
reader.readAsText(file);
|
|
});
|
|
};
|
|
}); |