From bf5571fbe1a609d1056557d57e948224e40bbb1a Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 21 Jul 2013 11:11:41 -0400 Subject: [PATCH] Improve help popup (pull-request) --- README.markdown | 3 +- assets/css/app.css | 4 +-- assets/js/app.js | 8 ++--- assets/js/{popupHelp.js => popup.js} | 5 ++- index.php | 7 +++++ locales/cs_CZ/translations.php | 5 +-- locales/de_DE/translations.php | 5 +-- locales/fr_FR/translations.php | 7 +++-- locales/it_IT/translations.php | 5 +-- locales/zh_CN/translations.php | 5 +-- templates/app_header.php | 18 +---------- templates/config.php | 16 +--------- templates/keyboard_shortcuts.php | 15 +++++++++ templates/login.php | 47 +++++++++++++++------------- templates/show_help.php | 19 +++++++++++ 15 files changed, 92 insertions(+), 77 deletions(-) rename assets/js/{popupHelp.js => popup.js} (59%) create mode 100644 templates/keyboard_shortcuts.php create mode 100644 templates/show_help.php diff --git a/README.markdown b/README.markdown index ab09730..42aa060 100644 --- a/README.markdown +++ b/README.markdown @@ -19,7 +19,7 @@ Features - Mobile CSS (responsive design) - Keyboard shortcuts (pressing '?' displays a pop-up listing the shortcuts; pressing 'q' closes it) - Basic bookmarks -- Translated in English, French, German, Italian and Simplified Chinese +- Translated in English, French, German, Italian, Czech and Simplified Chinese - Themes Todo and known bugs @@ -49,6 +49,7 @@ People who sent one or many pull-requests: - Félix: https://github.com/dysosmus - Horsely: https://github.com/horsley - Ing. Jan Kaláb: https://github.com/Pitel +- James Scott-Brown: https://github.com/jamesscottbrown - Luca Marra: https://github.com/facciocose - Maxime: https://github.com/EpocDotFr - MonsieurPaulLeBoulanger: https://github.com/MonsieurPaulLeBoulanger diff --git a/assets/css/app.css b/assets/css/app.css index f0a682e..906d735 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -216,8 +216,8 @@ textarea.form-error { margin-bottom: 15px; } -.invisible { - display:none; +.hide { + display: none; } /* alerts */ diff --git a/assets/js/app.js b/assets/js/app.js index 2b8b718..5b021f4 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -478,13 +478,9 @@ open_next_page(); break; case 63: // ? - var jsFile = document.URL.substr(0, document.URL.lastIndexOf('/') + 1) + "assets/js/popupHelp.js"; - var htmlHelp = document.getElementById("shortcuts").innerHTML; - var encodedHelp = "data:text/html;charset=utf-8," + htmlHelp; - var popup = open(encodedHelp, "Shortcuts", "width=300,height=300,location=no,scrollbars=no,status=no,toolbar=no"); - break; + open("?action=show-help", "Help", "width=320,height=400,location=no,scrollbars=no,status=no,toolbar=no"); + break; } }; })(); - diff --git a/assets/js/popupHelp.js b/assets/js/popup.js similarity index 59% rename from assets/js/popupHelp.js rename to assets/js/popup.js index b7727ef..426d1dd 100644 --- a/assets/js/popupHelp.js +++ b/assets/js/popup.js @@ -1,10 +1,9 @@ -document.title = "Keyboard Shortcuts"; document.onkeypress = function(e) { switch (e.keyCode || e.which) { case 81: // Q case 113: // q - window.close(); - break; + window.close(); + break; } }; diff --git a/index.php b/index.php index c58cf9d..1c630d3 100644 --- a/index.php +++ b/index.php @@ -85,6 +85,13 @@ Router\post_action('login', function() { }); +// Show help +Router\get_action('show-help', function() { + + Response\html(Template\load('show_help')); +}); + + // Show item without bottom nav Router\get_action('show', function() { diff --git a/locales/cs_CZ/translations.php b/locales/cs_CZ/translations.php index 4025599..71976d2 100644 --- a/locales/cs_CZ/translations.php +++ b/locales/cs_CZ/translations.php @@ -1,6 +1,7 @@ 'Pomoc', 'No item' => 'Žádný článěk', 'items' => 'články', 'There is %d empty feeds, there is maybe an error: %s...' => @@ -106,6 +107,6 @@ return array( 'Do you really want to remove this subscription: "%s"?' => 'Opravdu chcete odstranit tento odběr: "%s"?', 'Nothing to read, do you want to update your subscriptions?' => 'Nic ke čtení, chete aktualizovat vaše odběry?', - 'Show shortcuts' => 'Ukázat zkratky', - 'Close shortcut list' => 'Zavřít seznam zkratek' + 'Show help' => 'Zobrazit nápovědu', + 'Close help' => 'Zobrazit nápovědu' ); diff --git a/locales/de_DE/translations.php b/locales/de_DE/translations.php index 5535181..13c5420 100644 --- a/locales/de_DE/translations.php +++ b/locales/de_DE/translations.php @@ -1,6 +1,7 @@ 'Hilfe', 'Items per page' => 'Artikel pro Seite', 'Previous page' => 'Vorheriger Seite', 'Next page' => 'Nächster Seite', @@ -102,6 +103,6 @@ return array( 'Do you really want to remove this subscription: "%s"?' => 'Willst du dieses Abonnement wirklich löschen: "%s" ?', 'Nothing to read, do you want to update your subscriptions?' => 'Nichts zu lesen, willst du alle Abonemments aktualisieren?', - 'Show shortcuts' => 'Verknüpfungen anzeigen', - 'Close shortcut list' => 'Schließen Liste für Schnellzugriffe' + 'Show help' => 'Hilfe anzeigen', + 'Close help' => 'Hilfe schließen' ); diff --git a/locales/fr_FR/translations.php b/locales/fr_FR/translations.php index 65d08de..362ba57 100644 --- a/locales/fr_FR/translations.php +++ b/locales/fr_FR/translations.php @@ -1,6 +1,7 @@ 'Aide', 'Theme' => 'Thème', 'No item' => 'Aucun élément', 'items' => 'éléments', @@ -25,7 +26,7 @@ return array( 'remove bookmark' => 'supprimer des favoris', 'bookmarks' => 'favoris', 'Bookmarks' => 'Favoris', - 'Bookmark item' => 'Ajouter l\'élément séléctionné aux favoris', + 'Bookmark item' => 'Ajouter l\'élément aux favoris', 'No bookmark' => 'Aucun favoris', 'history' => 'historique', 'subscriptions' => 'abonnements', @@ -107,6 +108,6 @@ return array( 'Do you really want to remove this subscription: "%s"?' => 'Voulez-vous vraiment supprimer cet abonnement : "%s" ?', 'Nothing to read, do you want to update your subscriptions?' => 'Il n\'y a rien à lire, voulez-vous mettre à jour vos abonnements ?', - 'Show shortcuts' => 'Afficher les raccourcis', - 'Close shortcut list' => 'Fermer la liste des raccourcis' + 'Show help' => 'Afficher l\'aide', + 'Close help' => 'Fermer l\'aide', ); diff --git a/locales/it_IT/translations.php b/locales/it_IT/translations.php index a419aa0..08c8083 100644 --- a/locales/it_IT/translations.php +++ b/locales/it_IT/translations.php @@ -1,6 +1,7 @@ 'Aiuto', 'Theme' => 'Tema', 'Items per page' => 'Articoli per pagina', 'Previous page' => 'Pagina precedente', @@ -103,6 +104,6 @@ return array( 'Do you really want to remove this subscription: "%s"?' => 'Vuoi veramente cancellare la sottoscrizione a: "%s" ?', 'Nothing to read, do you want to update your subscriptions?' => 'Niente da leggere, vuoi aggiornare tutte le sottoscrizioni?', - 'Show shortcuts' => 'Mostra tasti di scelta rapida', - 'Close shortcut list' => 'Ridurre la lista di scelta rapida' + 'Show help' => 'Mostra help', + 'Close help' => 'Chiudere aiuto' ); diff --git a/locales/zh_CN/translations.php b/locales/zh_CN/translations.php index c9dde04..b9d292a 100644 --- a/locales/zh_CN/translations.php +++ b/locales/zh_CN/translations.php @@ -1,6 +1,7 @@ '帮助', 'Items per page' => '每页条目数', 'Previous page' => '上一页', 'Next page' => '下一页', @@ -102,6 +103,6 @@ return array( 'Do you really want to remove this subscription: "%s"?' => '你确定要移除这个订阅源: "%s" ?', 'Nothing to read, do you want to update your subscriptions?' => '空空如也,你想要更新订阅源嘛?', - 'Show shortcuts' => '显示捷径', - 'Close shortcut list' => '关闭快捷键列表' + 'Show help' => '显示帮助', + 'Close help' => '关闭帮助', ); diff --git a/templates/app_header.php b/templates/app_header.php index 675c5e0..f708821 100644 --- a/templates/app_header.php +++ b/templates/app_header.php @@ -41,20 +41,4 @@
%s') ?> - %s') ?> - - + %s') ?> \ No newline at end of file diff --git a/templates/config.php b/templates/config.php index 6dc106d..6af5c9b 100644 --- a/templates/config.php +++ b/templates/config.php @@ -45,21 +45,7 @@
  • -
    -

    -
      -
    • = p j
    • -
    • = n k
    • -
    • = m
    • -
    • = v
    • -
    • = o
    • -
    • = f
    • -
    • = h
    • -
    • = l

    • -
    • = ?
    • -
    • = q
    • -
    -
    +

      diff --git a/templates/keyboard_shortcuts.php b/templates/keyboard_shortcuts.php new file mode 100644 index 0000000..7b29fc9 --- /dev/null +++ b/templates/keyboard_shortcuts.php @@ -0,0 +1,15 @@ +
      +

      +
        +
      • = p j
      • +
      • = n k
      • +
      • = m
      • +
      • = v
      • +
      • = o
      • +
      • = f
      • +
      • = h
      • +
      • = l
      • +
      • = ?
      • +
      • = q
      • +
      +
      \ No newline at end of file diff --git a/templates/login.php b/templates/login.php index 35cb6e5..760738f 100644 --- a/templates/login.php +++ b/templates/login.php @@ -13,28 +13,31 @@ - - - - - -

      - - - -
      - - -
      - - - - -
      - +
      + - +
      + + + +

      + + + +
      + + +
      + + + + +
      + +
      +
      +
      +
      \ No newline at end of file diff --git a/templates/show_help.php b/templates/show_help.php new file mode 100644 index 0000000..d247fa0 --- /dev/null +++ b/templates/show_help.php @@ -0,0 +1,19 @@ + + + + + <?= t('Help') ?> + + + + +
      + +
      + +
      +
      + + \ No newline at end of file