diff --git a/ajax/import.php b/ajax/import.php new file mode 100644 index 00000000..6264bc78 --- /dev/null +++ b/ajax/import.php @@ -0,0 +1,27 @@ +t('Unsupported file type for import'); + } +} +OC_JSON::error(array('data'=>$error)); +//force charset as not set by OC_JSON +header('Content-Type: application/json; charset=utf-8'); +exit(); diff --git a/appinfo/app.php b/appinfo/app.php index 1b4e1ddf..84013d9d 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -17,7 +17,6 @@ OCP\App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'name' => $l->t('Bookmarks') )); -OCP\App::registerPersonal('bookmarks', 'settings'); OCP\Util::addscript('bookmarks', 'bookmarksearch'); OC_Search::registerProvider('OC_Search_Provider_Bookmarks'); diff --git a/css/bookmarks.css b/css/bookmarks.css index 7fe274ae..3062ad9c 100644 --- a/css/bookmarks.css +++ b/css/bookmarks.css @@ -333,4 +333,41 @@ li:hover em { display : none; } position: absolute; right: 1em; top: auto; +} + +#bookmark_settings { + -moz-box-sizing: border-box; + background: none repeat scroll 0 0 #EEEEEE; + border-right: 1px solid #CCCCCC; + border-top: 1px solid #CCCCCC; + bottom: 0; + height: 2.8em; + margin: 0; + overflow: visible; + padding: 0; + position: fixed; + width: 20em; + z-index: 2; +} +#leftcontent #bookmark_settings li{ + padding: 0; + background-color:transparent; +} +#leftcontent #bookmark_settings li:hover{ + background-color:transparent; +} + +#bookmark_settings .controls { + height: 100%; + width: 100%; +} + +#bookmark_settings .controls > li:last-child button { + margin-right: 0.3em; +} +#bookmark_settings button { + height: 2.4em; + margin: 0.15em 0 0 0.15em; + padding: 0.2em 0.1em 0; + width: 2.4em; } \ No newline at end of file diff --git a/js/bookmarks.js b/js/bookmarks.js index dba3cd25..0b5f4f08 100644 --- a/js/bookmarks.js +++ b/js/bookmarks.js @@ -9,6 +9,14 @@ $(document).ready(function() { $('.centercontent').click(clickSideBar); $('#view_type input').click(clickSwitchView); $('#bookmark_add_submit').click(addBookmark); + $('#settingsbtn').on('click keydown', function() { + try { + OC.appSettings({appid:'bookmarks', loadJS:true, cache:false}); + } catch(e) { + alert(e); + } + }); + $(window).resize(function () { fillWindow($('.bookmarks_list')); }); diff --git a/js/settings.js b/js/settings.js new file mode 100644 index 00000000..f005337d --- /dev/null +++ b/js/settings.js @@ -0,0 +1,57 @@ +$(document).ready(function() { + $('#bm_import_submit').click(attachSettingEvent); +}); + + +function attachSettingEvent(event) { + event.preventDefault(); + fileUpload($(this).closest('form'), $('#upload')); +} +function fileUpload(form, result_div) { + + var uploadEventHandler = function () { + var data = {}; + try{ + data = $.parseJSON(iframe.contents().text()); + }catch (e){} + if(data.status == 'error') { + list = $("