From: rich Date: Mon, 14 Aug 2006 10:04:24 +0000 (+0000) Subject: Add an option allowing the image toolbar to be suppressed in IE. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=8a6ae4a5a2f14da7b1fe0bf6bf95e3100856a079;p=cocanwiki.git Add an option allowing the image toolbar to be suppressed in IE. 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. --- diff --git a/schema/cocanwiki.sql b/schema/cocanwiki.sql index 4a62e68..17a00df 100644 --- a/schema/cocanwiki.sql +++ b/schema/cocanwiki.sql @@ -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 ); diff --git a/scripts/edit_host_settings.ml b/scripts/edit_host_settings.ml index ff4c231..34d1eeb 100644 --- a/scripts/edit_host_settings.ml +++ b/scripts/edit_host_settings.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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; diff --git a/scripts/edit_host_settings_form.ml b/scripts/edit_host_settings_form.ml index 6b8e73c..bd4bbb4 100644 --- a/scripts/edit_host_settings_form.ml +++ b/scripts/edit_host_settings_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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; diff --git a/scripts/host_menu.ml b/scripts/host_menu.ml index e6daeef..59909eb 100644 --- a/scripts/host_menu.ml +++ b/scripts/host_menu.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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; diff --git a/scripts/lib/cocanwiki_template.ml b/scripts/lib/cocanwiki_template.ml index 1632e18..266c92e 100644 --- a/scripts/lib/cocanwiki_template.ml +++ b/scripts/lib/cocanwiki_template.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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" []; ); diff --git a/templates/edit_host_settings_form.html b/templates/edit_host_settings_form.html index 0a3735b..567512f 100644 --- a/templates/edit_host_settings_form.html +++ b/templates/edit_host_settings_form.html @@ -42,6 +42,12 @@ + Disable image toolbar: + + + + + Theme: