diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-08-10 00:12:38 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-08-10 00:12:38 -0400 |
commit | a077e4ea2f34d3406373b7d3705162a44f527ace (patch) | |
tree | 7bdcfeeb6463e6e553ed072fe5353a65a47925b9 /js | |
parent | 98614791fb9cc79920405d2e07030a2411dc6f4a (diff) |
importing opml becomes simple for debugging reasons (ignore SimplePie issues for now)
Diffstat (limited to 'js')
-rw-r--r-- | js/news.js | 2 | ||||
-rw-r--r-- | js/settings.js | 94 |
2 files changed, 48 insertions, 48 deletions
diff --git a/js/news.js b/js/news.js index e485e4a4b..2d38ec930 100644 --- a/js/news.js +++ b/js/news.js @@ -348,7 +348,7 @@ $(document).ready(function(){ $('#settingsbtn').on('click keydown', function() { try { - OC.appSettings({appid:'news', loadJS:true}); + OC.appSettings({appid:'news', loadJS:true, cache:false}); } catch(e) { alert(e); } diff --git a/js/settings.js b/js/settings.js index 95fb14b6a..7bc1c80db 100644 --- a/js/settings.js +++ b/js/settings.js @@ -1,57 +1,57 @@ News = News || {} News.Settings={ - importkind: '', - importpath: '', - IMPORTCLOUD:'cloud', - IMPORTLOCAL:'local', - cloudFileSelected:function(path){ - $.getJSON(OC.filePath('news', 'ajax', 'selectfromcloud.php'),{'path':path},function(jsondata){ - if(jsondata.status == 'success'){ - $('#browsebtn, #cloudbtn, #importbtn').show(); - $('#opml_file').text(t('news', 'File ') + path + t('news', ' loaded from cloud.')); - News.Settings.importkind = News.Settings.IMPORTCLOUD; - News.Settings.importpath = jsondata.data.tmp; - } - else{ - OC.dialogs.alert(jsondata.data.message, t('news', 'Error')); - } - }); - }, - browseFile:function(filelist){ - if(!filelist) { - OC.dialogs.alert(t('news','No files selected.'), t('news', 'Error')); - return; + importkind: '', + importpath: '', + IMPORTCLOUD:'cloud', + IMPORTLOCAL:'local', + cloudFileSelected:function(path){ + $.getJSON(OC.filePath('news', 'ajax', 'selectfromcloud.php'),{'path':path},function(jsondata){ + if(jsondata.status == 'success'){ + $('#browsebtn, #cloudbtn, #importbtn').show(); + $('#opml_file').text(t('news', 'File ') + path + t('news', ' loaded from cloud.')); + News.Settings.importkind = News.Settings.IMPORTCLOUD; + News.Settings.importpath = jsondata.data.tmp; } - var file = filelist[0]; - $('#browsebtn, #cloudbtn, #importbtn').show(); - $('#opml_file').text(t('news', 'File ') + file.name + t('news', ' loaded from local filesystem.')); - $('#opml_file').prop('value', file.name); - }, - import:function(button){ - $(button).attr("disabled", true); - $(button).prop('value', t('news', 'Importing...')); - - var path = ''; - if (News.Settings.importkind == News.Settings.IMPORTCLOUD) { - path = News.Settings.importpath; - } else if (this.importkind == this.IMPORTLOCAL) { - } - else { - OC.dialogs.alert(t('news','Import kind not specified'), t('news', 'Error')); + else{ + OC.dialogs.alert(jsondata.data.message, t('news', 'Error')); } + }); + }, + browseFile:function(filelist){ + if(!filelist) { + OC.dialogs.alert(t('news','No files selected.'), t('news', 'Error')); + return; + } + var file = filelist[0]; + $('#browsebtn, #cloudbtn, #importbtn').show(); + $('#opml_file').text(t('news', 'File ') + file.name + t('news', ' loaded from local filesystem.')); + $('#opml_file').prop('value', file.name); + }, + import:function(button){ + $(button).attr("disabled", true); + $(button).prop('value', t('news', 'Importing...')); - $.post(OC.filePath('news', 'ajax', 'importopml.php'), { path: path }, function(jsondata){ - if (jsondata.status == 'success') { - alert(jsondata.data.title); - } else { - OC.dialogs.alert(jsondata.data.message, t('news', 'Error')); - } - }); - + var path = ''; + if (News.Settings.importkind == News.Settings.IMPORTCLOUD) { + path = News.Settings.importpath; + } else if (this.importkind == this.IMPORTLOCAL) { + } + else { + OC.dialogs.alert(t('news','Import kind not specified'), t('news', 'Error')); + } + + $.post(OC.filePath('news', 'ajax', 'importopml.php'), { path: path }, function(jsondata){ + if (jsondata.status == 'success') { + var message = jsondata.data.countsuccess + t('news', ' out of ') + jsondata.data.count + + t('news', ' feeds imported successfully from ') + jsondata.data.title; + OC.dialogs.alert(message, t('news', 'Success')); + } else { + OC.dialogs.alert(jsondata.data.message, t('news', 'Error')); + } $(button).prop('value', t('news', 'Import')); $(button).attr("disabled", false); - - } + }); + } } $('#browsebtn, #cloudbtn, #importbtn').hide(); |