From 2c484ae4a3094c17f63120f051de7fdb26b81419 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 22 Mar 2016 12:20:35 +0100 Subject: [PATCH] Added filters for image type, and french/english locales --- .../library/search/Pixabay.wgs/index.html | 53 ++++++++++++++++--- .../search/Pixabay.wgs/locales/locales.js | 8 ++- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/resources/library/search/Pixabay.wgs/index.html b/resources/library/search/Pixabay.wgs/index.html index 221bf576..890b992b 100644 --- a/resources/library/search/Pixabay.wgs/index.html +++ b/resources/library/search/Pixabay.wgs/index.html @@ -5,6 +5,7 @@ Pixabay Image Search + @@ -35,6 +36,9 @@ // Default language to search in, if the application can't return a suitable one var searchLanguage = "en"; + + // Language for the widget + var locale = "en"; // Fetch 960px images instead of the default 640px. However the API doesn't // provide size information in this case, so it is disabled by default. @@ -45,6 +49,7 @@ // --------------------- var currentIndex = 0; var currentTerm = ""; + var filtersDisplayed = false; // Pixabay's supported search languages var availableLanguages = ['cs', 'da', 'de', 'en', 'es', 'fr', 'id', 'it', 'hu', 'nl', 'no', @@ -60,13 +65,18 @@ // Get OpenBoard's current language var appLanguage = window.sankore ? sankore.locale().substr(0,2) : searchLanguage; + // Set it as search language, if possible if (availableLanguages.indexOf(appLanguage) > -1) - searchLanguage = appLanguage + searchLanguage = appLanguage; + + // And as the widget's language + if (locales[searchLanguage] != undefined) + locale = locales[searchLanguage]; var mode = false; //search or view mode var hide = false; //hide or no main panel - //basic containers and elements + // basic containers and elements var search = $("