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>
This commit is contained in:
parent
085157c5cb
commit
a973afeac7
10 changed files with 779 additions and 122 deletions
tpl
|
@ -3,19 +3,31 @@
|
|||
<head>{include="includes"}</head>
|
||||
<body onload="document.uploadform.filetoupload.focus();">
|
||||
<div id="pageheader">
|
||||
{include="page.header"}
|
||||
<div id="uploaddiv">
|
||||
Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize} bytes).
|
||||
<form method="POST" action="?do=upload" enctype="multipart/form-data" name="uploadform" id="uploadform">
|
||||
<input type="hidden" name="token" value="{$token}">
|
||||
<input type="file" name="filetoupload">
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}">
|
||||
<input type="submit" name="import_file" value="Import" class="bigbutton"><br>
|
||||
<input type="checkbox" name="private" id="private"><label for="private"> Import all links as private</label><br>
|
||||
<input type="checkbox" name="overwrite" id="overwrite"><label for="overwrite"> Overwrite existing links</label>
|
||||
</form>
|
||||
</div>
|
||||
{include="page.header"}
|
||||
<div id="uploaddiv">
|
||||
Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize} bytes).
|
||||
<form method="POST" action="?do=import" enctype="multipart/form-data"
|
||||
name="uploadform" id="uploadform">
|
||||
<input type="hidden" name="token" value="{$token}">
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}">
|
||||
<input type="file" name="filetoupload">
|
||||
<input type="submit" name="import_file" value="Import" class="bigbutton"><br>
|
||||
|
||||
<label for="privacy"> Visibility:</label><br>
|
||||
<input type="radio" name="privacy" value="default" checked="true">
|
||||
Use values from the imported file, default to public<br>
|
||||
<input type="radio" name="privacy" value="private">
|
||||
Import all bookmarks as private<br>
|
||||
<input type="radio" name="privacy" value="public">
|
||||
Import all bookmarks as public<br>
|
||||
|
||||
<input type="checkbox" name="overwrite" id="overwrite">
|
||||
<label for="overwrite"> Overwrite existing bookmarks</label><br>
|
||||
<label for="default_tags"> Add default tags</label>
|
||||
<input type="text" name="default_tags" id="default_tags">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{include="page.footer"}
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue