Add an option allowing the image toolbar to be suppressed in IE.
authorrich <rich>
Mon, 14 Aug 2006 10:04:24 +0000 (10:04 +0000)
committerrich <rich>
Mon, 14 Aug 2006 10:04:24 +0000 (10:04 +0000)
http://photomatt.net/2004/07/11/image-toolbar/

Be even more economical with those vital bytes at the top of the page,
before the content appears.

schema/cocanwiki.sql
scripts/edit_host_settings.ml
scripts/edit_host_settings_form.ml
scripts/host_menu.ml
scripts/lib/cocanwiki_template.ml
templates/edit_host_settings_form.html
templates/host_menu.html
templates/page.html
templates/page_header.html

index 4a62e68..17a00df 100644 (file)
@@ -1158,7 +1158,8 @@ CREATE TABLE hosts (
     brand text,
     brand_tagline text,
     brand_description text,
-    pagebug text
+    pagebug text,
+    ie_imagetoolbar_no boolean DEFAULT false NOT NULL
 );
 
 
index ff4c231..34d1eeb 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_host_settings.ml,v 1.11 2006/07/26 13:12:10 rich Exp $
+ * $Id: edit_host_settings.ml,v 1.12 2006/08/14 10:04:25 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -41,6 +41,7 @@ let run r (q : cgi) dbh hostid { hostname = hostname } _ =
   let feedback_email = trim (q#param "feedback_email") in
   let mailing_list = q#param_true "mailing_list" in
   let search_box = q#param_true "search_box" in
+  let ie_imagetoolbar_no = q#param_true "ie_imagetoolbar_no" in
   let navigation = q#param_true "navigation" in
   let view_anon = q#param_true "view_anon" in
   let brand = trim (q#param "brand") in
@@ -70,7 +71,7 @@ let run r (q : cgi) dbh hostid { hostname = hostname } _ =
        view_anon = $view_anon,
        brand = $?brand, brand_tagline = $?brand_tagline,
        brand_description = $?brand_description,
-       pagebug = $?pagebug
+       pagebug = $?pagebug, ie_imagetoolbar_no = $ie_imagetoolbar_no
      where id = $hostid";
 
   PGOCaml.commit dbh;
index 6b8e73c..bd4bbb4 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_host_settings_form.ml,v 1.7 2006/03/27 18:09:46 rich Exp $
+ * $Id: edit_host_settings_form.ml,v 1.8 2006/08/14 10:04:25 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -44,16 +44,16 @@ let run r (q : cgi) dbh hostid _ _ =
     PGSQL(dbh)
       "select canonical_hostname, edit_anon, create_account_anon, theme_css,
               feedback_email, mailing_list, search_box, navigation, view_anon,
-              brand, brand_tagline, brand_description
+              brand, brand_tagline, brand_description, ie_imagetoolbar_no
          from hosts where id = $hostid" in
 
   let canonical_hostname, edit_anon, create_account_anon, theme_css,
       feedback_email, mailing_list, search_box, navigation, view_anon,
-      brand, brand_tagline, brand_description =
+      brand, brand_tagline, brand_description, ie_imagetoolbar_no =
     match rows with
     | [canonical_hostname, edit_anon, create_account_anon, theme_css,
        feedback_email, mailing_list, search_box, navigation, view_anon,
-       brand, brand_tagline, brand_description] ->
+       brand, brand_tagline, brand_description, ie_imagetoolbar_no] ->
        let theme_css =
          match theme_css with Some s -> s | None -> "" in
        let feedback_email =
@@ -66,7 +66,7 @@ let run r (q : cgi) dbh hostid _ _ =
          match brand_description with Some s -> s | None -> "" in
        canonical_hostname, edit_anon, create_account_anon, theme_css,
        feedback_email, mailing_list, search_box, navigation, view_anon,
-       brand, brand_tagline, brand_description
+       brand, brand_tagline, brand_description, ie_imagetoolbar_no
     | _ -> assert false in
 
   template#set "canonical_hostname" canonical_hostname;
@@ -75,6 +75,7 @@ let run r (q : cgi) dbh hostid _ _ =
   template#set "feedback_email" feedback_email;
   template#conditional "mailing_list" mailing_list;
   template#conditional "search_box" search_box;
+  template#conditional "ie_imagetoolbar_no" ie_imagetoolbar_no;
   template#conditional "navigation" navigation;
   template#conditional "view_anon" view_anon;
   template#set "brand" brand;
index e6daeef..59909eb 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: host_menu.ml,v 1.10 2006/07/26 16:26:43 rich Exp $
+ * $Id: host_menu.ml,v 1.11 2006/08/14 10:04:25 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -51,21 +51,23 @@ let run r (q : cgi) dbh hostid host user =
                 t.name, t.description, h.feedback_email, h.mailing_list,
                 h.search_box, h.navigation, h.view_anon,
                 h.brand, coalesce (h.brand_tagline, ''),
-                coalesce (h.brand_description, '')
+                coalesce (h.brand_description, ''),
+                h.ie_imagetoolbar_no
            from hosts h left outer join themes t on h.theme_css = t.theme_css
           where h.id = $hostid" in
 
     let canonical_hostname, has_global_css, edit_anon, create_account_anon,
       has_theme_css, theme_name, theme_description, has_feedback_email,
       feedback_email, mailing_list, search_box, navigation, view_anon,
-      has_brand, brand, brand_tagline, brand_description =
+      has_brand, brand, brand_tagline, brand_description,
+      ie_imagetoolbar_no =
       match rows with
        [ Some canonical_hostname, Some has_global_css,
          Some edit_anon, Some create_account_anon, Some has_theme_css,
          theme_name, theme_description,
          feedback_email,
          Some mailing_list, Some search_box, Some navigation, Some view_anon,
-         brand, brand_tagline, brand_description ] ->
+         brand, brand_tagline, brand_description, Some ie_imagetoolbar_no ] ->
          let theme_name =
            match theme_name with Some s -> s | None -> "" in
          let theme_description =
@@ -85,7 +87,8 @@ let run r (q : cgi) dbh hostid host user =
          canonical_hostname, has_global_css, edit_anon, create_account_anon,
          has_theme_css, theme_name, theme_description, has_feedback_email,
          feedback_email, mailing_list, search_box, navigation, view_anon,
-         has_brand, brand, brand_tagline, brand_description
+         has_brand, brand, brand_tagline, brand_description,
+         ie_imagetoolbar_no
       | _ -> assert false in
 
     template#set "canonical_hostname" canonical_hostname;
@@ -99,6 +102,7 @@ let run r (q : cgi) dbh hostid host user =
     template#set "feedback_email" feedback_email;
     template#conditional "mailing_list" mailing_list;
     template#conditional "search_box" search_box;
+    template#conditional "ie_imagetoolbar_no" ie_imagetoolbar_no;
     template#conditional "navigation" navigation;
     template#conditional "view_anon" view_anon;
     template#conditional "has_brand" has_brand;
index 1632e18..266c92e 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_template.ml,v 1.8 2006/08/03 13:53:00 rich Exp $
+ * $Id: cocanwiki_template.ml,v 1.9 2006/08/14 10:04:25 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -87,12 +87,12 @@ let get_template ?page dbh hostid filename =
        "select h.theme_css, h.css is not null,
                 p.name, p.url, h.search_box,
                 h.brand, h.brand_tagline, h.brand_description,
-                h.pagebug
+                h.pagebug, h.ie_imagetoolbar_no
            from hosts h left outer join powered_by p on h.powered_by = p.id
           where h.id = $hostid" in
 
     let theme_css, has_host_css, powered_by_name, powered_by_url, search_box,
-      brand, brand_tagline, brand_description, pagebug =
+      brand, brand_tagline, brand_description, pagebug, ie_imagetoolbar_no =
       match rows with
       | [ row ] -> row
       | _ -> assert false in
@@ -142,6 +142,9 @@ let get_template ?page dbh hostid filename =
 
     let search_box = match search_box with Some b -> b | _ -> assert false in
 
+    let ie_imagetoolbar_no =
+      match ie_imagetoolbar_no with Some b -> b | _ -> assert false in
+
     template#set "theme_css" theme_css;
     template#conditional "has_host_css" has_host_css;
     template#set "powered_by_name" powered_by_name;
@@ -155,6 +158,7 @@ let get_template ?page dbh hostid filename =
     template#set "brand_description" brand_description;
     template#conditional "has_pagebug" has_pagebug;
     template#set "pagebug" pagebug;
+    template#conditional "ie_imagetoolbar_no" ie_imagetoolbar_no;
 
     (* Site menu. *)
     let rows = PGSQL(dbh)
@@ -199,6 +203,7 @@ let get_template ?page dbh hostid filename =
     template#set "brand_description" "";
     template#conditional "has_pagebug" false;
     template#set "pagebug" "";
+    template#conditional "ie_imagetoolbar_no" false;
     template#conditional "is_homepage" false;
     template#table "sitemenu" [];
   );
index 0a3735b..567512f 100644 (file)
 </td>
 </tr>
 <tr>
+<th> Disable image toolbar: </th>
+<td>
+<input type="checkbox" name="ie_imagetoolbar_no" value="1" ::if(ie_imagetoolbar_no)::checked="checked"::end:: id="ie_imagetoolbar_no"/><label for="ie_imagetoolbar_no">Suppress toolbar on images (IE only)</label>
+</td>
+</tr>
+<tr>
 <th> Theme: </th>
 <td>
 <select name="theme_css">
index 5b2c3c5..249ba89 100644 (file)
 <td> ::if(navigation)::Yes::else::No::end:: </td>
 </tr>
 <tr>
+<th> Disable image toolbar: </th>
+<td> ::if(ie_imagetoolbar_no)::Yes::else::No::end:: </td>
+</tr>
+<tr>
 <th> Theme: </th>
 <td> ::if(has_theme_css)::<strong>::theme_name_html::</strong> <br/> ::theme_description_html:: ::else:: Standard wiki theme ::end:: </td>
 </tr>
index 76c8d49..5c3a24e 100644 (file)
@@ -1,12 +1,4 @@
-::if(navigation)::<div id="navigation_space_div"></div>::end::
-
-::if(redirected)::
-<p id="redirected"><em>(Redirected from <a href="/::original_page_html_tag::?no_redirect=1">::original_page_html::</a>)</em></p>
-::end::
-
-::if(is_old_version)::
-<div id="old_version">
-<p>You are seeing an old version of this page.</p>
+::if(navigation)::<div id="navigation_space_div"></div>::end::::if(redirected)::<p id="redirected"><em>(Redirected from <a href="/::original_page_html_tag::?no_redirect=1">::original_page_html::</a>)</em></p>::end::::if(is_old_version)::<div id="old_version"><p>You are seeing an old version of this page.</p>
 <ul>
 <li> Go to the <a href="/::page_html_tag::">live version</a> of this page.</li>
 <li> See other <a href="/::page_html_tag::/history">old versions</a> of this page.</li>
@@ -15,12 +7,8 @@
 <li> <a href="/_bin/restore_form.cmo?page=::page_url::&version=::old_version::">Restore</a> this version live.</li>
 ::end::
 </ul>
-</div>
-::end::
-
-<div id="content_div">
-::table(sections)::
-::if(has_divname)::<div id="::divname_html_tag::"::if(has_jsgo):: onclick="go('/::jsgo_html_tag::')" class="jsgo_div"::end::>::end::::if(can_edit)::<p class="edit_link">[<a href="/::page_html_tag::/edit#::ordering::" title="Edit this section">edit</a>]</p>::end::::if(has_sectionname)::<a name="::linkname_html_tag::"></a><h2><span>::sectionname_html::</span></h2>::end::
+</div>::end::<div id="content_div">
+::table(sections)::::if(has_divname)::<div id="::divname_html_tag::"::if(has_jsgo):: onclick="go('/::jsgo_html_tag::')" class="jsgo_div"::end::>::end::::if(can_edit)::<p class="edit_link">[<a href="/::page_html_tag::/edit#::ordering::" title="Edit this section">edit</a>]</p>::end::::if(has_sectionname)::<a name="::linkname_html_tag::"></a><h2><span>::sectionname_html::</span></h2>::end::
 ::content::
 ::if(has_divname)::</div>::end::::end::
 </div>
index b424edf..a11a3c2 100644 (file)
@@ -1,15 +1,16 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-<title>::title_html::</title>
-::if(is_old_version)::<meta name="robots" content="noindex,nofollow" />::end::
-::if(has_description)::<meta name="description" content="::description_html_tag::" />::end::
-::if(has_keywords)::<meta name="keywords" content="::keywords_html_tag::" />::end::
+<title>::title_html::</title>::if(is_old_version)::
+<meta name="robots" content="noindex,nofollow" />::end::::if(has_description)::
+<meta name="description" content="::description_html_tag::" />::end::::if(has_keywords)::
+<meta name="keywords" content="::keywords_html_tag::" />::end::
 <meta name="author" content="http://www.merjis.com/" />
 <link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
-<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
-::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
-::if(has_page_css)::<link rel="stylesheet" href="/::page_html_tag::/styles.css::if(is_old_version)::?version=::old_version::::end::" type="text/css" title="Standard"/>::end::
+<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>::if(has_host_css)::
+<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_page_css)::
+<link rel="stylesheet" href="/::page_html_tag::/styles.css::if(is_old_version)::?version=::old_version::::end::" type="text/css" title="Standard"/>::end::::if(ie_imagetoolbar_no)::
+<meta http-equiv="imagetoolbar" content="no" />::end::
 <script src="/_js/go.js" type="text/javascript"></script>
 <link rel="icon" href="/_graphics/favicon.png" type="image/png" />
 <link rel="SHORTCUT ICON" href="/favicon.ico" type="image/x-icon" />