From c191ea52765c2515560eee01c62c61485b1ff6af Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 10 Feb 2016 16:42:39 +0100 Subject: [PATCH] upgrade code after js-url upgrade --- js/build/app.js | 6 ++---- js/build/app.min.js | 2 +- js/build/app.min.js.map | 2 +- js/gui/ExternSubscription.js | 6 ++---- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/js/build/app.js b/js/build/app.js index 8c2124c02..1520622d5 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -2133,9 +2133,8 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL) $(document).ready(function () { - var subscription = window.decodeURIComponent(url('?subscribe_to')); - - if (subscription && subscription !== 'null') { + var subscription = url('?subscribe_to'); + if (subscription && subscription !== 'undefined') { $('#new-feed').show(); var input = $('input[ng-model="Navigation.feed.url"]'); @@ -2152,7 +2151,6 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL) })(window, document, navigator, url, $); - /** * Various fixes */ diff --git a/js/build/app.min.js b/js/build/app.min.js index 00d0c87b5..cd25ac495 100644 --- a/js/build/app.min.js +++ b/js/build/app.min.js @@ -1,3 +1,3 @@ -!function(a,b,c,d,e,f,g,h,i){"use strict";var j=d.module("News",["ngRoute","ngSanitize","ngAnimate"]);j.config(["$routeProvider","$provide","$httpProvider",function(a,b,c){var d={FEED:0,FOLDER:1,STARRED:2,SUBSCRIPTIONS:3,SHARED:4,EXPLORE:5};b.constant("REFRESH_RATE",60),b.constant("ITEM_BATCH_SIZE",40),b.constant("ITEM_AUTO_PAGE_SIZE",20),b.constant("BASE_URL",f.generateUrl("/apps/news")),b.constant("FEED_TYPE",d),b.constant("MARK_READ_TIMEOUT",.5),b.constant("SCROLL_TIMEOUT",.1),b.factory("CSRFInterceptor",["$q","BASE_URL","$window",function(a,b,c){return{request:function(d){var e=c.location.href.split(c.location.pathname)[0];return(0===d.url.indexOf(b)||0===d.url.indexOf(e))&&(d.headers.requesttoken=g),d||a.when(d)}}}]);var e={0:t("news","Request failed, network connection unavailable!"),401:t("news","Request unauthorized. Are you logged in?"),403:t("news","Request forbidden. Are you an admin?"),412:t("news","Token expired or app not enabled! Reload the page!"),500:t("news","Internal server error! Please check your data/owncloud.log file for additional information!"),503:t("news","Request failed, ownCloud is in currently in maintenance mode!")};b.factory("ConnectionErrorInterceptor",["$q","$timeout",function(a,b){var c;return{responseError:function(d){return d.status in e&&(c&&b.cancel(c),f.Notification.hide(),f.Notification.showHtml(e[d.status]),c=b(function(){f.Notification.hide()},5e3)),a.reject(d)}}}]),c.interceptors.push("CSRFInterceptor"),c.interceptors.push("ConnectionErrorInterceptor");var h=function(a){return{data:["$http","$route","$q","$location","BASE_URL","ITEM_BATCH_SIZE","FEED_TYPE","SettingsResource","FeedResource",function(b,c,d,e,f,g,h,j,k){var l=j.get("showAll"),m=j.get("oldestFirst"),n=e.search().search||"",o=d.defer();if(null===l||null===m)o.resolve({});else{var p={type:a,limit:g,showAll:l,oldestFirst:m,search:n};if(c.current.params.id!==i&&(p.id=c.current.params.id),a===h.FEED){var q=k.getById(p.id);q===i||2===q.ordering?p.oldestFirst=!1:1===q.ordering&&(p.oldestFirst=!0)}b({url:f+"/items",method:"GET",params:p}).success(function(a){o.resolve(a)})}return o.promise}]}},j=function(){return{sites:["$http","$q","BASE_URL","$location","Publisher","SettingsResource",function(a,b,c,d,e,f){var g=b.defer(),h=d.search().lang;return h||(h=f.get("language")),a.get(c+"/settings").then(function(b){e.publishAll(b);var c=f.get("exploreUrl").replace(/\/+$/,""),d=c+"/feeds."+h+".json",g=c+"/feeds.en.json";return a.get(d)["catch"](function(){return a.get(g)})}).then(function(a){g.resolve(a.data)})["catch"](function(){g.reject()}),g.promise}]}};a.when("/items",{controller:"ContentController as Content",templateUrl:"content.html",resolve:h(d.SUBSCRIPTIONS),type:d.SUBSCRIPTIONS}).when("/items/starred",{controller:"ContentController as Content",templateUrl:"content.html",resolve:h(d.STARRED),type:d.STARRED}).when("/items/feeds/:id",{controller:"ContentController as Content",templateUrl:"content.html",resolve:h(d.FEED),type:d.FEED}).when("/items/folders/:id",{controller:"ContentController as Content",templateUrl:"content.html",resolve:h(d.FOLDER),type:d.FOLDER}).when("/explore",{controller:"ExploreController as Explore",templateUrl:"explore.html",resolve:j(),type:d.EXPLORE}).when("/shortcuts",{templateUrl:"shortcuts.html",type:-1})}]),j.run(["$rootScope","$location","$http","$q","$interval","$route","Loading","ItemResource","FeedResource","FolderResource","SettingsResource","Publisher","BASE_URL","FEED_TYPE","REFRESH_RATE",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){g.setLoading("global",!0),l.subscribe(h).toChannels(["items","newestItemId","starred"]),l.subscribe(j).toChannels(["folders"]),l.subscribe(i).toChannels(["feeds"]),l.subscribe(k).toChannels(["settings"]);var p=d.defer();c.get(m+"/settings").success(function(a){l.publishAll(a),p.resolve()});var q=d.defer(),r=b.path();c.get(m+"/feeds/active").success(function(a){var c;switch(a.activeFeed.type){case n.FEED:c="/items/feeds/"+a.activeFeed.id;break;case n.FOLDER:c="/items/folders/"+a.activeFeed.id;break;case n.STARRED:c="/items/starred";break;case n.EXPLORE:c="/explore";break;default:c="/items"}/^\/items(\/(starred|explore|feeds\/\d+|folders\/\d+))?\/?$/.test(r)||b.path(c),q.resolve()});var s,t=d.defer();c.get(m+"/feeds").success(function(a){s=a,t.resolve()});var u,v=d.defer();c.get(m+"/folders").success(function(a){u=a,v.resolve()}),d.all([t.promise,v.promise]).then(function(){l.publishAll(s),l.publishAll(u),0===s.feeds.length&&0===u.folders.length&&b.path("/explore")}),d.all([p.promise,q.promise,t.promise,v.promise]).then(function(){f.reload(),g.setLoading("global",!1)}),e(function(){c.get(m+"/feeds").success(function(a){l.publishAll(a)}),c.get(m+"/folders").success(function(a){l.publishAll(a)})},1e3*o),a.$on("$routeChangeStart",function(){g.setLoading("content",!0)}),a.$on("$routeChangeSuccess",function(){g.setLoading("content",!1)}),a.$on("$routeChangeError",function(){b.path("/items")})}]),j.controller("AppController",["Loading","FeedResource","FolderResource",function(a,b,c){this.loading=a,this.isFirstRun=function(){return 0===b.size()&&0===c.size()},this.play=function(a){this.playingItem=a}}]),j.controller("ContentController",["Publisher","FeedResource","ItemResource","SettingsResource","data","$route","$routeParams","$location","FEED_TYPE","ITEM_AUTO_PAGE_SIZE","Loading",function(a,b,c,d,e,f,g,h,j,k,l){c.clear(),a.publishAll(e),this.isAutoPagingEnabled=!0,c.size()>=k?this.isNothingMoreToAutoPage=!1:this.isNothingMoreToAutoPage=!0,this.getItems=function(){return c.getAll()},this.toggleStar=function(a){c.toggleStar(a)},this.toggleItem=function(a){this.isCompactView()&&(a.show=!a.show)},this.isShowAll=function(){return d.get("showAll")},this.markRead=function(a){var d=c.get(a);d.keepUnread||d.unread!==!0||(c.markItemRead(a),b.markItemOfFeedRead(d.feedId))},this.getFeed=function(a){return b.getById(a)},this.toggleKeepUnread=function(a){var d=c.get(a);d.unread||(b.markItemOfFeedUnread(d.feedId),c.markItemRead(a,!1)),d.keepUnread=!d.keepUnread};var m=this,n=function(){var a=d.get("oldestFirst");if(m.isFeed()){var c=b.getById(g.id);c&&1===c.ordering?a=!0:c&&2===c.ordering&&(a=!1)}return a};this.orderBy=function(){return n()?"id":"-id"},this.isCompactView=function(){return d.get("compact")},this.isCompactExpand=function(){return d.get("compactExpand")},this.autoPagingEnabled=function(){return this.isAutoPagingEnabled},this.markReadEnabled=function(){return!d.get("preventReadOnScroll")},this.scrollRead=function(a){var d=[],e=[];a.forEach(function(a){var b=c.get(a);b.keepUnread||(d.push(a),e.push(b.feedId))}),d.length>0&&(b.markItemsOfFeedsRead(e),c.markItemsRead(d))},this.isFeed=function(){return f.current.$$route.type===j.FEED},this.autoPage=function(){if(!this.isNothingMoreToAutoPage){if(!this.isAutoPagingEnabled)return void(this.autoPageAgain=!0);this.isAutoPagingEnabled=!1,this.autoPageAgain=!1;var b=f.current.$$route.type,e=g.id,i=n(),j=d.get("showAll"),m=this,o=h.search().search;l.setLoading("autopaging",!0),c.autoPage(b,e,i,j,o).success(function(b){a.publishAll(b),b.items.length>=k?m.isAutoPagingEnabled=!0:m.isNothingMoreToAutoPage=!0,m.isAutoPagingEnabled&&m.autoPageAgain&&m.autoPage()}).error(function(){m.isAutoPagingEnabled=!0})["finally"](function(){l.setLoading("autopaging",!1)})}},this.getRelativeDate=function(a){if(a!==i&&""!==a){var b=d.get("language"),c=moment.unix(a).locale(b).fromNow()+"";return c}return""},this.refresh=function(){f.reload()},this.getMediaType=function(a){return a&&0===a.indexOf("audio")?"audio":a&&0===a.indexOf("video")?"video":i}}]),j.controller("ExploreController",["sites","$rootScope","FeedResource","SettingsResource","$location",function(a,b,c,d,e){this.sites=a,this.feeds=Object.keys(a).map(function(b){return[b,a[b]]}).reduce(function(a,b){var c=b[0],d=b[1];return d.forEach(function(a){a.category=c}),a.concat(d)},[]),this.feedExists=function(a){return c.getByLocation(a)!==i},this.subscribeTo=function(a){b.$broadcast("addFeed",a)},this.isCategoryShown=function(a){return a.filter(function(a){return c.getByLocation(a.feed)===i}).length>0},this.getSupportedLanguageCodes=function(){return d.getSupportedLanguageCodes()},this.getCurrentLanguageCode=function(){var a=e.search().lang;return a||(a=d.get("language")),a},this.showLanguage=function(a){e.url("/explore/?lang="+a)},this.selectedLanguageCode=this.getCurrentLanguageCode()}]),j.controller("NavigationController",["$route","FEED_TYPE","FeedResource","FolderResource","ItemResource","SettingsResource","Publisher","$rootScope","$location","$q",function(a,b,c,d,e,f,g,h,j,k){this.feedError="",this.showNewFolder=!1,this.renamingFolder=!1,this.addingFeed=!1,this.addingFolder=!1,this.folderError="",this.renameError="",this.feed={};var l=function(){return parseInt(a.current.params.id,10)};this.getLanguageCode=function(){return f.get("language")},this.getFeeds=function(){return c.getAll()},this.getFolders=function(){return d.getAll()},this.markFolderRead=function(a){c.markFolderRead(a),c.getByFolderId(a).forEach(function(a){e.markFeedRead(a.id)})},this.markFeedRead=function(a){e.markFeedRead(a),c.markFeedRead(a)},this.markRead=function(){e.markRead(),c.markRead()},this.isShowAll=function(){return f.get("showAll")},this.getFeedsOfFolder=function(a){return c.getByFolderId(a)},this.getUnreadCount=function(){return c.getUnreadCount()},this.isUnread=function(){return this.getUnreadCount()>0},this.getFeedUnreadCount=function(a){var b=c.getById(a);return b!==i?b.unreadCount:0},this.isFeedUnread=function(a){return this.getFeedUnreadCount(a)>0},this.getFolderUnreadCount=function(a){return c.getFolderUnreadCount(a)},this.isFolderUnread=function(a){return this.getFolderUnreadCount(a)>0},this.getStarredCount=function(){return e.getStarredCount()},this.isStarredUnread=function(){return this.getStarredCount()>0},this.toggleFolder=function(a){d.toggleOpen(a)},this.hasFeeds=function(a){return c.getFolderUnreadCount(a)!==i},this.subFeedActive=function(d){var e=a.current.$$route.type;if(e===b.FEED){var f=c.getById(l());if(f!==i&&f.folderId===d)return!0}return!1},this.isSubscriptionsActive=function(){return a.current&&a.current.$$route.type===b.SUBSCRIPTIONS},this.isStarredActive=function(){return a.current&&a.current.$$route.type===b.STARRED},this.isExploreActive=function(){return a.current&&a.current.$$route.type===b.EXPLORE},this.isFolderActive=function(c){return a.current&&a.current.$$route.type===b.FOLDER&&l()===c},this.isFeedActive=function(c){return a.current&&a.current.$$route.type===b.FEED&&l()===c},this.folderNameExists=function(a){return a=a||"",d.get(a.trim())!==i},this.feedUrlExists=function(a){return a=a||"",a=a.trim(),c.get(a)!==i||c.get("http://"+a)!==i},this.createFeed=function(a){var b=this;this.showNewFolder=!1,this.addingFeed=!0;var e=a.newFolder,f=a.existingFolder||{id:0};e===i||""===e?(f.getsFeed=!0,c.create(a.url,f.id,i).then(function(a){g.publishAll(a),j.path("/items/feeds/"+a.feeds[0].id+"/")})["finally"](function(){f.getsFeed=i,a.url="",b.addingFeed=!1})):d.create(e).then(function(c){g.publishAll(c),a.existingFolder=d.get(c.folders[0].name),a.newFolder=i,b.createFeed(a)})},this.createFolder=function(a){var b=this;this.addingFolder=!0,d.create(a.name).then(function(a){g.publishAll(a)})["finally"](function(){b.addingFolder=!1,a.name=""})},this.moveFeed=function(b,d){var e=!1,f=c.getById(b);f.folderId!==d&&((this.isFolderActive(f.folderId)||this.isFolderActive(d))&&(e=!0),c.move(b,d),e&&a.reload())},this.renameFeed=function(a){c.patch(a.id,{title:a.title}),a.editing=!1},this.renameFolder=function(a,b){a.renameError="",this.renamingFolder=!0;var c=this;a.name===b?(a.renameError="",a.editing=!1,this.renamingFolder=!1):d.rename(a.name,b).then(function(){a.renameError="",a.editing=!1},function(b){a.renameError=b})["finally"](function(){c.renamingFolder=!1})},this.reversiblyDeleteFeed=function(b){c.reversiblyDelete(b.id)["finally"](function(){a.reload()})},this.undoDeleteFeed=function(b){c.undoDelete(b.id)["finally"](function(){a.reload()})},this.deleteFeed=function(a){c["delete"](a.url)},this.reversiblyDeleteFolder=function(b){k.all(c.reversiblyDeleteFolder(b.id),d.reversiblyDelete(b.name))["finally"](function(){a.reload()})},this.undoDeleteFolder=function(b){k.all(c.undoDeleteFolder(b.id),d.undoDelete(b.name))["finally"](function(){a.reload()})},this.deleteFolder=function(a){c.deleteFolder(a.id),d["delete"](a.name)},this.setOrdering=function(b,d){c.patch(b.id,{ordering:d}),a.reload()},this.togglePinned=function(a){var b=c.getById(a);return b?c.patch(a,{pinned:!b.pinned}):void 0},this.setUpdateMode=function(a,b){return c.patch(a,{updateMode:b})},this.toggleFullText=function(b){h.$broadcast("$routeChangeStart"),c.toggleFullText(b.id)["finally"](function(){h.$broadcast("$routeChangeSuccess"),a.reload()})},this.search=function(a){""===a?j.search("search",null):j.search("search",a)};var m=this;h.$on("moveFeedToFolder",function(a,b){m.moveFeed(b.feedId,b.folderId)});var n=function(){var e;a.current&&(e=a.current.$$route.type);var f=0;if(e===b.FOLDER)f=l();else if(e===b.FEED){var g=c.getById(l());g&&(f=g.folderId)}var h;0!==f&&(h=d.getById(f)),m.feed.existingFolder=h};h.$on("$routeChangeSuccess",function(){n()})}]),j.controller("SettingsController",["$route","$q","SettingsResource","ItemResource","OPMLParser","OPMLImporter","Publisher",function(a,b,c,d,e,f,g){this.isOPMLImporting=!1,this.isArticlesImporting=!1,this.opmlImportError=!1,this.articleImportError=!1;var h=function(b,d){c.set(b,d),["showAll","oldestFirst","compact"].indexOf(b)>=0&&a.reload()};this.toggleSetting=function(a){h(a,!this.getSetting(a))},this.getSetting=function(a){return c.get(a)},this.importOPML=function(a){this.opmlImportError=!1,this.articleImportError=!1;try{this.isOPMLImporting=!1;var b=e.parse(a),c=this,d=5;f.importFolders(b).then(function(a){return f.importFeedQueue(a,d)})["finally"](function(){c.isOPMLImporting=!1})}catch(g){console.error(g),this.isOPMLImporting=!1,this.opmlImportError=!0}},this.importArticles=function(a){this.opmlImportError=!1,this.articleImportError=!1;try{this.isArticlesImporting=!0;var b=JSON.parse(a),c=this;d.importArticles(b).success(function(a){g.publishAll(a)})["finally"](function(){c.isArticlesImporting=!1})}catch(e){console.error(e),this.articleImportError=!0,this.isArticlesImporting=!1}}}]),j.filter("trustUrl",["$sce",function(a){return function(b){return a.trustAsResourceUrl(b)}}]),j.filter("unreadCountFormatter",function(){return function(a){return a>999?"999+":a}}),j.factory("FeedResource",["Resource","$http","BASE_URL","$q",function(a,b,c,d){var e=function(b,c,d){a.call(this,b,c,"url"),this.ids={},this.locations={},this.unreadCount=0,this.folderUnreadCount={},this.folderIds={},this.$q=d};return e.prototype=Object.create(a.prototype),e.prototype.receive=function(b){a.prototype.receive.call(this,b),this.updateUnreadCache(),this.updateFolderCache()},e.prototype.clear=function(){a.prototype.clear.call(this),this.unreadCount=0,this.folderUnreadCount={},this.folderIds={},this.ids={},this.locations={}},e.prototype.updateUnreadCache=function(){this.unreadCount=0,this.folderUnreadCount={};var a=this;this.values.forEach(function(b){b.unreadCount&&(a.unreadCount+=b.unreadCount),b.folderId!==i&&(a.folderUnreadCount[b.folderId]=a.folderUnreadCount[b.folderId]||0,a.folderUnreadCount[b.folderId]+=b.unreadCount)})},e.prototype.updateFolderCache=function(){this.folderIds={};var a=this;this.values.forEach(function(b){a.folderIds[b.folderId]=a.folderIds[b.folderId]||[],a.folderIds[b.folderId].push(b)})},e.prototype.add=function(b){a.prototype.add.call(this,b),b.id!==i&&(this.ids[b.id]=this.hashMap[b.url]),b.location!==i&&(this.locations[b.location]=this.hashMap[b.url])},e.prototype.markRead=function(){this.values.forEach(function(a){a.unreadCount=0}),this.updateUnreadCache()},e.prototype.markFeedRead=function(a){this.ids[a].unreadCount=0,this.updateUnreadCache()},e.prototype.markFolderRead=function(a){this.values.forEach(function(b){b.folderId===a&&(b.unreadCount=0)}),this.updateUnreadCache()},e.prototype.markItemOfFeedRead=function(a){this.ids[a].unreadCount-=1,this.updateUnreadCache()},e.prototype.markItemsOfFeedsRead=function(a){var b=this;a.forEach(function(a){b.ids[a].unreadCount-=1}),this.updateUnreadCache()},e.prototype.markItemOfFeedUnread=function(a){this.ids[a].unreadCount+=1,this.updateUnreadCache()},e.prototype.getUnreadCount=function(){return this.unreadCount},e.prototype.getFolderUnreadCount=function(a){return this.folderUnreadCount[a]},e.prototype.getByFolderId=function(a){return this.folderIds[a]||[]},e.prototype.getById=function(a){return this.ids[a]},e.prototype.getByLocation=function(a){return this.locations[a]},e.prototype.move=function(a,b){var c=this.getById(a);return c.folderId=b,this.updateFolderCache(),this.updateUnreadCache(),this.patch(a,{folderId:b})},e.prototype.create=function(a,b,c){a=a.trim(),a.startsWith("http")||(a="https://"+a),c!==i&&(c=c.trim());var d={url:a,folderId:b||0,title:c||a,unreadCount:0};this.add(d),this.updateFolderCache();var e=this.$q.defer();return this.http({method:"POST",url:this.BASE_URL+"/feeds",data:{url:a,parentFolderId:b||0,title:c}}).success(function(a){e.resolve(a)}).error(function(a){d.faviconLink="",d.error=a.message,e.reject()}),e.promise},e.prototype.reversiblyDelete=function(a,b,c){var d=this.getById(a);return d&&c!==!0&&(d.deleted=!0),b!==!1&&this.updateUnreadCache(),this.http["delete"](this.BASE_URL+"/feeds/"+a)},e.prototype.reversiblyDeleteFolder=function(a){var b=this,c=[];this.getByFolderId(a).forEach(function(a){c.push(b.reversiblyDelete(a.id,!1,!0))}),this.updateUnreadCache();var d=this.$q.all(c);return d.promise},e.prototype["delete"]=function(b,c){var d=this.get(b);return d!==i&&d.id&&delete this.ids[d.id],d!==i&&d.location&&delete this.locations[d.location],a.prototype["delete"].call(this,b),c!==!1&&(this.updateUnreadCache(),this.updateFolderCache()),d},e.prototype.deleteFolder=function(a){var b=this;this.getByFolderId(a).forEach(function(a){b["delete"](a.url,!1)}),this.updateUnreadCache(),this.updateFolderCache()},e.prototype.undoDelete=function(a,b){var c=this.getById(a);return c&&(c.deleted=!1),b!==!1&&this.updateUnreadCache(),this.http.post(this.BASE_URL+"/feeds/"+a+"/restore")},e.prototype.undoDeleteFolder=function(a){var b=this,c=[];this.getByFolderId(a).forEach(function(a){c.push(b.undoDelete(a.id,!1))}),this.updateUnreadCache();var d=this.$q.all(c);return d.promise},e.prototype.setOrdering=function(a,b){var c=this.getById(a);if(c){c.ordering=b;var d=this.BASE_URL+"/feeds/"+a;return this.http.patch(d,{ordering:b})}},e.prototype.setPinned=function(a,b){var c=this.getById(a);if(c){c.pinned=b;var d=this.BASE_URL+"/feeds/"+a;return this.http.patch(d,{pinned:b})}},e.prototype.patch=function(a,b){var c=this.getById(a);if(c){Object.keys(b).forEach(function(a){c[a]=b[a]});var d=this.BASE_URL+"/feeds/"+a;return this.http.patch(d,b)}},e.prototype.toggleFullText=function(a){var b=this.getById(a);return this.patch(a,{fullTextEnabled:!b.fullTextEnabled})},new e(b,c,d)}]),j.factory("FolderResource",["Resource","$http","BASE_URL","$q",function(a,b,c,d){var e=function(b,c,d){a.call(this,b,c,"name"),this.deleted=null,this.$q=d,this.ids={}};return e.prototype=Object.create(a.prototype),e.prototype.add=function(b){a.prototype.add.call(this,b),b.id!==i&&(this.ids[b.id]=this.hashMap[b.name])},e.prototype.clear=function(){a.prototype.clear.call(this),this.ids={}},e.prototype["delete"]=function(b){var c=this.get(b);return c!==i&&c.id&&delete this.ids[c.id],a.prototype["delete"].call(this,b),c},e.prototype.toggleOpen=function(a){var b=this.get(a);return b.opened=!b.opened,this.http({url:this.BASE_URL+"/folders/"+b.id+"/open",method:"POST",data:{folderId:b.id,open:b.opened}})},e.prototype.rename=function(a,b){var c=this.get(a),d=this.$q.defer(),e=this;return this.http({url:this.BASE_URL+"/folders/"+c.id+"/rename",method:"POST",data:{folderName:b}}).success(function(){c.name=b,delete e.hashMap[a],e.hashMap[b]=c,d.resolve()}).error(function(a){d.reject(a.message)}),d.promise},e.prototype.getById=function(a){return this.ids[a]},e.prototype.create=function(a){a=a.trim();var b={name:a};this.add(b);var c=this.$q.defer();return this.http({url:this.BASE_URL+"/folders",method:"POST",data:{folderName:a}}).success(function(a){c.resolve(a)}).error(function(a){b.error=a.message}),c.promise},e.prototype.reversiblyDelete=function(a){var b=this.get(a),c=b.id;return b.deleted=!0,this.http["delete"](this.BASE_URL+"/folders/"+c)},e.prototype.undoDelete=function(a){var b=this.get(a),c=b.id;return b.deleted=!1,this.http.post(this.BASE_URL+"/folders/"+c+"/restore")},new e(b,c,d)}]),j.factory("ItemResource",["Resource","$http","BASE_URL","ITEM_BATCH_SIZE",function(a,b,c,d){var e=function(b,c,d){a.call(this,b,c),this.batchSize=d,this.clear()};return e.prototype=Object.create(a.prototype),e.prototype.clear=function(){this.starredCount=0,this.lowestId=0,this.highestId=0,a.prototype.clear.call(this)},e.prototype.receive=function(b,c){switch(c){case"newestItemId":this.newestItemId=b;break;case"starred":this.starredCount=b;break;default:var d=this;b.forEach(function(a){0===d.lowestId&&(d.lowestId=a.id),0===d.highestId&&(d.highestId=a.id),a.id>d.highestId&&(d.highestId=a.id),a.id0){var h=f.pop(),j=h.url,k=h.title,l=0,m=h.folderName;if(m!==i&&b.get(m)!==i){var n=b.get(m);n.opened=!0,l=n.id,n.getsFeed=!0,n.getsFeedCounter=n.getsFeedCounter||0,n.getsFeedCounter+=1}j!==i&&a.get(j)===i&&a.create(j,l,k).then(function(a){c.publishAll(a)})["finally"](function(){0!==l&&(n.getsFeedCounter-=1,0===n.getsFeedCounter&&(n.getsFeed=!1)),e(f)})}else g.resolve();return g.promise};this.importFolders=function(a){var e=[],f=[];a.folders.forEach(function(a){if(a.name!==i){if(b.get(a.name)===i){var d=b.create(a.name).then(function(a){c.publishAll(a)});f.push(d)}a.feeds.forEach(function(b){b.folderName=a.name,e.push(b)})}}),e=e.concat(a.feeds);var g=d.defer();return d.all(f)["finally"](function(){g.resolve(e)}),g.promise},this.importFeedQueue=function(a,b){for(var c=d.defer(),f=[],g=0;b>g;g+=1)f.push(e(a));return d.all(f).then(function(){c.resolve()}),c.promise}}]),j.service("OPMLParser",function(){var a=function(a){var b=a.attr("xmlUrl")||a.attr("htmlUrl"),c=a.attr("title")||a.attr("text")||b;return b===i?{type:"folder",name:c,feeds:[]}:{type:"feed",name:c,url:b}},b=function(c,d,f){for(var g=0;g outline"),d={feeds:[],folders:[]};return b(c,d,!0)}}),j.service("Publisher",function(){this.channels={},this.subscribe=function(a){var b=this;return{toChannels:function(c){c.forEach(function(c){b.channels[c]=b.channels[c]||[],b.channels[c].push(a)})}}},this.publishAll=function(a){var b=this;Object.keys(a).forEach(function(c){var d=b.channels[c];d!==i&&d.forEach(function(b){b.receive(a[c],c)})})}}),j.factory("Resource",function(){var a=function(a,b,c){this.id=c||"id",this.values=[],this.hashMap={},this.http=a,this.BASE_URL=b};return a.prototype.receive=function(a){var b=this;a.forEach(function(a){b.add(a)})},a.prototype.add=function(a){var b=this.hashMap[a[this.id]];b===i?(this.values.push(a),this.hashMap[a[this.id]]=a):Object.keys(a).forEach(function(c){b[c]=a[c]})},a.prototype.size=function(){return this.values.length},a.prototype.get=function(a){return this.hashMap[a]},a.prototype["delete"]=function(a){var b=this,c=this.values.findIndex(function(c){return c[b.id]===a});c!==i&&this.values.splice(c,1),this.hashMap[a]!==i&&delete this.hashMap[a]},a.prototype.clear=function(){for(this.hashMap={};this.values.length>0;)this.values.pop()},a.prototype.getAll=function(){return this.values},a}),j.service("SettingsResource",["$http","BASE_URL",function(a,b){this.settings={language:"en",showAll:null,compact:!1,oldestFirst:null,preventReadOnScroll:!1,compactExpand:!1,exploreUrl:""},this.defaultLanguageCode="en",this.supportedLanguageCodes=["ar-ma","ar","bg","ca","cs","cv","da","de","el","en","en-ca","en-gb","eo","es","et","eu","fi","fr-ca","fr","gl","he","hi","hu","id","is","it","ja","ka","ko","lv","ms-my","nb","ne","nl","pl","pt-br","pt","ro","ru","sk","sl","sv","th","tr","tzm-la","tzm","uk","zh-cn","zh-tw"],this.getSupportedLanguageCodes=function(){return this.supportedLanguageCodes},this.receive=function(a){var b=this;Object.keys(a).forEach(function(c){var d=a[c];"language"===c&&(d=b.processLanguageCode(d)),b.settings[c]=d})},this.get=function(a){return this.settings[a]},this.set=function(c,d){return this.settings[c]=d,a({url:b+"/settings",method:"PUT",data:{language:this.settings.language,showAll:this.settings.showAll,compact:this.settings.compact,oldestFirst:this.settings.oldestFirst,compactExpand:this.settings.compactExpand,preventReadOnScroll:this.settings.preventReadOnScroll}})},this.processLanguageCode=function(a){return a=a.replace("_","-").toLowerCase(),this.supportedLanguageCodes.indexOf(a)<0&&(a=a.split("-")[0]),this.supportedLanguageCodes.indexOf(a)<0&&(a=this.defaultLanguageCode),a}}]),function(a,b,c,d,e,f){var g=a.location,h=a.localStorage,i=function(a,b,d){var e=c.isContentHandlerRegistered,f=function(a,b){return e?"new"!==e(a,b):h.getItem("registeredHandler")===b};c.registerContentHandler&&!f(a,b)&&(c.registerContentHandler(a,k,d),e||h.setItem("registeredHandler",b))},j=g.protocol+"//"+g.host+g.pathname,k=j+"?subscribe_to=%s",l="application/vnd.mozilla.maybe.feed",m="ownCloud News @ "+j;i(l,k,m),e(b).ready(function(){var b=a.decodeURIComponent(d("?subscribe_to"));if(b&&"null"!==b){e("#new-feed").show();var c=e('input[ng-model="Navigation.feed.url"]');c.val(b),c.trigger("input"),setTimeout(function(){c.focus()},1e3)}})}(b,c,a,h,e),function(a,b){a.addEventListener("beforeunload",function(){var a=b.querySelector("#app-content");a.scrollTo(0,0)})}(b,c),function(a,b,c){var d=function(a){return!(a.is("input")||a.is("select")||a.is("textarea")||a.is("checkbox"))},e=function(a){return!(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey)},f=function(a){var b=".active > .app-navigation-entry-menu .mark-read button",c=a.find(b);c.length>0&&c.trigger("click")},g=function(a,b){var c=a.offset().top-b.offset().top,d=c+a.height(),e=b.height();return c>=0&&e>d},h=function(a,b,c){0===a.length||!c&&g(a,b)||b.scrollTop(a.offset().top-b.offset().top+b.scrollTop())},i=function(a){var b=a.find(".active");h(b,a.children("ul"),!0)},j=function(a){a.find(".active > a:visible").trigger("click")},k=function(a,b){if(0===b.scrollTop()){var c=b.find(".pull-to-refresh");c.hasClass("show-pull-to-refresh")?c.hasClass("done")&&j(a):c.addClass("show-pull-to-refresh")}},l=function(a,b){a.children("a:visible").trigger("click"),h(a,b.children("ul"))},m=function(a){var b=a.find(".active"),d=a.find(".explore-feed,.subscriptions-feed:visible,.starred-feed:visible,.feed:visible");if(b.hasClass("folder"))for(;b.length>0;){var e=b.find(".feed:visible");if(e.length>0)return void l(c(e[0]),a);b=b.next(".folder")}else for(var f=0;f0&&l(c(e[d]),a)},p=function(a){var b=a.find(".active");if(b.hasClass("folder"))l(b.prevAll(".folder:visible").first(),a);else if(b.hasClass("feed")){var c=n(b);c.length>0?l(c,a):o(a,!0)}else o(a,!0)},q=function(a){var b=a.find(".active");if(b.hasClass("folder"))l(b.nextAll(".folder:visible").first(),a);else if(b.hasClass("feed")){var c=n(b);c.length>0?l(c.nextAll(".folder:visible").first(),a):o(a)}else o(a)},r=function(a){var b=a.find(".active"),d=a.find(".explore-feed,.subscriptions-feed:visible,.starred-feed:visible,.feed:visible");if(b.hasClass("folder")){for(var e=b.prev(".folder");e.length>0;){var f=e.find(".feed:visible");if(f.length>0)return void l(c(f[f.length-1]),a);e=e.prev(".folder")}var g=b.siblings(".feed");if(g.length>0)return void l(c(g[g.length-1]),a);var h=c(".starred-feed:visible");return void(h.length>0&&l(h,a))}for(var i=d.length-1;i>0;i-=1){var j=d[i];if(j===b[0]){var k=d[i-1];l(c(k),a);break}}},s=function(a,b){var d=a.find(".item");d.each(function(a,d){return d=c(d),d.height()+d.position().top>30?(b(d),!1):void 0})},t=function(a){s(a,function(a){a.find(".toggle-keep-unread").trigger("click")})},u=function(a){s(a,function(a){a.find(".star").trigger("click")})},v=function(a){s(a,function(a){a.find(".utils").trigger("click")})},w=function(b){s(b,function(b){b.trigger("click"),a.open(b.find(".external:visible").attr("href"),"_blank")})},x=function(a,b,c){a.scrollTop(b.offset().top-a.offset().top+a.scrollTop()),c&&s(a,function(a){a.hasClass("open")||a.find(".utils").trigger("click")})},y=function(a,b){var d=a.find(".item"),e=!1;d.each(function(d,f){return f=c(f),0===f.position().top&&b&&!f.hasClass("open")||f.position().top>10?(x(a,f,b),e=!0,!1):void 0}),e||a.scrollTop(a.prop("scrollHeight"))},z=function(a,b,d){var e=b.find(".item"),f=!1;e.each(function(e,g){if(g=c(g),g.position().top+10>=0){var h=g.prev();return h.length>0?x(b,h,d):(k(a,b),b.scrollTop(0)),f=!0,!1}}),!f&&e.length>0&&x(b,e.last())};c(b).keyup(function(a){var b=a.keyCode,g=c("#app-content"),h=c("#app-navigation"),l=c("#articles.compact").length>0,n="true"===c("#articles").attr("news-compact-expand"),o=l&&n;d(c(":focus"))&&e(a)?[74,78,39].indexOf(b)>=0?(a.preventDefault(),y(g,o)):[75,80,37].indexOf(b)>=0?(a.preventDefault(),z(h,g,o)):[85].indexOf(b)>=0?(a.preventDefault(),t(g)):[69].indexOf(b)>=0?(a.preventDefault(),v(g)):[73,83,76].indexOf(b)>=0?(a.preventDefault(),u(g)):[72].indexOf(b)>=0?(a.preventDefault(),u(g),y(g)):[79].indexOf(b)>=0?(a.preventDefault(),w(g)):[82].indexOf(b)>=0?(a.preventDefault(),j(h)):[70].indexOf(b)>=0?(a.preventDefault(),m(h)):[68].indexOf(b)>=0?(a.preventDefault(),r(h)):[67].indexOf(b)>=0?(a.preventDefault(),p(h)):[65].indexOf(b)>=0?(a.preventDefault(),i(h)):[86].indexOf(b)>=0?(a.preventDefault(),q(h)):[81].indexOf(b)>=0?(a.preventDefault(), +!function(a,b,c,d,e,f,g,h,i){"use strict";var j=d.module("News",["ngRoute","ngSanitize","ngAnimate"]);j.config(["$routeProvider","$provide","$httpProvider",function(a,b,c){var d={FEED:0,FOLDER:1,STARRED:2,SUBSCRIPTIONS:3,SHARED:4,EXPLORE:5};b.constant("REFRESH_RATE",60),b.constant("ITEM_BATCH_SIZE",40),b.constant("ITEM_AUTO_PAGE_SIZE",20),b.constant("BASE_URL",f.generateUrl("/apps/news")),b.constant("FEED_TYPE",d),b.constant("MARK_READ_TIMEOUT",.5),b.constant("SCROLL_TIMEOUT",.1),b.factory("CSRFInterceptor",["$q","BASE_URL","$window",function(a,b,c){return{request:function(d){var e=c.location.href.split(c.location.pathname)[0];return(0===d.url.indexOf(b)||0===d.url.indexOf(e))&&(d.headers.requesttoken=g),d||a.when(d)}}}]);var e={0:t("news","Request failed, network connection unavailable!"),401:t("news","Request unauthorized. Are you logged in?"),403:t("news","Request forbidden. Are you an admin?"),412:t("news","Token expired or app not enabled! Reload the page!"),500:t("news","Internal server error! Please check your data/owncloud.log file for additional information!"),503:t("news","Request failed, ownCloud is in currently in maintenance mode!")};b.factory("ConnectionErrorInterceptor",["$q","$timeout",function(a,b){var c;return{responseError:function(d){return d.status in e&&(c&&b.cancel(c),f.Notification.hide(),f.Notification.showHtml(e[d.status]),c=b(function(){f.Notification.hide()},5e3)),a.reject(d)}}}]),c.interceptors.push("CSRFInterceptor"),c.interceptors.push("ConnectionErrorInterceptor");var h=function(a){return{data:["$http","$route","$q","$location","BASE_URL","ITEM_BATCH_SIZE","FEED_TYPE","SettingsResource","FeedResource",function(b,c,d,e,f,g,h,j,k){var l=j.get("showAll"),m=j.get("oldestFirst"),n=e.search().search||"",o=d.defer();if(null===l||null===m)o.resolve({});else{var p={type:a,limit:g,showAll:l,oldestFirst:m,search:n};if(c.current.params.id!==i&&(p.id=c.current.params.id),a===h.FEED){var q=k.getById(p.id);q===i||2===q.ordering?p.oldestFirst=!1:1===q.ordering&&(p.oldestFirst=!0)}b({url:f+"/items",method:"GET",params:p}).success(function(a){o.resolve(a)})}return o.promise}]}},j=function(){return{sites:["$http","$q","BASE_URL","$location","Publisher","SettingsResource",function(a,b,c,d,e,f){var g=b.defer(),h=d.search().lang;return h||(h=f.get("language")),a.get(c+"/settings").then(function(b){e.publishAll(b);var c=f.get("exploreUrl").replace(/\/+$/,""),d=c+"/feeds."+h+".json",g=c+"/feeds.en.json";return a.get(d)["catch"](function(){return a.get(g)})}).then(function(a){g.resolve(a.data)})["catch"](function(){g.reject()}),g.promise}]}};a.when("/items",{controller:"ContentController as Content",templateUrl:"content.html",resolve:h(d.SUBSCRIPTIONS),type:d.SUBSCRIPTIONS}).when("/items/starred",{controller:"ContentController as Content",templateUrl:"content.html",resolve:h(d.STARRED),type:d.STARRED}).when("/items/feeds/:id",{controller:"ContentController as Content",templateUrl:"content.html",resolve:h(d.FEED),type:d.FEED}).when("/items/folders/:id",{controller:"ContentController as Content",templateUrl:"content.html",resolve:h(d.FOLDER),type:d.FOLDER}).when("/explore",{controller:"ExploreController as Explore",templateUrl:"explore.html",resolve:j(),type:d.EXPLORE}).when("/shortcuts",{templateUrl:"shortcuts.html",type:-1})}]),j.run(["$rootScope","$location","$http","$q","$interval","$route","Loading","ItemResource","FeedResource","FolderResource","SettingsResource","Publisher","BASE_URL","FEED_TYPE","REFRESH_RATE",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){g.setLoading("global",!0),l.subscribe(h).toChannels(["items","newestItemId","starred"]),l.subscribe(j).toChannels(["folders"]),l.subscribe(i).toChannels(["feeds"]),l.subscribe(k).toChannels(["settings"]);var p=d.defer();c.get(m+"/settings").success(function(a){l.publishAll(a),p.resolve()});var q=d.defer(),r=b.path();c.get(m+"/feeds/active").success(function(a){var c;switch(a.activeFeed.type){case n.FEED:c="/items/feeds/"+a.activeFeed.id;break;case n.FOLDER:c="/items/folders/"+a.activeFeed.id;break;case n.STARRED:c="/items/starred";break;case n.EXPLORE:c="/explore";break;default:c="/items"}/^\/items(\/(starred|explore|feeds\/\d+|folders\/\d+))?\/?$/.test(r)||b.path(c),q.resolve()});var s,t=d.defer();c.get(m+"/feeds").success(function(a){s=a,t.resolve()});var u,v=d.defer();c.get(m+"/folders").success(function(a){u=a,v.resolve()}),d.all([t.promise,v.promise]).then(function(){l.publishAll(s),l.publishAll(u),0===s.feeds.length&&0===u.folders.length&&b.path("/explore")}),d.all([p.promise,q.promise,t.promise,v.promise]).then(function(){f.reload(),g.setLoading("global",!1)}),e(function(){c.get(m+"/feeds").success(function(a){l.publishAll(a)}),c.get(m+"/folders").success(function(a){l.publishAll(a)})},1e3*o),a.$on("$routeChangeStart",function(){g.setLoading("content",!0)}),a.$on("$routeChangeSuccess",function(){g.setLoading("content",!1)}),a.$on("$routeChangeError",function(){b.path("/items")})}]),j.controller("AppController",["Loading","FeedResource","FolderResource",function(a,b,c){this.loading=a,this.isFirstRun=function(){return 0===b.size()&&0===c.size()},this.play=function(a){this.playingItem=a}}]),j.controller("ContentController",["Publisher","FeedResource","ItemResource","SettingsResource","data","$route","$routeParams","$location","FEED_TYPE","ITEM_AUTO_PAGE_SIZE","Loading",function(a,b,c,d,e,f,g,h,j,k,l){c.clear(),a.publishAll(e),this.isAutoPagingEnabled=!0,c.size()>=k?this.isNothingMoreToAutoPage=!1:this.isNothingMoreToAutoPage=!0,this.getItems=function(){return c.getAll()},this.toggleStar=function(a){c.toggleStar(a)},this.toggleItem=function(a){this.isCompactView()&&(a.show=!a.show)},this.isShowAll=function(){return d.get("showAll")},this.markRead=function(a){var d=c.get(a);d.keepUnread||d.unread!==!0||(c.markItemRead(a),b.markItemOfFeedRead(d.feedId))},this.getFeed=function(a){return b.getById(a)},this.toggleKeepUnread=function(a){var d=c.get(a);d.unread||(b.markItemOfFeedUnread(d.feedId),c.markItemRead(a,!1)),d.keepUnread=!d.keepUnread};var m=this,n=function(){var a=d.get("oldestFirst");if(m.isFeed()){var c=b.getById(g.id);c&&1===c.ordering?a=!0:c&&2===c.ordering&&(a=!1)}return a};this.orderBy=function(){return n()?"id":"-id"},this.isCompactView=function(){return d.get("compact")},this.isCompactExpand=function(){return d.get("compactExpand")},this.autoPagingEnabled=function(){return this.isAutoPagingEnabled},this.markReadEnabled=function(){return!d.get("preventReadOnScroll")},this.scrollRead=function(a){var d=[],e=[];a.forEach(function(a){var b=c.get(a);b.keepUnread||(d.push(a),e.push(b.feedId))}),d.length>0&&(b.markItemsOfFeedsRead(e),c.markItemsRead(d))},this.isFeed=function(){return f.current.$$route.type===j.FEED},this.autoPage=function(){if(!this.isNothingMoreToAutoPage){if(!this.isAutoPagingEnabled)return void(this.autoPageAgain=!0);this.isAutoPagingEnabled=!1,this.autoPageAgain=!1;var b=f.current.$$route.type,e=g.id,i=n(),j=d.get("showAll"),m=this,o=h.search().search;l.setLoading("autopaging",!0),c.autoPage(b,e,i,j,o).success(function(b){a.publishAll(b),b.items.length>=k?m.isAutoPagingEnabled=!0:m.isNothingMoreToAutoPage=!0,m.isAutoPagingEnabled&&m.autoPageAgain&&m.autoPage()}).error(function(){m.isAutoPagingEnabled=!0})["finally"](function(){l.setLoading("autopaging",!1)})}},this.getRelativeDate=function(a){if(a!==i&&""!==a){var b=d.get("language"),c=moment.unix(a).locale(b).fromNow()+"";return c}return""},this.refresh=function(){f.reload()},this.getMediaType=function(a){return a&&0===a.indexOf("audio")?"audio":a&&0===a.indexOf("video")?"video":i}}]),j.controller("ExploreController",["sites","$rootScope","FeedResource","SettingsResource","$location",function(a,b,c,d,e){this.sites=a,this.feeds=Object.keys(a).map(function(b){return[b,a[b]]}).reduce(function(a,b){var c=b[0],d=b[1];return d.forEach(function(a){a.category=c}),a.concat(d)},[]),this.feedExists=function(a){return c.getByLocation(a)!==i},this.subscribeTo=function(a){b.$broadcast("addFeed",a)},this.isCategoryShown=function(a){return a.filter(function(a){return c.getByLocation(a.feed)===i}).length>0},this.getSupportedLanguageCodes=function(){return d.getSupportedLanguageCodes()},this.getCurrentLanguageCode=function(){var a=e.search().lang;return a||(a=d.get("language")),a},this.showLanguage=function(a){e.url("/explore/?lang="+a)},this.selectedLanguageCode=this.getCurrentLanguageCode()}]),j.controller("NavigationController",["$route","FEED_TYPE","FeedResource","FolderResource","ItemResource","SettingsResource","Publisher","$rootScope","$location","$q",function(a,b,c,d,e,f,g,h,j,k){this.feedError="",this.showNewFolder=!1,this.renamingFolder=!1,this.addingFeed=!1,this.addingFolder=!1,this.folderError="",this.renameError="",this.feed={};var l=function(){return parseInt(a.current.params.id,10)};this.getLanguageCode=function(){return f.get("language")},this.getFeeds=function(){return c.getAll()},this.getFolders=function(){return d.getAll()},this.markFolderRead=function(a){c.markFolderRead(a),c.getByFolderId(a).forEach(function(a){e.markFeedRead(a.id)})},this.markFeedRead=function(a){e.markFeedRead(a),c.markFeedRead(a)},this.markRead=function(){e.markRead(),c.markRead()},this.isShowAll=function(){return f.get("showAll")},this.getFeedsOfFolder=function(a){return c.getByFolderId(a)},this.getUnreadCount=function(){return c.getUnreadCount()},this.isUnread=function(){return this.getUnreadCount()>0},this.getFeedUnreadCount=function(a){var b=c.getById(a);return b!==i?b.unreadCount:0},this.isFeedUnread=function(a){return this.getFeedUnreadCount(a)>0},this.getFolderUnreadCount=function(a){return c.getFolderUnreadCount(a)},this.isFolderUnread=function(a){return this.getFolderUnreadCount(a)>0},this.getStarredCount=function(){return e.getStarredCount()},this.isStarredUnread=function(){return this.getStarredCount()>0},this.toggleFolder=function(a){d.toggleOpen(a)},this.hasFeeds=function(a){return c.getFolderUnreadCount(a)!==i},this.subFeedActive=function(d){var e=a.current.$$route.type;if(e===b.FEED){var f=c.getById(l());if(f!==i&&f.folderId===d)return!0}return!1},this.isSubscriptionsActive=function(){return a.current&&a.current.$$route.type===b.SUBSCRIPTIONS},this.isStarredActive=function(){return a.current&&a.current.$$route.type===b.STARRED},this.isExploreActive=function(){return a.current&&a.current.$$route.type===b.EXPLORE},this.isFolderActive=function(c){return a.current&&a.current.$$route.type===b.FOLDER&&l()===c},this.isFeedActive=function(c){return a.current&&a.current.$$route.type===b.FEED&&l()===c},this.folderNameExists=function(a){return a=a||"",d.get(a.trim())!==i},this.feedUrlExists=function(a){return a=a||"",a=a.trim(),c.get(a)!==i||c.get("http://"+a)!==i},this.createFeed=function(a){var b=this;this.showNewFolder=!1,this.addingFeed=!0;var e=a.newFolder,f=a.existingFolder||{id:0};e===i||""===e?(f.getsFeed=!0,c.create(a.url,f.id,i).then(function(a){g.publishAll(a),j.path("/items/feeds/"+a.feeds[0].id+"/")})["finally"](function(){f.getsFeed=i,a.url="",b.addingFeed=!1})):d.create(e).then(function(c){g.publishAll(c),a.existingFolder=d.get(c.folders[0].name),a.newFolder=i,b.createFeed(a)})},this.createFolder=function(a){var b=this;this.addingFolder=!0,d.create(a.name).then(function(a){g.publishAll(a)})["finally"](function(){b.addingFolder=!1,a.name=""})},this.moveFeed=function(b,d){var e=!1,f=c.getById(b);f.folderId!==d&&((this.isFolderActive(f.folderId)||this.isFolderActive(d))&&(e=!0),c.move(b,d),e&&a.reload())},this.renameFeed=function(a){c.patch(a.id,{title:a.title}),a.editing=!1},this.renameFolder=function(a,b){a.renameError="",this.renamingFolder=!0;var c=this;a.name===b?(a.renameError="",a.editing=!1,this.renamingFolder=!1):d.rename(a.name,b).then(function(){a.renameError="",a.editing=!1},function(b){a.renameError=b})["finally"](function(){c.renamingFolder=!1})},this.reversiblyDeleteFeed=function(b){c.reversiblyDelete(b.id)["finally"](function(){a.reload()})},this.undoDeleteFeed=function(b){c.undoDelete(b.id)["finally"](function(){a.reload()})},this.deleteFeed=function(a){c["delete"](a.url)},this.reversiblyDeleteFolder=function(b){k.all(c.reversiblyDeleteFolder(b.id),d.reversiblyDelete(b.name))["finally"](function(){a.reload()})},this.undoDeleteFolder=function(b){k.all(c.undoDeleteFolder(b.id),d.undoDelete(b.name))["finally"](function(){a.reload()})},this.deleteFolder=function(a){c.deleteFolder(a.id),d["delete"](a.name)},this.setOrdering=function(b,d){c.patch(b.id,{ordering:d}),a.reload()},this.togglePinned=function(a){var b=c.getById(a);return b?c.patch(a,{pinned:!b.pinned}):void 0},this.setUpdateMode=function(a,b){return c.patch(a,{updateMode:b})},this.toggleFullText=function(b){h.$broadcast("$routeChangeStart"),c.toggleFullText(b.id)["finally"](function(){h.$broadcast("$routeChangeSuccess"),a.reload()})},this.search=function(a){""===a?j.search("search",null):j.search("search",a)};var m=this;h.$on("moveFeedToFolder",function(a,b){m.moveFeed(b.feedId,b.folderId)});var n=function(){var e;a.current&&(e=a.current.$$route.type);var f=0;if(e===b.FOLDER)f=l();else if(e===b.FEED){var g=c.getById(l());g&&(f=g.folderId)}var h;0!==f&&(h=d.getById(f)),m.feed.existingFolder=h};h.$on("$routeChangeSuccess",function(){n()})}]),j.controller("SettingsController",["$route","$q","SettingsResource","ItemResource","OPMLParser","OPMLImporter","Publisher",function(a,b,c,d,e,f,g){this.isOPMLImporting=!1,this.isArticlesImporting=!1,this.opmlImportError=!1,this.articleImportError=!1;var h=function(b,d){c.set(b,d),["showAll","oldestFirst","compact"].indexOf(b)>=0&&a.reload()};this.toggleSetting=function(a){h(a,!this.getSetting(a))},this.getSetting=function(a){return c.get(a)},this.importOPML=function(a){this.opmlImportError=!1,this.articleImportError=!1;try{this.isOPMLImporting=!1;var b=e.parse(a),c=this,d=5;f.importFolders(b).then(function(a){return f.importFeedQueue(a,d)})["finally"](function(){c.isOPMLImporting=!1})}catch(g){console.error(g),this.isOPMLImporting=!1,this.opmlImportError=!0}},this.importArticles=function(a){this.opmlImportError=!1,this.articleImportError=!1;try{this.isArticlesImporting=!0;var b=JSON.parse(a),c=this;d.importArticles(b).success(function(a){g.publishAll(a)})["finally"](function(){c.isArticlesImporting=!1})}catch(e){console.error(e),this.articleImportError=!0,this.isArticlesImporting=!1}}}]),j.filter("trustUrl",["$sce",function(a){return function(b){return a.trustAsResourceUrl(b)}}]),j.filter("unreadCountFormatter",function(){return function(a){return a>999?"999+":a}}),j.factory("FeedResource",["Resource","$http","BASE_URL","$q",function(a,b,c,d){var e=function(b,c,d){a.call(this,b,c,"url"),this.ids={},this.locations={},this.unreadCount=0,this.folderUnreadCount={},this.folderIds={},this.$q=d};return e.prototype=Object.create(a.prototype),e.prototype.receive=function(b){a.prototype.receive.call(this,b),this.updateUnreadCache(),this.updateFolderCache()},e.prototype.clear=function(){a.prototype.clear.call(this),this.unreadCount=0,this.folderUnreadCount={},this.folderIds={},this.ids={},this.locations={}},e.prototype.updateUnreadCache=function(){this.unreadCount=0,this.folderUnreadCount={};var a=this;this.values.forEach(function(b){b.unreadCount&&(a.unreadCount+=b.unreadCount),b.folderId!==i&&(a.folderUnreadCount[b.folderId]=a.folderUnreadCount[b.folderId]||0,a.folderUnreadCount[b.folderId]+=b.unreadCount)})},e.prototype.updateFolderCache=function(){this.folderIds={};var a=this;this.values.forEach(function(b){a.folderIds[b.folderId]=a.folderIds[b.folderId]||[],a.folderIds[b.folderId].push(b)})},e.prototype.add=function(b){a.prototype.add.call(this,b),b.id!==i&&(this.ids[b.id]=this.hashMap[b.url]),b.location!==i&&(this.locations[b.location]=this.hashMap[b.url])},e.prototype.markRead=function(){this.values.forEach(function(a){a.unreadCount=0}),this.updateUnreadCache()},e.prototype.markFeedRead=function(a){this.ids[a].unreadCount=0,this.updateUnreadCache()},e.prototype.markFolderRead=function(a){this.values.forEach(function(b){b.folderId===a&&(b.unreadCount=0)}),this.updateUnreadCache()},e.prototype.markItemOfFeedRead=function(a){this.ids[a].unreadCount-=1,this.updateUnreadCache()},e.prototype.markItemsOfFeedsRead=function(a){var b=this;a.forEach(function(a){b.ids[a].unreadCount-=1}),this.updateUnreadCache()},e.prototype.markItemOfFeedUnread=function(a){this.ids[a].unreadCount+=1,this.updateUnreadCache()},e.prototype.getUnreadCount=function(){return this.unreadCount},e.prototype.getFolderUnreadCount=function(a){return this.folderUnreadCount[a]},e.prototype.getByFolderId=function(a){return this.folderIds[a]||[]},e.prototype.getById=function(a){return this.ids[a]},e.prototype.getByLocation=function(a){return this.locations[a]},e.prototype.move=function(a,b){var c=this.getById(a);return c.folderId=b,this.updateFolderCache(),this.updateUnreadCache(),this.patch(a,{folderId:b})},e.prototype.create=function(a,b,c){a=a.trim(),a.startsWith("http")||(a="https://"+a),c!==i&&(c=c.trim());var d={url:a,folderId:b||0,title:c||a,unreadCount:0};this.add(d),this.updateFolderCache();var e=this.$q.defer();return this.http({method:"POST",url:this.BASE_URL+"/feeds",data:{url:a,parentFolderId:b||0,title:c}}).success(function(a){e.resolve(a)}).error(function(a){d.faviconLink="",d.error=a.message,e.reject()}),e.promise},e.prototype.reversiblyDelete=function(a,b,c){var d=this.getById(a);return d&&c!==!0&&(d.deleted=!0),b!==!1&&this.updateUnreadCache(),this.http["delete"](this.BASE_URL+"/feeds/"+a)},e.prototype.reversiblyDeleteFolder=function(a){var b=this,c=[];this.getByFolderId(a).forEach(function(a){c.push(b.reversiblyDelete(a.id,!1,!0))}),this.updateUnreadCache();var d=this.$q.all(c);return d.promise},e.prototype["delete"]=function(b,c){var d=this.get(b);return d!==i&&d.id&&delete this.ids[d.id],d!==i&&d.location&&delete this.locations[d.location],a.prototype["delete"].call(this,b),c!==!1&&(this.updateUnreadCache(),this.updateFolderCache()),d},e.prototype.deleteFolder=function(a){var b=this;this.getByFolderId(a).forEach(function(a){b["delete"](a.url,!1)}),this.updateUnreadCache(),this.updateFolderCache()},e.prototype.undoDelete=function(a,b){var c=this.getById(a);return c&&(c.deleted=!1),b!==!1&&this.updateUnreadCache(),this.http.post(this.BASE_URL+"/feeds/"+a+"/restore")},e.prototype.undoDeleteFolder=function(a){var b=this,c=[];this.getByFolderId(a).forEach(function(a){c.push(b.undoDelete(a.id,!1))}),this.updateUnreadCache();var d=this.$q.all(c);return d.promise},e.prototype.setOrdering=function(a,b){var c=this.getById(a);if(c){c.ordering=b;var d=this.BASE_URL+"/feeds/"+a;return this.http.patch(d,{ordering:b})}},e.prototype.setPinned=function(a,b){var c=this.getById(a);if(c){c.pinned=b;var d=this.BASE_URL+"/feeds/"+a;return this.http.patch(d,{pinned:b})}},e.prototype.patch=function(a,b){var c=this.getById(a);if(c){Object.keys(b).forEach(function(a){c[a]=b[a]});var d=this.BASE_URL+"/feeds/"+a;return this.http.patch(d,b)}},e.prototype.toggleFullText=function(a){var b=this.getById(a);return this.patch(a,{fullTextEnabled:!b.fullTextEnabled})},new e(b,c,d)}]),j.factory("FolderResource",["Resource","$http","BASE_URL","$q",function(a,b,c,d){var e=function(b,c,d){a.call(this,b,c,"name"),this.deleted=null,this.$q=d,this.ids={}};return e.prototype=Object.create(a.prototype),e.prototype.add=function(b){a.prototype.add.call(this,b),b.id!==i&&(this.ids[b.id]=this.hashMap[b.name])},e.prototype.clear=function(){a.prototype.clear.call(this),this.ids={}},e.prototype["delete"]=function(b){var c=this.get(b);return c!==i&&c.id&&delete this.ids[c.id],a.prototype["delete"].call(this,b),c},e.prototype.toggleOpen=function(a){var b=this.get(a);return b.opened=!b.opened,this.http({url:this.BASE_URL+"/folders/"+b.id+"/open",method:"POST",data:{folderId:b.id,open:b.opened}})},e.prototype.rename=function(a,b){var c=this.get(a),d=this.$q.defer(),e=this;return this.http({url:this.BASE_URL+"/folders/"+c.id+"/rename",method:"POST",data:{folderName:b}}).success(function(){c.name=b,delete e.hashMap[a],e.hashMap[b]=c,d.resolve()}).error(function(a){d.reject(a.message)}),d.promise},e.prototype.getById=function(a){return this.ids[a]},e.prototype.create=function(a){a=a.trim();var b={name:a};this.add(b);var c=this.$q.defer();return this.http({url:this.BASE_URL+"/folders",method:"POST",data:{folderName:a}}).success(function(a){c.resolve(a)}).error(function(a){b.error=a.message}),c.promise},e.prototype.reversiblyDelete=function(a){var b=this.get(a),c=b.id;return b.deleted=!0,this.http["delete"](this.BASE_URL+"/folders/"+c)},e.prototype.undoDelete=function(a){var b=this.get(a),c=b.id;return b.deleted=!1,this.http.post(this.BASE_URL+"/folders/"+c+"/restore")},new e(b,c,d)}]),j.factory("ItemResource",["Resource","$http","BASE_URL","ITEM_BATCH_SIZE",function(a,b,c,d){var e=function(b,c,d){a.call(this,b,c),this.batchSize=d,this.clear()};return e.prototype=Object.create(a.prototype),e.prototype.clear=function(){this.starredCount=0,this.lowestId=0,this.highestId=0,a.prototype.clear.call(this)},e.prototype.receive=function(b,c){switch(c){case"newestItemId":this.newestItemId=b;break;case"starred":this.starredCount=b;break;default:var d=this;b.forEach(function(a){0===d.lowestId&&(d.lowestId=a.id),0===d.highestId&&(d.highestId=a.id),a.id>d.highestId&&(d.highestId=a.id),a.id0){var h=f.pop(),j=h.url,k=h.title,l=0,m=h.folderName;if(m!==i&&b.get(m)!==i){var n=b.get(m);n.opened=!0,l=n.id,n.getsFeed=!0,n.getsFeedCounter=n.getsFeedCounter||0,n.getsFeedCounter+=1}j!==i&&a.get(j)===i&&a.create(j,l,k).then(function(a){c.publishAll(a)})["finally"](function(){0!==l&&(n.getsFeedCounter-=1,0===n.getsFeedCounter&&(n.getsFeed=!1)),e(f)})}else g.resolve();return g.promise};this.importFolders=function(a){var e=[],f=[];a.folders.forEach(function(a){if(a.name!==i){if(b.get(a.name)===i){var d=b.create(a.name).then(function(a){c.publishAll(a)});f.push(d)}a.feeds.forEach(function(b){b.folderName=a.name,e.push(b)})}}),e=e.concat(a.feeds);var g=d.defer();return d.all(f)["finally"](function(){g.resolve(e)}),g.promise},this.importFeedQueue=function(a,b){for(var c=d.defer(),f=[],g=0;b>g;g+=1)f.push(e(a));return d.all(f).then(function(){c.resolve()}),c.promise}}]),j.service("OPMLParser",function(){var a=function(a){var b=a.attr("xmlUrl")||a.attr("htmlUrl"),c=a.attr("title")||a.attr("text")||b;return b===i?{type:"folder",name:c,feeds:[]}:{type:"feed",name:c,url:b}},b=function(c,d,f){for(var g=0;g outline"),d={feeds:[],folders:[]};return b(c,d,!0)}}),j.service("Publisher",function(){this.channels={},this.subscribe=function(a){var b=this;return{toChannels:function(c){c.forEach(function(c){b.channels[c]=b.channels[c]||[],b.channels[c].push(a)})}}},this.publishAll=function(a){var b=this;Object.keys(a).forEach(function(c){var d=b.channels[c];d!==i&&d.forEach(function(b){b.receive(a[c],c)})})}}),j.factory("Resource",function(){var a=function(a,b,c){this.id=c||"id",this.values=[],this.hashMap={},this.http=a,this.BASE_URL=b};return a.prototype.receive=function(a){var b=this;a.forEach(function(a){b.add(a)})},a.prototype.add=function(a){var b=this.hashMap[a[this.id]];b===i?(this.values.push(a),this.hashMap[a[this.id]]=a):Object.keys(a).forEach(function(c){b[c]=a[c]})},a.prototype.size=function(){return this.values.length},a.prototype.get=function(a){return this.hashMap[a]},a.prototype["delete"]=function(a){var b=this,c=this.values.findIndex(function(c){return c[b.id]===a});c!==i&&this.values.splice(c,1),this.hashMap[a]!==i&&delete this.hashMap[a]},a.prototype.clear=function(){for(this.hashMap={};this.values.length>0;)this.values.pop()},a.prototype.getAll=function(){return this.values},a}),j.service("SettingsResource",["$http","BASE_URL",function(a,b){this.settings={language:"en",showAll:null,compact:!1,oldestFirst:null,preventReadOnScroll:!1,compactExpand:!1,exploreUrl:""},this.defaultLanguageCode="en",this.supportedLanguageCodes=["ar-ma","ar","bg","ca","cs","cv","da","de","el","en","en-ca","en-gb","eo","es","et","eu","fi","fr-ca","fr","gl","he","hi","hu","id","is","it","ja","ka","ko","lv","ms-my","nb","ne","nl","pl","pt-br","pt","ro","ru","sk","sl","sv","th","tr","tzm-la","tzm","uk","zh-cn","zh-tw"],this.getSupportedLanguageCodes=function(){return this.supportedLanguageCodes},this.receive=function(a){var b=this;Object.keys(a).forEach(function(c){var d=a[c];"language"===c&&(d=b.processLanguageCode(d)),b.settings[c]=d})},this.get=function(a){return this.settings[a]},this.set=function(c,d){return this.settings[c]=d,a({url:b+"/settings",method:"PUT",data:{language:this.settings.language,showAll:this.settings.showAll,compact:this.settings.compact,oldestFirst:this.settings.oldestFirst,compactExpand:this.settings.compactExpand,preventReadOnScroll:this.settings.preventReadOnScroll}})},this.processLanguageCode=function(a){return a=a.replace("_","-").toLowerCase(),this.supportedLanguageCodes.indexOf(a)<0&&(a=a.split("-")[0]),this.supportedLanguageCodes.indexOf(a)<0&&(a=this.defaultLanguageCode),a}}]),function(a,b,c,d,e,f){var g=a.location,h=a.localStorage,i=function(a,b,d){var e=c.isContentHandlerRegistered,f=function(a,b){return e?"new"!==e(a,b):h.getItem("registeredHandler")===b};c.registerContentHandler&&!f(a,b)&&(c.registerContentHandler(a,k,d),e||h.setItem("registeredHandler",b))},j=g.protocol+"//"+g.host+g.pathname,k=j+"?subscribe_to=%s",l="application/vnd.mozilla.maybe.feed",m="ownCloud News @ "+j;i(l,k,m),e(b).ready(function(){var a=d("?subscribe_to");if(a&&"undefined"!==a){e("#new-feed").show();var b=e('input[ng-model="Navigation.feed.url"]');b.val(a),b.trigger("input"),setTimeout(function(){b.focus()},1e3)}})}(b,c,a,h,e),function(a,b){a.addEventListener("beforeunload",function(){var a=b.querySelector("#app-content");a.scrollTo(0,0)})}(b,c),function(a,b,c){var d=function(a){return!(a.is("input")||a.is("select")||a.is("textarea")||a.is("checkbox"))},e=function(a){return!(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey)},f=function(a){var b=".active > .app-navigation-entry-menu .mark-read button",c=a.find(b);c.length>0&&c.trigger("click")},g=function(a,b){var c=a.offset().top-b.offset().top,d=c+a.height(),e=b.height();return c>=0&&e>d},h=function(a,b,c){0===a.length||!c&&g(a,b)||b.scrollTop(a.offset().top-b.offset().top+b.scrollTop())},i=function(a){var b=a.find(".active");h(b,a.children("ul"),!0)},j=function(a){a.find(".active > a:visible").trigger("click")},k=function(a,b){if(0===b.scrollTop()){var c=b.find(".pull-to-refresh");c.hasClass("show-pull-to-refresh")?c.hasClass("done")&&j(a):c.addClass("show-pull-to-refresh")}},l=function(a,b){a.children("a:visible").trigger("click"),h(a,b.children("ul"))},m=function(a){var b=a.find(".active"),d=a.find(".explore-feed,.subscriptions-feed:visible,.starred-feed:visible,.feed:visible");if(b.hasClass("folder"))for(;b.length>0;){var e=b.find(".feed:visible");if(e.length>0)return void l(c(e[0]),a);b=b.next(".folder")}else for(var f=0;f0&&l(c(e[d]),a)},p=function(a){var b=a.find(".active");if(b.hasClass("folder"))l(b.prevAll(".folder:visible").first(),a);else if(b.hasClass("feed")){var c=n(b);c.length>0?l(c,a):o(a,!0)}else o(a,!0)},q=function(a){var b=a.find(".active");if(b.hasClass("folder"))l(b.nextAll(".folder:visible").first(),a);else if(b.hasClass("feed")){var c=n(b);c.length>0?l(c.nextAll(".folder:visible").first(),a):o(a)}else o(a)},r=function(a){var b=a.find(".active"),d=a.find(".explore-feed,.subscriptions-feed:visible,.starred-feed:visible,.feed:visible");if(b.hasClass("folder")){for(var e=b.prev(".folder");e.length>0;){var f=e.find(".feed:visible");if(f.length>0)return void l(c(f[f.length-1]),a);e=e.prev(".folder")}var g=b.siblings(".feed");if(g.length>0)return void l(c(g[g.length-1]),a);var h=c(".starred-feed:visible");return void(h.length>0&&l(h,a))}for(var i=d.length-1;i>0;i-=1){var j=d[i];if(j===b[0]){var k=d[i-1];l(c(k),a);break}}},s=function(a,b){var d=a.find(".item");d.each(function(a,d){return d=c(d),d.height()+d.position().top>30?(b(d),!1):void 0})},t=function(a){s(a,function(a){a.find(".toggle-keep-unread").trigger("click")})},u=function(a){s(a,function(a){a.find(".star").trigger("click")})},v=function(a){s(a,function(a){a.find(".utils").trigger("click")})},w=function(b){s(b,function(b){b.trigger("click"),a.open(b.find(".external:visible").attr("href"),"_blank")})},x=function(a,b,c){a.scrollTop(b.offset().top-a.offset().top+a.scrollTop()),c&&s(a,function(a){a.hasClass("open")||a.find(".utils").trigger("click")})},y=function(a,b){var d=a.find(".item"),e=!1;d.each(function(d,f){return f=c(f),0===f.position().top&&b&&!f.hasClass("open")||f.position().top>10?(x(a,f,b),e=!0,!1):void 0}),e||a.scrollTop(a.prop("scrollHeight"))},z=function(a,b,d){var e=b.find(".item"),f=!1;e.each(function(e,g){if(g=c(g),g.position().top+10>=0){var h=g.prev();return h.length>0?x(b,h,d):(k(a,b),b.scrollTop(0)),f=!0,!1}}),!f&&e.length>0&&x(b,e.last())};c(b).keyup(function(a){var b=a.keyCode,g=c("#app-content"),h=c("#app-navigation"),l=c("#articles.compact").length>0,n="true"===c("#articles").attr("news-compact-expand"),o=l&&n;d(c(":focus"))&&e(a)?[74,78,39].indexOf(b)>=0?(a.preventDefault(),y(g,o)):[75,80,37].indexOf(b)>=0?(a.preventDefault(),z(h,g,o)):[85].indexOf(b)>=0?(a.preventDefault(),t(g)):[69].indexOf(b)>=0?(a.preventDefault(),v(g)):[73,83,76].indexOf(b)>=0?(a.preventDefault(),u(g)):[72].indexOf(b)>=0?(a.preventDefault(),u(g),y(g)):[79].indexOf(b)>=0?(a.preventDefault(),w(g)):[82].indexOf(b)>=0?(a.preventDefault(),j(h)):[70].indexOf(b)>=0?(a.preventDefault(),m(h)):[68].indexOf(b)>=0?(a.preventDefault(),r(h)):[67].indexOf(b)>=0?(a.preventDefault(),p(h)):[65].indexOf(b)>=0?(a.preventDefault(),i(h)):[86].indexOf(b)>=0?(a.preventDefault(),q(h)):[81].indexOf(b)>=0?(a.preventDefault(), c("#searchbox").focus()):[33].indexOf(b)>=0&&k(h,g):d(c(":focus"))&&a.shiftKey&&[65].indexOf(b)>=0&&(a.preventDefault(),f(h))})}(b,c,e),b.News=b.News||{},function(a,b,c,d,e){var f=[];d.addArticleAction=function(a){f.push(a)},d.getArticleActionPlugins=function(){return f}}(b,c,jQuery,b.News),j.run(["$document","$rootScope",function(a,b){a.click(function(a){b.$broadcast("documentClicked",a)})}]),j.directive("appNavigationEntryUtils",function(){return{restrict:"C",link:function(a,b){var c=b.siblings(".app-navigation-entry-menu"),d=e(b).find(".app-navigation-entry-utils-menu-button button");d.click(function(){c.toggleClass("open")}),a.$on("documentClicked",function(a,b){b.target!==d[0]&&c.removeClass("open")})}}}),j.directive("newsAddFeed",["$rootScope","$timeout",function(a,b){return{restrict:"A",link:function(c,d){a.$on("addFeed",function(a,e){b(function(){d.is(":animated")?(d.stop(!0,!0),d.show()):d.is(":visible")||d.slideDown(),d.find('[ng-model="Navigation.feed.url"]').focus()}),c.Navigation.feed.url=e})}}}]),j.directive("newsArticleActions",function(){return{restrict:"A",scope:{newsArticleActions:"=",noPlugins:"="},link:function(a,b){for(var c=News.getArticleActionPlugins(),d=0;d=0;g-=1){var h=e(f[g]);if(d>=a)break;if(h.position().top<0){c.$apply(c.newsScrollAutoPage);break}d+=1}},h=function(a,b,c){if(a){var d=[],f=b.find(".item:not(.read)");f.each(function(a,b){var c=e(b);return c.position().top<=-10?void d.push(parseInt(c.data("id"),10)):!1}),c.itemIds=d,c.$apply(c.newsScrollMarkRead)}};return{restrict:"A",scope:{newsScroll:"@",newsScrollAutoPage:"&",newsScrollMarkRead:"&",newsScrollEnabledMarkRead:"="},link:function(j,k){var l=!0,m=k;j.newsScroll&&(m=e(j.newsScroll));var n=function(){l&&(l=!1,a(function(){l=!0},1e3*d),g(b,k,j),f&&a.cancel(f),f=a(function(){h(j.newsScrollEnabledMarkRead,k,j),f=i},1e3*c))};m.on("scroll",n),j.$on("$destroy",function(){m.off("scroll",n)})}}}]),j.directive("newsSearch",["$document","$location",function(a,b){return{restrict:"E",scope:{onSearch:"="},link:function(a){var c=e("#searchbox");c.val(b.search().search);var d=function(){var b=c.val();a.$apply(function(){a.onSearch(b)})};c.on("search keyup",function(a){("search"===a.type||13===a.keyCode)&&d()}),a.$watch(function(){return b.search()},function(a){a&&a.search?c.val(a.search):c.val("")})}}}]),j.directive("newsStickyMenu",function(){return function(a,b,c){var d=40;e(c.newsStickyMenu).scroll(function(){var a=e(this).scrollTop();a>d?(b.addClass("fixed"),b.css("top",a)):b.removeClass("fixed")})}}),j.directive("newsStopPropagation",function(){return{restrict:"A",link:function(a,b){b.bind("click",function(a){a.stopPropagation()})}}}),j.directive("newsTimeout",["$timeout","$rootScope",function(a,b){return{restrict:"A",scope:{newsTimeout:"&"},link:function(c,d){var e=!1,f=7,g=a(c.newsTimeout,1e3*f);c.$on("$destroy",function(){e=!0,a.cancel(g)}),b.$on("$locationChangeStart",function(){a.cancel(g),e||(e=!0,d.remove(),c.newsTimeout())})}}}]),j.directive("newsTitleUnreadCount",["$window",function(a){var b=a.document.title,c=b.split("-"),d=c[0]||"News",e=c[1]||"ownCloud";return{restrict:"E",scope:{unreadCount:"@"},link:function(b,c,f){f.$observe("unreadCount",function(b){"0"!==b?a.document.title=d+"("+b+") - "+e:a.document.title=d+" - "+e})}}}]),j.directive("newsToggleShow",function(){return{restrict:"A",scope:{newsToggleShow:"@"},link:function(a,b){b.click(function(){var b=e(a.newsToggleShow);b.toggle()})}}}),j.directive("newsTriggerClick",function(){return function(a,b,c){b.click(function(){e(c.newsTriggerClick).trigger("click")})}})}(navigator,window,document,angular,jQuery,OC,oc_requesttoken,url); //# sourceMappingURL=app.min.js.map \ No newline at end of file diff --git a/js/build/app.min.js.map b/js/build/app.min.js.map index eac319ae3..a223cfe02 100644 --- a/js/build/app.min.js.map +++ b/js/build/app.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["app.js"],"names":["navigator","window","document","angular","$","OC","csrfToken","url","undefined","app","module","config","$routeProvider","$provide","$httpProvider","feedType","FEED","FOLDER","STARRED","SUBSCRIPTIONS","SHARED","EXPLORE","constant","generateUrl","factory","$q","BASE_URL","$window","request","domain","location","href","split","pathname","indexOf","headers","requesttoken","when","errorMessages",0,"t",401,403,412,500,503,"$timeout","timer","responseError","response","status","cancel","Notification","hide","showHtml","reject","interceptors","push","getItemResolve","type","data","$http","$route","$location","ITEM_BATCH_SIZE","FEED_TYPE","SettingsResource","FeedResource","showAll","get","oldestFirst","search","deferred","defer","resolve","parameters","limit","current","params","id","feed","getById","ordering","method","success","promise","getExploreResolve","sites","Publisher","language","lang","then","publishAll","replace","exploreUrl","defaultExploreUrl","controller","templateUrl","run","$rootScope","$interval","Loading","ItemResource","FolderResource","REFRESH_RATE","setLoading","subscribe","toChannels","settingsDeferred","activeFeedDeferred","path","activeFeed","test","feeds","feedDeferred","folders","folderDeferred","all","length","reload","$on","this","loading","isFirstRun","size","play","item","playingItem","$routeParams","ITEM_AUTO_PAGE_SIZE","clear","isAutoPagingEnabled","isNothingMoreToAutoPage","getItems","getAll","toggleStar","itemId","toggleItem","isCompactView","show","isShowAll","markRead","keepUnread","unread","markItemRead","markItemOfFeedRead","feedId","getFeed","toggleKeepUnread","markItemOfFeedUnread","self","getOrdering","isFeed","orderBy","isCompactExpand","autoPagingEnabled","markReadEnabled","scrollRead","itemIds","ids","feedIds","forEach","markItemsOfFeedsRead","markItemsRead","$$route","autoPage","autoPageAgain","items","error","getRelativeDate","timestamp","languageCode","date","moment","unix","locale","fromNow","refresh","getMediaType","Object","keys","map","key","reduce","xs","x","category","feedList","concat","feedExists","getByLocation","subscribeTo","$broadcast","isCategoryShown","filter","element","getSupportedLanguageCodes","getCurrentLanguageCode","showLanguage","selectedLanguageCode","feedError","showNewFolder","renamingFolder","addingFeed","addingFolder","folderError","renameError","getRouteId","parseInt","getLanguageCode","getFeeds","getFolders","markFolderRead","folderId","getByFolderId","markFeedRead","getFeedsOfFolder","getUnreadCount","isUnread","getFeedUnreadCount","unreadCount","isFeedUnread","getFolderUnreadCount","isFolderUnread","getStarredCount","isStarredUnread","toggleFolder","folderName","toggleOpen","hasFeeds","subFeedActive","isSubscriptionsActive","isStarredActive","isExploreActive","isFolderActive","isFeedActive","folderNameExists","trim","feedUrlExists","createFeed","newFolder","existingFolder","getsFeed","create","name","createFolder","folder","moveFeed","move","renameFeed","patch","title","editing","renameFolder","rename","message","reversiblyDeleteFeed","reversiblyDelete","undoDeleteFeed","undoDelete","deleteFeed","reversiblyDeleteFolder","undoDeleteFolder","deleteFolder","setOrdering","togglePinned","pinned","setUpdateMode","updateMode","toggleFullText","value","scope","setSelectedFolderForRoute","OPMLParser","OPMLImporter","isOPMLImporting","isArticlesImporting","opmlImportError","articleImportError","set","toggleSetting","getSetting","importOPML","content","parsedContent","parse","jobSize","importFolders","feedQueue","importFeedQueue","console","importArticles","articles","JSON","$sce","trustAsResourceUrl","Resource","call","locations","folderUnreadCount","folderIds","prototype","receive","updateUnreadCache","updateFolderCache","values","add","hashMap","startsWith","http","parentFolderId","faviconLink","updateCache","isFolder","deleted","promises","post","setPinned","isPinned","diff","fullTextEnabled","opened","open","toFolderName","batchSize","starredCount","lowestId","highestId","channel","newestItemId","getNewestItemId","star","isStarred","it","guidHash","starred","isRead","read","highestItemId","offset","json","service","global","autopaging","area","isLoading","startFeedJob","queue","pop","getsFeedCounter","folderPromises","jobPromises","i","parseOutline","outline","attr","recursivelyParse","level","root","firstLevel","entry","children","xml","parseXML","find","channels","obj","listeners","listener","objs","existing","deleteAtIndex","findIndex","splice","settings","compact","preventReadOnScroll","compactExpand","defaultLanguageCode","supportedLanguageCodes","processLanguageCode","toLowerCase","storage","localStorage","registerHandler","mime","registered","isContentHandlerRegistered","isRegistered","getItem","registerContentHandler","subscribeUrl","setItem","cleanUrl","protocol","host","mimeType","ready","subscription","decodeURIComponent","input","val","trigger","setTimeout","focus","addEventListener","querySelector","scrollTo","noInputFocused","is","noModifierKey","event","shiftKey","altKey","ctrlKey","metaKey","markAllRead","navigationArea","selector","button","isInScrollView","elem","scrollArea","elemTop","top","elemBottom","height","areaBottom","scrollToNavigationElement","toTop","scrollTop","scrollToActiveNavigationEntry","reloadFeed","tryReload","pullToRefresh","hasClass","addClass","activateNavigationEntry","nextFeed","elements","subfeeds","next","getParentFolder","parent","selectFirstOrLastFolder","isLast","index","previousFolder","prevAll","first","parentFolder","nextFolder","nextAll","previousFeed","prev","siblings","previous","onActiveItem","callback","each","position","toggleUnread","expandItem","openLink","scrollToItem","expandItemInCompact","scrollToNextItem","jumped","prop","scrollToPreviousItem","last","keyup","keyCode","isExpandItem","preventDefault","News","exports","articleActionPlugins","addArticleAction","action","getArticleActionPlugins","jQuery","$document","click","directive","restrict","link","elm","menu","toggleClass","target","removeClass","_","stop","slideDown","Navigation","newsArticleActions","noPlugins","plugins","attrs","toFocus","newsAutoFocus","$watch","newsBindHtmlUnsafe","html","$eval","options","newsDraggable","isDefined","draggable","$observe","details","accept","hoverClass","greedy","drop","ui","$apply","droppable","on","newsFinishedTransition","$interpolate","toReadd","newsFocus","notification","args","pause","scrolled","newsPullToRefresh","change","file","files","reader","FileReader","onload","$fileContent","result","newsReadFile","readAsText","masonry","itemSelector","gutter","columnWidth","$last","MARK_READ_TIMEOUT","SCROLL_TIMEOUT","counter","newsScrollAutoPage","enabled","article","newsScrollMarkRead","newsScroll","newsScrollEnabledMarkRead","allowScroll","scrollHandler","off","onSearch","box","doSearch","newsStickyMenu","scroll","scrollHeight","css","bind","stopPropagation","newsTimeout","destroyed","seconds","remove","baseTitle","titles","appName","ownCloudName","newsToggleShow","toggle","newsTriggerClick","oc_requesttoken"],"mappings":"CAAA,SAAUA,EAAWC,EAAQC,EAAUC,EAASC,EAAGC,EAAIC,EAAWC,EAAKC,GAEvE,YAIA,IAAIC,GAAMN,EAAQO,OAAO,QAAS,UAAW,aAAc,aAC3DD,GAAIE,QAAQ,iBAAkB,WAAY,gBAAiB,SAAUC,EAAgBC,EAAUC,GAG3F,GAAIC,IACAC,KAAM,EACNC,OAAQ,EACRC,QAAS,EACTC,cAAe,EACfC,OAAQ,EACRC,QAAS,EAIbR,GAASS,SAAS,eAAgB,IAClCT,EAASS,SAAS,kBAAmB,IAErCT,EAASS,SAAS,sBAAuB,IACzCT,EAASS,SAAS,WAAYjB,EAAGkB,YAAY,eAC7CV,EAASS,SAAS,YAAaP,GAC/BF,EAASS,SAAS,oBAAqB,IACvCT,EAASS,SAAS,iBAAkB,IAGpCT,EAASW,QAAQ,mBAAoB,KAAM,WAAY,UAAW,SAAUC,EAAIC,EAAUC,GACtF,OACIC,QAAS,SAAUjB,GACf,GAAIkB,GACAF,EAAQG,SAASC,KAAKC,MAAML,EAAQG,SAASG,UAAU,EAM3D,QALqC,IA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DA,GAAY,EACZnX,EAAQqX,SACRzS,EAAMsS,sBAM1B5iB,EAAI2d,UAAU,wBAAyB,UAAW,SAAUzc,GAGxD,GAAI8hB,GAAY9hB,EAAQzB,SAASyP,MAC7B+T,EAASD,EAAUzhB,MAAM,KACzB2hB,EAAUD,EAAO,IAAM,OACvBE,EAAeF,EAAO,IAAM,UAEhC,QACIrF,SAAU,IACVtN,OACInD,YAAa,KAEjB0Q,KAAM,SAAUvN,EAAOsJ,EAAM8E,GACzBA,EAAMW,SAAS,cAAe,SAAUhP,GACtB,MAAVA,EACAnP,EAAQzB,SAASyP,MAAQgU,EACrB,IAAM7S,EAAQ,OAAS8S,EAE3BjiB,EAAQzB,SAASyP,MAAQgU,EAAU,MAAQC,SAO/DnjB,EAAI2d,UAAU,iBAAkB,WAE5B,OACIC,SAAU,IACVtN,OACI8S,eAAkB,KAEtBvF,KAAM,SAAUvN,EAAOsJ,GACnBA,EAAK8D,MAAM,WACP,GAAIO,GAASte,EAAE2Q,EAAM8S,eACrBnF,GAAOoF,eAMvBrjB,EAAI2d,UAAU,mBAAoB,WAG9B,MAAO,UAAUrN,EAAOwN,EAAKpI,GACzBoI,EAAIJ,MAAM,WACN/d,EAAE+V,EAAK4N,kBAAkB7K,QAAQ,eAM1ClZ,UAAWC,OAAQC,SAAUC,QAAS8d,OAAS5d,GAAI2jB,gBAAiBzjB","file":"app.min.js"} \ No newline at end of file +{"version":3,"sources":["app.js"],"names":["navigator","window","document","angular","$","OC","csrfToken","url","undefined","app","module","config","$routeProvider","$provide","$httpProvider","feedType","FEED","FOLDER","STARRED","SUBSCRIPTIONS","SHARED","EXPLORE","constant","generateUrl","factory","$q","BASE_URL","$window","request","domain","location","href","split","pathname","indexOf","headers","requesttoken","when","errorMessages",0,"t",401,403,412,500,503,"$timeout","timer","responseError","response","status","cancel","Notification","hide","showHtml","reject","interceptors","push","getItemResolve","type","data","$http","$route","$location","ITEM_BATCH_SIZE","FEED_TYPE","SettingsResource","FeedResource","showAll","get","oldestFirst","search","deferred","defer","resolve","parameters","limit","current","params","id","feed","getById","ordering","method","success","promise","getExploreResolve","sites","Publisher","language","lang","then","publishAll","replace","exploreUrl","defaultExploreUrl","controller","templateUrl","run","$rootScope","$interval","Loading","ItemResource","FolderResource","REFRESH_RATE","setLoading","subscribe","toChannels","settingsDeferred","activeFeedDeferred","path","activeFeed","test","feeds","feedDeferred","folders","folderDeferred","all","length","reload","$on","this","loading","isFirstRun","size","play","item","playingItem","$routeParams","ITEM_AUTO_PAGE_SIZE","clear","isAutoPagingEnabled","isNothingMoreToAutoPage","getItems","getAll","toggleStar","itemId","toggleItem","isCompactView","show","isShowAll","markRead","keepUnread","unread","markItemRead","markItemOfFeedRead","feedId","getFeed","toggleKeepUnread","markItemOfFeedUnread","self","getOrdering","isFeed","orderBy","isCompactExpand","autoPagingEnabled","markReadEnabled","scrollRead","itemIds","ids","feedIds","forEach","markItemsOfFeedsRead","markItemsRead","$$route","autoPage","autoPageAgain","items","error","getRelativeDate","timestamp","languageCode","date","moment","unix","locale","fromNow","refresh","getMediaType","Object","keys","map","key","reduce","xs","x","category","feedList","concat","feedExists","getByLocation","subscribeTo","$broadcast","isCategoryShown","filter","element","getSupportedLanguageCodes","getCurrentLanguageCode","showLanguage","selectedLanguageCode","feedError","showNewFolder","renamingFolder","addingFeed","addingFolder","folderError","renameError","getRouteId","parseInt","getLanguageCode","getFeeds","getFolders","markFolderRead","folderId","getByFolderId","markFeedRead","getFeedsOfFolder","getUnreadCount","isUnread","getFeedUnreadCount","unreadCount","isFeedUnread","getFolderUnreadCount","isFolderUnread","getStarredCount","isStarredUnread","toggleFolder","folderName","toggleOpen","hasFeeds","subFeedActive","isSubscriptionsActive","isStarredActive","isExploreActive","isFolderActive","isFeedActive","folderNameExists","trim","feedUrlExists","createFeed","newFolder","existingFolder","getsFeed","create","name","createFolder","folder","moveFeed","move","renameFeed","patch","title","editing","renameFolder","rename","message","reversiblyDeleteFeed","reversiblyDelete","undoDeleteFeed","undoDelete","deleteFeed","reversiblyDeleteFolder","undoDeleteFolder","deleteFolder","setOrdering","togglePinned","pinned","setUpdateMode","updateMode","toggleFullText","value","scope","setSelectedFolderForRoute","OPMLParser","OPMLImporter","isOPMLImporting","isArticlesImporting","opmlImportError","articleImportError","set","toggleSetting","getSetting","importOPML","content","parsedContent","parse","jobSize","importFolders","feedQueue","importFeedQueue","console","importArticles","articles","JSON","$sce","trustAsResourceUrl","Resource","call","locations","folderUnreadCount","folderIds","prototype","receive","updateUnreadCache","updateFolderCache","values","add","hashMap","startsWith","http","parentFolderId","faviconLink","updateCache","isFolder","deleted","promises","post","setPinned","isPinned","diff","fullTextEnabled","opened","open","toFolderName","batchSize","starredCount","lowestId","highestId","channel","newestItemId","getNewestItemId","star","isStarred","it","guidHash","starred","isRead","read","highestItemId","offset","json","service","global","autopaging","area","isLoading","startFeedJob","queue","pop","getsFeedCounter","folderPromises","jobPromises","i","parseOutline","outline","attr","recursivelyParse","level","root","firstLevel","entry","children","xml","parseXML","find","channels","obj","listeners","listener","objs","existing","deleteAtIndex","findIndex","splice","settings","compact","preventReadOnScroll","compactExpand","defaultLanguageCode","supportedLanguageCodes","processLanguageCode","toLowerCase","storage","localStorage","registerHandler","mime","registered","isContentHandlerRegistered","isRegistered","getItem","registerContentHandler","subscribeUrl","setItem","cleanUrl","protocol","host","mimeType","ready","subscription","input","val","trigger","setTimeout","focus","addEventListener","querySelector","scrollTo","noInputFocused","is","noModifierKey","event","shiftKey","altKey","ctrlKey","metaKey","markAllRead","navigationArea","selector","button","isInScrollView","elem","scrollArea","elemTop","top","elemBottom","height","areaBottom","scrollToNavigationElement","toTop","scrollTop","scrollToActiveNavigationEntry","reloadFeed","tryReload","pullToRefresh","hasClass","addClass","activateNavigationEntry","nextFeed","elements","subfeeds","next","getParentFolder","parent","selectFirstOrLastFolder","isLast","index","previousFolder","prevAll","first","parentFolder","nextFolder","nextAll","previousFeed","prev","siblings","previous","onActiveItem","callback","each","position","toggleUnread","expandItem","openLink","scrollToItem","expandItemInCompact","scrollToNextItem","jumped","prop","scrollToPreviousItem","last","keyup","keyCode","isExpandItem","preventDefault","News","exports","articleActionPlugins","addArticleAction","action","getArticleActionPlugins","jQuery","$document","click","directive","restrict","link","elm","menu","toggleClass","target","removeClass","_","stop","slideDown","Navigation","newsArticleActions","noPlugins","plugins","attrs","toFocus","newsAutoFocus","$watch","newsBindHtmlUnsafe","html","$eval","options","newsDraggable","isDefined","draggable","$observe","details","accept","hoverClass","greedy","drop","ui","$apply","droppable","on","newsFinishedTransition","$interpolate","toReadd","newsFocus","notification","args","pause","scrolled","newsPullToRefresh","change","file","files","reader","FileReader","onload","$fileContent","result","newsReadFile","readAsText","masonry","itemSelector","gutter","columnWidth","$last","MARK_READ_TIMEOUT","SCROLL_TIMEOUT","counter","newsScrollAutoPage","enabled","article","newsScrollMarkRead","newsScroll","newsScrollEnabledMarkRead","allowScroll","scrollHandler","off","onSearch","box","doSearch","newsStickyMenu","scroll","scrollHeight","css","bind","stopPropagation","newsTimeout","destroyed","seconds","remove","baseTitle","titles","appName","ownCloudName","newsToggleShow","toggle","newsTriggerClick","oc_requesttoken"],"mappings":"CAAA,SAAUA,EAAWC,EAAQC,EAAUC,EAASC,EAAGC,EAAIC,EAAWC,EAAKC,GAEvE,YAIA,IAAIC,GAAMN,EAAQO,OAAO,QAAS,UAAW,aAAc,aAC3DD,GAAIE,QAAQ,iBAAkB,WAAY,gBAAiB,SAAUC,EAAgBC,EAAUC,GAG3F,GAAIC,IACAC,KAAM,EACNC,OAAQ,EACRC,QAAS,EACTC,cAAe,EACfC,OAAQ,EACRC,QAAS,EAIbR,GAASS,SAAS,eAAgB,IAClCT,EAASS,SAAS,kBAAmB,IAErCT,EAASS,SAAS,sBAAuB,IACzCT,EAASS,SAAS,WAAYjB,EAAGkB,YAAY,eAC7CV,EAASS,SAAS,YAAaP,GAC/BF,EAASS,SAAS,oBAAqB,IACvCT,EAASS,SAAS,iBAAkB,IAGpCT,EAASW,QAAQ,mBAA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MvJ,IAAI,WAAY,WAClB6b,GAAY,EACZvgB,EAASK,OAAOJ,KAKpBoD,EAAWqB,IAAI,uBAAwB,WAInC1E,EAASK,OAAOJ,GACXsgB,IACDA,GAAY,EACZlX,EAAQoX,SACRxS,EAAMqS,sBAM1B3iB,EAAI0d,UAAU,wBAAyB,UAAW,SAAUxc,GAGxD,GAAI6hB,GAAY7hB,EAAQzB,SAASyP,MAC7B8T,EAASD,EAAUxhB,MAAM,KACzB0hB,EAAUD,EAAO,IAAM,OACvBE,EAAeF,EAAO,IAAM,UAEhC,QACIrF,SAAU,IACVrN,OACInD,YAAa,KAEjByQ,KAAM,SAAUtN,EAAOqJ,EAAM8E,GACzBA,EAAMW,SAAS,cAAe,SAAU/O,GACtB,MAAVA,EACAnP,EAAQzB,SAASyP,MAAQ+T,EACrB,IAAM5S,EAAQ,OAAS6S,EAE3BhiB,EAAQzB,SAASyP,MAAQ+T,EAAU,MAAQC,SAO/DljB,EAAI0d,UAAU,iBAAkB,WAE5B,OACIC,SAAU,IACVrN,OACI6S,eAAkB,KAEtBvF,KAAM,SAAUtN,EAAOqJ,GACnBA,EAAK8D,MAAM,WACP,GAAIO,GAASre,EAAE2Q,EAAM6S,eACrBnF,GAAOoF,eAMvBpjB,EAAI0d,UAAU,mBAAoB,WAG9B,MAAO,UAAUpN,EAAOuN,EAAKnI,GACzBmI,EAAIJ,MAAM,WACN9d,EAAE+V,EAAK2N,kBAAkB7K,QAAQ,eAM1CjZ,UAAWC,OAAQC,SAAUC,QAAS6d,OAAS3d,GAAI0jB,gBAAiBxjB","file":"app.min.js"} \ No newline at end of file diff --git a/js/gui/ExternSubscription.js b/js/gui/ExternSubscription.js index b12d683be..e6bc59d2e 100644 --- a/js/gui/ExternSubscription.js +++ b/js/gui/ExternSubscription.js @@ -50,9 +50,8 @@ $(document).ready(function () { - var subscription = window.decodeURIComponent(url('?subscribe_to')); - - if (subscription && subscription !== 'null') { + var subscription = url('?subscribe_to'); + if (subscription && subscription !== 'undefined') { $('#new-feed').show(); var input = $('input[ng-model="Navigation.feed.url"]'); @@ -68,4 +67,3 @@ }); })(window, document, navigator, url, $); -