added possibility to import OPML file via URL

This commit is contained in:
Jeena 2013-10-19 20:15:28 +02:00
parent aa91965541
commit 77baac7ca6
2 changed files with 17 additions and 2 deletions

View file

@ -236,6 +236,14 @@ function DevCtrl($scope, downloader, updateFeedsAlarmManager, opml, downloaderBa
var url = 'https://raw.github.com/colinfrei/Podcast/master/podcasts.xml'; var url = 'https://raw.github.com/colinfrei/Podcast/master/podcasts.xml';
var xmlPromise = downloaderBackend.downloadXml(url); var xmlPromise = downloaderBackend.downloadXml(url);
xmlPromise.then(function(xml) {
opml.import(xml);
});
}
$scope.importOpmlFromUrl = function() {
var url = document.getElementById("importOpmlFromUrlInput").value;
var xmlPromise = downloaderBackend.downloadXml(url);
xmlPromise.then(function(xml) { xmlPromise.then(function(xml) {
opml.import(xml); opml.import(xml);
}); });

View file

@ -1,15 +1,22 @@
<button ng-click="downloadFiles()">Download Files</button> <button ng-click="downloadFiles()">Download Files</button>
<button ng-click="setAlarmTmp()">Set Alarm in 10 Seconds</button> <button ng-click="setAlarmTmp()">Set Alarm in 10 Seconds</button>
<button ng-click="checkForPendingMessage()">Check for pending Messages</button> <button ng-click="checkForPendingMessage()">Check for pending Messages</button>
<hr>
<div> <div>
Import OPML File<br /> <label>Import OPML from URL</label>
<input id="importOpmlFromUrlInput" placeholder="http://example.com/podcasts.opml" size="30" />
<button ng-click="importOpmlFromUrl()">Import</button>
</div>
<hr>
<div>
Import Colin's OPML File<br />
<button ng-click="importColinsOpml()">Import Colin's OPML File</button> <button ng-click="importColinsOpml()">Import Colin's OPML File</button>
<!-- <!--
File input fields don't work yet on FirefoxOS, see https://bugzilla.mozilla.org/show_bug.cgi?id=832923 File input fields don't work yet on FirefoxOS, see https://bugzilla.mozilla.org/show_bug.cgi?id=832923
<input type="file" onchange="angular.element(this).scope().importOpmlFile(this)" /> <input type="file" onchange="angular.element(this).scope().importOpmlFile(this)" />
--> -->
</div> </div>
<!-- <!--
<br /> <br />
List of ALarms List of ALarms