diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index 9ad96fc02..66ac063bc 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js @@ -4,6 +4,8 @@ import $ from 'jquery'; /* Annotations */ import annotator from 'annotator'; +import ClipboardJS from 'clipboard'; + /* Fonts */ import 'material-design-icons-iconfont/dist/material-design-icons.css'; import 'lato-font/css/lato-font.css'; @@ -107,4 +109,12 @@ $(document).ready(() => { $('#user_emailTwoFactor').on('change', () => { $('#user_googleTwoFactor').prop('checked', false); }); + + // handle copy to clipboard for developer stuff + const clipboard = new ClipboardJS('.btn'); + clipboard.on('success', (e) => { + console.info(e.text); + + e.clearSelection(); + }); }); diff --git a/package.json b/package.json index ac894e797..61f447149 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ }, "dependencies": { "annotator": "git://github.com/wallabag/annotator.git#0f076c7d371ed25eb0793346f46982d90f2c4c85", + "clipboard": "^2.0.4", "hammerjs": "^2.0.8", "highlight.js": "^9.12.0", "icomoon-free-npm": "^0.0.0", diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 2db283ae6..c504bddc8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -518,6 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'Back' + # copy_to_clipboard: Copy to clipboard # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index db01272f4..b2d1a09da 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Weiterleitungs-URIs' save_label: 'Neuen Client erstellen' action_back: 'Zurück' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'API-Client-Verwaltung > Client-Parameter' page_description: 'Dies sind deine Client-Parameter.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 6d0063108..6874e924b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Redirect URIs (optional)' save_label: 'Create a new client' action_back: 'Back' + copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'API clients management > Client parameters' page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 0eb743964..13e96e0fd 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'URIs de redirección' save_label: 'Crear un nuevo cliente' action_back: 'Volver' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Gestión de clientes API > Parámetros del cliente' page_description: 'Aquí están los parámetros del cliente.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 35afdbf43..425d3a6a8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -518,6 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'بازگشت' + # copy_to_clipboard: Copy to clipboard # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 8a79b02ff..2c1a91a8d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: "Adresses de redirection (optionnel)" save_label: "Créer un nouveau client" action_back: "Retour" + copy_to_clipboard: Copier dans le presse-papier client_parameter: page_title: "Gestion des clients API > Les paramètres de votre client" page_description: "Voilà les paramètres de votre client" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 859bbb146..b8b37301e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Redirect URI' save_label: 'Crea un nuovo client' action_back: 'Indietro' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Gestione client API > Parametri Client' page_description: 'Questi sono i tuoi parametri del client.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 7d9286131..c887fe294 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'URLs de redireccion' save_label: 'Crear un novèl client' action_back: 'Retorn' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Gestion dels clients API > Los paramètres de vòstre client' page_description: 'Vaquí los paramètres de vòstre client.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 8e7ad7f25..3a2073d3b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Przekieruj adresy URI' save_label: 'Stwórz nowego klienta' action_back: 'Cofnij' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Zarządzanie klientami API > Parametry klienta' page_description: 'Tutaj znajdują się parametry klienta.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index ee45c0857..50bc246c3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'URIs de redirecionamento' save_label: 'Criar um novo cliente' action_back: 'Voltar' + # copy_to_clipboard: Copy to clipboard client_parameter: # page_title: 'API clients management > Parâmetros de clientes' page_description: 'Aqui estão os parâmetros de seus clientes.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index edfc77a25..a0da32998 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -518,6 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'Back' + # copy_to_clipboard: Copy to clipboard # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index c99da444f..7aedc2909 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Ссылка перенаправления (опционально)' save_label: 'Создать нового клиента' action_back: 'Назад' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Управление клиентским API > Параметры клиента' page_description: 'Здесь ваши параметры клиента.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 9927d0598..924a85d9c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'เส้นทางใหม่ของ URIs (ให้เลือกได้)' save_label: 'สร่้างลูกข่ายใหม' action_back: 'กลับ' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'การจัดการลูกข่ายของ API > พารามิเตอร์ของลูกข่าย' page_description: 'ที่นี้เป็นพารามิเตอร์ของลูกข่ายของคุณ' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 60fa44d59..e81c1974c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -518,6 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'Back' + # copy_to_clipboard: Copy to clipboard # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig index b498cceb4..3a3ba0c97 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig @@ -8,11 +8,29 @@
{{ 'developer.client_parameter.page_description'|trans }}
-{{ client_name }}
{{ client_id }}
{{ client_secret }}
{{ 'developer.client_parameter.field_name'|trans }} | +{{ client_name }} |
+
{{ 'developer.client_parameter.field_id'|trans }} | +
+ {{ client_id }}
+
+ |
+
{{ 'developer.client_parameter.field_secret'|trans }} | +
+ {{ client_secret }}
+
+ |
+
{{ 'developer.existing_clients.field_id'|trans }} | -{{ client.clientId }} |
+
+ {{ client.clientId }}
+
+ |
{{ 'developer.existing_clients.field_secret'|trans }} | -{{ client.secret }} |
+
+ {{ client.secret }}
+
+ |
{{ 'developer.existing_clients.field_uris'|trans }} | @@ -48,9 +54,10 @@{{ client.allowedGrantTypes|json_encode() }} |
{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name }) }}
+{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name }) }}
- {{ 'developer.remove.warn_message_1'|trans({'%name%': client.name }) }}
- {{ 'developer.remove.warn_message_2'|trans({'%name%': client.name }) }}
{{ 'developer.remove.action'|trans({'%name%': client.name }) }}