From b036d309c27132e4f10df952e9335afdb3edfeb5 Mon Sep 17 00:00:00 2001 From: HK2FB Date: Sun, 15 May 2022 13:16:56 +0200 Subject: Vue Rewrite Signed-off-by: Sean Molenaar --- .editorconfig | 2 +- .eslintrc.js | 5 + .github/workflows/lint.yml | 52 + .gitignore | 4 +- .stylelintignore | 1 + Makefile | 9 +- babel.config.js | 6 + css/admin.css | 12 - css/admin.scss | 12 + css/app.css | 111 - css/app.scss | 111 + css/content.css | 753 - css/explore.scss | 7 - css/merged.scss | 9 + css/navigation.css | 265 - css/navigation.scss | 214 + js-old/.jshintignore | 2 + js-old/.jshintrc | 52 + js-old/admin/Admin.js | 109 + js-old/app/App.js | 18 + js-old/app/Config.js | 221 + js-old/app/Run.js | 133 + js-old/controller/AppController.js | 22 + js-old/controller/ContentController.js | 227 + js-old/controller/ExploreController.js | 57 + js-old/controller/NavigationController.js | 419 + js-old/controller/SettingsController.js | 86 + js-old/directive/AppNavigationEntryUtils.js | 37 + js-old/directive/NewsAddFeed.js | 32 + js-old/directive/NewsArticleActions.js | 28 + js-old/directive/NewsAutoFocus.js | 24 + js-old/directive/NewsBindUnsafeHtml.js | 18 + js-old/directive/NewsDraggable.js | 30 + js-old/directive/NewsDroppable.js | 34 + js-old/directive/NewsFinishedTransition.js | 20 + js-old/directive/NewsFocus.js | 22 + js-old/directive/NewsInstantNotification.js | 26 + js-old/directive/NewsOnActive.js | 23 + js-old/directive/NewsPlayOne.js | 30 + js-old/directive/NewsReadFile.js | 30 + js-old/directive/NewsRefreshMasonry.js | 29 + js-old/directive/NewsScroll.js | 111 + js-old/directive/NewsSearch.js | 48 + js-old/directive/NewsStickyMenu.js | 27 + js-old/directive/NewsStopPropagation.js | 20 + js-old/directive/NewsTimeout.js | 45 + js-old/directive/NewsTitleUnreadCount.js | 35 + js-old/directive/NewsToggleShow.js | 24 + js-old/directive/NewsTriggerClick.js | 19 + js-old/filter/TrustUrl.js | 16 + js-old/filter/UnreadCountFormatter.js | 19 + js-old/gui/ExternSubscription.js | 83 + js-old/gui/Fixes.js | 25 + js-old/gui/KeyboardShortcuts.js | 446 + js-old/karma.conf.js | 80 + js-old/plugin/ArticleActionPlugin.js | 18 + js-old/protractor.conf.js | 46 + js-old/service/FeedResource.js | 348 + js-old/service/FolderResource.js | 123 + js-old/service/ItemResource.js | 223 + js-old/service/Loading.js | 27 + js-old/service/OPMLImporter.js | 111 + js-old/service/OPMLParser.js | 90 + js-old/service/Publisher.js | 44 + js-old/service/Resource.js | 90 + js-old/service/SettingsResource.js | 85 + js-old/tests/e2e/main.js | 34 + js-old/tests/static/owncloud.org.rss | 639 + js-old/tests/unit/controller/AppControllerSpec.js | 56 + .../tests/unit/controller/ContentControllerSpec.js | 589 + .../tests/unit/controller/ExploreControllerSpec.js | 72 + .../unit/controller/NavigationControllerSpec.js | 1141 + .../unit/controller/SettingsControllerSpec.js | 169 + .../tests/unit/filter/UnreadCountFormatterSpec.js | 27 + js-old/tests/unit/service/FeedResourceSpec.js | 338 + js-old/tests/unit/service/FolderResourceSpec.js | 148 + js-old/tests/unit/service/ItemResourceSpec.js | 387 + js-old/tests/unit/service/LoadingSpec.js | 26 + js-old/tests/unit/service/OPMLImporterSpec.js | 31 + js-old/tests/unit/service/OPMLParserSpec.js | 87 + js-old/tests/unit/service/PublisherSpec.js | 54 + js-old/tests/unit/service/ResourceSpec.js | 140 + js-old/tests/unit/service/SettingsResourceSpec.js | 101 + js-old/tests/unit/stubs/App.js | 10 + js-old/tests/unit/stubs/OC.js | 16 + js/.gitkeep | 0 js/.jshintignore | 2 - js/.jshintrc | 52 - js/README.md | 29 - js/admin/Admin.js | 109 - js/app/App.js | 18 - js/app/Config.js | 221 - js/app/Run.js | 133 - js/controller/AppController.js | 22 - js/controller/ContentController.js | 227 - js/controller/ExploreController.js | 57 - js/controller/NavigationController.js | 419 - js/controller/SettingsController.js | 86 - js/controller/ShareController.js | 187 - js/directive/AppNavigationEntryUtils.js | 37 - js/directive/ClickOutside.js | 31 - js/directive/NewsAddFeed.js | 32 - js/directive/NewsArticleActions.js | 28 - js/directive/NewsAutoFocus.js | 24 - js/directive/NewsBindUnsafeHtml.js | 18 - js/directive/NewsDraggable.js | 30 - js/directive/NewsDroppable.js | 34 - js/directive/NewsFinishedTransition.js | 20 - js/directive/NewsFocus.js | 22 - js/directive/NewsInstantNotification.js | 26 - js/directive/NewsOnActive.js | 23 - js/directive/NewsPlayOne.js | 30 - js/directive/NewsReadFile.js | 30 - js/directive/NewsRefreshMasonry.js | 29 - js/directive/NewsScroll.js | 111 - js/directive/NewsSearch.js | 48 - js/directive/NewsStickyMenu.js | 27 - js/directive/NewsStopPropagation.js | 20 - js/directive/NewsTimeout.js | 45 - js/directive/NewsTitleUnreadCount.js | 35 - js/directive/NewsToggleShow.js | 24 - js/directive/NewsTriggerClick.js | 19 - js/filter/RelativeTimestamp.js | 58 - js/filter/TrustUrl.js | 16 - js/filter/UnreadCountFormatter.js | 19 - js/gui/ExternSubscription.js | 83 - js/gui/Fixes.js | 25 - js/gui/KeyboardShortcuts.js | 446 - js/gulpfile.js | 79 - js/karma.conf.js | 80 - js/package-lock.json | 6503 ----- js/package.json | 63 - js/plugin/ArticleActionPlugin.js | 18 - js/protractor.conf.js | 46 - js/service/FeedResource.js | 348 - js/service/FolderResource.js | 123 - js/service/ItemResource.js | 223 - js/service/Loading.js | 27 - js/service/OPMLImporter.js | 111 - js/service/OPMLParser.js | 90 - js/service/Publisher.js | 44 - js/service/Resource.js | 90 - js/service/SettingsResource.js | 85 - js/service/ShareResource.js | 37 - js/tests/e2e/main.js | 34 - js/tests/static/owncloud.org.rss | 639 - js/tests/unit/controller/AppControllerSpec.js | 56 - js/tests/unit/controller/ContentControllerSpec.js | 589 - js/tests/unit/controller/ExploreControllerSpec.js | 72 - .../unit/controller/NavigationControllerSpec.js | 1141 - js/tests/unit/controller/SettingsControllerSpec.js | 169 - js/tests/unit/filter/UnreadCountFormatterSpec.js | 27 - js/tests/unit/service/FeedResourceSpec.js | 338 - js/tests/unit/service/FolderResourceSpec.js | 148 - js/tests/unit/service/ItemResourceSpec.js | 387 - js/tests/unit/service/LoadingSpec.js | 26 - js/tests/unit/service/OPMLImporterSpec.js | 31 - js/tests/unit/service/OPMLParserSpec.js | 87 - js/tests/unit/service/PublisherSpec.js | 54 - js/tests/unit/service/ResourceSpec.js | 140 - js/tests/unit/service/SettingsResourceSpec.js | 101 - js/tests/unit/stubs/App.js | 10 - js/tests/unit/stubs/OC.js | 16 - package-lock.json | 23906 +++++++++++++++++++ package.json | 57 + src/App.vue | 26 + src/README.md | 31 + src/components/AddFeed.vue | 148 + src/components/Explore.vue | 78 + src/components/Sidebar.vue | 164 + src/main.js | 126 + stylelint.config.js | 3 + templates-old/admin.php | 132 + templates-old/index.php | 99 + templates-old/part.content.explore.php | 26 + templates-old/part.content.php | 243 + templates-old/part.content.shortcuts.php | 74 + templates-old/part.content.warnings.php | 25 + templates-old/part.navigation.addfeed.php | 121 + templates-old/part.navigation.addfolder.php | 39 + templates-old/part.navigation.explore.php | 5 + templates-old/part.navigation.feed.php | 179 + templates-old/part.navigation.folder.php | 142 + templates-old/part.navigation.starredfeed.php | 20 + templates-old/part.navigation.unreadfeed.php | 71 + templates-old/part.settings.php | 159 + templates/admin.php | 132 - templates/index.php | 107 +- templates/part.content.explore.php | 26 - templates/part.content.php | 243 - templates/part.content.shortcuts.php | 74 - templates/part.content.warnings.php | 25 - templates/part.navigation.addfeed.php | 121 - templates/part.navigation.addfolder.php | 39 - templates/part.navigation.explore.php | 5 - templates/part.navigation.feed.php | 179 - templates/part.navigation.folder.php | 142 - templates/part.navigation.starredfeed.php | 20 - templates/part.navigation.unreadfeed.php | 71 - templates/part.settings.php | 159 - webpack.js | 3 + 201 files changed, 34299 insertions(+), 17475 deletions(-) create mode 100644 .eslintrc.js create mode 100644 .github/workflows/lint.yml create mode 100644 .stylelintignore create mode 100644 babel.config.js delete mode 100644 css/admin.css create mode 100644 css/admin.scss delete mode 100644 css/app.css create mode 100644 css/app.scss delete mode 100644 css/content.css create mode 100644 css/merged.scss delete mode 100644 css/navigation.css create mode 100644 css/navigation.scss create mode 100644 js-old/.jshintignore create mode 100644 js-old/.jshintrc create mode 100644 js-old/admin/Admin.js create mode 100644 js-old/app/App.js create mode 100644 js-old/app/Config.js create mode 100644 js-old/app/Run.js create mode 100644 js-old/controller/AppController.js create mode 100644 js-old/controller/ContentController.js create mode 100644 js-old/controller/ExploreController.js create mode 100644 js-old/controller/NavigationController.js create mode 100644 js-old/controller/SettingsController.js create mode 100644 js-old/directive/AppNavigationEntryUtils.js create mode 100644 js-old/directive/NewsAddFeed.js create mode 100644 js-old/directive/NewsArticleActions.js create mode 100644 js-old/directive/NewsAutoFocus.js create mode 100644 js-old/directive/NewsBindUnsafeHtml.js create mode 100644 js-old/directive/NewsDraggable.js create mode 100644 js-old/directive/NewsDroppable.js create mode 100644 js-old/directive/NewsFinishedTransition.js create mode 100644 js-old/directive/NewsFocus.js create mode 100644 js-old/directive/NewsInstantNotification.js create mode 100644 js-old/directive/NewsOnActive.js create mode 100644 js-old/directive/NewsPlayOne.js create mode 100644 js-old/directive/NewsReadFile.js create mode 100644 js-old/directive/NewsRefreshMasonry.js create mode 100644 js-old/directive/NewsScroll.js create mode 100644 js-old/directive/NewsSearch.js create mode 100644 js-old/directive/NewsStickyMenu.js create mode 100644 js-old/directive/NewsStopPropagation.js create mode 100644 js-old/directive/NewsTimeout.js create mode 100644 js-old/directive/NewsTitleUnreadCount.js create mode 100644 js-old/directive/NewsToggleShow.js create mode 100644 js-old/directive/NewsTriggerClick.js create mode 100644 js-old/filter/TrustUrl.js create mode 100644 js-old/filter/UnreadCountFormatter.js create mode 100644 js-old/gui/ExternSubscription.js create mode 100644 js-old/gui/Fixes.js create mode 100644 js-old/gui/KeyboardShortcuts.js create mode 100644 js-old/karma.conf.js create mode 100644 js-old/plugin/ArticleActionPlugin.js create mode 100644 js-old/protractor.conf.js create mode 100644 js-old/service/FeedResource.js create mode 100644 js-old/service/FolderResource.js create mode 100644 js-old/service/ItemResource.js create mode 100644 js-old/service/Loading.js create mode 100644 js-old/service/OPMLImporter.js create mode 100644 js-old/service/OPMLParser.js create mode 100644 js-old/service/Publisher.js create mode 100644 js-old/service/Resource.js create mode 100644 js-old/service/SettingsResource.js create mode 100644 js-old/tests/e2e/main.js create mode 100644 js-old/tests/static/owncloud.org.rss create mode 100644 js-old/tests/unit/controller/AppControllerSpec.js create mode 100644 js-old/tests/unit/controller/ContentControllerSpec.js create mode 100644 js-old/tests/unit/controller/ExploreControllerSpec.js create mode 100644 js-old/tests/unit/controller/NavigationControllerSpec.js create mode 100644 js-old/tests/unit/controller/SettingsControllerSpec.js create mode 100644 js-old/tests/unit/filter/UnreadCountFormatterSpec.js create mode 100644 js-old/tests/unit/service/FeedResourceSpec.js create mode 100644 js-old/tests/unit/service/FolderResourceSpec.js create mode 100644 js-old/tests/unit/service/ItemResourceSpec.js create mode 100644 js-old/tests/unit/service/LoadingSpec.js create mode 100644 js-old/tests/unit/service/OPMLImporterSpec.js create mode 100644 js-old/tests/unit/service/OPMLParserSpec.js create mode 100644 js-old/tests/unit/service/PublisherSpec.js create mode 100644 js-old/tests/unit/service/ResourceSpec.js create mode 100644 js-old/tests/unit/service/SettingsResourceSpec.js create mode 100644 js-old/tests/unit/stubs/App.js create mode 100644 js-old/tests/unit/stubs/OC.js create mode 100644 js/.gitkeep delete mode 100644 js/.jshintignore delete mode 100644 js/.jshintrc delete mode 100644 js/README.md delete mode 100644 js/admin/Admin.js delete mode 100644 js/app/App.js delete mode 100644 js/app/Config.js delete mode 100644 js/app/Run.js delete mode 100644 js/controller/AppController.js delete mode 100644 js/controller/ContentController.js delete mode 100644 js/controller/ExploreController.js delete mode 100644 js/controller/NavigationController.js delete mode 100644 js/controller/SettingsController.js delete mode 100644 js/controller/ShareController.js delete mode 100644 js/directive/AppNavigationEntryUtils.js delete mode 100644 js/directive/ClickOutside.js delete mode 100644 js/directive/NewsAddFeed.js delete mode 100644 js/directive/NewsArticleActions.js delete mode 100644 js/directive/NewsAutoFocus.js delete mode 100644 js/directive/NewsBindUnsafeHtml.js delete mode 100644 js/directive/NewsDraggable.js delete mode 100644 js/directive/NewsDroppable.js delete mode 100644 js/directive/NewsFinishedTransition.js delete mode 100644 js/directive/NewsFocus.js delete mode 100644 js/directive/NewsInstantNotification.js delete mode 100644 js/directive/NewsOnActive.js delete mode 100644 js/directive/NewsPlayOne.js delete mode 100644 js/directive/NewsReadFile.js delete mode 100644 js/directive/NewsRefreshMasonry.js delete mode 100644 js/directive/NewsScroll.js delete mode 100644 js/directive/NewsSearch.js delete mode 100644 js/directive/NewsStickyMenu.js delete mode 100644 js/directive/NewsStopPropagation.js delete mode 100644 js/directive/NewsTimeout.js delete mode 100644 js/directive/NewsTitleUnreadCount.js delete mode 100644 js/directive/NewsToggleShow.js delete mode 100644 js/directive/NewsTriggerClick.js delete mode 100644 js/filter/RelativeTimestamp.js delete mode 100644 js/filter/TrustUrl.js delete mode 100644 js/filter/UnreadCountFormatter.js delete mode 100644 js/gui/ExternSubscription.js delete mode 100644 js/gui/Fixes.js delete mode 100644 js/gui/KeyboardShortcuts.js delete mode 100644 js/gulpfile.js delete mode 100644 js/karma.conf.js delete mode 100644 js/package-lock.json delete mode 100644 js/package.json delete mode 100644 js/plugin/ArticleActionPlugin.js delete mode 100644 js/protractor.conf.js delete mode 100644 js/service/FeedResource.js delete mode 100644 js/service/FolderResource.js delete mode 100644 js/service/ItemResource.js delete mode 100644 js/service/Loading.js delete mode 100644 js/service/OPMLImporter.js delete mode 100644 js/service/OPMLParser.js delete mode 100644 js/service/Publisher.js delete mode 100644 js/service/Resource.js delete mode 100644 js/service/SettingsResource.js delete mode 100644 js/service/ShareResource.js delete mode 100644 js/tests/e2e/main.js delete mode 100644 js/tests/static/owncloud.org.rss delete mode 100644 js/tests/unit/controller/AppControllerSpec.js delete mode 100644 js/tests/unit/controller/ContentControllerSpec.js delete mode 100644 js/tests/unit/controller/ExploreControllerSpec.js delete mode 100644 js/tests/unit/controller/NavigationControllerSpec.js delete mode 100644 js/tests/unit/controller/SettingsControllerSpec.js delete mode 100644 js/tests/unit/filter/UnreadCountFormatterSpec.js delete mode 100644 js/tests/unit/service/FeedResourceSpec.js delete mode 100644 js/tests/unit/service/FolderResourceSpec.js delete mode 100644 js/tests/unit/service/ItemResourceSpec.js delete mode 100644 js/tests/unit/service/LoadingSpec.js delete mode 100644 js/tests/unit/service/OPMLImporterSpec.js delete mode 100644 js/tests/unit/service/OPMLParserSpec.js delete mode 100644 js/tests/unit/service/PublisherSpec.js delete mode 100644 js/tests/unit/service/ResourceSpec.js delete mode 100644 js/tests/unit/service/SettingsResourceSpec.js delete mode 100644 js/tests/unit/stubs/App.js delete mode 100644 js/tests/unit/stubs/OC.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/App.vue create mode 100644 src/README.md create mode 100644 src/components/AddFeed.vue create mode 100644 src/components/Explore.vue create mode 100644 src/components/Sidebar.vue create mode 100644 src/main.js create mode 100644 stylelint.config.js create mode 100644 templates-old/admin.php create mode 100644 templates-old/index.php create mode 100644 templates-old/part.content.explore.php create mode 100644 templates-old/part.content.php create mode 100644 templates-old/part.content.shortcuts.php create mode 100644 templates-old/part.content.warnings.php create mode 100644 templates-old/part.navigation.addfeed.php create mode 100644 templates-old/part.navigation.addfolder.php create mode 100644 templates-old/part.navigation.explore.php create mode 100644 templates-old/part.navigation.feed.php create mode 100644 templates-old/part.navigation.folder.php create mode 100644 templates-old/part.navigation.starredfeed.php create mode 100644 templates-old/part.navigation.unreadfeed.php create mode 100644 templates-old/part.settings.php delete mode 100644 templates/admin.php delete mode 100644 templates/part.content.explore.php delete mode 100644 templates/part.content.php delete mode 100644 templates/part.content.shortcuts.php delete mode 100644 templates/part.content.warnings.php delete mode 100644 templates/part.navigation.addfeed.php delete mode 100644 templates/part.navigation.addfolder.php delete mode 100644 templates/part.navigation.explore.php delete mode 100644 templates/part.navigation.feed.php delete mode 100644 templates/part.navigation.folder.php delete mode 100644 templates/part.navigation.starredfeed.php delete mode 100644 templates/part.navigation.unreadfeed.php delete mode 100644 templates/part.settings.php create mode 100644 webpack.js diff --git a/.editorconfig b/.editorconfig index 05116e70f..df73b20ac 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,7 @@ trim_trailing_whitespace = true end_of_line = lf insert_final_newline = true -[*.{js,php,html}] +[*.{js,php,html,vue}] indent_style = space indent_size = 4 charset = utf-8 diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..35cc6888f --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + extends: [ + '@nextcloud', + ] +} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..8497d5e34 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,52 @@ +name: Lint + +on: + pull_request: + push: + branches: + - master + +jobs: + eslint: + runs-on: ubuntu-latest + + strategy: + matrix: + node-versions: [12.x] + + name: eslint node${{ matrix.node-versions }} + steps: + - uses: actions/checkout@v2 + + - name: Set up node ${{ matrix.node-versions }} + uses: actions/setup-node@v1 + with: + node-versions: ${{ matrix.node-versions }} + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + stylelint: + runs-on: ubuntu-latest + + strategy: + matrix: + node-versions: [12.x] + + name: stylelint node${{ matrix.node-versions }} + steps: + - uses: actions/checkout@v2 + + - name: Set up node ${{ matrix.node-versions }} + uses: actions/setup-node@v1 + with: + node-versions: ${{ matrix.node-versions }} + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run stylelint \ No newline at end of file diff --git a/.gitignore b/.gitignore index 44cf6f335..e9fd95dbb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,11 +2,9 @@ composer.phar node_modules/ vendor/ -js/build *.log /build/ -/js/coverage/ -js/*.xml +js/ .rvm *.clover .phpunit.result.cache diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 000000000..a725465ae --- /dev/null +++ b/.stylelintignore @@ -0,0 +1 @@ +vendor/ \ No newline at end of file diff --git a/Makefile b/Makefile index 3322b3b51..5a2e03f1a 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ endif .PHONY: npm npm: ifneq (, $(npm)) - cd js && $(npm) run build + $(npm) run build else @echo "npm command not available, please install nodejs first" @exit 1 @@ -200,12 +200,7 @@ php-test-dependencies: .PHONY: unit-test unit-test: - @if [ "$(CODECOVERAGE)" = "true" ]; then \ - ./vendor/phpunit/phpunit/phpunit -c phpunit.xml --coverage-clover build/php-unit.clover; \ - else \ - ./vendor/phpunit/phpunit/phpunit -c phpunit.xml --no-coverage; \ - fi - + ./vendor/phpunit/phpunit/phpunit -c phpunit.xml --coverage-clover build/php-unit.clover # Command for running JS and PHP tests. Works for package.json files in the js/ # and root directory. If phpunit is not installed systemwide, a copy is fetched diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 000000000..a179fa443 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: [ + '@babel/plugin-syntax-dynamic-import', + ], + presets: ['@babel/preset-env'], +} diff --git a/css/admin.css b/css/admin.css deleted file mode 100644 index fe8f2e9dd..000000000 --- a/css/admin.css +++ /dev/null @@ -1,12 +0,0 @@ -#news-saved-message { - margin: 15px 0; - display: none; -} - -#news .form-line { - margin: 25px 0 15px 0; -} - -#news .notice { - color: var(--color-error); -} diff --git a/css/admin.scss b/css/admin.scss new file mode 100644 index 000000000..fe8f2e9dd --- /dev/null +++ b/css/admin.scss @@ -0,0 +1,12 @@ +#news-saved-message { + margin: 15px 0; + display: none; +} + +#news .form-line { + margin: 25px 0 15px 0; +} + +#news .notice { + color: var(--color-error); +} diff --git a/css/app.css b/css/app.css deleted file mode 100644 index 6e0124139..000000000 --- a/css/app.css +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Nextcloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Bernhard Posselt - * @copyright Bernhard Posselt 2014 - */ -#global-loading { - width: 100%; -} - -#undo-container { - position: fixed; - top: 0px; - width: 100%; - text-align: center; - z-index: 101; - line-height: 1.2; -} - -#undo { - z-index: 101; - background-color: var(--color-warning); - border: 0; - padding: 0 .7em .3em; - display: none; - position: relative; - top: 0; - border-bottom-left-radius: 1em; - border-bottom-right-radius: 1em; -} - -#undo a { - font-weight: bold; -} - -#undo a:hover { - text-decoration: underline; -} - -#searchbox { - display: block !important; -} - -#mark-all-read-button { - position: fixed; - z-index: 1; - bottom: 0.5em; - right: 0.5em; -} - -.dropdown-content { - position: absolute; - background-color: #f1f1f1; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); - z-index: 999; - min-width: 20em; - left: 100px; -} - -.compact .dropdown-content { - left: auto; - right: 15px; -} - - -.dropdown-content a { - color: black; - padding: 2px 12px 2px 44px; - background-position: 14px center; - text-decoration: none; - display: block; -} - -.dropdown-content a:hover { - background-color: #ddd; -} - -.compact-dropdown{ - z-index: 1; -} - -/* Override hidden before angular is loaded */ -[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) { - display: none !important; -} - -.contact-input { - display: flex; - justify-content: space-between; - margin: 1em 1.5em; -} - -.label-group { - padding-left: 1.5em; - background-color: rgba(0, 0, 0, 0.1); - font-weight: bold; -} - -.dropdown-search-message { - margin-left: 2em; - font-size: 0.85em; -} - -.share-status-icon { - margin-top: 1.1em; - margin-right: 1em; - float: right; -} diff --git a/css/app.scss b/css/app.scss new file mode 100644 index 000000000..6e0124139 --- /dev/null +++ b/css/app.scss @@ -0,0 +1,111 @@ +/** + * Nextcloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt + * @copyright Bernhard Posselt 2014 + */ +#global-loading { + width: 100%; +} + +#undo-container { + position: fixed; + top: 0px; + width: 100%; + text-align: center; + z-index: 101; + line-height: 1.2; +} + +#undo { + z-index: 101; + background-color: var(--color-warning); + border: 0; + padding: 0 .7em .3em; + display: none; + position: relative; + top: 0; + border-bottom-left-radius: 1em; + border-bottom-right-radius: 1em; +} + +#undo a { + font-weight: bold; +} + +#undo a:hover { + text-decoration: underline; +} + +#searchbox { + display: block !important; +} + +#mark-all-read-button { + position: fixed; + z-index: 1; + bottom: 0.5em; + right: 0.5em; +} + +.dropdown-content { + position: absolute; + background-color: #f1f1f1; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 999; + min-width: 20em; + left: 100px; +} + +.compact .dropdown-content { + left: auto; + right: 15px; +} + + +.dropdown-content a { + color: black; + padding: 2px 12px 2px 44px; + background-position: 14px center; + text-decoration: none; + display: block; +} + +.dropdown-content a:hover { + background-color: #ddd; +} + +.compact-dropdown{ + z-index: 1; +} + +/* Override hidden before angular is loaded */ +[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) { + display: none !important; +} + +.contact-input { + display: flex; + justify-content: space-between; + margin: 1em 1.5em; +} + +.label-group { + padding-left: 1.5em; + background-color: rgba(0, 0, 0, 0.1); + font-weight: bold; +} + +.dropdown-search-message { + margin-left: 2em; + font-size: 0.85em; +} + +.share-status-icon { + margin-top: 1.1em; + margin-right: 1em; + float: right; +} diff --git a/css/content.css b/css/content.css deleted file mode 100644 index f2dff8ee2..000000000 --- a/css/content.css +++ /dev/null @@ -1,753 +0,0 @@ -/** - * Nextcloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Bernhard Posselt - * @copyright Bernhard Posselt 2014 - */ - -#app-content { - width: 100%; - flex-basis: auto; -} - -#app-navigation:not(.hidden) + #app-content { - width: calc(100% - 300px); -} - -#app-content #searchresults { - display: none; -} - -#app-content #text-content { - padding: 20px; -} - -#app-content #text-content h1 { - font-size: 18pt; - margin-bottom: 15px; -} - -#app-content #text-content p { - font-size: 11pt; -} - -#app-content .no-feeds-available { - text-align: center; - color: var(--color-text-lighter); - font-size: 16pt; - min-height: 100%; - height: 100%; - width: 100%; - display: table; -} - -#app-content .no-feeds-available p { - vertical-align: middle; - display: table-cell; -} - -#articles { - width: 100%; -} - -/** - * Podcast settings - */ -#app-content .podcast { - height: 50px; - z-index: 10000; - background-color: #111; - display: flex; - position: sticky; - top: 50px; - align-items: center; -} - -#app-content .podcast audio { - display: block; - width: calc(100% - 60px); - border-radius: 0; - height: inherit; -} - -#app-content .podcast button, -#app-content .podcast a { - display: block; - float: left; - height: 30px; - width: 30px; - border: 0; - border-radius: 0; - margin: 0; - background-color: transparent; - background-repeat: no-repeat; - background-position: center; -} - -#app-content .podcast-close { - background-size: 25px; - background-image: url('../img/close.svg'); -} - -#app-content .podcast-download { - transform: rotate(270deg); - background-size: 20px; - background-image: url('../img/arrow-white.svg'); -} - -#app-content .podcast audio::-webkit-media-controls-enclosure { - max-width: inherit; -} - -#app-content .podcast.fixed { - position: absolute; - right: 0; - left: 0; -} - -#notification a { - text-decoration: underline; - color: blue; -} - -#notification li { - display: block; -} - -/** - * Content styles - */ -#app-content.loading-content { - background: url('../img/loading.gif') no-repeat; - background-color: var(--color-main-background); - background-position: calc(50% - 16px) calc(50% - 16px); - /* Overrides the snap.js animation making the loading icon to fly in app-content. */ - transition: none !important; - -webkit-transition: none !important; - -moz-webkit-transition: none !important; -} - -#app-content.loading-content #app-content-wrapper { - display: none; -} - -#app-content:not(.explore) #articles:after { - content: ''; - display: block; - height: 100%; - background-repeat: no-repeat; -} - -#app-content .autopaging: #articles:after { - content: ''; - background-image: url('../img/loading.gif'); - background-position: calc(50% - 16px) calc(50% - 16px); - /* Overrides the snap.js animation making the loading icon to fly in app-content. */ - transition: none !important; - -webkit-transition: none !important; - -moz-webkit-transition: none !important; -} - -#app-content .finished-auto-paging #articles:after { - background: var(--color-main-background); -} - -/** - * - */ -.pull-to-refresh { - height: 0; - overflow: hidden; - text-align: center; - background-image: -moz-linear-gradient(top, #eee 0%, #fefefe 100%); - background-image: -webkit-linear-gradient(top, #eee 0%, #fefefe 100%); - background-image: -ms-linear-gradient(top, #eee 0%, #fefefe 100%); - background-image: linear-gradient(top, #eee 0%, #fefefe 100%); -} - -.pull-to-refresh.show-pull-to-refresh { - transition: all 0.5s ease; - padding-top: 10px; - height: 44px; -} - - -/** - * Rules for a single feed item - */ -#app-content .only-in-expanded { - display: block; -} - -#app-content .compact .only-in-expanded { - display: none; -} - -#app-content .only-in-compact { - display: none; -} - -#app-content .compact .only-in-compact { - display: block; -} - -#app-content .item { - cursor: default; - border-bottom: 1px solid var(--color-border); -} - -#app-content .item.active { - background-image: linear-gradient(to right, orange 0, orange 2px, transparent 2px); -} - -#app-content .compact li.item div.utils:hover { - background-color: var(--color-background-hover); -} - -#app-content :not(.compact) .item { -} - -#app-content .item:last-child { - border-bottom: 0; -} - -/** - * Utils panel - */ -#app-content .utils { - width: 100%; - line-height: 52px; - box-sizing: border-box; - padding: 15px 50px 0 15px; - position: relative; -} - -#app-content .compact .utils { - cursor: pointer; - padding: 0 15px 0 0; - -webkit-position: sticky; - position: sticky; - top: 50px; - background-color: var(--color-main-background); - min-height: 43px; -} - -/* Only apply opacity to the util bar, not the dropdown */ -#app-content .compact .utils ul { - opacity: 0.9; -} - -#app-content .utils ul { - height: 43px; - list-style-type: none; - display: flex; - margin: 0; - padding: 0; -} - -#app-content .compact .util-spacer, -#app-content .compact .util, -#app-content .compact .only-in-compact { - flex: 1 0 auto; -} -#app-content .compact .title { - flex: 1 1 auto; -} -#app-content .open .utils ul { - height: auto; -} - -#app-content .utils ul > li { - min-width: 0; -} - -#app-content .util-spacer { - width: 25px; -} - -#app-content .compact .util-spacer { - width: 5px; -} -@media screen and (max-width: 1024px) { - #app-content .compact .util-spacer { - width: 0; - flex: 0 0 auto; - } - #app-content .item:first-of-type .util-spacer { - width: 28px; - } -} - -#app-content .utils li { - line-height: 43px; - vertical-align: middle; -} - -#app-content .utils > ul > li:last-child { - padding-right: 0; -} - -#app-content .utils > ul > li:first-child { - padding-left: 0; -} - -#app-content .utils .util { - padding: 0; -} - -#app-content .utils .article-action-plugins { - -} - -#app-content .utils button, -#app-content .utils .external { - padding: 0; - margin: 0; - height: 43px; - width: 40px; - border: 0; - float: left; - background-color: transparent; - background-size: 100%; - background-repeat: no-repeat; - background-size: 25px; - background-position: center; -} - -#app-content .utils .external, -#app-content .utils .menu button, -#app-content .utils .icon-toggle { - display: inline-block; - opacity: 0.3; -} - -#app-content .utils .external:hover, -#app-content .utils .menu button:hover, -#app-content .utils .icon-toggle:hover, -#app-content .utils .icon-toggle.keep-unread { - opacity: 1; -} - -#app-content .utils .star { - background-image: url('../img/inactive_star.svg'); -} - -#app-content .utils .starred { - background-image: url('../img/active_star.svg'); -} - -#app-content .utils .star:hover { - background-image: url('../img/hover_star.svg'); -} - -#app-content .utils .share { - opacity: .3; -} - -#app-content .utils .share:hover { - opacity: 1; -} - -#app-content .utils .more button { - opacity: .3; -} - -#app-content .utils .more button:hover { - opacity: 1; -} - -#app-content .utils .more { - position: relative; -} - -#app-content .article-actions { - display: none; - filter: drop-shadow(0 0 5px rgba(150, 150, 150, 0.75)); - -webkit-filter: drop-shadow(0 0 5px rgba(150, 150, 150, 0.75)); - -moz-filter: drop-shadow(0 0 5px rgba(150, 150, 150, 0.75)); - position: absolute; - top: 40px; - border-radius: 3px; - z-index: 1000; - border: 1px solid transparent; - margin: 0; - padding: 0; -} - -#app-content .article-actions ul { - display: flex; - float: left; -} - -#app-content .article-actions li { - float: left; - width: 40px !important; -} - -#app-content #articles:not(.compact) .article-actions { - left: 6px; -} - -#app-content #articles:not(.compact) .article-actions:after, -#app-content #articles:not(.compact) .article-actions:before { - left: 20px; -} - -#app-content #articles.compact .article-actions { - right: -10px; -} - -#app-content #articles.compact .article-actions:after, -#app-content #articles.compact .article-actions:before { - right: 9px; -} - -#app-content .article-actions:after, -#app-content .article-actions:before { - bottom: 100%; - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; - pointer-events: none; -} - -#app-content .article-actions:after { - border-color: rgba(255, 255, 255, 0); - border-bottom-color: var(--color-border); - border-width: 5px; - margin-left: -5px; -} - -#app-content .article-actions:before { - border-color: rgba(255, 255, 255, 0); - border-bottom-color: var(--color-border); - border-width: 9px; - margin-left: -9px; -} - -/** - * Article title - */ -#app-content .utils .title { - width: 100%; - padding-left: 35px; - background-position: 6px 10px; - background-size: 20px 20px; - background-repeat: no-repeat; -} - -#app-content .compact .utils .title h1 { - line-height: 1; -} - -#app-content .feed-view .utils .title { - background: none !important; - padding-left: 10px; -} - -#app-content .utils .title h1 a { - /*text-overflow: ellipsis;*/ - white-space: nowrap; - overflow: hidden; - width: 100%; - display: inline-block; - color: var(--color-main-text); - font-weight: bold; - font-size: 16px; - line-height: 1.5; - padding-top: 8px; - min-height: 40px; -} - -#app-content .open .title .intro { - display: none; -} - -#app-content .title .intro { - color: var(--color-text-lighter); - font-size: 10pt; - font-weight: normal; - margin-left: 20px; -} - -#app-content .open .utils .title h1 a { - overflow: auto; - white-space: normal; -} - -#app-content .read .utils .title h1 a { - font-weight: normal; - color: var(--color-text-lighter); -} - -#app-content .utils .date { - padding: 0 15px; -} - - -/** - * Expanded content - */ -#app-content .heading { - padding: 25px 0 10px 0; -} - -#app-content .heading h1 { - font-size: 19px; - max-width: 770px; - word-wrap: break-word; -} - -#app-content .heading a { - font-weight: bold; - color: var(--color-main-text); - text-decoration: none; - margin:0; -} - -#app-content .heading a:hover { - text-decoration: underline; -} - -#app-content .heading .date { - float: right; - display: inline-block; - font-size: 15px; - padding: 0 10px; -} - -#app-content .read .heading a { - font-weight: normal !important; - color: var(--color-text-lighter); -} - -#app-content .feed-view .source { - display: none; -} - -#app-content .source img { - height: 16px; - display: inline-block; - margin: 0 0 -2px 2px; -} - -/** - * Actual content - */ -#app-content .article { - min-height: 69px; - padding: 0 50px 50px 50px; -} - -#app-content .compact .article { - display: none; -} - -#app-content .open .article { - display: block; -} - -/** - * Timestamp - */ -#app-content .subtitle { - color: var(--color-text-lighter); - font-size: 15px; - max-width: 770px; - padding: 25px 0; -} - -#app-content .subtitle a { - color: var(--color-text-lighter); -} - -#app-content .subtitle a:hover { - text-decoration: underline; -} - -#app-content .date { - color: var(--color-text-lighter); - white-space: nowrap; -} - -/** - * Author - */ -#app-content .author { - color: var(--color-text-lighter); - font-size: 15px; -} - -#app-content .author a { - color: inherit; -} - -#app-content .author a:hover { - text-decoration: underline; -} - -/** - * Enclosure - */ -#app-content .enclosure { - padding: 20px 0; - max-width: 770px; - margin-bottom: 15px; -} - -#app-content .enclosure audio, -#app-content .enclosure video { - width: 100%; -} - -#app-content .enclosure video { - background-color: #000; - margin-bottom: 20px; -} - -#app-content .enclosure-error { - line-height: 1.5; - height: 40px; -} - -/** - * Article body - */ -#app-content .body { - max-width: 770px; - font-size: 14px; - clear: both; - overflow-x: auto; -} - -#app-content .body p { - line-height: 1.5; - margin: 7px 0 14px 0; -} - -#app-content .body img, -#app-content .body table { - max-width: 100%; - height: auto; - overflow: auto; - word-wrap: break-word; - white-space: normal; -} - -#app-content .body table { - border-collapse: collapse; -} - -#app-content .body table th { - font-weight: bold; -} - -#app-content .body table th, -#app-content .body table td { - border: 1px solid var(--color-text-lighter); - padding: 2px 6px; -} - -#app-content .body iframe { - max-width: 100%; -} - -#app-content .body > div > img:first-child, -#app-content .body > div > :first-child > img:first-child { - padding: 0 14px 0 0; - float: left; -} - -#app-content .body h1, -#app-content .body h2 { - font-size: 17px; - font-weight: bold; - color: var(--color-main-text); - margin: 21px 0 5px 0; -} - -#app-content .body h3 { - font-size: 15px; - font-weight: bold; - color: var(--color-main-text); - margin: 21px 0 0 0; - text-decoration: underline; -} - -#app-content .body h4, -#app-content .body h5, -#app-content .body h6 { - font-weight: bold; -} - -#app-content .body > div { - margin: 7px 0; -} - -#app-content .body a { - color: #0c76ff; - text-decoration: underline; -} - -#app-content .body ul { - margin: 7px 0; - padding-left: 14px; - list-style-type: disc; -} - -#app-content .body ol { - margin: 7px 0; - padding-left: 21px; -} - -#app-content .body ul li { - cursor: default; - line-height: 21px; -} - -#app-content .body pre { - padding: 7px 7px 7px 14px; - background-color: var(--color-background-darker); - border: 1px solid var(--color-border-dark); - margin: 7px 0 14px 0; - overflow-y: auto; -} - -#app-content .body pre::-webkit-scrollbar { - height: 10px; -} - -#app-content .body pre::-webkit-scrollbar-thumb { - background: #333; -} - -#app-content .body pre::-webkit-scrollbar-track-piece { - background: #ddd; -} - -#app-content .body code, -#app-content .body pre { - font-family: monospace; - font-size: 16px; -} - -#app-content .body blockquote { - border-left: 1px solid rgb(210, 210, 210); - margin: 25px 0; - padding: 0 0 0 15px; - font-style: italic; -} - -#app-content .body em { - font-style: italic; - opacity: 1; -} - -#app-content *[dir=rtl] { - text-align: right; -} diff --git a/css/explore.scss b/css/explore.scss index d459ae825..dabd17239 100644 --- a/css/explore.scss +++ b/css/explore.scss @@ -53,12 +53,5 @@ } } - .explore-subscribe { - margin-top: 16px; - max-width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } } } diff --git a/css/merged.scss b/css/merged.scss new file mode 100644 index 000000000..0720831e3 --- /dev/null +++ b/css/merged.scss @@ -0,0 +1,9 @@ +@import 'explore'; +@import 'admin'; +@import 'app'; +@import 'content'; +@import 'custom'; +@import 'mobile'; +@import 'navigation'; +@import 'settings'; +@import 'shortcuts'; diff --git a/css/navigation.css b/css/navigation.css deleted file mode 100644 index dda57038a..000000000 --- a/css/navigation.css +++ /dev/null @@ -1,265 +0,0 @@ -/** - * Nextcloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Bernhard Posselt - * @copyright Bernhard Posselt 2014 - */ - -/* add new feed or folder */ -/* button */ -#app-navigation .add-new .heading { - height: 44px; - width: 100%; -} - -#app-navigation .add-new .heading:hover { - background-color: var(--color-background-darker); -} - -#app-navigation .add-new .heading button { - padding: 0 0 0 44px; - line-height: 44px; - width: 100%; - border: 0; - margin: 0; - text-align: left; - font-weight: normal; - background-color: transparent; - background-position: 14px center; -} - - -/* actual form content */ -#app-navigation .add-new-popup { - display: none; - padding: 10px; - width: 100%; - border-top: 1px solid var(--color-border-dark); - border-bottom: 1px solid var(--color-border-dark); -} - - -#app-navigation input.ng-invalid { - border: 1px solid var(--color-error); -} - -#app-navigation .add-new-popup input, -#app-navigation .add-new-popup select { - width: 100%; - height: 36px; - padding: 5px; - margin-right: 0; -} - -#app-navigation .add-new-popup select, -#app-navigation #new-feed [name="folderName"] { - width: calc(100% - 36px); - border-right: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - float: left; -} - -#app-navigation .add-new-popup .add-new-folder-primary { - border-bottom-left-radius: 0; - border-top-left-radius: 0; - width: 36px; - height: 36px; - margin-left: 0; - margin-right: 0; -} - -#app-navigation .add-new-popup .add-new-basicauth-toggle { - padding: 5px 0; -} - -#app-navigation .add-new-popup .add-feed-basicauth { - width: 100%; - padding: 0 0 10px; -} - -#app-navigation .add-new-popup .error { - padding: 0 0 10px 0; -} - -/* navigation */ -#app-navigation ul.with-icon > li > a, -#app-navigation ul.with-icon > li > ul > li > a { - padding-left: 44px; -} - -#app-navigation .icon-starred { - background-image: url('../img/starred.png'); -} - -.icon-rss { - background-image: url('../img/rss.svg') !important; -} - -.icon-rss-unread { - background-image: url('../img/rss_unread.svg') !important; -} - -.icon-add-folder { - background-image: url('../img/add_folder.svg') !important; -} - -.icon-facebook { - background-image: url('../img/facebook.svg') !important; -} - -.icon-twitter { - background-image: url('../img/twitter.svg') !important; -} - - -.col-4 { - -ms-flex: 0 0 33.333333%; - flex: 0 0 33.333333%; - max-width: 33.333333%; - position: relative; - width: 100%; -} - -.row { - display: -ms-flexbox; - display: flex; - -ms-flex-wrap: wrap; - flex-wrap: wrap; -} - -.icon-dropdown{ - background-position: center !important; - background-size: 24px; - padding: 2em !important; - min-height: 28px !important; - min-width: 28px !important; -} - -.icon-full-text-enabled { - background-image: url('../img/fulltext.svg'); - background-size: 50%; - opacity: .5; -} - - -.icon-full-text-disabled { - background-image: url('../img/nonfulltext.svg'); - background-size: 50%; - opacity: .5; -} - -#app-navigation .unread > a { - font-weight: bold; -} - -#app-navigation p.error { - line-height: 25px; -} - -#app-navigation .folder-rename-error { - height: auto; -} - -/** - * Error message - */ -#app-navigation .error-message { - padding: 15px; - background-color: var(--color-main-background); - color: var(--color-error); - position: relative; - overflow-y: auto; -} - -#app-navigation .ui-state-disabled { - opacity: 1; -} - -#app-navigation .error-message .title { - font-weight: bold; - padding-right: 30px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -#app-navigation .error-message:hover .title -#app-navigation .error-message:hover .message { - -} - -#app-navigation .error-message button { - top: 0; - right: 0; - position: absolute; - margin: 0; - height: 44px; - width: 44px; - padding: 15px; - border: 0; - background-size: 25px; - background-color: transparent; - background-image: url('../img/close.svg'); - background-repeat: no-repeat; - background-position: right 5px top 5px; - opacity: .9; -} - -#app-navigation .error-message button:hover { - opacity: 1; -} - -#app-navigation .animate-show.ng-hide-add, -#app-navigation .animate-show.ng-hide-remove { - /* this is required as of 1.3x to properly - apply all styling in a show/hide animation */ - transition: 0s linear opacity; -} - -#app-navigation .animate-show.ng-hide-add-active, -#app-navigation .animate-show.ng-hide-remove-active { - transition: .2s linear opacity; -} - -#app-navigation .animate-show { - opacity: 1; -} - -#app-navigation .animate-show.ng-hide { - opacity: 0; -} - -#app-navigation .feed-no-ordering { - transform: rotate(270deg); -} - -#app-navigation .feed-reverse-ordering { - transform: rotate(180deg); -} - -#app-navigation .feed-normal-ordering { -} - -#app-navigation .icon-pinned { - background-image: url('../img/pinned.svg'); -} - -#app-navigation .icon-unpinned { - background-image: url('../img/unpinned.svg'); -} - -#app-navigation .icon-updatemode-default { - background-image: url('../img/updatemodedefault.svg'); -} - -#app-navigation .icon-updatemode-unread { - background-image: url('../img/updatemodeunread.svg'); -} - -#app-navigation .updateerror a { - background-color: var(--color-warning) !important; -} diff --git a/css/navigation.scss b/css/navigation.scss new file mode 100644 index 000000000..c9387913f --- /dev/null +++ b/css/navigation.scss @@ -0,0 +1,214 @@ + +/** + * Nextcloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt + * @copyright Bernhard Posselt 2014 + */ + +/* add new feed or folder */ +/* button */ +#app-navigation .add-new .heading { + height: 44px; + width: 100%; +} + +#app-navigation .add-new .heading:hover { + background-color: var(--color-background-darker); +} + +#app-navigation .add-new .heading button { + padding: 0 0 0 44px; + line-height: 44px; + width: 100%; + border: 0; + margin: 0; + text-align: left; + font-weight: normal; + background-color: transparent; + background-position: 14px center; +} + + +/* navigation */ +#app-navigation ul.with-icon > li > a, +#app-navigation ul.with-icon > li > ul > li > a { + padding-left: 44px; +} + +#app-navigation .icon-starred { + background-image: url('../img/starred.png'); +} + +.icon-rss { + background-image: url('../img/rss.svg') !important; +} + +.icon-rss-unread { + background-image: url('../img/rss_unread.svg') !important; +} + +.icon-add-folder { + background-image: url('../img/add_folder.svg') !important; +} + +.icon-facebook { + background-image: url('../img/facebook.svg') !important; +} + +.icon-twitter { + background-image: url('../img/twitter.svg') !important; +} + + +.col-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + position: relative; + width: 100%; +} + +.row { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} + +.icon-dropdown{ + background-position: center !important; + background-size: 24px; + padding: 2em !important; + min-height: 28px !important; + min-width: 28px !important; +} + +.icon-full-text-enabled { + background-image: url('../img/fulltext.svg'); + background-size: 50%; + opacity: .5; +} + + +.icon-full-text-disabled { + background-image: url('../img/nonfulltext.svg'); + background-size: 50%; + opacity: .5; +} + +#app-navigation .unread > a { + font-weight: bold; +} + +#app-navigation p.error { + line-height: 25px; +} + +#app-navigation .folder-rename-error { + height: auto; +} + +/** + * Error message + */ +#app-navigation .error-message { + padding: 15px; + background-color: var(--color-main-background); + color: var(--color-error); + position: relative; + overflow-y: auto; +} + +#app-navigation .ui-state-disabled { + opacity: 1; +} + +#app-navigation .error-message .title { + font-weight: bold; + padding-right: 30px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +#app-navigation .error-message:hover .title +#app-navigation .error-message:hover .message { + +} + +#app-navigation .error-message button { + top: 0; + right: 0; + position: absolute; + margin: 0; + height: 44px; + width: 44px; + padding: 15px; + border: 0; + background-size: 25px; + background-color: transparent; + background-image: url('../img/close.svg'); + background-repeat: no-repeat; + background-position: right 5px top 5px; + opacity: .9; +} + +#app-navigation .error-message button:hover { + opacity: 1; +} + +#app-navigation .animate-show.ng-hide-add, +#app-navigation .animate-show.ng-hide-remove { + /* this is required as of 1.3x to properly + apply all styling in a show/hide animation */ + transition: 0s linear opacity; +} + +#app-navigation .animate-show.ng-hide-add-active, +#app-navigation .animate-show.ng-hide-remove-active { + transition: .2s linear opacity; +} + +#app-navigation .animate-show { + opacity: 1; +} + +#app-navigation .animate-show.ng-hide { + opacity: 0; +} + +#app-navigation .feed-no-ordering { + transform: rotate(270deg); +} + +#app-navigation .feed-reverse-ordering { + transform: rotate(180deg); +} + +#app-navigation .feed-normal-ordering { +} + +#app-navigation .icon-pinned { + background-image: url('../img/pinned.svg'); +} + +#app-navigation .icon-unpinned { + background-image: url('../img/unpinned.svg'); +} + +#app-navigation .icon-updatemode-default { + background-image: url('../img/updatemodedefault.svg'); +} + +#app-navigation .icon-updatemode-unread { + background-image: url('../img/updatemodeunread.svg'); +} + +#app-navigation .updateerror a { + background-color: var(--color-warning) !important; +} + diff --git a/js-old/.jshintignore b/js-old/.jshintignore new file mode 100644 index 000000000..3e2e84b08 --- /dev/null +++ b/js-old/.jshintignore @@ -0,0 +1,2 @@ +build/ +node_modules/ diff --git a/js-old/.jshintrc b/js-old/.jshintrc new file mode 100644 index 000000000..1f0c276f4 --- /dev/null +++ b/js-old/.jshintrc @@ -0,0 +1,52 @@ +{ + "esnext": true, + "bitwise": true, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "forin": false, + "immed": true, + "indent": 4, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "plusplus": true, + "quotmark": "single", + "undef": true, + "unused": true, + "strict": true, + "maxparams": false, + "maxdepth": 3, + "maxlen": 120, + "browser": true, + "devel": true, + "jquery": true, + "globals": { + "angular": true, + "app": true, + "OC": true, + "csrfToken": true, + "inject": true, + "module": true, + "protractor": true, + "browser": true, + "By": true, + "it": true, + "afterEach": true, + "jasmine": true, + "describe": true, + "beforeEach": true, + "expect": true, + "exports": true, + "reverse": true, + "items": true, + "enumerate": true, + "News": true, + "t": true, + "navigator": true, + "oc_requesttoken": true, + "_": true + } +} diff --git a/js-old/admin/Admin.js b/js-old/admin/Admin.js new file mode 100644 index 000000000..5830f13f5 --- /dev/null +++ b/js-old/admin/Admin.js @@ -0,0 +1,109 @@ +/** + * Nextcloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt + * @copyright Bernhard Posselt 2014 + */ + +/** + * Used to update the admin settings + */ +(function (window, document, $) { + 'use strict'; + + $(document).ready(function () { + var useCronUpdatesInput = + $('#news input[name="news-use-cron-updates"]'); + var autoPurgeMinimumIntervalInput = + $('#news input[name="news-auto-purge-minimum-interval"]'); + var autoPurgeCountInput = + $('#news input[name="news-auto-purge-count"]'); + var maxRedirectsInput = + $('#news input[name="news-max-redirects"]'); + var feedFetcherTimeoutInput = + $('#news input[name="news-feed-fetcher-timeout"]'); + var maxSizeInput = + $('#news input[name="news-max-size"]'); + var exploreUrlInput = + $('#news input[name="news-explore-url"]'); + var updateIntervalInput = + $('#news input[name="news-update-interval"]'); + var savedMessage = $('#news-saved-message'); + + var saved = function () { + if (savedMessage.is(':visible')) { + savedMessage.hide(); + } + + savedMessage.fadeIn(function () { + setTimeout(function () { + savedMessage.fadeOut(); + }, 5000); + }); + }; + + var submit = function () { + var autoPurgeMinimumInterval = autoPurgeMinimumIntervalInput.val(); + var autoPurgeCount = autoPurgeCountInput.val(); + var maxRedirects = maxRedirectsInput.val(); + var feedFetcherTimeout = feedFetcherTimeoutInput.val(); + var maxSize = maxSizeInput.val(); + var exploreUrl = exploreUrlInput.val(); + var updateInterval = updateIntervalInput.val() + var useCronUpdates = useCronUpdatesInput.is(':checked'); + + var data = { + autoPurgeMinimumInterval: + parseInt(autoPurgeMinimumInterval, 10), + autoPurgeCount: parseInt(autoPurgeCount, 10), + maxRedirects: parseInt(maxRedirects, 10), + feedFetcherTimeout: parseInt(feedFetcherTimeout, 10), + maxSize: parseInt(maxSize, 10), + useCronUpdates: useCronUpdates, + exploreUrl: exploreUrl, + updateInterval: parseInt(updateInterval, 10) + }; + + var url = OC.generateUrl('/apps/news/admin'); + + $.ajax({ + type: 'PUT', + contentType: 'application/json; charset=utf-8', + url: url, + data: JSON.stringify(data), + dataType: 'json' + }).then(function (data) { + saved(); + autoPurgeMinimumIntervalInput + .val(data.autoPurgeMinimumInterval); + autoPurgeCountInput.val(data.autoPurgeCount); + maxRedirectsInput.val(data.maxRedirects); + maxSizeInput.val(data.maxSize); + feedFetcherTimeoutInput.val(data.feedFetcherTimeout); + useCronUpdatesInput.prop('checked', data.useCronUpdates); + exploreUrlInput.val(data.exploreUrl); + updateIntervalInput.val(data.updateInterval); + }); + + }; + + $('#news input[type="text"]').blur(submit); + $('#news input[type="checkbox"]').change(submit); + $('#news-migrate').click(function () { + var button = $(this); + button.addClass('loading'); + + $.post(OC.generateUrl('/apps/news/admin/migrate')) + .always(function () { + button.removeClass('loading'); + }); + + return false; + }); + }); + + +}(window, document, jQuery)); diff --git a/js-old/app/App.js b/js-old/app/App.js new file mode 100644 index 000000000..9e4ee5621 --- /dev/null +++ b/js-old/app/App.js @@ -0,0 +1,18 @@ +/** + * Nextcloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt + * @copyright Bernhard Posselt 2014 + */ + +$('#content.app-news') + .attr('ng-app', 'News') + .attr('ng-cloak', '') + .attr('ng-strict-di', '') + .attr('ng-controller', 'AppController as App'); + +/* jshint unused: false */ +var app = angular.module('News', ['ngRoute', 'ngSanitize', 'ngAnimate']); diff --git a/js-old/app/Config.js b/js-old/app/Config.js new file mode 100644 index 000000000..f7c62e7ae --- /dev/null +++ b/js-old/app/Config.js @@ -0,0 +1,221 @@ +/** + * Nextcloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt + * @copyright Bernhard Posselt 2014 + */ +app.config(function ($routeProvider, $provide, $httpProvider, $locationProvider) { + 'use strict'; + + var feedType = { + FEED: 0, + FOLDER: 1, + STARRED: 2, + SUBSCRIPTIONS: 3, + SHARED: 4, + EXPLORE: 5, + UNREAD: 6 + }; + + // default hashPrefix changed in angular 1.6 to '!' + // change back to empty string to keep links working + $locationProvider.hashPrefix(''); + + // constants + $provide.constant('REFRESH_RATE', 60); // seconds + $provide.constant('ITEM_BATCH_SIZE', 40); // how many items should be + // fetched initially + $provide.constant('ITEM_AUTO_PAGE_SIZE', 20); + $provide.constant('BASE_URL', OC.generateUrl('/apps/news')); + $provide.constant('FEED_TYPE', feedType); + $provide.constant('MARK_READ_TIMEOUT', 0.5); + $provide.constant('SCROLL_TIMEOUT', 0.1); + + // make sure that the CSRF header is only sent to the Nextcloud domain + $provide.factory('CSRFInterceptor', function ($q, BASE_URL, $w