diff --git a/.gitignore b/.gitignore index c574792b9..8e4713eb1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ composer.phar node_modules/ vendor/ -js/vendor/ js/build *.log /build/ diff --git a/Makefile b/Makefile index ba1c104cc..b12332881 100644 --- a/Makefile +++ b/Makefile @@ -29,13 +29,13 @@ # build tools and additional package managers should be installed locally in # your project, since this won't pollute people's global namespace. # -# The following npm scripts in your package.json install and update the bower -# and npm dependencies and use gulp as build system (notice how everything is -# run from the node_modules folder): +# The following npm scripts in your package.json install the npm dependencies +# and use gulp as build system (notice how everything is run from the +# node_modules folder): # # "scripts": { # "test": "node node_modules/gulp-cli/bin/gulp.js karma", -# "prebuild": "npm install && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update", +# "prebuild": "npm install", # "build": "node node_modules/gulp-cli/bin/gulp.js" # }, @@ -104,13 +104,12 @@ npm: clean: rm -rf ./build -# Same as clean but also removes dependencies installed by composer, bower and +# Same as clean but also removes dependencies installed by composer and # npm .PHONY: distclean distclean: clean rm -rf vendor rm -rf node_modules - rm -rf js/vendor rm -rf js/node_modules # Builds the source and appstore package @@ -153,14 +152,6 @@ appstore: "COPYING" \ "AUTHORS.md" \ "CHANGELOG.md" \ - "js/vendor/js-url/url.min.js" \ - "js/vendor/es6-shim/es6-shim.min.js" \ - "js/vendor/angular/angular.min.js" \ - "js/vendor/angular-animate/angular-animate.min.js" \ - "js/vendor/angular-route/angular-route.min.js" \ - "js/vendor/angular-sanitize/angular-sanitize.min.js" \ - "js/vendor/moment/min/moment-with-locales.min.js" \ - "js/vendor/masonry/dist/masonry.pkgd.min.js" \ "js/build/app.min.js" \ "js/admin/Admin.js" \ $(appstore_build_directory) diff --git a/js/.bowerrc b/js/.bowerrc deleted file mode 100644 index d55cb0793..000000000 --- a/js/.bowerrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "directory": "vendor" - -} diff --git a/js/.jshintignore b/js/.jshintignore index eb5a16ccc..3e2e84b08 100644 --- a/js/.jshintignore +++ b/js/.jshintignore @@ -1,3 +1,2 @@ build/ node_modules/ -vendor/ diff --git a/js/.jshintrc b/js/.jshintrc index dedacd590..0d5e8b544 100644 --- a/js/.jshintrc +++ b/js/.jshintrc @@ -46,7 +46,6 @@ "enumerate": true, "News": true, "t": true, - "url": true, "navigator": true, "oc_requesttoken": true, "_": true diff --git a/js/bower.json b/js/bower.json deleted file mode 100644 index e5e6c29f9..000000000 --- a/js/bower.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "nextcloud-news", - "homepage": "https://github.com/nextcloud/news", - "authors": [ - "Bernhard Posselt " - ], - "description": "An RSS/Atom feed reader", - "keywords": [ - "rss", - "atom", - "nextcloud", - "feed", - "reader", - "app" - ], - "license": "AGPL-3.0", - "private": true, - "ignore": [ - "**/.*", - "node_modules", - "vendor", - "tests" - ], - "dependencies": { - "angular": "~1.6.0", - "angular-route": "~1.6.0", - "angular-mocks": "~1.6.0", - "angular-sanitize": "~1.6.0", - "angular-animate": "~1.6.0", - "jquery": "~2.2.0", - "moment": "~2.18", - "es6-shim": "~0.35.0", - "js-url": "~2.5.0", - "masonry": "~4.2.0" - } -} diff --git a/js/gui/ExternSubscription.js b/js/gui/ExternSubscription.js index b53be918b..ff57a1f50 100644 --- a/js/gui/ExternSubscription.js +++ b/js/gui/ExternSubscription.js @@ -12,9 +12,22 @@ * This prefills the add feed section if an external link has ?subsribe_to * filled out */ -(function (window, document, navigator, url, $, undefined) { +(function (window, document, navigator, $, undefined) { 'use strict'; + function queryParam(param) + { + var query = window.location.search.substring(1); + var vars = query.split('&'); + for (var i = 0; i < vars.length; i += 1) { + var pair = vars[i].split('='); + if(pair[0] === param) { + return decodeURIComponent(pair[1]); + } + } + return(false); + } + // register reader as feed reader in firefox var location = window.location; var storage = window.localStorage; @@ -50,12 +63,13 @@ $(document).ready(function () { - var subscription = url('?subscribe_to'); - if (subscription && subscription !== 'undefined') { + var subscribeTo = queryParam('subscribe_to'); + + if(subscribeTo && subscribeTo !== 'undefined') { $('#new-feed').show(); var input = $('input[ng-model="Navigation.feed.url"]'); - input.val(subscription); + input.val(subscribeTo); input.trigger('input'); // hacky way to focus because initial loading of a feed @@ -66,4 +80,4 @@ } }); -})(window, document, navigator, url, $); +})(window, document, navigator, $); diff --git a/js/gulpfile.js b/js/gulpfile.js index 30d6d545d..b6b3d123b 100644 --- a/js/gulpfile.js +++ b/js/gulpfile.js @@ -26,6 +26,12 @@ const phpunitConfig = __dirname + '/../phpunit.xml'; const karmaConfig = __dirname + '/karma.conf.js'; const destinationFolder = __dirname + '/build/'; const sources = [ + 'node_modules/angular/angular.min.js', + 'node_modules/angular-animate/angular-animate.min.js', + 'node_modules/angular-route/angular-route.min.js', + 'node_modules/angular-sanitize/angular-sanitize.min.js', + 'node_modules/moment/min/moment-with-locales.min.js', + 'node_modules/masonry-layout/dist/masonry.pkgd.min.js', 'app/App.js', 'app/Config.js', 'app/Run.js', 'controller/**/*.js', 'filter/**/*.js', diff --git a/js/karma.conf.js b/js/karma.conf.js index 68bb0fee1..590cb598a 100644 --- a/js/karma.conf.js +++ b/js/karma.conf.js @@ -16,14 +16,12 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ - 'vendor/js-url/url.min.js', - 'vendor/es6-shim/es6-shim.min.js', - 'vendor/jquery/dist/jquery.js', - 'vendor/moment/min/moment-with-locales.js', - 'vendor/angular/angular.js', - 'vendor/angular-mocks/angular-mocks.js', - 'vendor/angular-route/angular-route.js', - 'vendor/angular-sanitize/angular-sanitize.js', + 'node_modules/jquery/dist/jquery.js', + 'node_modules/moment/min/moment-with-locales.js', + 'node_modules/angular/angular.js', + 'node_modules/angular-mocks/angular-mocks.js', + 'node_modules/angular-route/angular-route.js', + 'node_modules/angular-sanitize/angular-sanitize.js', 'tests/unit/stubs/App.js', 'tests/unit/stubs/OC.js', 'controller/**/*.js', diff --git a/js/package.json b/js/package.json index 30391282a..ac71adb9f 100644 --- a/js/package.json +++ b/js/package.json @@ -4,7 +4,7 @@ "main": "build/app.min.js", "scripts": { "test": "node node_modules/gulp-cli/bin/gulp.js karma", - "prebuild": "npm install && npm update && node_modules/bower/bin/bower install && node_modules/bower/bin/bower update", + "prebuild": "npm install && npm update", "build": "node node_modules/gulp-cli/bin/gulp.js" }, "repository": { @@ -30,7 +30,6 @@ "private": true, "homepage": "https://github.com/nextcloud/news", "devDependencies": { - "bower": "^1.8.0", "gulp": "^3.9.1", "gulp-cli": "^1.2.2", "gulp-concat": "^2.6.1", @@ -40,6 +39,7 @@ "gulp-sourcemaps": "^1.9.1", "gulp-uglify": "^2.0.0", "jasmine-core": "^2.5.2", + "jquery": "^2.2.4", "jshint": "^2.9.4", "karma": "^1.3.0", "karma-chrome-launcher": "^2.0.0", @@ -47,5 +47,14 @@ "karma-firefox-launcher": "^1.0.0", "karma-jasmine": "^1.1.0" }, - "dependencies": {} + "dependencies": { + "angular": "^1.6.4", + "angular-animate": "^1.6.4", + "angular-mocks": "^1.6.4", + "angular-route": "^1.6.4", + "angular-sanitize": "^1.6.4", + "debug": "^2.6.8", + "masonry-layout": "^4.2.0", + "moment": "^2.18.1" + } } diff --git a/templates/index.php b/templates/index.php index f341d40a3..a7f8bb303 100644 --- a/templates/index.php +++ b/templates/index.php @@ -2,14 +2,6 @@ use OCA\News\Plugin\Client\Plugin; script('news', [ - 'vendor/js-url/url.min', - 'vendor/es6-shim/es6-shim.min', - 'vendor/angular/angular.min', - 'vendor/angular-animate/angular-animate.min', - 'vendor/angular-route/angular-route.min', - 'vendor/angular-sanitize/angular-sanitize.min', - 'vendor/moment/min/moment-with-locales.min', - 'vendor/masonry/dist/masonry.pkgd.min', 'build/app.min', ]);