├── .editorconfig ├── .github └── workflows │ └── release.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── eslint.config.js ├── material ├── 404.html ├── addlink.html ├── changepassword.html ├── changetag.html ├── configure.html ├── daily.html ├── dailyrss.html ├── editlink.batch.html ├── editlink.html ├── error.html ├── export.bookmarks.html ├── export.html ├── feed.atom.html ├── feed.rss.html ├── import.html ├── includes.html ├── install.html ├── linklist.html ├── linklist.paging.html ├── loginform.html ├── opensearch.html ├── page.footer.html ├── page.header.html ├── page.html ├── picwall.html ├── pluginsadmin.html ├── server.html ├── server.requirements.html ├── tag.cloud.html ├── tag.list.html ├── tag.sort.html ├── thumbnails.html └── tools.html ├── package-lock.json ├── package.json ├── rollup.config.js ├── screenshots ├── configuration.png ├── home.png ├── settings.png └── showcase.png ├── src ├── assets │ ├── fonts │ │ ├── material-icons │ │ │ ├── materialdesignicons-webfont.eot │ │ │ ├── materialdesignicons-webfont.svg │ │ │ ├── materialdesignicons-webfont.ttf │ │ │ ├── materialdesignicons-webfont.woff │ │ │ └── materialdesignicons-webfont.woff2 │ │ ├── oldnewspapertypes │ │ │ ├── oldnewspapertypes-webfont.ttf │ │ │ ├── oldnewspapertypes-webfont.woff │ │ │ └── oldnewspapertypes-webfont.woff2 │ │ └── roboto │ │ │ ├── Apache License.txt │ │ │ ├── Roboto-Black.ttf │ │ │ ├── Roboto-BlackItalic.ttf │ │ │ ├── Roboto-Bold.ttf │ │ │ ├── Roboto-BoldItalic.ttf │ │ │ ├── Roboto-Italic.ttf │ │ │ ├── Roboto-Light.ttf │ │ │ ├── Roboto-LightItalic.ttf │ │ │ ├── Roboto-Medium.ttf │ │ │ ├── Roboto-MediumItalic.ttf │ │ │ ├── Roboto-Regular.ttf │ │ │ ├── Roboto-Thin.ttf │ │ │ ├── Roboto-ThinItalic.ttf │ │ │ ├── RobotoCondensed-Bold.ttf │ │ │ ├── RobotoCondensed-BoldItalic.ttf │ │ │ ├── RobotoCondensed-Italic.ttf │ │ │ ├── RobotoCondensed-Light.ttf │ │ │ ├── RobotoCondensed-LightItalic.ttf │ │ │ └── RobotoCondensed-Regular.ttf │ └── img │ │ ├── arrow-compress.png │ │ ├── arrow-expand.png │ │ ├── favicons │ │ ├── android-chrome-36x36.png │ │ ├── android-chrome-48x48.png │ │ ├── android-chrome-72x72.png │ │ ├── android-chrome-96x96.png │ │ ├── apple-touch-icon-57x57.png │ │ ├── apple-touch-icon-60x60.png │ │ ├── apple-touch-icon-72x72.png │ │ ├── apple-touch-icon-76x76.png │ │ ├── apple-touch-icon-precomposed.png │ │ ├── apple-touch-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-64x64.png │ │ ├── favicon-96x96.png │ │ ├── favicon.ico │ │ ├── manifest.json │ │ ├── mstile-150x150.png │ │ ├── mstile-310x150.png │ │ └── mstile-70x70.png │ │ ├── sad_star.png │ │ └── tools │ │ └── star-circle.png ├── js │ ├── components │ │ ├── action-bar.js │ │ ├── animations.js │ │ ├── batch-add.js │ │ ├── batch-edit.js │ │ ├── http.js │ │ ├── link-editor.js │ │ ├── link-list.js │ │ ├── modal.js │ │ ├── notification.js │ │ ├── overlay.js │ │ ├── popup.js │ │ ├── ripple.js │ │ ├── search.js │ │ ├── tag.js │ │ ├── thumbnail.js │ │ └── utils.js │ ├── lib.js │ └── main.js └── scss │ ├── components │ ├── _actionbar.scss │ ├── _animations.scss │ ├── _bookmarklet.scss │ ├── _button.scss │ ├── _card.scss │ ├── _fonts.scss │ ├── _footer.scss │ ├── _form.scss │ ├── _global.scss │ ├── _header.scss │ ├── _helpers.scss │ ├── _icons.scss │ ├── _layout.scss │ ├── _list.scss │ ├── _markdown.scss │ ├── _modal.scss │ ├── _notification.scss │ ├── _overlay.scss │ ├── _overrides.scss │ ├── _page-daily.scss │ ├── _page-linklist.scss │ ├── _pager.scss │ ├── _popup.scss │ ├── _progress.scss │ ├── _reset.scss │ ├── _ripple.scss │ ├── _shadow.scss │ ├── _structure.scss │ ├── _table.scss │ ├── _tag.scss │ ├── _text.scss │ └── _values.scss │ └── styles.scss └── user.example.css /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_size = 2 8 | indent_style = space 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release Shaarli Material 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*.*.*' 7 | - 'v*.*.*-*' 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - name: Use Node.js 17 | uses: actions/setup-node@v4 18 | with: 19 | node-version: "20.x" 20 | 21 | - name: Build plugin 22 | run: | 23 | npm install 24 | npm run build 25 | 26 | - name: Package 27 | run: | 28 | tag="${GITHUB_REF#refs/tags/}" 29 | zip -r shaarli-material.$tag.zip material 30 | tar -czvf shaarli-material.$tag.tar.gz material 31 | 32 | - name: Create release 33 | env: 34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 35 | run: | 36 | tag="${GITHUB_REF#refs/tags/}" 37 | 38 | gh release create "$tag" \ 39 | --title="$tag" \ 40 | --draft \ 41 | shaarli-material.$tag.zip shaarli-material.$tag.tar.gz 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Sublime Text files. 2 | *.sublime-project 3 | *.sublime-workspace 4 | 5 | # Removes some useless build files. 6 | material/dist/* 7 | #!material/dist 8 | material/opengraph.png 9 | 10 | # Removes the user defined template. 11 | material/extra.html 12 | 13 | # Removes node modules. 14 | node_modules 15 | 16 | # Removes the HTML version of README. 17 | README.html 18 | 19 | # Removes VS Code config that isn't useful for others. 20 | .vscode/settings.json 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 kalvn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shaarli Material Theme 2 | Shaarli Material is a theme for [Shaarli](https://github.com/shaarli/Shaarli), the famous personal, minimalist, super-fast, database free, bookmarking service. 3 | 4 | 5 | ## Screenshots 6 | ![Shaarli Material Screenshot Home](https://raw.githubusercontent.com/kalvn/Shaarli-Material/master/screenshots/showcase.png) 7 | 8 | [More screenshots](https://github.com/kalvn/Shaarli-Material/tree/master/screenshots). 9 | 10 | 11 | ## Compatibility 12 | Shaarli Material follows the exact same versions numbers than Shaarli. It means that if you install Shaarli vX.Y.Z, you must use Shaarli Material vX.Y.Z. 13 | 14 | Shaarli Material was tested and validated with **Shaarli 0.14.0**. 15 | 16 | 17 | ## Download 18 | To download this theme, [visit this page](https://github.com/kalvn/Shaarli-Material/releases) and choose the most recent version matching the version of your Shaarli installation. Both use the same notation. 19 | 20 | Versions suffixed by `-patch.x` include some bugfix so take those preferentially if they exist for the version that fits your Shaarli installation. 21 | 22 | If you install an older version, please read the README.md file you'll find in the root folder rather than this one. 23 | 24 | 25 | ## Installation 26 | Download the `material` folder into the `tpl` directory of your Shaarli installation next to the `default` directory. 27 | 28 | Access your Shaarli and finish the setup process. Then, go into menu **Tools > Configure your Shaarli** and change the setting **Theme** to **Material**. 29 | 30 | You can now enjoy your new Material theme. 31 | 32 | 33 | ## Customization 34 | ### Configuration 35 | You can customize a few things using the `data/config.json.php` file of your Shaarli installation. If the file doesn't exist, just create it. Be careful to respect the JSON format notation (end lines with a comma except for the last item, just before the closing curly brace), otherwise you'll get errors. 36 | 37 | Here are parameters you can set. 38 | 39 | - `config.MATERIAL_PHP_DATE_PATTERN` (optional): Customizes the date format. Check this to know what to write: https://php.net/manual/function.strftime.php (ex: `"%d/%m/%Y"` will output for example '30/05/2015'). 40 | - `config.MATERIAL_NO_QRCODE` (optional): Removes the QR code control of the theme. To completely get rid of QR Codes, you of course need to disable the qrcode plugin as well. 41 | - `config.MATERIAL_COLOR` (optional): Customizes the theme's colors. It's used for example on Android for notification bar. It will generate ``. 42 | 43 | 44 | Here is an example of what you can configure (in real life, there will be other parameters in the file, just add those to the different categories): 45 | 46 | ```json 47 | { 48 | "resource": { 49 | "raintpl_tpl": "tpl\/material\/" 50 | }, 51 | 52 | "config": { 53 | "MATERIAL_PHP_DATE_PATTERN": "%d\/%m\/%Y %H:%M:%S", 54 | "MATERIAL_NO_QRCODE": true, 55 | "MATERIAL_COLOR": "#607D8B" 56 | } 57 | } 58 | ``` 59 | 60 | ### Custom Open Graph image 61 | [Open Graph](https://ogp.me/#metadata) is a protocol that enables web site developers to attach rich metadata that will be used when sharing a link on social medias for example. 62 | 63 | Shaarli Material supports adding a custom image that will be used by default when no image is attached to a shared link. 64 | 65 | To add yours, create a PNG image and save it as `tpl/material/opengraph.png`. 66 | 67 | ### Custom CSS 68 | You can add your own CSS rules in file `data/user.css`. You'll find an example that shows how to change the whole theme color in `user.example.css`. 69 | 70 | 71 | ## Add custom resources 72 | If you want to add your custom scripts or styles (for example analytics script), you must create a new template named `extra.html` in the *material* folder. 73 | Then, anything you add in this file will be included at the end of the `` tag. 74 | 75 | This file is NOT commited on the repository, which allows you to update the theme without overriding this file. 76 | 77 | 78 | ## Plugins 79 | As from Shaarli v0.6.0, you can install plugins to enrich your experience. 80 | Most of them should work properly, although it's up to the plugin developer to ensure the code is as minimal as possible to integrates well in custom themes. 81 | I tested all plugins available with Shaarli 0.6.0 and they all work well even though the display is a bit weird for some of them. I will keep monitoring the behavior of popular plugins in the future. 82 | 83 | 84 | ## Libraries used 85 | This theme uses a few JavaScript libraries. 86 | 87 | - [jQuery](http://jquery.com/) 88 | - [Bootstrap](http://getbootstrap.com/) 89 | - [awesomplete](http://leaverou.github.io/awesomplete/) 90 | - [blazy](http://dinbror.dk/blazy/) 91 | - [Sortable](http://rubaxa.github.io/Sortable/) 92 | - [Salvattore](https://salvattore.js.org/) 93 | - [Autosize](https://github.com/jackmoore/autosize/) 94 | - [node-qrcode](https://github.com/soldair/node-qrcode) 95 | 96 | 97 | ## Demo 98 | A read-only demo is available on my personal Shaarli : [https://links.kalvn.net](https://links.kalvn.net) 99 | 100 | 101 | ## Develop and debug 102 | To tweak this theme, you'll need to install dependencies and to build JavaScript and CSS libraries. To do this, install [Node.js and NPM](https://nodejs.org) and run this from the root folder: 103 | 104 | ```bash 105 | $ npm install 106 | $ npm run dev 107 | ``` 108 | 109 | 110 | ## Build for production 111 | 112 | ```bash 113 | $ npm install 114 | $ npm run build 115 | ``` 116 | 117 | ------------------------------------------------------------------------------ 118 | 119 | You can download Shaarli via the Github project page: https://github.com/shaarli/Shaarli 120 | 121 | Original project page: http://sebsauvage.net/wiki/doku.php?id=php:shaarli 122 | -------------------------------------------------------------------------------- /eslint.config.js: -------------------------------------------------------------------------------- 1 | import neostandard from 'neostandard'; 2 | 3 | export default [ 4 | ...neostandard({ 5 | semi: true, 6 | ts: false 7 | }), 8 | { 9 | rules: { 10 | 'no-undef': 'off', 11 | 'n/no-callback-literal': 'off' 12 | }, 13 | ignores: [ 14 | 'node_modules/*', 15 | 'material/dist/*' 16 | ] 17 | } 18 | ]; 19 | -------------------------------------------------------------------------------- /material/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="404"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 |
10 |
11 | Nothing found 12 |
13 |
{'Sorry, nothing to see here.'|t} That's a 404.
14 |

{$error_message}

15 |
16 | {include="page.footer"} 17 | 18 | 19 | -------------------------------------------------------------------------------- /material/addlink.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="addlink"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 |
10 |
11 |
12 |
13 |
{"Shaare a new link"|t}
14 |
15 |
16 |
17 | 18 |
19 |
20 | 24 |
25 |
26 | 27 |
28 | 29 |
30 | 31 | 57 |
58 |
59 |
60 | {include="page.footer"} 61 | 62 | 63 | -------------------------------------------------------------------------------- /material/changepassword.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="changepassword"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 |
10 |
11 |
12 |
13 |
{'Change password'|t}
14 |
15 |
16 | 17 | 18 |
19 |
20 | 21 | 22 |
23 | 24 |
25 | 29 |
30 |
31 |
32 |
33 | {include="page.footer"} 34 | 35 | 36 | -------------------------------------------------------------------------------- /material/changetag.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="changetag"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 |
10 |
11 |
12 |
13 |
{"Manage tags"|t}
14 |
15 | 16 |

All modifications are case sensitive.

17 | 18 |
19 | 20 | 23 | 24 |
25 |
26 | 27 | 28 |
29 |

{'You can also edit tags in the'|t} {'tag list'|t}.

30 |
31 | 36 |
37 |
38 | 39 |
40 |
41 |
{"Change tags separator"|t}
42 |
43 |

44 | {'Your current tag separator is'|t} {$tags_separator}{if="!empty($tags_separator_desc)"} ({$tags_separator_desc}){/if}. 45 |

46 |
47 | 48 | 49 | 50 |
51 |
52 | 59 |
60 |
61 |
62 |
63 | {include="page.footer"} 64 | 65 | 66 | -------------------------------------------------------------------------------- /material/daily.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="daily"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 | 10 |
11 |
12 | {'Daily'|t} 13 | {'Weekly'|t} 14 | {'Monthly'|t} 15 |
16 |
17 | 18 | 19 |
20 |
21 | {loop="$plugin_start_zone"} 22 | {$value} 23 | {/loop} 24 |
25 | 26 |
27 |

{$localizedType} Shaarli

28 |

{function="t('All links of one :type in a single page.', '', 1, 'shaarli', [':type' => t($type)])"}

29 | 45 |
46 | 47 |

{$dayDesc}

48 | 49 |
50 | {loop="$daily_about_plugin"} 51 | {$value} 52 | {/loop} 53 |
54 | 55 | {if="$linksToDisplay"} 56 |
57 | {loop="$linksToDisplay"} 58 | {$link=$value} 59 |
60 |
61 | 62 | {$link.title} 63 | 64 | 65 | {if="$thumbnails_enabled && !empty($link.thumbnail)"} 66 |
67 | {/if} 68 | 69 | {if="$link.formatedDescription"} 70 |
71 | {$link.formatedDescription} 72 |
73 | {/if} 74 | 100 |
101 |
102 | {/loop} 103 |
104 | {else} 105 |
No articles on this day.
106 | {/if} 107 | 108 |
109 | {loop="$plugin_end_zone"} 110 | {$value} 111 | {/loop} 112 |
113 |
114 | {include="page.footer"} 115 | 116 | 117 | -------------------------------------------------------------------------------- /material/dailyrss.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$localizedType} - {$title} 5 | {$index_url} 6 | {function="t('All links of one :type in a single page.', '', 1, 'shaarli', [':type' => t($type)])"} 7 | {$language} 8 | {$index_url} 9 | Shaarli 10 | 11 | {loop="$days"} 12 | 13 | {$value.date_human} - {$title} 14 | {$value.absolute_url} 15 | {$value.absolute_url} 16 | {$value.date_rss} 17 | {$value.title} 20 | 21 | {if="!$hide_timestamps"}{$value.created|format_date} — {/if} 22 | {'Permalink'|t} 23 | {if="$value.tags"} — {$value.tags}{/if} 24 |
25 | {$value.url} 26 |

27 | {if="$value.thumbnail"}thumbnail{/if}
28 | {if="$value.description"}{$value.description}{/if} 29 |

30 | {/loop} 31 | ]]>
32 |
33 | {/loop} 34 |
35 |
36 | -------------------------------------------------------------------------------- /material/editlink.batch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="editlinkbatch"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 | 10 | 28 | 29 |
30 | 31 |
32 | 33 | {loop="$links"} 34 | {$index=$key} 35 | {include="editlink"} 36 | {/loop} 37 | 38 |
39 | 40 |
41 | 42 | {include="page.footer"} 43 | 44 | 45 | -------------------------------------------------------------------------------- /material/editlink.html: -------------------------------------------------------------------------------- 1 | {if="empty($batch_mode)"} 2 | 3 | 4 | 5 | {$pageName="editlink"} 6 | {include="includes"} 7 | 8 | 9 | {include="page.header"} 10 | {else} 11 | {ignore}Lil hack: when included in a loop in batch mode, `$value` is assigned by RainTPL with template vars.{/ignore} 12 | {function="extract($value) ? '' : ''"} 13 | {/if} 14 | {$asyncLoadClass=$link_is_new && $async_metadata && empty($link.title) ? 'loading-wrapper' : ''} 15 | {if="!isset($index)"} 16 | {$index=""} 17 | {/if} 18 |
19 |
20 |
21 |
22 | {if="isset($link.id)"} 23 | 24 | {/if} 25 | 26 | 27 | {if="$http_referer"} 28 | 29 | {/if} 30 | 31 |
32 | {if="!$link_is_new"}Edit a link{else}Add a new link{/if} 33 | {if="!$link_is_new"} - {'created on'|t} {$link.created|format_date}{/if} 34 | 35 |
36 |
37 |
38 |
39 | 40 |
41 |
42 |
43 |
44 | 45 |
46 |
47 |
48 |
49 |
50 | 51 |
52 |
53 |
54 |
55 |
56 | 58 |
59 |
60 | {if="isset($edit_link_plugin)"} 61 | {loop="$edit_link_plugin"} 62 |
63 | {$value} 64 |
65 | {/loop} 66 | {/if} 67 |
68 | 69 | 70 |
71 | {if="$formatter==='markdown'"} 72 |
73 | {'Description will be rendered with'|t} 74 | 75 | {'Markdown syntax'|t} 76 | . 77 |
78 | {/if} 79 |
80 | 91 |
92 |
93 |
94 |
95 | {if="empty($batch_mode)"} 96 | {include="page.footer"} 97 | {/if} 98 | 99 | 100 | -------------------------------------------------------------------------------- /material/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="error"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 | 10 |
11 |

{$message}

12 | 13 |
14 | 15 |
16 | 17 | {if="!empty($text)"} 18 |

{$text}

19 | {/if} 20 | 21 | {if="!empty($stacktrace)"} 22 |
23 |             {$stacktrace}
24 |         
25 | {/if} 26 |
27 | {include="page.footer"} 28 | 29 | 30 | -------------------------------------------------------------------------------- /material/export.bookmarks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {ignore}The RainTPL loop is formatted to avoid generating extra newlines{/ignore} 6 | {$pagetitle} 7 |

Shaarli export of {$selection} bookmarks on {$date}

8 |

{loop="links"} 9 |

{$value.title}{if="$value.description"}{$eol}
{$value.description}{/if}{/loop} 10 |

11 | -------------------------------------------------------------------------------- /material/export.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="export"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 |

10 |
11 |
12 |
13 | 14 |

{"Export Database"|t}

15 |
16 |
17 |
18 |
19 |
{'Prepend note permalinks with this Shaarli instance\'s URL'|t}
20 |
{'Useful to import bookmarks in a web browser'|t}
21 |
22 |
23 |
24 | 28 |
29 |
30 |
31 |
32 | 36 |
37 | 38 | 39 |
40 |
41 |
42 | 46 |
47 | 48 | 49 |
50 |
51 |
52 | 56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 | 66 |
67 |
68 |
69 |
70 | {include="page.footer"} 71 | 72 | 73 | -------------------------------------------------------------------------------- /material/feed.atom.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {$pagetitle} 4 | Shaared links 5 | {if="$show_dates"} 6 | {$last_update} 7 | {/if} 8 | 9 | 11 | {loop="$plugins_feed_header"} 12 | {$value} 13 | {/loop} 14 | 15 | {$pagetitle} 16 | {$index_url} 17 | 18 | {$index_url} 19 | Shaarli 20 | {loop="$links"} 21 | 22 | {$value.title} 23 | {if="$usepermalinks"} 24 | 25 | {else} 26 | 27 | {/if} 28 | {$value.guid} 29 | {if="$show_dates"} 30 | {$value.pub_iso_date} 31 | {$value.up_iso_date} 32 | {/if} 33 | 34 | {loop="$value.taglist"} 35 | 36 | {/loop} 37 | {loop="$value.feed_plugins"} 38 | {$value} 39 | {/loop} 40 | 41 | {/loop} 42 | 43 | -------------------------------------------------------------------------------- /material/feed.rss.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pagetitle} 5 | {$index_url} 6 | Shaared links 7 | {$language} 8 | {$index_url} 9 | Shaarli 10 | 11 | 39 | 40 | -------------------------------------------------------------------------------- /material/import.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="import"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 |
10 |
11 |
12 |
13 | 14 | 15 |
{"Import Database"|t}
16 |
17 |

Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...).

18 |
19 | 20 | 21 |
{'Maximum size allowed:'|t} {$maxfilesizeHuman}
22 |
23 |
24 | 25 | 26 |
27 |
28 | 29 |
30 |
31 |
32 | 36 |
37 | 38 | 39 |
40 |
41 |
42 | 46 |
47 | 48 | 49 |
50 |
51 |
52 | 56 |
57 | 58 | 59 |
60 |
61 | 62 |
63 |
64 | 65 | 66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
78 |
79 | {include="page.footer"} 80 | 81 | 82 | -------------------------------------------------------------------------------- /material/includes.html: -------------------------------------------------------------------------------- 1 | {$pagetitle} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {if="$pageName === 'linklist' && !empty($links) && count($links) === 1"} 21 | {$link=reset($links)} 22 | 23 | 24 | 25 | {$ogDescription=isset($link.description_src) ? $link.description_src : $link.description} 26 | 27 | {if="!empty($link.thumbnail)"} 28 | 29 | {elseif="is_file('tpl/material/opengraph.png')"} 30 | 31 | {/if} 32 | {if="!$hide_timestamps || $is_logged_in"} 33 | 34 | {if="!empty($link.updated)"} 35 | 36 | {/if} 37 | {/if} 38 | {loop="link.taglist"} 39 | 40 | {/loop} 41 | {else} 42 | 43 | 44 | {if="is_file('tpl/material/opengraph.png')"} 45 | 46 | {/if} 47 | {/if} 48 | 49 | 50 | {if="$conf->get('config.MATERIAL_COLOR')"} 51 | {$themeColor=$conf->get('config.MATERIAL_COLOR')} 52 | 53 | {else} 54 | 55 | {/if} 56 | {loop="$plugins_includes.css_files"} 57 | 58 | {/loop} 59 | {if="is_file('data/user.css')"} 60 | 61 | {/if} 62 | {$tagSeparator=str_replace("'", "\\'", $tags_separator)} 63 | 76 | {if="file_exists('tpl/material/extra.html')"} 77 | {include="extra"} 78 | {/if} 79 | -------------------------------------------------------------------------------- /material/install.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="install"} 5 | {include="includes"} 6 | 7 | 8 |
9 |
10 |
11 |
12 |
13 |
Welcome to your Shaarli
14 |
15 |

{'It looks like it\'s the first time you run Shaarli. Please configure it.'|t}

16 |
17 | 18 | 19 |
20 |
21 | 22 | 23 |
24 |
25 | 26 |
27 |
28 | 37 |
38 |
39 | 48 |
49 |
50 |
51 |
52 | 53 | 54 |
55 |
56 | 57 | 58 |
59 |
60 | 61 | 62 |
{'Allow third party software to use Shaarli such as mobile application'|t}
63 |
64 |
65 | 69 |
70 |
71 |
72 |
73 | 74 | {include="server.requirements"} 75 |
76 | {include="page.footer"} 77 | 78 | 79 | -------------------------------------------------------------------------------- /material/linklist.paging.html: -------------------------------------------------------------------------------- 1 | {if="$page_max > 1"} 2 | {if="$is_logged_in"} 3 | {$total="$linkcount"} 4 | {else} 5 | {if="empty($privateLinkcount)"} 6 | {$total="$linkcount"} 7 | {else} 8 | {$total="$linkcount" - "$privateLinkcount"} 9 | {/if} 10 | {/if} 11 | {$from=("$page_current" - 1) * "$links_per_page" + 1} 12 | {$to=min($total, ("$page_current" - 1) * "$links_per_page" + "$links_per_page")} 13 |
14 | 20 |
21 | {loop="$action_plugin"} 22 | 30 | {/loop} 31 |
32 |
33 | {/if} 34 | -------------------------------------------------------------------------------- /material/loginform.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="loginform"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 | 10 | 40 | 41 | {include="page.footer"} 42 | 43 | 44 | -------------------------------------------------------------------------------- /material/opensearch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shaarli search - {$pagetitle} 4 | Shaarli search - {$pagetitle} 5 | 6 | 7 | 8 | UTF-8 9 | Shaarli Community - https://github.com/shaarli/Shaarli/ 10 | data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAHRklE 11 | QVRIx5WWaWxU5xWG3++7986dfYYZb+MN2xiMDRiDFePUiQsNoiwpUNpAmhInJVEqpa0oQUlbJVKq 12 | olaiqpLKUtOKhAJRm1BKRVWctuykpFjAgPcFx/uMl5mxPTOeuXPv3O3rjyiV0lIpfX+dc36c55xf 13 | 70vwP9TZ2fFpSQCwT5u6unX4f0QeNLx27RoMQwfRveTd11T23M+8S9w+Z3NRma1W4Hk6/nEimFpM 14 | Xnun9Xpmz1MPY+feOhBi/fwAAOjq7iJEqmQqCZf5i7NvyNZ/bJPYgAjCiJc2Zmhyw68SM/T1+NlK 15 | uf61BPoH+tHU1PT5ACMjI8RXvACvpZ5NT0+fmrG+2TKqtDLV0BgA2AUfXS3+UtfDX2ixCf73E+oA 16 | rat92CTkv9fRBwEkSaLDt/JZR/v0Q7qjb8dQ5hjSqmYSOCkzBbogL+ij2RN8bik9wK88Al9tH4tG 17 | ow88lvb19yEyPwfGGLq6OungYD9fUlosrqwoQVVVUeOU8qE/mU0ZTq6KNvreNort+5hugkayQUgY 18 | qQld/u6qnVRhkciscOdOkNy5E0RnZ+e/AbwsZxAaHyORZA+prW01CTlnGppOqAcwUnCmlDAkAyin 19 | Dapb2t7lNeRijpwvTGlJROXugoKS+upz/S19Kj9lJjxXGY1VU49tGevt7WOCSMHTeAXclePsQts9 20 | Jq9oLR7rPVkHxpUYkK2c07ZDiieRNcAx3ZlNphcnsxbiMuEsXFSTZpabp+VVS17UNSV/8n7+gN75 21 | +C1DM6VEjkgatiz/5IOCAheiUdeyr+198keKZXLzTKYjMDk/ZzGJhkV9AiPSdWaYIAY4U7TYNJMR 22 | pugMqgHcXTiJqDK8ycMv2+TPWyWtKFw3KEdtJxNz8u8+/PNYIqeUgY/Oz+Z7q5X3gtqvG7qip8yM 23 | HqdZg5kGgwGACoQQQkEMQ2DMIFnGE04xCRQTZFaexUT6jEEImJ2njjxx9fr13hfqfULTQ4apHept 24 | lxf4mrqS3Tek0w1toTc1K6WcXfAwnyWH8kSkIueEhdhNrzUAv16fSCUzNwR3vr/G2lKWojMqbxF4 25 | FWlLPDvBR+RBNpTsNqfkV7htuUe/UVq456qdzzvFh2KjdSH0I6ODs1ps9NHcw2jMfRYcEQyOCiox 26 | aWR0fOQWVLFNUuOnrXJxfIPnpXLRKzocLpsJanhUU/bfjJ4gfwm/ys3JGX1cuS3UBvauLa/MBe9z 27 | 5c/xGRdSKpiVmhhN98JK/w4DGgg4uLh8u1NfPhWbmzszeH3G1rxv3dL7+qXyGaXHJi46s4QQophp 28 | TKSDkHWGlAqmGCbAGAUA3sY5LlRZv3w44Dhnm0iFzbnsGfJR5E+EEsppTBVXuBptL5b8YQMlwnO+ 29 | Z2wtea4cl8Rc3KXJ4zShRm0CFaCaGhSDwGSMlbtLhSr7FnVhKhscC4+AO3L0x5PSFBdfE9i40SE6 30 | xLSWRCIbJ6phIqEysqvk+2aJ0vhB1NK353zyaL3GS76NgRbVYykkt2OXuaQqMwuxkk0FT+OJpS+z 31 | piXPRP1KzRvz4dRvO68PaWCMEQAIDcbqFiLJtyaSA/Ef3NnMGttgvHS7mUUWw7cTMemtY/cPsw3n 32 | oe2+4mGXpt7VGWPJ6zOn1V2Xfaz5AxgvBzexodmeGWmCbWWTDOGpSZIIqeAe2/IYvnXgWbomUj2T 33 | lNlwUP7bV64lzuRIeoodqDxi1OKRs/e0i08dH/6JPWtk6KKaZd3xj2jAXkY3BvZGK1xrhZvRNktP 34 | fNA0ubQrxyxV4jHpSkWoXJPKYqBetxeRpgsMWwE5b/bxaYxUDSWmzCLbStqQuy02LY4/cWLsqH8i 35 | HYNbyEeJczkJSzH2855DwsXp932F9hXEKQSQ1UHa568iRAa3uFyeNVolMBmeIrzT4cTXm37KMuvA 36 | xb8XXTqiDELRgKg8h/dGWwP9iSDaIzcYJSCbA/uNR3N2sNahV/hbsSA70vEdW66tCOOpj8FRkIgU 37 | Q5ybLUopiTzeTpFWUoTXdR3knwQMzLANOyQX50fWhDktLeAX3UcIA2EEQHPgi6TBsrWzaLGm7emC 38 | H7bY+GPlV6YumiEpDhslxGBgROApz+yyhROzduIEzwngDh48iD3jO0nBRAUUXtHcoq+ZWbI5EWWa 39 | WTieFjoKsaVoN92T88J4vlz+asXqpb+hEcdotbdueZ47vyiqhpA2UoRQwpoLtpNHxR0382jR8RzT 40 | k8xYMyCMMfR33Uc8rxdrA9tpuHPyS7pPOTRPZ1arepa4rUsybiWnnU9a39ZXxdur+XoGAGMdoXLi 41 | M789axnfNxDr8omiDcvF1f3OhPf18efjF/nfz6PGvv6zlrlwWwYBgcBZbKH4WKHODLHEURDxbHDF 42 | QWGePftHUlZWjsy8guYnH2EgwORfZ5cuavEqgGhLnL6+sycvRP1Fbux/fheIn3wCCN4N/qdPMwA4 43 | 2fYOeoe7kc6kcfCbh8n+r7YwAOjs6QCl9DNx5t7dew+MOf8CcuqqoLxlhwgAAAAASUVORK5CYII= 44 | 45 | 46 | -------------------------------------------------------------------------------- /material/page.footer.html: -------------------------------------------------------------------------------- 1 | 28 | 29 | {loop="$plugins_footer.js_files"} 30 | 31 | {/loop} 32 | -------------------------------------------------------------------------------- /material/page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="custom"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 | You body goes here... 10 | {include="page.footer"} 11 | 12 | 13 | -------------------------------------------------------------------------------- /material/picwall.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="picwall"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 | 10 | {if="count($linksToDisplay) === 0 && $is_logged_in"} 11 |
12 | {'There is no cached thumbnail.'|t} 13 | {'Try to synchronize them.'|t} 14 |
15 | {/if} 16 | 17 |
18 | {loop="$plugin_start_zone"} 19 | {$value} 20 | {/loop} 21 |
22 |
23 | {loop="$linksToDisplay"} 24 |
25 | {ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore} 26 | thumbnail 29 | {$value.title} 30 | 31 | {loop="$value.picwall_plugin"} 32 | {$value} 33 | {/loop} 34 | 35 |
36 | {/loop} 37 |
38 |
39 | {loop="$plugin_end_zone"} 40 | {$value} 41 | {/loop} 42 |
43 |
44 | {include="page.footer"} 45 | 46 | 47 | -------------------------------------------------------------------------------- /material/pluginsadmin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="pluginsadmin"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 |
10 |
11 |
12 | 15 | 16 |

{'Plugin administration'|t}

17 |

Drag and drop your plugin to change the order in which they'll be called. Uncheck enabled plugin to disable them and vice-versa.

18 | 19 |
20 | 21 |
22 |
{'Enabled Plugins'|t}
23 | {if="count($enabledPlugins)==0"} 24 |
25 |

{'No plugin enabled.'|t}

26 |
27 | {else} 28 |
    29 | {loop="$enabledPlugins"} 30 |
  • 31 | 32 | 33 | 34 |
    35 |

    {function="str_replace('_', ' ', $key)"}

    36 |
    {$value.description}
    37 |
    38 |
    39 |
  • 40 | {/loop} 41 |
42 | {/if} 43 |
44 | 45 |
46 |
Disabled plugins
47 | {if="count($disabledPlugins)==0"} 48 |
49 |

{'No plugin disabled.'|t}

50 |
51 | {else} 52 |
    53 | {loop="$disabledPlugins"} 54 |
  • 55 | 56 | 57 |
    58 |

    {function="str_replace('_', ' ', $key)"}

    59 |
    {$value.description}
    60 |
    61 |
  • 62 | {/loop} 63 |
64 | {/if} 65 |
66 | 67 |
68 |

69 | {"More plugins available"|t} 70 | {"in the documentation"|t}. 71 |

72 | 73 |
74 |
75 |
76 |
77 | 78 |
79 |
Plugin parameters
80 |
81 | {if="count($enabledPlugins)==0"} 82 |

{'No plugin enabled.'|t}

83 | {else} 84 | {$count=0} 85 | {loop="$enabledPlugins"} 86 | {if="count($value.parameters) > 0"} 87 | {if="$count>0"} 88 |
89 | {/if} 90 | {$count=$count+1} 91 |

{function="str_replace('_', ' ', $key)"}

92 | {loop="$value.parameters"} 93 |
94 |
95 | 96 | {if="isset($value.desc)"}
{$value.desc}
{/if} 97 |
98 |
99 | 100 |
101 |
102 | {/loop} 103 | {/if} 104 | {/loop} 105 | {if="$count==0"} 106 |

{'No parameter available.'|t}

107 | {/if} 108 | {/if} 109 |
110 | 113 |
114 |
115 |
116 |
117 |
118 | {include="page.footer"} 119 | 120 | 121 | -------------------------------------------------------------------------------- /material/server.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="server"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 | 10 |
11 |
12 |
13 |
14 |

{'Server administration'|t}

15 | 16 |
17 |
{'General'|t}
18 |
19 |
20 |
21 |
{'Index URL'|t}
22 | 23 |
24 |
25 |
{'Base path'|t}
26 |
{$base_path}
27 |
28 |
29 |
{'Client IP'|t}
30 |
{$client_ip}
31 |
32 |
33 |
{'Trusted reverse proxies'|t}
34 |
35 | {if="count($trusted_proxies) > 0"} 36 |
    37 | {loop="$trusted_proxies"} 38 |
  • {$value}
  • 39 | {/loop} 40 |
41 | {else} 42 | {'N/A'|t} 43 | {/if} 44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | 53 | {include="server.requirements"} 54 | 55 |
56 |
57 |
58 |
59 |
{'Version'|t}
60 |
61 |
62 |
63 |
{'Current version'|t}
64 |
{$current_version}
65 |
66 |
67 |
{'Latest release'|t}
68 | 69 |
70 |
71 |
72 |
73 |
74 | 75 |
76 |
77 |
{'Thumbnails'|t}
78 |
79 |
80 |
81 |
{'Thumbnails status'|t}
82 |
83 | {if="$thumbnails_mode==='all'"} 84 | {'All'|t} 85 | {elseif="$thumbnails_mode==='common'"} 86 | {'Only common media hosts'|t} 87 | {else} 88 | {'None'|t} 89 | {/if} 90 |
91 |
92 |
93 |
94 | {if="$thumbnails_mode!=='none'"} 95 | 99 | {/if} 100 |
101 |
102 | 103 |
104 |
105 |
{'Cache'|t}
106 | 111 |
112 |
113 |
114 |
115 |
116 | 117 | {include="page.footer"} 118 | 119 | 120 | -------------------------------------------------------------------------------- /material/server.requirements.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
{'Permissions'|t}
6 |
7 | {if="count($permissions) > 0"} 8 |

{'There are permissions that need to be fixed.'|t}

9 |
    10 | {loop="$permissions"} 11 |
  • {$value}
  • 12 | {/loop} 13 |
14 | {else} 15 |

{'All read/write permissions are properly set.'|t}

16 | {/if} 17 |
18 |
19 |
20 | 21 |
22 |
23 |
PHP
24 |
25 |

26 | {'Running PHP'|t} {$php_version} 27 | 28 | {if="$php_has_reached_eol"} 29 |
30 | {'End of life: '|t} {$php_eol} 31 | {else} 32 |
33 | {/if} 34 |

35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | {loop="$php_extensions"} 47 | 48 | 49 | 50 | 51 | 66 | 67 | {/loop} 68 | 69 |
{'Extension'|t}{'Usage'|t}{'Status'|t}{'Loaded'|t}
{$value.name}{$value.desc}{$value.required ? t('Required') : t('Optional')} 52 | {if="$value.loaded"} 53 | {$classLoaded="text-success"} 54 | {$strLoaded=t('Loaded')} 55 | {else} 56 | {$strLoaded=t('Not loaded')} 57 | {if="$value.required"} 58 | {$classLoaded="text-error"} 59 | {else} 60 | {$classLoaded="text-warning"} 61 | {/if} 62 | {/if} 63 | 64 | 65 |
70 |
71 |
72 |
73 |
74 |
75 | -------------------------------------------------------------------------------- /material/tag.cloud.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="tag.cloud"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 | 10 | {include="tag.sort"} 11 | 12 |
13 |
14 | {loop="$plugin_start_zone"} 15 | {$value} 16 | {/loop} 17 |
18 |
19 | {loop="$tags"} 20 | {$key}{$value.count} 22 | {loop="$value.tag_plugin"} 23 | {$value} 24 | {/loop} 25 | {/loop} 26 |
27 |
28 | {loop="$plugin_end_zone"} 29 | {$value} 30 | {/loop} 31 |
32 |
33 | {include="page.footer"} 34 | 35 | 36 | -------------------------------------------------------------------------------- /material/tag.list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="tag.list"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 | 10 | {include="tag.sort"} 11 | 12 |
13 | {$countTags=count($tags)} 14 | 15 |
16 | {loop="$plugin_start_zone"} 17 | {$value} 18 | {/loop} 19 |
20 | 21 |
22 |
23 | 24 | {'Tag list'|t} 25 |
26 | 36 | {loop="tags"} 37 |
38 |
39 | {$value} 40 |
41 |
42 | {$key} 43 | {loop="$value.tag_plugin"} 44 | {$value} 45 | {/loop} 46 |
47 |
48 | 49 | 50 | 51 | {if="$is_logged_in"} 52 | 53 | 54 | 55 | 56 | {/if} 57 |
58 |
59 | {/loop} 60 |
61 | 62 |
63 | {loop="$plugin_end_zone"} 64 | {$value} 65 | {/loop} 66 |
67 |
68 | 69 | {if="$is_logged_in"} 70 | 71 | {/if} 72 | 73 | {include="page.footer"} 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /material/tag.sort.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /material/thumbnails.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {$pageName="thumbnails"} 5 | {include="includes"} 6 | 7 | 8 | {include="page.header"} 9 |
10 |
11 |
12 |
13 |

{'Thumbnails update'|t}

14 |
15 |
16 | 17 |
18 | 21 |
22 |
23 |
24 |
25 | 0 / {$ids|count} 26 |
27 | 28 | 29 |
30 |
31 |
32 |
33 |
34 | {include="page.footer"} 35 | 36 | 37 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shaarlimaterial", 3 | "version": "0.14.0", 4 | "description": "Shaarli Material is a theme for [Shaarli](https://github.com/shaarli/Shaarli), the personal, minimalist, super fast, database-free, bookmarking service.", 5 | "main": "src/js/main.js", 6 | "type": "module", 7 | "dependencies": { 8 | "autosize": "^6.0.1", 9 | "awesomplete": "^1.1.5", 10 | "blazy": ">=1.3.0", 11 | "bootstrap": "^3.4.1", 12 | "jquery": "^3.5.1", 13 | "qrcode": "^1.4.4", 14 | "salvattore": "^1.0.9", 15 | "sortablejs": "^1.13.0" 16 | }, 17 | "devDependencies": { 18 | "@rollup/plugin-commonjs": "^28.0.2", 19 | "@rollup/plugin-eslint": "^9.0.3", 20 | "@rollup/plugin-node-resolve": "^16.0.0", 21 | "@rollup/plugin-terser": "^0.4.0", 22 | "cross-env": "^7.0.3", 23 | "csso": "^5.0.5", 24 | "eslint": "^9.17.0", 25 | "neostandard": "^0.12.0", 26 | "postcss": "^8.2.4", 27 | "postcss-clean": "^1.1.0", 28 | "rollup": "^4.29.1", 29 | "rollup-plugin-copy": "^3.3.0", 30 | "rollup-plugin-css-only": "^4.3.0", 31 | "rollup-plugin-sass": "^1.12.19", 32 | "sass": "^1.32.4" 33 | }, 34 | "scripts": { 35 | "build": "cross-env NODE_ENV=production rollup -c --strictDeprecations", 36 | "dev": "cross-env NODE_ENV=development rollup -c --watch", 37 | "lint": "eslint src/js", 38 | "lint:fix": "eslint src/js --fix" 39 | }, 40 | "repository": { 41 | "type": "git", 42 | "url": "https://github.com/kalvn/Shaarli-Material.git" 43 | }, 44 | "keywords": [ 45 | "shaarli", 46 | "material", 47 | "design" 48 | ], 49 | "author": "kalvn", 50 | "license": "MIT", 51 | "browserslist": [ 52 | "last 5 versions" 53 | ] 54 | } 55 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import fs from 'fs'; 3 | 4 | import resolve from '@rollup/plugin-node-resolve'; 5 | import commonjs from '@rollup/plugin-commonjs'; 6 | import postcss from 'postcss'; 7 | import clean from 'postcss-clean'; 8 | import copy from 'rollup-plugin-copy'; 9 | import terser from '@rollup/plugin-terser'; 10 | import sass from 'rollup-plugin-sass'; 11 | import css from 'rollup-plugin-css-only'; 12 | import { minify } from 'csso'; 13 | 14 | const config = { 15 | input: 'src/js/main.js', 16 | output: { 17 | file: 'material/dist/bundle.js', 18 | format: 'iife' 19 | }, 20 | plugins: [ 21 | resolve({ 22 | browser: true 23 | }), 24 | commonjs(), 25 | css({ 26 | output: function (styles) { 27 | fs.writeFileSync(path.join('material', 'dist', 'lib.css'), minify(styles).css); 28 | } 29 | }), 30 | sass({ 31 | output: true, 32 | processor: css => postcss([clean]) 33 | .process(css, { from: undefined }) 34 | .then(result => result.css) 35 | }), 36 | process.env.NODE_ENV === 'production' ? terser() : null, 37 | copy({ 38 | targets: [ 39 | { src: 'src/assets/fonts', dest: 'material/dist' }, 40 | { src: 'src/assets/img', dest: 'material/dist' }, 41 | { src: 'node_modules/bootstrap/dist/fonts/*', dest: 'material/dist/fonts' } 42 | ] 43 | }) 44 | ], 45 | watch: { 46 | exclude: 'node_modules/**' 47 | } 48 | }; 49 | 50 | export default config; 51 | -------------------------------------------------------------------------------- /screenshots/configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/screenshots/configuration.png -------------------------------------------------------------------------------- /screenshots/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/screenshots/home.png -------------------------------------------------------------------------------- /screenshots/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/screenshots/settings.png -------------------------------------------------------------------------------- /screenshots/showcase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/screenshots/showcase.png -------------------------------------------------------------------------------- /src/assets/fonts/material-icons/materialdesignicons-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/material-icons/materialdesignicons-webfont.eot -------------------------------------------------------------------------------- /src/assets/fonts/material-icons/materialdesignicons-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/material-icons/materialdesignicons-webfont.ttf -------------------------------------------------------------------------------- /src/assets/fonts/material-icons/materialdesignicons-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/material-icons/materialdesignicons-webfont.woff -------------------------------------------------------------------------------- /src/assets/fonts/material-icons/materialdesignicons-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/material-icons/materialdesignicons-webfont.woff2 -------------------------------------------------------------------------------- /src/assets/fonts/oldnewspapertypes/oldnewspapertypes-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/oldnewspapertypes/oldnewspapertypes-webfont.ttf -------------------------------------------------------------------------------- /src/assets/fonts/oldnewspapertypes/oldnewspapertypes-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/oldnewspapertypes/oldnewspapertypes-webfont.woff -------------------------------------------------------------------------------- /src/assets/fonts/oldnewspapertypes/oldnewspapertypes-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/oldnewspapertypes/oldnewspapertypes-webfont.woff2 -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-Black.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-Bold.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-Italic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-Light.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-Medium.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-Regular.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-Thin.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/RobotoCondensed-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/RobotoCondensed-Bold.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/RobotoCondensed-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/RobotoCondensed-BoldItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/RobotoCondensed-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/RobotoCondensed-Italic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/RobotoCondensed-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/RobotoCondensed-Light.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/RobotoCondensed-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/RobotoCondensed-LightItalic.ttf -------------------------------------------------------------------------------- /src/assets/fonts/roboto/RobotoCondensed-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/fonts/roboto/RobotoCondensed-Regular.ttf -------------------------------------------------------------------------------- /src/assets/img/arrow-compress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/arrow-compress.png -------------------------------------------------------------------------------- /src/assets/img/arrow-expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/arrow-expand.png -------------------------------------------------------------------------------- /src/assets/img/favicons/android-chrome-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/android-chrome-36x36.png -------------------------------------------------------------------------------- /src/assets/img/favicons/android-chrome-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/android-chrome-48x48.png -------------------------------------------------------------------------------- /src/assets/img/favicons/android-chrome-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/android-chrome-72x72.png -------------------------------------------------------------------------------- /src/assets/img/favicons/android-chrome-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/android-chrome-96x96.png -------------------------------------------------------------------------------- /src/assets/img/favicons/apple-touch-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/apple-touch-icon-57x57.png -------------------------------------------------------------------------------- /src/assets/img/favicons/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /src/assets/img/favicons/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /src/assets/img/favicons/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /src/assets/img/favicons/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /src/assets/img/favicons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/apple-touch-icon.png -------------------------------------------------------------------------------- /src/assets/img/favicons/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | #603cba 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/assets/img/favicons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/favicon-16x16.png -------------------------------------------------------------------------------- /src/assets/img/favicons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/favicon-32x32.png -------------------------------------------------------------------------------- /src/assets/img/favicons/favicon-64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/favicon-64x64.png -------------------------------------------------------------------------------- /src/assets/img/favicons/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/favicon-96x96.png -------------------------------------------------------------------------------- /src/assets/img/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/favicon.ico -------------------------------------------------------------------------------- /src/assets/img/favicons/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Links", 3 | "icons": [ 4 | { 5 | "src": "tpl\/material\/images\/favicons\/android-chrome-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "tpl\/material\/images\/favicons\/android-chrome-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "tpl\/material\/images\/favicons\/android-chrome-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "tpl\/material\/images\/favicons\/android-chrome-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /src/assets/img/favicons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/mstile-150x150.png -------------------------------------------------------------------------------- /src/assets/img/favicons/mstile-310x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/mstile-310x150.png -------------------------------------------------------------------------------- /src/assets/img/favicons/mstile-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/favicons/mstile-70x70.png -------------------------------------------------------------------------------- /src/assets/img/sad_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/sad_star.png -------------------------------------------------------------------------------- /src/assets/img/tools/star-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kalvn/Shaarli-Material/aa47a72f16657b55f9ef45dc7cb10e5b70effea8/src/assets/img/tools/star-circle.png -------------------------------------------------------------------------------- /src/js/components/action-bar.js: -------------------------------------------------------------------------------- 1 | import $ from 'jquery'; 2 | 3 | import animations from './animations'; 4 | import { guid } from './utils'; 5 | 6 | const displayActionBar = function (options) { 7 | if (typeof options !== 'object') { 8 | console.error('displayActionBar expects an object as options.'); 9 | return; 10 | } 11 | 12 | const uid = guid(); 13 | let html = ''; 25 | 26 | $('body').append(html); 27 | 28 | const $actionbar = $('#' + uid).eq(0); 29 | 30 | if (typeof options.onCancel === 'function') { 31 | $('#actionbar-cancel').on('click', function () { 32 | options.onCancel(); 33 | }); 34 | } 35 | 36 | for (const i in options.controls) { 37 | const control = options.controls[i]; 38 | $('#' + control.id).on('click', control.callback); 39 | } 40 | 41 | animations.showSlideFromBottom($actionbar); 42 | 43 | return $actionbar; 44 | }; 45 | 46 | export default displayActionBar; 47 | -------------------------------------------------------------------------------- /src/js/components/animations.js: -------------------------------------------------------------------------------- 1 | import $ from 'jquery'; 2 | 3 | const animationEventName = 'animationend'; 4 | 5 | const animations = { 6 | animation: function (animationName, element, callbackBegin, callbackEnd) { 7 | element.on(animationEventName + '.' + animationName, function () { 8 | // Removes this listener and animation classes. 9 | $(this).off(animationEventName + '.' + animationName) 10 | .removeClass(function (index, classes) { 11 | return (classes.match(/animate-\S+/g) || []).join(' '); 12 | }); 13 | 14 | // Calls the specified callback if it exists. 15 | if (typeof callbackEnd === 'function') { 16 | callbackEnd(); 17 | } 18 | }); 19 | 20 | element.addClass('animate-' + animationName); 21 | if (typeof callbackBegin === 'function') { 22 | callbackBegin(); 23 | } 24 | }, 25 | fadeIn: function (element, callbackBegin, callbackEnd) { 26 | const realCallbackBegin = function () { 27 | element.removeClass('hidden'); 28 | if (typeof callbackBegin === 'function') { 29 | callbackBegin(); 30 | } 31 | }; 32 | 33 | this.animation('fade-in', element, realCallbackBegin, callbackEnd); 34 | }, 35 | fadeOut: function (element, callbackBegin, callbackEnd) { 36 | const realCallbackEnd = function () { 37 | element.addClass('hidden'); 38 | if (typeof callbackEnd === 'function') { 39 | callbackEnd(); 40 | } 41 | }; 42 | 43 | this.animation('fade-out', element, callbackBegin, realCallbackEnd); 44 | }, 45 | slideFromTop: function (element, callbackBegin, callbackEnd) { 46 | const realCallbackBegin = function () { 47 | element.removeClass('hidden'); 48 | if (typeof callbackBegin === 'function') { 49 | callbackBegin(); 50 | } 51 | }; 52 | 53 | this.animation('slide-from-top', element, realCallbackBegin, callbackEnd); 54 | }, 55 | slideFromRight: function (element, callbackBegin, callbackEnd) { 56 | const realCallbackBegin = function () { 57 | element.removeClass('hidden'); 58 | if (typeof callbackBegin === 'function') { 59 | callbackBegin(); 60 | } 61 | }; 62 | 63 | this.animation('slide-from-right', element, realCallbackBegin, callbackEnd); 64 | }, 65 | hideSlideToBottom: function (element, callbackBegin, callbackEnd) { 66 | const realCallbackEnd = function () { 67 | element.addClass('hidden'); 68 | if (typeof callbackEnd === 'function') { 69 | callbackEnd(); 70 | } 71 | }; 72 | 73 | this.animation('hide-slide-to-bottom', element, callbackBegin, realCallbackEnd); 74 | }, 75 | showSlideFromBottom: function (element, callbackBegin, callbackEnd) { 76 | const realCallbackBegin = function () { 77 | element.removeClass('hidden'); 78 | if (typeof callbackBegin === 'function') { 79 | callbackBegin(); 80 | } 81 | }; 82 | 83 | this.animation('show-slide-from-bottom', element, realCallbackBegin, callbackEnd); 84 | }, 85 | compressHeight: function (element, callbackBegin, callbackEnd) { 86 | const realCallbackEnd = function () { 87 | element.addClass('hidden'); 88 | if (typeof callbackEnd === 'function') { 89 | callbackEnd(); 90 | } 91 | }; 92 | 93 | this.animation('compress-height-50', element, callbackBegin, realCallbackEnd); 94 | } 95 | }; 96 | 97 | export default animations; 98 | -------------------------------------------------------------------------------- /src/js/components/batch-add.js: -------------------------------------------------------------------------------- 1 | import $ from 'jquery'; 2 | 3 | import http from './http'; 4 | import modal from './modal'; 5 | 6 | const saveLink = async function ($form) { 7 | const data = {}; 8 | const exists = $form.find('[name="lf_id"]').length > 0; 9 | 10 | $form.find('input[type="text"], textarea, input[type="checkbox"], input[type="hidden"]') 11 | .each(function (index, element) { 12 | const $element = $(element); 13 | if ($element.attr('type') === 'checkbox') { 14 | if ($element.prop('checked')) { 15 | data[$element.attr('name')] = 'on'; 16 | } 17 | 18 | return; 19 | } 20 | 21 | data[$element.attr('name')] = $element.val(); 22 | }); 23 | 24 | try { 25 | formBeforeLoad($form); 26 | 27 | await http.createLink(data); 28 | 29 | formAfterLoad($form, exists ? 'updated' : 'created', 'success'); 30 | } catch (err) { 31 | console.error(err); 32 | formError($form); 33 | modal('Error', 'Something went wrong when saving the link.', 'alert'); 34 | } 35 | }; 36 | 37 | const saveAllLinks = async function () { 38 | const forms = document.querySelectorAll('form[name="linkform"]'); 39 | const total = forms.length; 40 | const $progressOverlay = $('#progress-overlay'); 41 | const $progressCurrent = $progressOverlay.find('.progress-current'); 42 | const $progressTotal = $progressOverlay.find('.progress-total'); 43 | const $progressActual = $progressOverlay.find('.progress-actual'); 44 | 45 | $progressTotal.text(total); 46 | 47 | $progressOverlay.removeClass('hidden'); 48 | 49 | for (let i = 0; i < total; i++) { 50 | await saveLink($(forms[i])); 51 | $progressCurrent.text(i + 1); 52 | $progressActual.css('width', `${(i + 1) * 100 / total}%`); 53 | } 54 | 55 | $progressOverlay.addClass('hidden'); 56 | }; 57 | 58 | const deleteLink = async function ($buttonDelete) { 59 | const url = $buttonDelete.attr('href'); 60 | const $form = $buttonDelete.closest('form'); 61 | 62 | modal('Delete link', 'Are you sure you want to delete this link?', 'confirm', async function (accepts) { 63 | if (accepts) { 64 | try { 65 | formBeforeLoad($form); 66 | 67 | await http.deleteLinkByUrl(url); 68 | 69 | formAfterLoad($form, 'deleted', 'danger'); 70 | } catch (err) { 71 | console.error(err); 72 | formError($form); 73 | modal('Error', 'Something went wrong when deleting the link.', 'alert'); 74 | } 75 | } 76 | }); 77 | }; 78 | 79 | const cancelLink = async function ($buttonCancel) { 80 | const $form = $buttonCancel.closest('form'); 81 | 82 | formBeforeLoad($form); 83 | 84 | // Necessary for the animation to play properly. 85 | await new Promise(resolve => setTimeout(resolve, 100)); 86 | 87 | formAfterLoad($form, 'cancelled'); 88 | }; 89 | 90 | // Checks if there are remaining links. 91 | const noMoreLinks = function () { 92 | if ($('form[name="linkform"]').length === 0) { 93 | $('[name="save_edit_batch"]').attr('disabled', 'disabled'); 94 | } 95 | }; 96 | 97 | const formBeforeLoad = function ($form) { 98 | $form.append('
'); 99 | const height = $form.height(); 100 | $form.css('max-height', `${height}px`); 101 | }; 102 | const formAfterLoad = function ($form, message, type) { 103 | const url = $form.find('[name="lf_url"]').val(); 104 | const customClass = type ? `is-${type}` : ''; 105 | $form.find('.card-overlay').html(`
${url}
${message}
`); 106 | $form.closest('.editlinkform').addClass('is-batch-done'); 107 | // Prevents this form from being treated again. 108 | $form.removeAttr('name'); 109 | }; 110 | const formError = function ($form) { 111 | $form.find('.card-overlay').remove(); 112 | $form.css('max-height', 'none'); 113 | }; 114 | 115 | const batchAdd = { 116 | init: function () { 117 | if (shaarli.pageName === 'addlink') { 118 | $('.button-batch-addform').on('click', function () { 119 | $('.batch-addform').removeClass('hidden'); 120 | $(this).remove(); 121 | }); 122 | } 123 | 124 | if (shaarli.pageName === 'editlinkbatch') { 125 | // Single save buttons. 126 | $('[name="save_edit"]').on('click', async function (event) { 127 | event.preventDefault(); 128 | await saveLink($(this).closest('form')); 129 | noMoreLinks(); 130 | return false; 131 | }); 132 | 133 | $('[name="save_edit_batch"]').on('click', async function (event) { 134 | event.preventDefault(); 135 | await saveAllLinks(); 136 | noMoreLinks(); 137 | return false; 138 | }); 139 | 140 | // Single delete buttons. 141 | $('[name="delete_link"]').off('click').on('click', async function (event) { 142 | event.preventDefault(); 143 | await deleteLink($(this)); 144 | noMoreLinks(); 145 | return false; 146 | }); 147 | 148 | // Single cancel buttons. 149 | $('[name="cancel-batch-link"]').on('click', async function (event) { 150 | event.preventDefault(); 151 | await cancelLink($(this)); 152 | noMoreLinks(); 153 | return false; 154 | }); 155 | } 156 | } 157 | }; 158 | 159 | export default batchAdd; 160 | -------------------------------------------------------------------------------- /src/js/components/http.js: -------------------------------------------------------------------------------- 1 | import $ from 'jquery'; 2 | 3 | const http = { 4 | // data must be a key-value object where keys correspond to edit form names. 5 | createLink: async function (data) { 6 | const params = []; 7 | 8 | Object.keys(data).forEach(key => { 9 | params.push([ 10 | encodeURIComponent(key), 11 | encodeURIComponent(data[key]) 12 | ].join('=')); 13 | }); 14 | 15 | const response = await $.ajax({ 16 | url: `${shaarli.basePath}/admin/shaare`, 17 | method: 'post', 18 | data: params.join('&') 19 | }); 20 | 21 | return response; 22 | }, 23 | 24 | deleteLinkByUrl: async function (url) { 25 | const response = await $.ajax({ 26 | url: `${url}&source=batch`, 27 | method: 'get' 28 | }); 29 | 30 | return response; 31 | }, 32 | 33 | updateThumbnail: async function (id) { 34 | const response = await $.ajax({ 35 | method: 'patch', 36 | url: `${shaarli.basePath}/admin/shaare/${id}/update-thumbnail` 37 | }); 38 | 39 | return response; 40 | }, 41 | 42 | refreshToken: function (callback) { 43 | $.ajax({ 44 | url: shaarli.basePath + '/admin/token', 45 | method: 'get', 46 | success: function (token) { 47 | $('#token').val(token); 48 | 49 | if (typeof callback === 'function') { 50 | callback(token); 51 | } 52 | }, 53 | error: function (err) { 54 | console.error('Failed to refresh token.', err); 55 | } 56 | }); 57 | } 58 | }; 59 | 60 | export default http; 61 | -------------------------------------------------------------------------------- /src/js/components/link-editor.js: -------------------------------------------------------------------------------- 1 | import $ from 'jquery'; 2 | import autosize from 'autosize'; 3 | 4 | import modal from './modal'; 5 | import { escapeHtml } from './utils'; 6 | 7 | const initMetadata = async function () { 8 | if ((shaarli.pageName !== 'editlink' && shaarli.pageName !== 'editlinkbatch') || !shaarli.asyncMetadata) { 9 | return; 10 | } 11 | 12 | // For each edit form present in the page. 13 | $('.editlinkform').each(async function (index, form) { 14 | const $form = $(form); 15 | 16 | const $loadingWrappers = $form.find('.loading-wrapper'); 17 | const $inputTitle = $form.find('input[name="lf_title"]'); 18 | const $inputDescription = $form.find('textarea[name="lf_description"]'); 19 | const $inputTags = $form.find('input[name="lf_tags"]'); 20 | const url = $form.find('input[name="lf_url"]').val(); 21 | 22 | if ($inputTitle.length > 0 && $inputTitle.val().length > 0) { 23 | return; 24 | } 25 | 26 | $loadingWrappers.addClass('is-loading'); 27 | 28 | try { 29 | const data = await $.ajax({ 30 | url: shaarli.basePath + '/admin/metadata?url=' + encodeURIComponent(url), 31 | method: 'get' 32 | }); 33 | 34 | if (data.title && $inputTitle && $inputTitle.length > 0 && $inputTitle.val().length === 0) { 35 | $inputTitle.val(data.title); 36 | } 37 | 38 | if (data.description && $inputDescription && $inputDescription.length > 0 && $inputDescription.val().length === 0) { 39 | $inputDescription.val(data.description); 40 | } 41 | 42 | if (data.tags && $inputTags && $inputTags.length > 0 && $inputTags.val().length === 0) { 43 | $inputTags.val(data.tags); 44 | } 45 | } catch (err) { 46 | console.error('Failed to get link metadata.'); 47 | modal('Error', 'An error occurred while getting metadata for ' + escapeHtml(url), 'alert'); 48 | } 49 | 50 | $loadingWrappers.removeClass('is-loading'); 51 | }); 52 | }; 53 | 54 | const linkEditor = { 55 | init: function () { 56 | const _this = this; 57 | 58 | $('.button-expand').on('click', function (event) { 59 | _this.toggleExpand($(this)); 60 | }).each(function () { 61 | if (parseInt(localStorage.getItem('expand'))) { 62 | _this.toggleExpand($(this)); 63 | } 64 | }); 65 | 66 | autosize($('#lf_description')); 67 | initMetadata(); 68 | 69 | // Delete button when editing an existing link. 70 | $('[name=delete_link]').on('click', function (event) { 71 | event.preventDefault(); 72 | 73 | const url = $(this).attr('href'); 74 | 75 | modal('Delete link', 'Are you sure you want to delete this link?', 'confirm', function (accepts) { 76 | if (accepts) { 77 | window.location.href = url; 78 | } 79 | }); 80 | return false; 81 | }); 82 | }, 83 | 84 | toggleExpand: function ($element) { 85 | const $card = $element.closest('.card'); 86 | const isExpanded = $card.toggleClass('is-expanded').hasClass('is-expanded') ? 1 : 0; 87 | $card.closest('.editlinkform-row').toggleClass('row').find('.editlinkform-col').toggleClass('col-md-6 col-md-offset-3'); 88 | 89 | localStorage.setItem('expand', isExpanded); 90 | } 91 | }; 92 | 93 | export default linkEditor; 94 | -------------------------------------------------------------------------------- /src/js/components/link-list.js: -------------------------------------------------------------------------------- 1 | import $ from 'jquery'; 2 | 3 | import modal from './modal'; 4 | import http from './http'; 5 | 6 | const linkList = { 7 | init: function () { 8 | // Delete button in the link list. 9 | $('.button-delete').on('click', function (event) { 10 | event.preventDefault(); 11 | 12 | const url = $(this).attr('href'); 13 | 14 | modal('Delete link', 'Are you sure you want to delete this link?', 'confirm', function (accepts) { 15 | if (accepts) { 16 | window.location.href = url; 17 | } 18 | }); 19 | return false; 20 | }); 21 | 22 | // Async thumbnail retrieval. 23 | if (shaarli.asyncMetadata) { 24 | $('div[data-async-thumbnail]').each(async function (index, el) { 25 | const $el = $(el); 26 | const id = $el.closest('[data-id]').data('id'); 27 | 28 | const response = await http.updateThumbnail(id); 29 | 30 | if (response.thumbnail !== false) { 31 | const $img = $el.find('img'); 32 | $img.attr('src', response.thumbnail); 33 | $img.data('src', response.thumbnail); 34 | $el.removeClass('hidden'); 35 | } 36 | }); 37 | } 38 | } 39 | }; 40 | 41 | export default linkList; 42 | -------------------------------------------------------------------------------- /src/js/components/modal.js: -------------------------------------------------------------------------------- 1 | import $ from 'jquery'; 2 | 3 | import overlay from './overlay'; 4 | import ripple from './ripple'; 5 | import { escapeHtml } from './utils'; 6 | 7 | /** 8 | * Displays modal. 9 | * @param {String} title Modal title. 10 | * @param {String} text Modal body. 11 | * @param {String} type Type of modal between alert, confirm and prompt. 12 | * @param {Function} callback Callback called when main modal button is pushed. 13 | * @param {Object} options Additional options: 14 | * - noHtmlEscape {Boolean} Prevent HTML escape of title and body. 15 | * - value {String} Value of input field when using type prompt. 16 | * - buttonLabelOk {String} Label for OK button. Defaults to 'OK'. 17 | * - buttonClassesOk {String} Classes for OK button. 18 | * @return {Void} 19 | */ 20 | const displayModal = function (title, text, type, callback, options) { 21 | options = options || {}; 22 | title = options.noHtmlEscape ? title : escapeHtml(title); 23 | let html = '