From eabdbd545ed474ebcf63c3e839f2e50e40ddb379 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Mon, 7 Jan 2019 18:44:03 +0100 Subject: remove useless space --- customize.cgi | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 132 insertions(+), 1 deletion(-) mode change 120000 => 100755 customize.cgi (limited to 'customize.cgi') diff --git a/customize.cgi b/customize.cgi deleted file mode 120000 index 26de213..0000000 --- a/customize.cgi +++ /dev/null @@ -1 +0,0 @@ -customize.rb \ No newline at end of file diff --git a/customize.cgi b/customize.cgi new file mode 100755 index 0000000..bbcd8d9 --- /dev/null +++ b/customize.cgi @@ -0,0 +1,132 @@ +#!/usr/bin/env ruby + +############################################################################ +# Copyright 2009,2010 Benjamin Kellermann # +# # +# This file is part of Dudle. # +# # +# Dudle is free software: you can redistribute it and/or modify it under # +# the terms of the GNU Affero General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# Dudle is distributed in the hope that it will be useful, but WITHOUT ANY # +# WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public # +# License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with dudle. If not, see . # +############################################################################ + + +if __FILE__ == $0 + +$:.push("..") +require_relative "dudle" + +$d = Dudle.new + + +$d << "

" + _("Customize personal settings") + "

" +$d << _("You need cookies enabled in order to personalize your settings.") + +def choosetable(options, cursetting) + ret = < + +HEAD + ret += "" + _("Current setting") + "" + ret += "" + _("Description") + "" + ret += "" + options.each{|description,href,title| + selected = href == cursetting + ret += "" + ret += YES if selected + ret += "" + ret += "" unless selected + ret += description + ret += "" unless selected + ret += "" + } + ret += "" + ret +end + + +a = [[_("Use special characters") + " (#{UTFCHARS})","utf", _("Use this option if you see the characters in the parenthesis.")], + [_("Use only normal strings"),"ascii",_("Use this option if you have problems with some characters.")]] +$d.html.add_cookie("ascii","true","/",Time.now + (1*60*60*24*365 * ($USEUTF ? -1 : 1 ))) +$d << "
" +$d << "

" + _("Charset")+ "

" +$d << choosetable(a,$USEUTF ? "utf" : "ascii") +$d << "
" + +$d << "
" +$d << "

" + _("Stylesheet") + "

" +$d << choosetable($d.css.collect{|href| [href.scan(/([^\/]*)\.css/).flatten[0],"css=#{href}"]},"css=#{$d.user_css}") +$d << "
" + + +username = $cgi.cookies["username"][0] +if $cgi.include?("delete_username") + $d.html.add_cookie("username","","/",Time.now - 1*60*60*24*365) + username = "" +elsif $cgi.include?("username") && $cgi["username"] != "" + $d.html.add_cookie("username",$cgi["username"],"/",Time.now + 1*60*60*24*365) +end + + + +defaultuserstr = _("Default Username") +usernamestr = _("Username:") +$d << < +

#{defaultuserstr}

+
+ + + + + + + + + + + + +
+ + +CHARSET + +if username && !$cgi.include?("edit") + $d << <#{CGI.escapeHTML(username)} + + +
+CHARSET + $d << "" +else + $d << < +
+CHARSET + $d << "" +end + +$d.html << "" if username + +$d << < +
+
+ +CHARSET + +$d.out +end + + -- cgit v1.2.3