diff --git a/README.md b/README.md index da44af2..161815e 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,12 @@ Click a forum, topic, post or FAQ heading to copy a link to it, ready-made as BB - Also works on the title above the posting form and on the posts in the topic review below it. - Links are full addresses built from the forum, topic or post ID, so they work anywhere they're pasted and never carry a session ID. They always point at the forum, topic or post itself, not a page of it. - A small icon (Font Awesome `fa-clone` by default) marks each copyable heading and turns into a tick for a moment after copying. Screen readers announce "The link has been copied." -- Built for keyboard and screen reader use: headings stay ordinary links reached with Tab and copied with Enter, each one is described as "Copy a link to this as BBCode", the icon is hidden from screen readers, and focus is always clearly outlined. +- Built for keyboard and screen reader use: headings stay ordinary links reached with Tab and copied with Enter, each one has a description matching the selected copy format, the icon is hidden from screen readers, and focus is always clearly outlined. +- Clicking a post or FAQ question also follows its anchor and keeps the link focused. - Ctrl-, Cmd-, Shift- and middle-clicks still open the link as usual. -- When the browser won't allow copying (for example a board on plain `http://`), the BBCode is shown in a box to copy by hand. +- When the browser won't allow copying (for example a board on plain `http://`), the selected link format is shown in a box to copy by hand. - Search engine bots get the board unchanged. -- Turn the icon on or off, or choose another icon, under **ACP → Extensions → Copy Links → Settings**. +- Choose BBCode (the default) or plain URLs, turn the icon on or off, or choose another icon, under **ACP → Extensions → Copy Links → Settings**. - Works with prosilver and styles based on it. ## Screenshots @@ -23,7 +24,7 @@ Click a forum, topic, post or FAQ heading to copy a link to it, ready-made as BB Tick after copying a topic title Tick after copying an FAQ question -ACP settings +ACP settings @@ -40,6 +41,8 @@ Click an image for the full size. See the [screenshot gallery](docs/images/scree 2. In the Administration Control Panel, go to **Customise → Manage extensions** 3. Enable the **Copy Links** extension +After updating an existing installation, disable and re-enable the extension to apply the new settings migration; do not delete its data. + ## Contributing Contributions are welcome! diff --git a/acp/main_module.php b/acp/main_module.php index c5b82dd..28d7132 100644 --- a/acp/main_module.php +++ b/acp/main_module.php @@ -11,8 +11,7 @@ namespace phpbbmodders\copylinks\acp; /** - * ACP settings page: whether to show an icon next to copyable headings, and - * which Font Awesome icon to use. + * ACP settings page: copy format and the icon next to copyable headings. */ class main_module { @@ -55,12 +54,14 @@ public function main($id, $mode) $config->set('copylinks_icon_enable', (int) $request->variable('copylinks_icon_enable', false)); $config->set('copylinks_icon', $icon); + $config->set('copylinks_plain_url', (int) $request->variable('copylinks_plain_url', false)); $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_COPYLINKS_SETTINGS'); trigger_error($language->lang('CONFIG_UPDATED') . adm_back_link($this->u_action)); } $template->assign_vars([ + 'S_COPYLINKS_PLAIN_URL' => !empty($config['copylinks_plain_url']), 'U_ACTION' => $this->u_action, 'S_COPYLINKS_ICON_ENABLE' => !empty($config['copylinks_icon_enable']), 'COPYLINKS_ICON' => !empty($config['copylinks_icon']) ? $config['copylinks_icon'] : self::DEFAULT_ICON, diff --git a/adm/style/acp_copylinks_settings.html b/adm/style/acp_copylinks_settings.html index 7f22174..f276cdd 100644 --- a/adm/style/acp_copylinks_settings.html +++ b/adm/style/acp_copylinks_settings.html @@ -6,6 +6,10 @@

{{ lang('ACP_COPYLINKS') }}