Use OpenSearch toolbar ==> IE7 & FF compatible
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 15 Feb 2007 18:41:50 +0000 (18:41 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 15 Feb 2007 18:41:50 +0000 (18:41 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1499 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
htdocs/javascript/xorg.js
htdocs/xorg.opensearch.xml [new file with mode: 0644]
htdocs/xorg.src [deleted file]
templates/search/quick.tpl
templates/skin/common.header.tpl

index c666141..dbbee9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@ New:
     * Core:
         - UTF-8                                                            -FRU
 
+    * Search:
+        - Search Engine IE7 compatible                                     -FRU
+
 ================================================================================
 VERSION 0.9.13                                                        30 01 2007
 
index 44c3291..c89dd72 100644 (file)
@@ -44,17 +44,24 @@ function getNow() {
 // }}}
 // {{{ Firefox
 
-function addFirefoxEngine() {
+function addSearchEngine()
+{
+  var searchURI = "http://www.polytechnique.org/xorg.opensearch.xml";
   if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
     window.sidebar.addSearchEngine(
-      "http://www.polytechnique.org/xorg.src",
+      searchURI,
       "http://www.polytechnique.org/images/xorg.png",
-      "Recherche rapide X.org",
+      "Annuaire Polytechnique.org",
       "Academic");
-  } else { alert("Impossible d'installer la barre de recherche Firefox"); }
+  } else {
+    try {
+        window.external.AddSearchProvider(searchURI);
+    } catch(e) {
+        alert("Impossible d'installer la barre de recherche"); 
+    }
+  }
 }
 
-
 // }}}
 // {{{ Events
 
diff --git a/htdocs/xorg.opensearch.xml b/htdocs/xorg.opensearch.xml
new file mode 100644 (file)
index 0000000..e9161f8
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
+  <ShortName>Annuaire Polytechnique.org</ShortName>
+  <Description>Recherche rapide dans l'annuaire de Polytechnique.org</Description>
+  <Tags>polytechnique alumni</Tags>
+  <Contact>contact@polytechnique.org</Contact>
+  <Url type="text/html" template="https://www.polytechnique.org/search?quick={searchTerms}" />
+  <Language>fr_FR</Language>
+  <OutputEncoding>UTF-8</OutputEncoding>
+  <InputEncoding>UTF-8</InputEncoding>
+</OpenSearchDescription>
diff --git a/htdocs/xorg.src b/htdocs/xorg.src
deleted file mode 100644 (file)
index c7d853d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Mozilla/Polytechnique.org plug-in by contact@polytechnique.org
-
-<search
-       name="Polytechnique.org"
-       description="Recherche rapide X.org"
-       method="GET"
-       action="http://www.polytechnique.org/search"
-       update="http://www.polytechnique.org/xorg.src"
-       updateCheckDays=30
-       queryEncoding="ISO-8859-15"
-       queryCharset="ISO-8859-15">
-
-<input name="quick" user>
-</search>
index 2c0e373..ceb033f 100644 (file)
@@ -52,7 +52,7 @@ sans distinction de casse et sans tenir compte des accents.
 
 {if $smarty.session.auth ge AUTH_COOKIE}
 <h2>Barre de recherche pour Firefox</h2>
-<p>Tu peux <a href="javascript:addFirefoxEngine()">installer</a> la barre de recherche rapide directement dans ton navigateur.
+<p>Tu peux <a href="javascript:addSearchEngine()">installer</a> la barre de recherche rapide directement dans ton navigateur.
 </p>
 {/if}
 
index 08c360c..d618850 100644 (file)
     <meta name="description" content="Le Portail des Polytechniciens" />
     <meta name="keywords" content="Ecole polytechnique, anciens eleves, portail, alumni, AX, X, routage, reroutage, e-mail, email, mail" />
     <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
-    <link rel="icon" href="images/favicon.png" type="image/png" />
+    <link rel="icon" href="/images/favicon.png" type="image/png" />
     <link rel="index"  href="" />
     <link rel="author" href="changelog" />
     <link rel="search" href="search" />
+    <link rel="search" type="application/opensearchdescription+xml" href="/xorg.opensearch.xml" title="Annuaire Polytechnique.org" />
     <link rel="help"   href="Xorg/FAQ" />
     <link rel="bookmark" href="http://www.polytechnique.fr/"        title="| Ă‰cole polytechnique" />
     <link rel="bookmark" href="http://www.polytechnique.edu/"       title="| Institutionnal site" />