diff options
author | Daniel Schaal <daniel@schaal.email> | 2017-06-18 12:19:38 +0200 |
---|---|---|
committer | Bernhard Posselt <BernhardPosselt@users.noreply.github.com> | 2017-06-18 12:19:38 +0200 |
commit | fd630242dade58b7f58de638d64ef1f0db7ae36d (patch) | |
tree | 0e5fc827c0bb489af4595870ced3d0c3a5744b19 /js/gui | |
parent | c32d85c11954fdd7592856d1e403c41cb2253fb0 (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/gui')
-rw-r--r-- | js/gui/ExternSubscription.js | 24 |
1 files changed, 19 insertions, 5 deletions
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, $); |