From 89f8cb3de10b7ff26b09ec01818da02bbaf9e9f0 Mon Sep 17 00:00:00 2001 From: karl <karl@suma-ev.de> Date: Mon, 20 Jun 2016 09:42:42 +0200 Subject: [PATCH] =?UTF-8?q?Alle=20Plugin-Popups=20sind=20=C3=BCbersetzt=20?= =?UTF-8?q?und=20laufen=20ohne=20Javascript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/StartpageController.php | 8 +- public/js/scriptStartPage.js | 4 +- resources/lang/de/index.php | 70 ++++++++++++++--- resources/lang/en/index.php | 56 ++++++++++++- resources/views/index.blade.php | 83 ++++++++++++++++---- 5 files changed, 191 insertions(+), 30 deletions(-) diff --git a/app/Http/Controllers/StartpageController.php b/app/Http/Controllers/StartpageController.php index 9df592c56..14afaca2e 100644 --- a/app/Http/Controllers/StartpageController.php +++ b/app/Http/Controllers/StartpageController.php @@ -2,6 +2,8 @@ namespace App\Http\Controllers; +use Jenssegers\Agent\Agent; + use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Response; @@ -33,6 +35,9 @@ class StartpageController extends Controller } } + $agent = new Agent(); + $browser = $agent->browser(); + return view('index') ->with('title', trans('titles.index')) ->with('homeIcon') @@ -42,7 +47,8 @@ class StartpageController extends Controller ->with('time', $request->input('param_time', '1000')) ->with('sprueche', $request->input('param_sprueche', 'off')) ->with('tab', $request->input('param_sprueche', 'off')) - ->with('focusPages', $focusPages); + ->with('focusPages', $focusPages) + ->with('browser', $browser); } public function loadPage($subpage) diff --git a/public/js/scriptStartPage.js b/public/js/scriptStartPage.js index b53290789..d2fff42ea 100644 --- a/public/js/scriptStartPage.js +++ b/public/js/scriptStartPage.js @@ -1,5 +1,5 @@ $(document).ready(function(){ - checkPlugin(); + // checkPlugin(); if(location.href.indexOf("#plugin-modal") > -1) $("#plugin-modal").modal("show"); $("button").popover(); @@ -45,6 +45,7 @@ $(document).ready(function(){ }); }); +/* function checkPlugin(){ if(isFirefox){ $("#plugin-modal .modal-header h4").html("MetaGer zum Firefox hinzufügen"); @@ -107,6 +108,7 @@ function checkPlugin(){ $(".seperator").addClass("hidden"); } } +*/ function setSettings(){ for(var i = 0; i < localStorage.length; i++){ diff --git a/resources/lang/de/index.php b/resources/lang/de/index.php index 98dde7f60..0f15f2aef 100644 --- a/resources/lang/de/index.php +++ b/resources/lang/de/index.php @@ -1,21 +1,71 @@ <?php return [ - 'foki.bilder' => 'Bilder', - 'foki.nachrichten' => 'Nachrichten', - 'foki.wissenschaft' => 'Wissenschaft', - 'foki.produkte' => 'Produkte', - 'foki.anpassen' => 'anpassen', - 'conveyor' => 'Einkaufen bei MetaGer-Fördershops', - 'plugin' => 'MetaGer-Plugin hinzufügen', - 'sponsors' => 'Sponsoren', - 'sponsors.woxikon' => 'Woxikon: Nach Wörtern & Synonymen suchen', + 'foki.bilder' => 'Bilder', + 'foki.nachrichten' => 'Nachrichten', + 'foki.wissenschaft' => 'Wissenschaft', + 'foki.produkte' => 'Produkte', + 'foki.anpassen' => 'anpassen', + + 'conveyor' => 'Einkaufen bei MetaGer-Fördershops', + + 'plugin' => 'MetaGer-Plugin hinzufügen', + + 'sponsors.head.1' => 'Weitere Informationen', + 'sponsors.head.2' => 'Sponsoren', + 'sponsors.woxikon' => 'Woxikon: Nach Wörtern & Synonymen suchen', 'sponsors.gutscheine' => 'Aktuelle Gutscheine auf Gutschein-Magazin.de', 'sponsors.kredite' => 'Günstige Kredite auf FINANZCHECK.de vergleichen ', + 'about.title' => 'Ãœber uns', 'about.1.1' => 'Datenschutz & Privatsphäre', 'about.1.2' => ' sind bei uns einfach & selbstverständlich.', 'about.2.1' => 'Wir arbeiten nicht gewinnorientiert, wir sind ein ', - 'about.2.2' => 'gemeinnütziger Verein. ' + 'about.2.2' => 'gemeinnütziger Verein. ', + + 'plugin.head.1' => 'MetaGer zum Firefox hinzufügen', + 'plugin.head.2' => 'MetaGer zum Chrome hinzufügen', + 'plugin.head.3' => 'MetaGer zum Opera hinzufügen', + 'plugin.head.4' => 'MetaGer zum Internet Explorer hinzufügen', + 'plugin.head.5' => 'MetaGer zum Microsoft Edge hinzufügen', + + 'plugin.firefox.1' => 'Klicken Sie ', + 'plugin.firefox.2' => 'hier', + 'plugin.firefox.3' => ', um MetaGer als Suchmaschine hinzuzufügen.', + 'plugin.firefox.4' => 'Setzen Sie einen Haken bei "Diese als aktuelle Suchmaschine setzen"', + 'plugin.firefox.5' => 'Klicken Sie auf "Hinzufügen"', + + 'plugin.chrome.1' => 'Klicken Sie ', + 'plugin.chrome.2' => 'hier', + 'plugin.chrome.3' => ', um MetaGer als Suchmaschine hinzuzufügen', + 'plugin.chrome.4' => 'Klicken Sie im Popup auf OK', + 'plugin.chrome.5' => '(Sollte der OK-Knopf deaktiviert sein, ist MetaGer bereits in Ihren Suchmaschinen. Klicken Sie dann auf Abbrechen und fahren mit Schritt 2 fort.)', + 'plugin.chrome.6' => 'Klicken in Ihrem Browser oben rechts auf ', + 'plugin.chrome.7' => 'Wählen Sie "Einstellungen"', + 'plugin.chrome.8' => 'Im Bereich Suchen, klicken Sie auf "Suchmaschinen verwalten"', + 'plugin.chrome.9' => 'In der nun angezeigten Liste, finden Sie MetaGer. Fahren Sie mit der Maus über den Eintrag und klicken auf "Als Standard festlegen"', + + 'plugin.opera.1' => 'Klicken Sie ', + 'plugin.opera.2' => 'hier', + 'plugin.opera.3' => ' um MetaGer in einem neuen Tab zu öffnen.', + 'plugin.opera.4' => 'Im neuen Tab klicken Sie mit der rechten Maustaste auf das Sucheingabefeld in der Mitte der Seite.', + 'plugin.opera.5' => 'Wählen Sie im Kontextmenü "Suchmaschine erstellen..."', + 'plugin.opera.6' => 'Klicken Sie im Popup auf "erstellen"', + 'plugin.opera.7' => '(Leider ist es Suchmaschinen nicht mehr möglich im Opera als Standard eingestellt zu werden, aber ', + 'plugin.opera.8' => 'hier', + 'plugin.opera.9' => ' können Sie mit Firefox einen Open-Source Browser installieren, der dies unterstützt.)', + + 'plugin.IE.1' => 'Klicken Sie ', + 'plugin.IE.2' => 'hier', + 'plugin.IE.3' => ', um MetaGer als Suchmaschine hinzuzufügen', + 'plugin.IE.4' => 'Klicken Sie in Ihrem Browser oben rechts auf Extras (', + 'plugin.IE.5' => 'Wählen Sie den Menüpunkt "Add-Ons verwalten"', + 'plugin.IE.6' => 'Klicken Sie im Bereich Add-On-Typen auf "Suchanbieter" und danach im rechten Bereich auf "MetaGer"', + 'plugin.IE.7' => 'Wählen Sie unten den Knopf "Als Standard"', + 'plugin.edge.1' => 'Klicken Sie in Ihrem Browser oben rechts auf Extras (', + 'plugin.edge.2' => ') und wählen sie "Einstellungen"', + 'plugin.edge.3' => 'Scrollen Sie nach unten und klicken auf "Erweiterte Einstellungen anzeigen"', + 'plugin.edge.4' => 'Scrollen Sie erneut nach unten bis zum Punkt "In Adressleiste suchen mit" und klicken Sie auf "Ändern"', + 'plugin.edge.5' => 'Wählen Sie "MetaGer: Sicher suchen & finden..." und klicken Sie auf "Als Standard"', ]; \ No newline at end of file diff --git a/resources/lang/en/index.php b/resources/lang/en/index.php index ce9902d44..8ff2b2c28 100644 --- a/resources/lang/en/index.php +++ b/resources/lang/en/index.php @@ -6,16 +6,66 @@ return [ 'foki.wissenschaft' => 'Science', 'foki.produkte' => 'Shopping', 'foki.anpassen' => 'customize', + 'conveyor' => 'Purchase at supporting MetaGer Shops', - 'plugin' => 'add the MetaGer-Plugin', - 'sponsors' => '', + + 'plugin' => 'Add the MetaGer-Plugin', + + 'sponsors.head.1' => 'Further Information', + 'sponsors.head.2' => '', 'sponsors.woxikon' => '', 'sponsors.gutscheine' => '', 'sponsors.kredite' => '', + 'about.title' => 'About us', 'about.1.1' => 'Data protection & privacy', 'about.1.2' => ' are simple and natural for us.', 'about.2.1' => 'We do not work for profit. We are a ', - 'about.2.2' => 'non-profit association. ' + 'about.2.2' => 'non-profit association. ', + + 'plugin.head.1' => 'Add MetaGer to your Firefox', + 'plugin.head.2' => 'Add MetaGer to your Chrome', + 'plugin.head.3' => 'Add MetaGer to your Opera', + 'plugin.head.4' => 'Add MetaGer to your Internet Explorer', + 'plugin.head.5' => 'Add MetaGer to your Microsoft Edge', + + 'plugin.firefox.1' => 'Click ', + 'plugin.firefox.2' => 'here', + 'plugin.firefox.3' => ', to add MetaGer as a search engine.', + 'plugin.firefox.4' => 'Please tick the box "Make this the current search engine"', + 'plugin.firefox.5' => 'Click on "Add"', + + 'plugin.chrome.1' => 'Click ', + 'plugin.chrome.2' => 'here', + 'plugin.chrome.3' => ', to add MetaGer as a search engine.', + 'plugin.chrome.4' => 'Click OK on the next Popup', + 'plugin.chrome.5' => '(If the OK.button is disabled, MetaGer is already registered as a search engine. In this case click cancel and go on with step 2.)', + 'plugin.chrome.6' => 'Click this icon in the top right corner of your browser', + 'plugin.chrome.7' => 'Select "Settings"', + 'plugin.chrome.8' => 'In the search section, click on "Manage Search Engines"', + 'plugin.chrome.9' => 'In the displayed list, find MetaGer. Move your mouse over the entry and then click on "Make Default"', + + 'plugin.opera.1' => 'Click ', + 'plugin.opera.2' => 'here', + 'plugin.opera.3' => ' to open MetaGer in a new tab.', + 'plugin.opera.4' => 'In the new tab right click the search field in the middle of the page.', + 'plugin.opera.5' => 'Select "Create search engine..." in the context menu', + 'plugin.opera.6' => 'In the popup click "Create"', + 'plugin.opera.7' => '(Unfortunately it is no longer possible to set search engines as default in Opera, but ', + 'plugin.opera.8' => 'here', + 'plugin.opera.9' => ' you can download the open-source browser Firefox, which can do this.)', + + 'plugin.IE.1' => 'Click ', + 'plugin.IE.2' => 'here', + 'plugin.IE.3' => ', to add MetaGer as a search engine.', + 'plugin.IE.4' => 'Click on extras in the upper right corner of your browser (', + 'plugin.IE.5' => 'Select "Manage Add-Ons"', + 'plugin.IE.6' => 'In the add-ons type are click on "Search Providers" and then in the right area on "MetaGer"', + 'plugin.IE.7' => 'Choose the button "Make this my efault search provider"', + 'plugin.edge.1' => 'Click on extras in the upper right corner of your browser (', + 'plugin.edge.2' => ') and select "Settings"', + 'plugin.edge.3' => 'Scroll down and click on "View advanced settings"', + 'plugin.edge.4' => 'Scroll down until you reach "Search in adress bar with" and click "Change"', + 'plugin.edge.5' => 'Select "MetaGer: Search and Find Savely, Protect Privacy..." and click on "Set as default"', ]; \ No newline at end of file diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index c635d123d..8edd50073 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -12,9 +12,64 @@ </span> </button> <h4> + @if ($browser === 'Firefox' || $browser === 'Mozilla') + {{ trans('index.plugin.head.1') }} + @elseif ($browser === 'Chrome') + {{ trans('index.plugin.head.2') }} + @elseif ($browser === 'Opera') + {{ trans('index.plugin.head.3') }} + @elseif ($browser === 'IE') + {{ trans('index.plugin.head.4') }} + @elseif ($browser === 'Edge') + {{ trans('index.plugin.head.5') }} + @else + $(".seperator").addClass("hidden"); + @endif </h4> </div> <div class="modal-body"> + @if ($browser === 'Firefox' || $browser === 'Mozilla') + <ol> + <li>{{ trans('index.plugin.firefox.1') }}<a href="javascript:window.external.AddSearchProvider($('link[rel=search]').attr('href'))">{{ trans('index.plugin.firefox.2') }}</a>{{ trans('index.plugin.firefox.3') }}</li> + <li>{{ trans('index.plugin.firefox.4') }}</li> + <li>{{ trans('index.plugin.firefox.5') }}</li> + </ol> + @elseif ($browser === 'Chrome') + <ol> + <li>{{ trans('index.plugin.chrome.1') }}<a href="javascript:window.external.AddSearchProvider($('link[rel=search]').attr('href'))" onclick="$('#more').removeClass('hidden');">{{ trans('index.plugin.chrome.2') }}</a>{{ trans('index.plugin.chrome.3') }} + <ul id=\"more\" class=\"hidden list-unstyled\"> + <li>{{ trans('index.plugin.chrome.4') }}</li> + <li><small>{{ trans('index.plugin.chrome.5') }}</small></li> + </ul></li> + <li>{{ trans('index.plugin.chrome.6') }}<span class=\"glyphicon glyphicon-menu-hamburger\"></span></li> + <li>{{ trans('index.plugin.chrome.7') }}</li> + <li>{{ trans('index.plugin.chrome.8') }}</li> + <li>{{ trans('index.plugin.chrome.9') }}</li> + </ol> + @elseif ($browser === 'Opera') + <ol> + <li>{{ trans('index.plugin.opera.1') }}<a href=\"/\" target=\"_blank\">{{ trans('index.plugin.opera.2') }}</a>{{ trans('index.plugin.opera.3') }}</li> + <li>{{ trans('index.plugin.opera.4') }}</li> + <li>{{ trans('index.plugin.opera.5') }}</li> + <li>{{ trans('index.plugin.opera.6') }}</li> + <li><small>{{ trans('index.plugin.opera.7') }}<a href=\"https://www.mozilla.org/de/firefox/new/\" target=\"_blank\">{{ trans('index.plugin.opera.8') }}</a>{{ trans('index.plugin.opera.9') }}</small> + </ol> + @elseif ($browser === 'IE') + <ol> + <li>{{ trans('index.plugin.IE.1') }}<a href=\"javascript:window.external.addSearchProvider($('link[rel=search]').attr('href'));\">{{ trans('index.plugin.IE.2') }}</a>{{ trans('index.plugin.IE.3') }} + <li>{{ trans('index.plugin.IE.4') }}<span class=\"glyphicon glyphicon-cog\"></span>)</li> + <li>{{ trans('index.plugin.IE.5') }}</li> + <li>{{ trans('index.plugin.IE.6') }}</li> + <li>{{ trans('index.plugin.IE.7') }}</li> + </ol> + @elseif ($browser === 'Edge') + <ol> + <li>{{ trans('index.plugin.edge.1') }}<span class=\"glyphicon glyphicon-option-horizontal\"></span>{{ trans('index.plugin.edge.2') }}</li> + <li>{{ trans('index.plugin.edge.3') }}</li> + <li>{{ trans('index.plugin.edge.4') }}</li> + <li>{{ trans('index.plugin.edge.5') }}</li> + </ol> + @endif </div> </div> </div> @@ -75,6 +130,10 @@ <div class="input-group"> <div class="input-group-addon"> <button type="button" data-toggle="popover" data-html="true" data-container="body" title="Persönliches Design auswählen" data-content=' <ul id="color-chooser" class="list-inline list-unstyled"> +} +} +} +} <li ><a id="standard" data-rgba="255,194,107,1" href="javascript:void(0)"></a></li> <li ><a id="standardHard" data-rgba="255,128,0,1" href="javascript:void(0)"></a></li> <li ><a id="blue" data-rgba="164,192,230,1" href="javascript:void(0)"></a></li> @@ -120,9 +179,9 @@ </li> <li class="hidden-xs seperator">| </li> - <li id="plug"> - <a href="#" id="plugin" data-toggle="modal" data-target="#plugin-modal">{{ trans('index.plugin') }} - </a> + <li id="plug" @unless ($browser === 'Firefox' || $browser === 'Mozilla' || $browser === 'Chrome' || $browser === 'Opera' || $browser === 'IE' || $browser === 'Edge') + class="hidden" @endunless > + <a href="#" id="plugin" data-toggle="modal" data-target="#plugin-modal">{{ trans('index.plugin') }}</a> </li> </ul> </figure> @@ -131,31 +190,25 @@ @section('optionalContent') <section id="moreInformation" class="hidden-xs"> - <h1 class="hidden">Weitere Informationen - </h1> + <h1 class="hidden">{{ trans('index.sponsors.head.1') }}</h1> <div class="row"> <div id="sponsors" class="col-md-6 col-sm12"> - <h2>{{ trans('index.sponsors') }} - </h2> + <h2>{{ trans('index.sponsors.head.2') }}</h2> <ul> <li> - <a href="http://www.woxikon.de/" class="mutelink" target="_blank">{{ trans('index.sponsors.woxikon') }} - </a> + <a href="http://www.woxikon.de/" class="mutelink" target="_blank">{{ trans('index.sponsors.woxikon') }}</a> </li> <li> - <a href="http://www.gutschein-magazin.de/" class="mutelink" target="_blank">{{ trans('index.sponsors.gutscheine') }} - </a> + <a href="http://www.gutschein-magazin.de/" class="mutelink" target="_blank">{{ trans('index.sponsors.gutscheine') }}</a> </li> <li> - <a href="https://www.finanzcheck.de/" class="mutelink" target="_blank">{{ trans('index.sponsors.kredite') }} - </a> + <a href="https://www.finanzcheck.de/" class="mutelink" target="_blank">{{ trans('index.sponsors.kredite') }}</a> </li> </ul> </div> <div class="col-md-6 col-sm-12"> <h2> - <a href="/about/">{{ trans('index.about.title') }} - </a> + <a href="/about/">{{ trans('index.about.title') }}</a> </h2> <ul> <li> -- GitLab