summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorDaniel Schaal <daniel@schaal.email>2017-06-18 12:19:38 +0200
committerBernhard Posselt <BernhardPosselt@users.noreply.github.com>2017-06-18 12:19:38 +0200
commitfd630242dade58b7f58de638d64ef1f0db7ae36d (patch)
tree0e5fc827c0bb489af4595870ced3d0c3a5744b19 /js
parentc32d85c11954fdd7592856d1e403c41cb2253fb0 (diff)
Remove bower, install everything using npm (#197)
* Remove bower, install everything using npm Remove js-url and use a simple function to get the query param. * Bundle all js scripts in app.min.js * Move jquery to devDependencies * Remove es6-shim, most common browsers support es6 natively.
Diffstat (limited to 'js')
-rw-r--r--js/.bowerrc4
-rw-r--r--js/.jshintignore1
-rw-r--r--js/.jshintrc1
-rw-r--r--js/bower.json36
-rw-r--r--js/gui/ExternSubscription.js24
-rw-r--r--js/gulpfile.js6
-rw-r--r--js/karma.conf.js14
-rw-r--r--js/package.json15
8 files changed, 43 insertions, 58 deletions
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 <dev@bernhard-posselt.com>"
- ],
- "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"
+ }
}