diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-03-31 14:03:28 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-06-10 10:23:21 +0200 |
commit | 1829fa2c1571428cb4318443387dde1707fc9641 (patch) | |
tree | 075e7e4ee7d7064dae651f873425f4578da74fe9 /install/html/ffconfig.js | |
parent | 78f026bc9013347d4bc2b4c02e72b19495a1b8ac (diff) | |
download | freeipa-1829fa2c1571428cb4318443387dde1707fc9641.tar.gz freeipa-1829fa2c1571428cb4318443387dde1707fc9641.tar.xz freeipa-1829fa2c1571428cb4318443387dde1707fc9641.zip |
webui: apply PatternFly theme on config pages
https://fedorahosted.org/freeipa/ticket/4278
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install/html/ffconfig.js')
-rw-r--r-- | install/html/ffconfig.js | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/install/html/ffconfig.js b/install/html/ffconfig.js index 3c9f34c77..ecb1a635f 100644 --- a/install/html/ffconfig.js +++ b/install/html/ffconfig.js @@ -111,6 +111,36 @@ IPA.browser_config = { var element = self.get_data_element(); var ext_installed = element.getAttribute('answer') === 'true'; return ext_installed; - } + }, + + get_browser: function() { + + var ua = window.navigator.userAgent.toLowerCase(); + + var match = (/(chrome)[ \/]([\w.]+)/.exec(ua)) || + (/(webkit)[ \/]([\w.]+)/.exec(ua)) || + (/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)) || + (/(msie) ([\w.]+)/.exec(ua)) || + ua.indexOf("compatible") < 0 && (/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)) || + []; + var matched = { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + var browser = {}; + + if (matched.browser) { + browser[matched.browser] = true; + browser.version = matched.version; + } + + // Chrome is Webkit, but Webkit is also Safari. + if (browser.chrome) { + browser.webkit = true; + } else if ( browser.webkit ) { + browser.safari = true; + } + return browser; + } };
\ No newline at end of file |