25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-12 17:01:52 +01:00

Don't include CSS, javascript and image data directly in the code

This commit is contained in:
Evgeniy Khramtsov 2017-10-09 23:35:42 +03:00
parent d22ee24e72
commit 5a184b0433
21 changed files with 606 additions and 722 deletions

View File

@ -49,6 +49,12 @@ MSGSDIR = $(PRIVDIR)/msgs
# /usr/lib/ejabberd/priv/css
CSSDIR = $(PRIVDIR)/css
# /usr/lib/ejabberd/priv/img
IMGDIR = $(PRIVDIR)/img
# /usr/lib/ejabberd/priv/js
JSDIR = $(PRIVDIR)/js
# /usr/lib/ejabberd/priv/sql
SQLDIR = $(PRIVDIR)/sql
@ -132,7 +138,7 @@ DEPS_FILES=$(call FILES_WILDCARD,$(foreach DEP,$(DEPS),deps/$(DEP)/ebin/*.beam d
DEPS_FILES_FILTERED=$(filter-out %/epam %/eimp deps/elixir/ebin/elixir.app,$(DEPS_FILES))
DEPS_DIRS=$(sort deps/ $(foreach DEP,$(DEPS),deps/$(DEP)/) $(dir $(DEPS_FILES)))
MAIN_FILES=$(filter-out %/configure.beam,$(call FILES_WILDCARD,ebin/*.beam ebin/*.app priv/msgs/*.msg priv/css/*.css priv/lib/* include/*.hrl COPYING))
MAIN_FILES=$(filter-out %/configure.beam,$(call FILES_WILDCARD,ebin/*.beam ebin/*.app priv/msgs/*.msg priv/css/*.css priv/img/*.png priv/js/*.js priv/lib/* include/*.hrl COPYING))
MAIN_DIRS=$(sort $(dir $(MAIN_FILES)) priv/bin priv/sql)
define DEP_VERSION_template
@ -253,10 +259,14 @@ uninstall-binary:
rm -fr $(PBINDIR)
rm -f $(SODIR)/*.so
rm -fr $(SODIR)
rm -f $(MSGSDIR)/*.msgs
rm -f $(MSGSDIR)/*.msg
rm -fr $(MSGSDIR)
rm -f $(CSSDIR)/*.css
rm -fr $(CSSDIR)
rm -f $(IMGDIR)/*.png
rm -fr $(IMGDIR)
rm -f $(JSDIR)/*.js
rm -fr $(JSDIR)
rm -f $(SQLDIR)/*.sql
rm -fr $(SQLDIR)
rm -fr $(PRIVDIR)

279
priv/css/admin.css Normal file
View File

@ -0,0 +1,279 @@
html,body {
margin: 0;
padding: 0;
height: 100%;
background: #f9f9f9;
font-family: sans-serif;
}
body {
min-width: 990px;
}
a {
text-decoration: none;
color: #3eaffa;
}
a:hover,
a:active {
text-decoration: underline;
}
#container {
position: relative;
padding: 0;
margin: 0 auto;
max-width: 1280px;
min-height: 100%;
height: 100%;
margin-bottom: -30px;
z-index: 1;
}
html>body #container {
height: auto;
}
#header h1 {
width: 100%;
height: 50px;
padding: 0;
margin: 0;
background-color: #49cbc1;
}
#header h1 a {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 50px;
padding: 0;
margin: 0;
background: url('@BASE@logo.png') 10px center no-repeat transparent;
background-size: auto 25px;
display: block;
text-indent: -9999px;
}
#clearcopyright {
display: block;
width: 100%;
height: 30px;
}
#copyrightouter {
position: relative;
display: table;
width: 100%;
height: 30px;
z-index: 2;
}
#copyright {
display: table-cell;
vertical-align: bottom;
width: 100%;
height: 30px;
}
#copyright a {
font-weight: bold;
color: #fff;
}
#copyright p {
margin-left: 0;
margin-right: 0;
margin-top: 5px;
margin-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 5px;
padding-bottom: 5px;
width: 100%;
color: #fff;
background-color: #30353E;
font-size: 0.75em;
text-align: center;
}
#navigation {
display: inline-block;
vertical-align: top;
width: 30%;
}
#navigation ul {
padding: 0;
margin: 0;
width: 90%;
background: #fff;
}
#navigation ul li {
list-style: none;
margin: 0;
border-bottom: 1px solid #f9f9f9;
text-align: left;
}
#navigation ul li a {
margin: 0;
display: inline-block;
padding: 10px;
color: #333;
}
ul li #navhead a, ul li #navheadsub a, ul li #navheadsubsub a {
font-size: 1.5em;
color: inherit;
}
#navitemsub {
border-left: 0.5em solid #424a55;
}
#navitemsubsub {
border-left: 2em solid #424a55;
}
#navheadsub,
#navheadsubsub {
padding-left: 0.5em;
}
#navhead,
#navheadsub,
#navheadsubsub {
border-top: 3px solid #49cbc1;
background: #424a55;
color: #fff;
}
#lastactivity li {
padding: 2px;
margin-bottom: -1px;
}
thead tr td {
background: #3eaffa;
color: #fff;
}
thead tr td a {
color: #fff;
}
td.copy {
text-align: center;
}
tr.head {
color: #fff;
background-color: #3b547a;
text-align: center;
}
tr.oddraw {
color: #412c75;
background-color: #ccd4df;
text-align: center;
}
tr.evenraw {
color: #412c75;
background-color: #dbe0e8;
text-align: center;
}
td.leftheader {
color: #412c75;
background-color: #ccccc1;
padding-left: 5px;
padding-top: 2px;
padding-bottom: 2px;
margin-top: 0px;
margin-bottom: 0px;
}
td.leftcontent {
color: #000044;
background-color: #e6e6df;
padding-left: 5px;
padding-right: 5px;
padding-top: 2px;
padding-bottom: 2px;
margin-top: 0px;
margin-bottom: 0px;
}
td.rightcontent {
color: #000044;
text-align: justify;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 5px;
}
h1 {
color: #000044;
padding-top: 2px;
padding-bottom: 2px;
margin-top: 0px;
margin-bottom: 0px;
}
h2 {
color: #000044;
text-align: center;
padding-top: 2px;
padding-bottom: 2px;
margin-top: 0px;
margin-bottom: 0px;
}
h3 {
color: #000044;
text-align: left;
padding-top: 20px;
padding-bottom: 2px;
margin-top: 0px;
margin-bottom: 0px;
}
#content ul {
padding-left: 1.1em;
margin-top: 1em;
}
#content ul li {
list-style-type: disc;
padding: 5px;
}
#content ul.nolistyle>li {
list-style-type: none;
}
#content {
display: inline-block;
vertical-align: top;
padding-top: 25px;
width: 70%;
}
div.guidelink,
p[dir=ltr] {
display: inline-block;
float: right;
margin: 0;
margin-right: 1em;
}
div.guidelink a,
p[dir=ltr] a {
display: inline-block;
border-radius: 3px;
padding: 3px;
background: #3eaffa;
text-transform: uppercase;
font-size: 0.75em;
color: #fff;
}
table {
margin-top: 1em;
}
table tr td {
padding: 0.5em;
}
table tr:nth-child(odd) {
background: #fff;
}
table.withtextareas>tbody>tr>td {
vertical-align: top;
}
textarea {
margin-bottom: 1em;
}
input,
select {
font-size: 1em;
}
p.result {
border: 1px;
border-style: dashed;
border-color: #FE8A02;
padding: 1em;
margin-right: 1em;
background: #FFE3C9;
}
*.alignright {
text-align: right;
}

51
priv/css/bosh.css Normal file
View File

@ -0,0 +1,51 @@
body {
margin: 0;
padding: 0;
font-family: sans-serif;
color: #fff;
}
h1 {
font-size: 3em;
color: #444;
}
p {
line-height: 1.5em;
color: #888;
}
a {
color: #fff;
}
a:hover,
a:active {
text-decoration: underline;
}
.container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #424A55;
background-image: -webkit-linear-gradient(270deg, rgba(48,52,62,0) 24%, #30353e 100%);
background-image: linear-gradient(-180deg, rgba(48,52,62,0) 24%, #30353e 100%);
}
.section {
padding: 3em;
}
.white.section {
background: #fff;
border-bottom: 4px solid #41AFCA;
}
.white.section a {
text-decoration: none;
color: #41AFCA;
}
.white.section a:hover,
.white.section a:active {
text-decoration: underline;
}
.block {
margin: 0 auto;
max-width: 900px;
width: 100%;
}

27
priv/css/muc.css Normal file
View File

@ -0,0 +1,27 @@
.ts {color: #AAAAAA; text-decoration: none;}
.mrcm {color: #009900; font-style: italic; font-weight: bold;}
.msc {color: #009900; font-style: italic; font-weight: bold;}
.msm {color: #000099; font-style: italic; font-weight: bold;}
.mj {color: #009900; font-style: italic;}
.ml {color: #009900; font-style: italic;}
.mk {color: #009900; font-style: italic;}
.mb {color: #009900; font-style: italic;}
.mnc {color: #009900; font-style: italic;}
.mn {color: #0000AA;}
.mne {color: #AA0099;}
a.nav {color: #AAAAAA; font-family: monospace; letter-spacing: 3px; text-decoration: none;}
div.roomtitle {border-bottom: #224466 solid 3pt; margin-left: 20pt;}
div.roomtitle {color: #336699; font-size: 24px; font-weight: bold; font-family: sans-serif; letter-spacing: 3px; text-decoration: none;}
a.roomjid {color: #336699; font-size: 24px; font-weight: bold; font-family: sans-serif; letter-spacing: 3px; margin-left: 20pt; text-decoration: none;}
div.logdate {color: #663399; font-size: 20px; font-weight: bold; font-family: sans-serif; letter-spacing: 2px; border-bottom: #224466 solid 1pt; margin-left:80pt; margin-top:20px;}
div.roomsubject {color: #336699; font-size: 18px; font-family: sans-serif; margin-left: 80pt; margin-bottom: 10px;}
div.rc {color: #336699; font-size: 12px; font-family: sans-serif; margin-left: 50%; text-align: right; background: #f3f6f9; border-bottom: 1px solid #336699; border-right: 4px solid #336699;}
div.rct {font-weight: bold; background: #e3e6e9; padding-right: 10px;}
div.rcos {padding-right: 10px;}
div.rcoe {color: green;}
div.rcod {color: red;}
div.rcoe:after {content: ": v";}
div.rcod:after {content: ": x";}
div.rcot:after {}
.legend {width: 100%; margin-top: 30px; border-top: #224466 solid 1pt; padding: 10px 0px 10px 0px; text-align: left; font-family: monospace; letter-spacing: 2px;}
.w3c {position: absolute; right: 10px; width: 60%; text-align: right; font-family: monospace; letter-spacing: 1px;}

103
priv/css/oauth.css Normal file
View File

@ -0,0 +1,103 @@
body {
margin: 0;
padding: 0;
font-family: sans-serif;
color: #fff;
}
h1 {
font-size: 3em;
color: #444;
}
p {
line-height: 1.5em;
color: #888;
}
a {
color: #fff;
}
a:hover,
a:active {
text-decoration: underline;
}
em {
display: inline-block;
padding: 0 5px;
background: #f4f4f4;
border-radius: 5px;
font-style: normal;
font-weight: bold;
color: #444;
}
form {
color: #444;
}
label {
display: block;
font-weight: bold;
}
input[type=text],
input[type=password] {
margin-bottom: 1em;
padding: 0.4em;
max-width: 330px;
width: 100%;
border: 1px solid #c4c4c4;
border-radius: 5px;
outline: 0;
font-size: 1.2em;
}
input[type=text]:focus,
input[type=password]:focus,
input[type=text]:active,
input[type=password]:active {
border-color: #41AFCA;
}
input[type=submit] {
font-size: 1em;
}
.container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #424A55;
background-image: -webkit-linear-gradient(270deg, rgba(48,52,62,0) 24%, #30353e 100%);
background-image: linear-gradient(-180deg, rgba(48,52,62,0) 24%, #30353e 100%);
}
.section {
padding: 3em;
}
.white.section {
background: #fff;
border-bottom: 4px solid #41AFCA;
}
.white.section a {
text-decoration: none;
color: #41AFCA;
}
.white.section a:hover,
.white.section a:active {
text-decoration: underline;
}
.container > .section {
background: #424A55;
}
.block {
margin: 0 auto;
max-width: 900px;
width: 100%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

BIN
priv/img/admin-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
priv/img/bosh-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
priv/img/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
priv/img/oauth-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

BIN
priv/img/valid-xhtml10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
priv/img/vcss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

15
priv/js/admin.js Normal file
View File

@ -0,0 +1,15 @@
function selectAll() {
for(i=0;i<document.forms[0].elements.length;i++)
{ var e = document.forms[0].elements[i];
if(e.type == 'checkbox')
{ e.checked = true; }
}
}
function unSelectAll() {
for(i=0;i<document.forms[0].elements.length;i++)
{ var e = document.forms[0].elements[i];
if(e.type == 'checkbox')
{ e.checked = false; }
}
}

8
priv/js/muc.js Normal file
View File

@ -0,0 +1,8 @@
// Show/Hide an element
function sh(e) {
if (document.getElementById(e).style.display=='none') {
document.getElementById(e).style.display='block';
} else {
document.getElementById(e).style.display='none';
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@
l2i/1, i2l/1, i2l/2, expr_to_term/1, term_to_expr/1,
now_to_usec/1, usec_to_now/1, encode_pid/1, decode_pid/2,
compile_exprs/2, join_atoms/2, try_read_file/1, have_eimp/0,
css_dir/0]).
css_dir/0, img_dir/0, js_dir/0, read_css/1, read_img/1, read_js/1]).
%% Deprecated functions
-export([decode_base64/1, encode_base64/1]).
@ -231,6 +231,40 @@ css_dir() ->
Path -> Path
end.
-spec img_dir() -> file:filename().
img_dir() ->
case os:getenv("EJABBERD_IMG_PATH") of
false ->
case code:priv_dir(ejabberd) of
{error, _} -> filename:join(["priv", "img"]);
Path -> filename:join([Path, "img"])
end;
Path -> Path
end.
-spec js_dir() -> file:filename().
js_dir() ->
case os:getenv("EJABBERD_JS_PATH") of
false ->
case code:priv_dir(ejabberd) of
{error, _} -> filename:join(["priv", "js"]);
Path -> filename:join([Path, "js"])
end;
Path -> Path
end.
-spec read_css(file:filename()) -> {ok, binary()} | {error, file:posix()}.
read_css(File) ->
read_file(filename:join(css_dir(), File)).
-spec read_img(file:filename()) -> {ok, binary()} | {error, file:posix()}.
read_img(File) ->
read_file(filename:join(img_dir(), File)).
-spec read_js(file:filename()) -> {ok, binary()} | {error, file:posix()}.
read_js(File) ->
read_file(filename:join(js_dir(), File)).
%%%===================================================================
%%% Internal functions
%%%===================================================================
@ -242,3 +276,14 @@ set_node_id(PidStr, NodeBin) ->
[H|_] = string:tokens(ExtPidStr, "."),
[_|T] = string:tokens(PidStr, "."),
erlang:list_to_pid(string:join([H|T], ".")).
-spec read_file(file:filename()) -> {ok, binary()} | {error, file:posix()}.
read_file(Path) ->
case file:read_file(Path) of
{ok, Data} ->
{ok, Data};
{error, Why} = Err ->
?ERROR_MSG("Failed to read file ~s: ~s",
[Path, file:format_error(Why)]),
Err
end.

File diff suppressed because one or more lines are too long

View File

@ -502,186 +502,22 @@ make_dir_rec(Dir) ->
%% c("../../ejabberd/src/jlib.erl").
%% base64:encode(F1b).
image_base64(<<"powered-by-erlang.png">>) ->
<<"iVBORw0KGgoAAAANSUhEUgAAAGUAAAAfCAYAAAD+xQNoA"
"AADN0lEQVRo3u1aP0waURz+rjGRRQ+nUyRCYmJyDPTapD"
"ARaSIbTUj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xykafI"
"YrizbfESoB+dd9/KF/d/wX3cJvREzl1vAAAAABJRU5Erk"
"Jggg==">>;
image_base64(<<"valid-xhtml10.png">>) ->
<<"iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAAEjEcpEA"
"AACiFBMVEUAAADe5+fOezmtra3ejEKlhELvvWO9WlrehE"
"LOe3vepaWclHvetVLGc3PerVKcCAj3vVqUjHOUe1JjlL0"
"xOUpjjL2UAAC91ueMrc7vrVKlvdbW3u+EpcbO3ufO1ucY"
"WpSMKQi9SiF7e3taWkoQEAiMczkQSoxaUkpzc3O1lEoIC"
"ACEazEhGAgIAACEYzFra2utjELWcznGnEr/7+9jY2POaz"
"HOYzGta2NShLVrlL05OUqctdacCADGa2ucAADGpVqUtc6"
"1ORg5OTmlUikYGAiUezl7YzEYEAiUczkxMTG9nEqtIRDe"
"3t4AMXu9lEoQCACMazEAKXspKSmljFrW1ta1jELOzs7n7"
"/fGxsa9pVqEOSkpY5xznL29tZxahLXOpVr/99ZrY1L/79"
"ZjUiljSikAOYTvxmMAMYScezmchFqUczGtlFp7c2utjFq"
"UlJStxt73///39/9Ce61CSkq9xsZznMbW5+9Cc62MjIxC"
"Qkrv9/fv7/fOzsbnlErWjIz/3mtCORhza1IpIRBzWjH/1"
"mtCMRhzY1L/zmvnvVpSQiHOpVJrUinntVr3zmOEc1L3xm"
"NaWlq1nFo5QkrGWim1lFoISpRSUlK1zt4hWpwASoz////"
"///8xa6WUaykAQoxKe61KSkp7nMbWtWPe5+9jWlL39/f3"
"9/fWrWNCQkLera3nvWPv7+85MRjntWPetVp7c1IxKRCUl"
"HtKORh7a1IxIRCUjHtaSiHWrVIpIQhzWinvvVpaQiH/1m"
"PWpVKMe1L/zmP/xmNrUiGErc4YGBj/73PG1ucQWpT/53O"
"9nFoQUpS1SiEQEBC9zt69vb05c6UISoxSUko5a6UICAhS"
"SkohUpS1tbXetWMAQoSUgD+kAAAA2HRSTlP/////////i"
"P9sSf//dP////////////////////////////////////"
"////////////8M////////////ef/////////////////"
"/////////////////////////////////////////////"
"//////////////////////9d/////////////////////"
"///////////////AP//////////////CP//RP////////"
"/////////////////////////////////////////////"
"///////9xPp1gAAAFvUlEQVR42pVWi18URRwfy7vsYUba"
"iqBRBFmICUQGVKcZckQeaRJQUCLeycMSfKGH0uo5NELpI"
"vGQGzokvTTA85VHKTpbRoeJnPno/p1+M7t3txj20e/Nzu"
"7Ofve7v/k9Zg4Vc+wRQMW0eyLx1ZSANeBDxVmxZZSwEUY"
"kGAewm1eIBOMRvhv1UA+q8KXIVuxGdCelFYwxAnxOrxgb"
"Y8Ti1t4VA0QHYz4x3FnVC8OVLXv9fkKGSWDoW/4lG6Vbd"
"tBblesOs+MjmEmzJKNIJWFEfEQTCWNPFKvcKEymjLO1b8"
"bwYQd1hCiiDCl5KsrDCIlhj4fSuvcpfSpgJmyv6dzeZv+"
"nMPx3dhbt94II07/JZliEtm1N2RIYPkTYshwYm245a/zk"
"WjJwcyFh6ZIcYxxmqiaDSYxhOhFUsqngi3Fzcj3ljdYDN"
"E9uzA1YD/5MhnzW1KRqF7mYG8jFYXLcfLpjOe2LA0fuGq"
"QrQHl10sdK0sFcFSOSlzF0BgXQH9h3QZDBI0ccNEhftjX"
"uippBDD2/eMRiETmwwNEYHyqhdDyo22w+3QHuNbdve5a7"
"eOkHmDVJ0ixNmfbz1h0qo/Q6GuSB2wQJQbpOjOQAl7woW"
"SRJ0m2ewhvAOUiYYtZtaZL0CZZmtmVOQttLfr/dbveLZo"
"drfrL7W75wG/JjqkQxoNTtNsTKELQpQL6/D5loaSmyTT8"
"TUhsmi8iFA0hZiyltf7OiNKdarRm5w2So2lTNdPLuIzR+"
"AiLj8VTRJaj0LmX4VhJ27f/VJV/yycilWPOrk8NkXi7Qq"
"mj5bHqVZlJKZIRk1wFzKrt0WUbnXMPJ1fk4TJ5oWBA61p"
"1V76DeIs0MX+s3GxRlA1vtw83KhgNphc1nyErLO5zcvbO"
"srq+scbZnpzc6QVFPenLwGx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Y/yGKFEiRt/"
"jG/2P79s8KCwoLCgoLC/khUBA5F0SfQZ+RYfpNE/4Xosm"
"q7jsZAJsAAAAASUVORK5CYII=">>;
image_base64(<<"vcss.png">>) ->
<<"iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAABUFvrSA"
"AABKVBMVEUAAAAjIx8MR51ZVUqAdlmdnZ3ejEWLDAuNjY"
"1kiMG0n2d9fX19Ghfrp1FtbW3y39+3Ph6lIRNdXV2qJBF"
"cVUhcVUhPT0/dsmpUfLr57+/u7u4/PDWZAACZAADOp1Gd"
"GxG+SyTgvnNdSySzk16+mkuxw+BOS0BOS0DOzs7MzMy4T"
"09RRDwsJBG+vr73wV6fkG6eCQRFcLSurq6/X1+ht9nXfz"
"5sepHuwV59ZTHetFjQ2+wMCQQ2ZK5tWCsmWajsz8+Sq9N"
"MPh4hVaY8MRj///////////////////////9MTEyOp9Lu"
"8vhXU1A8PDyjOSTBz+YLRJ2rLy8sLCwXTaKujEUcHByDn"
"82dfz7/zGafDw+fDw+zRSlzlMcMDAyNcji1tbXf5vIcFg"
"vATJOjAAAAY3RSTlP/8/////////////////8A//////P"
"/////ov//8//////////////z///T//////////+i////"
"//////////8w/////6IA/xAgMP//////////8////////"
"/8w0/////////+zehebAAACkUlEQVR42u2VfVPTQBDG19"
"VqC6LY+lKrRIxFQaFSBPuSvhBPF8SIUZK2J5Yav/+HcO8"
"uZdLqTCsU/nKnyWwvk1/unnt2D9ZmH+8/cMAaTRFy+ng6"
"9/yiwC/+gy8R3McGv5zHvGJEGAdR4eBgi1IbZwevIEZE2"
"4pFtBtzG1Q4AoD5zvw5pEDcJvIQV/TE3/l+H9GnNJwcdA"
"BS5wAbFQLMqI98/UReoAaOTlaJsp0zaHx7LwZvY0BUR2x"
"pWTzqam0gzY8KGzG4MhBCNGucha4QbpETy+Yk/BP85nt7"
"34AjpQLTsE4ZFpf/dnkUCglXVNYB+OfUZJHvAqAoa45Oe"
"uPgm4+Xjtv7xm4N7PMV4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QVRIx72WjXKiMBSFQalIFbNiy1pdrJZaRV"
"YR5deGwPs/VRNBSBB2OjvQO0oYjPfj5J6bCcdx8i2Uldx"
"KcDhk1HbIPwFBF/kHKJfjPSVAyIRHF9rRZ4sUX3EDdWOv"
"1+u2tESaavpnYTbv9zvd0WwDy3/QcGQXlH5uTxB1l07MJ"
"lRpsUei0JF6Qi+OHyGK7ijXxPklHe/umIllim3iUBMJDI"
"EULxxPP0TVWhhKJoN9fUpdmQLteV8aDgEAg9gIcTjL4F4"
"L+r4WVKEF+rbJdwYYAoQHY+oQjnGootyKwxapoi73WkyF"
"FySQBv988naEEp4+YMMec5VUCQDJTscEy7Kc0HsLmqNE7"
"rovDjMpIHHGYeidXn4TQcaxMYqP3RV3C8oCl2WvrlSPaN"
"pGZadRnmPGCk8ylM2okAJ4i9TEe1KersXxSl6jUt5uayi"
"IodirtcKLOaWblj50wiyMv1F9lm9TUDArGAD0FmEpvCUs"
"VoZy6dW81Fg0aDaHogQa36ekAPG5DDGsbdZrGsrzZUnzv"
"Bo1I2tLmuL69kSitAweyHKN9b3leDfQMnu3nIIKWfmXnq"
"GVKedJT6QpICbJvf2f8aOsvn68v+k7/cwUQdPoxaMoRTn"
"KFHNlKsKQphCTOa84u64vpi8bH31CqsbF6lSONRTkTyQG"
"Arq49/fEvjBwz4eDS2/JpaXRNOoXRD/VmOrDVTJJRIZCT"
"Lav3VrqbPvP3vdduGEhQJzilncbpSA4F3vsihErO+dayv"
"/sY5/yRE0GDEXCu2VoNiMlo5i+P2KlgMEvTNk2eYa5XEy"
"h12Ex17Z8vzQUR3KEPbYd6XG87eC4Ly75RneS5ZYHAAAA"
"AElFTkSuQmCC">>.
create_image_files(Images_dir) ->
?INFO_MSG("here = ~p", [Images_dir]),
Filenames = [<<"powered-by-ejabberd.png">>,
<<"powered-by-erlang.png">>, <<"valid-xhtml10.png">>,
<<"vcss.png">>],
lists:foreach(fun (Filename) ->
Filename_full = fjoin([Images_dir, Filename]),
{ok, F} = file:open(Filename_full, [write]),
Image = base64:decode(image_base64(Filename)),
io:format(F, <<"~s">>, [Image]),
file:close(F)
end,
Filenames),
ok.
lists:foreach(
fun(Filename) ->
Src = filename:join([misc:img_dir(), Filename]),
Dst = fjoin([Images_dir, Filename]),
case file:copy(Src, Dst) of
{ok, _} -> ok;
{error, Why} ->
?ERROR_MSG("Failed to copy ~s to ~s",
[Src, Dst, file:format_error(Why)])
end
end, Filenames).
fw(F, S) -> fw(F, S, [], html).
@ -768,77 +604,10 @@ put_header(F, Room, Date, CSSFile, Lang, Hour_offset,
put_header_css(F, false) ->
fw(F, <<"<style type=\"text/css\">">>),
fw(F, <<"<!--">>),
fw(F,
<<".ts {color: #AAAAAA; text-decoration: "
"none;}">>),
fw(F,
<<".mrcm {color: #009900; font-style: italic; "
"font-weight: bold;}">>),
fw(F,
<<".msc {color: #009900; font-style: italic; "
"font-weight: bold;}">>),
fw(F,
<<".msm {color: #000099; font-style: italic; "
"font-weight: bold;}">>),
fw(F, <<".mj {color: #009900; font-style: italic;}">>),
fw(F, <<".ml {color: #009900; font-style: italic;}">>),
fw(F, <<".mk {color: #009900; font-style: italic;}">>),
fw(F, <<".mb {color: #009900; font-style: italic;}">>),
fw(F, <<".mnc {color: #009900; font-style: italic;}">>),
fw(F, <<".mn {color: #0000AA;}">>),
fw(F, <<".mne {color: #AA0099;}">>),
fw(F,
<<"a.nav {color: #AAAAAA; font-family: "
"monospace; letter-spacing: 3px; text-decorati"
"on: none;}">>),
fw(F,
<<"div.roomtitle {border-bottom: #224466 "
"solid 3pt; margin-left: 20pt;}">>),
fw(F,
<<"div.roomtitle {color: #336699; font-size: "
"24px; font-weight: bold; font-family: "
"sans-serif; letter-spacing: 3px; text-decorat"
"ion: none;}">>),
fw(F,
<<"a.roomjid {color: #336699; font-size: "
"24px; font-weight: bold; font-family: "
"sans-serif; letter-spacing: 3px; margin-left: "
"20pt; text-decoration: none;}">>),
fw(F,
<<"div.logdate {color: #663399; font-size: "
"20px; font-weight: bold; font-family: "
"sans-serif; letter-spacing: 2px; border-botto"
"m: #224466 solid 1pt; margin-left:80pt; "
"margin-top:20px;}">>),
fw(F,
<<"div.roomsubject {color: #336699; font-size: "
"18px; font-family: sans-serif; margin-left: "
"80pt; margin-bottom: 10px;}">>),
fw(F,
<<"div.rc {color: #336699; font-size: 12px; "
"font-family: sans-serif; margin-left: "
"50%; text-align: right; background: "
"#f3f6f9; border-bottom: 1px solid #336699; "
"border-right: 4px solid #336699;}">>),
fw(F,
<<"div.rct {font-weight: bold; background: "
"#e3e6e9; padding-right: 10px;}">>),
fw(F, <<"div.rcos {padding-right: 10px;}">>),
fw(F, <<"div.rcoe {color: green;}">>),
fw(F, <<"div.rcod {color: red;}">>),
fw(F, <<"div.rcoe:after {content: \": v\";}">>),
fw(F, <<"div.rcod:after {content: \": x\";}">>),
fw(F, <<"div.rcot:after {}">>),
fw(F,
<<".legend {width: 100%; margin-top: 30px; "
"border-top: #224466 solid 1pt; padding: "
"10px 0px 10px 0px; text-align: left; "
"font-family: monospace; letter-spacing: "
"2px;}">>),
fw(F,
<<".w3c {position: absolute; right: 10px; "
"width: 60%; text-align: right; font-family: "
"monospace; letter-spacing: 1px;}">>),
case misc:read_css("muc.css") of
{ok, Data} -> fw(F, Data);
{error, _} -> ok
end,
fw(F, <<"//-->">>),
fw(F, <<"</style>">>);
put_header_css(F, CSSFile) ->
@ -849,16 +618,10 @@ put_header_css(F, CSSFile) ->
put_header_script(F) ->
fw(F, <<"<script type=\"text/javascript\">">>),
fw(F, <<"function sh(e) // Show/Hide an element">>),
fw(F,
<<"{if(document.getElementById(e).style.display="
"='none')">>),
fw(F,
<<"{document.getElementById(e).style.display='bl"
"ock';}">>),
fw(F,
<<"else {document.getElementById(e).style.displa"
"y='none';}}">>),
case misc:read_js("muc.js") of
{ok, Data} -> fw(F, Data);
{error, _} -> ok
end,
fw(F, <<"</script>">>).
put_room_config(_F, _RoomConfig, _Lang, plaintext) ->