diff options
author | VirtualTam <virtualtam@flibidi.net> | 2016-07-28 22:54:33 +0200 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2016-08-10 01:42:44 +0200 |
commit | a973afeac7b7399d35b881920f0afc1947765ccd (patch) | |
tree | 4a13ddf32779cb8f02600d7cc20d23f692c9068c /tpl/import.html | |
parent | 085157c5cb6bd0df928c7875fb7997683418f1fb (diff) | |
download | Shaarli-a973afeac7b7399d35b881920f0afc1947765ccd.tar.gz Shaarli-a973afeac7b7399d35b881920f0afc1947765ccd.tar.zst Shaarli-a973afeac7b7399d35b881920f0afc1947765ccd.zip |
Refactor bookmark import using a generic Netscape parser
Relates to #607
Relates to #608
Relates to #493 (abandoned)
Additions:
- use Composer's autoload to load 3rd-party dependencies under vendor/
Modifications:
- [import] replace the current parser with a generic, stable parser
- move code to application/NetscapeBookmarkUtils
- improve status report after parsing
- [router] use the same endpoint for both bookmark upload and import dialog
- [template] update bookmark import options
- allow adding tags to all imported links
- allow selecting the visibility (privacy) of imported links
- [tests] ensure bookmarks are properly parsed and imported in the LinkDB
- reuse reference input from the parser's test data
See:
- https://github.com/shaarli/netscape-bookmark-parser
- https://getcomposer.org/doc/01-basic-usage.md#autoloading
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tpl/import.html')
-rw-r--r-- | tpl/import.html | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/tpl/import.html b/tpl/import.html index 6c4f9421..071e1160 100644 --- a/tpl/import.html +++ b/tpl/import.html | |||
@@ -3,19 +3,31 @@ | |||
3 | <head>{include="includes"}</head> | 3 | <head>{include="includes"}</head> |
4 | <body onload="document.uploadform.filetoupload.focus();"> | 4 | <body onload="document.uploadform.filetoupload.focus();"> |
5 | <div id="pageheader"> | 5 | <div id="pageheader"> |
6 | {include="page.header"} | 6 | {include="page.header"} |
7 | <div id="uploaddiv"> | 7 | <div id="uploaddiv"> |
8 | Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize} bytes). | 8 | Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize} bytes). |
9 | <form method="POST" action="?do=upload" enctype="multipart/form-data" name="uploadform" id="uploadform"> | 9 | <form method="POST" action="?do=import" enctype="multipart/form-data" |
10 | <input type="hidden" name="token" value="{$token}"> | 10 | name="uploadform" id="uploadform"> |
11 | <input type="file" name="filetoupload"> | 11 | <input type="hidden" name="token" value="{$token}"> |
12 | <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}"> | 12 | <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}"> |
13 | <input type="submit" name="import_file" value="Import" class="bigbutton"><br> | 13 | <input type="file" name="filetoupload"> |
14 | <input type="checkbox" name="private" id="private"><label for="private"> Import all links as private</label><br> | 14 | <input type="submit" name="import_file" value="Import" class="bigbutton"><br> |
15 | <input type="checkbox" name="overwrite" id="overwrite"><label for="overwrite"> Overwrite existing links</label> | 15 | |
16 | </form> | 16 | <label for="privacy"> Visibility:</label><br> |
17 | </div> | 17 | <input type="radio" name="privacy" value="default" checked="true"> |
18 | Use values from the imported file, default to public<br> | ||
19 | <input type="radio" name="privacy" value="private"> | ||
20 | Import all bookmarks as private<br> | ||
21 | <input type="radio" name="privacy" value="public"> | ||
22 | Import all bookmarks as public<br> | ||
23 | |||
24 | <input type="checkbox" name="overwrite" id="overwrite"> | ||
25 | <label for="overwrite"> Overwrite existing bookmarks</label><br> | ||
26 | <label for="default_tags"> Add default tags</label> | ||
27 | <input type="text" name="default_tags" id="default_tags"> | ||
28 | </form> | ||
29 | </div> | ||
18 | </div> | 30 | </div> |
19 | {include="page.footer"} | 31 | {include="page.footer"} |
20 | </body> | 32 | </body> |
21 | </html> \ No newline at end of file | 33 | </html> |