diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-23 10:43:53 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-07-23 10:43:53 -0400 |
commit | 27df8ca4628457e2fca13a64125152469dab33bb (patch) | |
tree | d93d9f6d2249fc7898bf201bfb28ebe7d443cbe3 /js | |
parent | 2580eb06003aa3827106c9a5eb78348c333dabc8 (diff) |
dialog for opml importing
Diffstat (limited to 'js')
-rw-r--r-- | js/settings.js | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/js/settings.js b/js/settings.js index 265f12d6b..28a61dfc3 100644 --- a/js/settings.js +++ b/js/settings.js @@ -1,27 +1,46 @@ -News={ - Settings:{ +NewsSettings={ + UI: { + overview:function(dialogtype, dialogfile){ + if($(dialogtype).dialog('isOpen') == true){ + $(dialogtype).dialog('moveToTop'); + }else{ + $('#dialog_holder').load(OC.filePath('news', 'ajax', dialogfile), function(jsondata){ + if(jsondata.status != 'error'){ + $(dialogtype).dialog({ + dialogClass:'dialog', + minWidth: 600, + close: function(event, ui) { + $(this).dialog('destroy').remove(); + } + }).css('overflow','visible'); + } else { + alert(jsondata.data.message); + } + }); + } + return false; + }, cloudFileSelected:function(path){ -// $.getJSON(OC.filePath('contacts', 'ajax', 'oc_photo.php'),{'path':path,'id':Contacts.UI.Card.id},function(jsondata){ -// if(jsondata.status == 'success'){ -// //alert(jsondata.data.page); -// Contacts.UI.Card.editPhoto(jsondata.data.id, jsondata.data.tmp) -// $('#edit_photo_dialog_img').html(jsondata.data.page); -// } -// else{ -// OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); -// } -// }); - } - } +// $.getJSON(OC.filePath('contacts', 'ajax', 'oc_photo.php'),{'path':path,'id':Contacts.UI.Card.id},function(jsondata){ +// if(jsondata.status == 'success'){ +// //alert(jsondata.data.page); +// Contacts.UI.Card.editPhoto(jsondata.data.id, jsondata.data.tmp) +// $('#edit_photo_dialog_img').html(jsondata.data.page); +// } +// else{ +// OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); +// } +// }); + } + }, } $(document).ready(function(){ - + $('#opml_file').click(function() { - OC.dialogs.filepicker(t('news', 'Select file'), News.Settings.cloudFileSelected, false, '', true); + NewsSettings.UI.overview('#import_dialog', 'importdialog.php'); }); - - + //OC.dialogs.filepicker(t('news', 'Select file'), NewsSettings.cloudFileSelected, false, '', true); }); |